jgroup.relacs.registry
Class RegistryLayer

java.lang.Object
  extended by jgroup.relacs.registry.RegistryLayer
All Implemented Interfaces:
Layer, MembershipListener, RegistryService

public class RegistryLayer
extends java.lang.Object
implements RegistryService, MembershipListener

This layer implements the registry service interface, allowing the server associated with the local group manager, or layers within the group manager to gain access to the content of the dependable registry.

Since:
Jgroup 2.1
Author:
Alberto Montresor, Hein Meling

Nested Class Summary
 
Nested classes/interfaces inherited from interface jgroup.core.Layer
Layer.FinalizeLayer
 
Nested classes/interfaces inherited from interface jgroup.core.MembershipListener
MembershipListener.AllowDuplicateViews
 
Field Summary
 
Fields inherited from interface jgroup.core.registry.RegistryService
DEFAULT_LEASE_TIME
 
Method Summary
 void addListener(java.lang.Object listener)
          This method does not need to do any processing since the RegistryListener interface is an empty marker.
 IID bind()
          Bind the server associated with the RegistryLayer to the object group associated with the name obtained from the application.xml file in the dependable registry running in the same distributed system as this group manager.
 IID bind(java.lang.Object server)
          Bind the given server to the object group associated with the name obtained from the application.xml file in the dependable registry running in the same distributed system as this group manager.
 IID bind(java.lang.String name, java.lang.Object server)
          Bind the given server to the object group associated with the name in the dependable registry running in the same distributed system as this group manager.
 IID bind(java.lang.String name, java.lang.Object server, DependableRegistry registry)
          Bind the given server to the object group associated with the specified name in the specified dependable registry.
 IID getIID()
          Returns the local invocation identifier bound to the dependable registry.
static RegistryLayer getLayer(ExternalGMIService egmis, MembershipService pgms)
           
 void hasLeft()
          Upcall that is invoked by Jgroup to acknowledge the fact that this object has left the group.
 void prepareChange()
          Upcall that is invoked by the group membership service to notify that the current view is not valid any more, and the group membership service is trying to reach an agreement on a new view.
 void refreshLease()
          Refresh the lease for the local server.
 void unbind()
          Unbind the reference associated with the RegistryLayer from the dependable registry running in the same distributed system as this group manager.
 void unbind(IID bid)
          Unbind the reference associated with the specified binding identifier from the dependable registry running in the same distributed system as this group manager.
 void unbind(IID bid, DependableRegistry registry)
          Unbind the reference associated with the specified binding identifier from the specified dependable registry.
 void viewChange(View view)
          Bind the local server with the dependable registry if: it has not already been bound, it is configured to auto bind and if the this view represents a fully replicated service view.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLayer

public static RegistryLayer getLayer(ExternalGMIService egmis,
                                     MembershipService pgms)

addListener

public void addListener(java.lang.Object listener)
This method does not need to do any processing since the RegistryListener interface is an empty marker.

Specified by:
addListener in interface Layer
Parameters:
listener - An Object representation of the listener interface. This will typically be cast to the appropriate listener interface type after checking the type with the instanceof operator.

bind

public IID bind()
         throws java.rmi.RemoteException,
                JgroupException
Description copied from interface: RegistryService
Bind the server associated with the RegistryLayer to the object group associated with the name obtained from the application.xml file in the dependable registry running in the same distributed system as this group manager.

Specified by:
bind in interface RegistryService
Returns:
A binding identifier IID that can be used to remove this server binding from the registry.
Throws:
java.rmi.RemoteException - Raised when the remote operation failed.
java.rmi.AccessException - Raised when this operation is not permitted.
JgroupException - Raised in the event of a group communication failure.

bind

public IID bind(java.lang.Object server)
         throws java.rmi.RemoteException,
                JgroupException
Description copied from interface: RegistryService
Bind the given server to the object group associated with the name obtained from the application.xml file in the dependable registry running in the same distributed system as this group manager.

Specified by:
bind in interface RegistryService
Parameters:
server - The server in the object group to associated with the given name.
Returns:
A binding identifier IID that can be used to remove this server binding from the registry.
Throws:
java.rmi.RemoteException - Raised when the remote operation failed.
java.rmi.AccessException - Raised when this operation is not permitted.
JgroupException - Raised in the event of a group communication failure.

bind

public IID bind(java.lang.String name,
                java.lang.Object server)
         throws java.rmi.RemoteException,
                JgroupException
Description copied from interface: RegistryService
Bind the given server to the object group associated with the name in the dependable registry running in the same distributed system as this group manager.

Specified by:
bind in interface RegistryService
Parameters:
name - The name associated with the object group.
server - The server in the object group to associated with the given name.
Returns:
A binding identifier IID that can be used to remove this server binding from the registry.
Throws:
java.rmi.RemoteException - Raised when the remote operation failed.
java.rmi.AccessException - Raised when this operation is not permitted.
JgroupException - Raised in the event of a group communication failure.

bind

public IID bind(java.lang.String name,
                java.lang.Object server,
                DependableRegistry registry)
         throws java.rmi.RemoteException,
                JgroupException
Description copied from interface: RegistryService
Bind the given server to the object group associated with the specified name in the specified dependable registry.

Specified by:
bind in interface RegistryService
Parameters:
name - The name associated with the object group.
server - The server in the object group to associated with the given name.
registry - The dependable registry in which to bind the given server.
Returns:
A binding identifier IID that can be used to remove this server binding from the registry.
Throws:
java.rmi.RemoteException - Raised when the remote operation failed.
java.rmi.AccessException - Raised when this operation is not permitted.
JgroupException - Raised in the event of a group communication failure.

unbind

public void unbind()
            throws java.rmi.RemoteException,
                   java.rmi.NotBoundException,
                   JgroupException
Description copied from interface: RegistryService
Unbind the reference associated with the RegistryLayer from the dependable registry running in the same distributed system as this group manager.

Specified by:
unbind in interface RegistryService
Throws:
java.rmi.RemoteException - Raised when the remote operation failed.
java.rmi.AccessException - Raised when this operation is not permitted.
java.rmi.NotBoundException - Raised the given binding identifier was not in the dependable registry.
JgroupException - Raised in the event of a group communication failure.

unbind

public void unbind(IID bid)
            throws java.rmi.RemoteException,
                   java.rmi.NotBoundException,
                   JgroupException
Description copied from interface: RegistryService
Unbind the reference associated with the specified binding identifier from the dependable registry running in the same distributed system as this group manager.

Specified by:
unbind in interface RegistryService
Parameters:
bid - The binding identifier to be removed from the dependable registry.
Throws:
java.rmi.RemoteException - Raised when the remote operation failed.
java.rmi.AccessException - Raised when this operation is not permitted.
java.rmi.NotBoundException - Raised the given binding identifier was not in the dependable registry.
JgroupException - Raised in the event of a group communication failure.

unbind

public void unbind(IID bid,
                   DependableRegistry registry)
            throws java.rmi.RemoteException,
                   java.rmi.NotBoundException
Description copied from interface: RegistryService
Unbind the reference associated with the specified binding identifier from the specified dependable registry.

Specified by:
unbind in interface RegistryService
Parameters:
bid - The binding identifier to be removed from the dependable registry.
registry - The dependable registry from which to unbind the given binding.
Throws:
java.rmi.RemoteException - Raised when the remote operation failed.
java.rmi.AccessException - Raised when this operation is not permitted.
java.rmi.NotBoundException - Raised the given binding identifier was not in the dependable registry.

refreshLease

public void refreshLease()
                  throws java.rmi.RemoteException,
                         JgroupException
Description copied from interface: RegistryService
Refresh the lease for the local server.

Specified by:
refreshLease in interface RegistryService
Throws:
java.rmi.RemoteException - Raised when the remote operation failed.
JgroupException - Raised in the event of a group communication failure.

getIID

public IID getIID()
           throws java.lang.NullPointerException
Description copied from interface: RegistryService
Returns the local invocation identifier bound to the dependable registry. This can be used to unbind() the associated server from the dependable registry.

Specified by:
getIID in interface RegistryService
Returns:
The local invocation identifier bound to the depedable registry.
Throws:
java.lang.NullPointerException - Raised if the replica is not yet bound to the dependable registry.

viewChange

public void viewChange(View view)
Bind the local server with the dependable registry if:
  1. it has not already been bound,
  2. it is configured to auto bind and
  3. if the this view represents a fully replicated service view.

Specified by:
viewChange in interface MembershipListener
Parameters:
view - The new view that has been installed.
See Also:
MembershipListener.viewChange(jgroup.core.View)

prepareChange

public void prepareChange()
Description copied from interface: MembershipListener
Upcall that is invoked by the group membership service to notify that the current view is not valid any more, and the group membership service is trying to reach an agreement on a new view.

Specified by:
prepareChange in interface MembershipListener
See Also:
MembershipService

hasLeft

public void hasLeft()
Description copied from interface: MembershipListener
Upcall that is invoked by Jgroup to acknowledge the fact that this object has left the group. This method is only invoked after the leave method has been invoked on the group membership service.

Specified by:
hasLeft in interface MembershipListener
See Also:
MembershipService


Copyright © 1998-2006 The Jgroup/ARM development team. All Rights Reserved.