org.apache.geronimo.messaging.replication
Class ReplicationMemberImpl

java.lang.Object
  extended byorg.apache.geronimo.messaging.BaseEndPoint
      extended byorg.apache.geronimo.messaging.GBeanBaseEndPoint
          extended byorg.apache.geronimo.messaging.replication.ReplicationMemberImpl
All Implemented Interfaces:
EndPoint, org.apache.geronimo.gbean.GBeanLifecycle, MsgConsProd, MsgConsumer, MsgProducer, ReplicationMember, UpdateListener

public class ReplicationMemberImpl
extends GBeanBaseEndPoint
implements ReplicationMember

ReplicationMember implementation.

Version:
$Revision: 1.5 $ $Date: 2004/07/17 03:50:27 $

Field Summary
static org.apache.geronimo.gbean.GBeanInfo GBEAN_INFO
           
 
Fields inherited from class org.apache.geronimo.messaging.BaseEndPoint
id, node, out, sender
 
Constructor Summary
ReplicationMemberImpl(Node aNode, Object anID, NodeInfo[] aTargetNodes)
          Creates a replication group member.
 
Method Summary
 void fireUpdateEvent(UpdateEvent anEvent)
          Fire an UpdateEvent on this listener.
static org.apache.geronimo.gbean.GBeanInfo getGBeanInfo()
           
 Object getReplicationGroupID()
          Gets the replication group identifier.
 void mergeWithUpdate(UpdateEvent anEvent)
          Merges an UpdateEvent with a registered ReplicationCapable.
 void registerLocalReplicantCapable(ReplicationCapable aReplicant)
          This method is for internal use only.
 void registerReplicantCapable(ReplicationCapable aReplicant)
          Registers a ReplicantCapable.
 ReplicationCapable retrieveReplicantCapable(Object anID)
          Retrieves the ReplicationCapable having the specified id.
 void setMsgProducerOut(MsgOutInterceptor aMsgOut)
          Sets a mean to this instance to push Msgs to the outside world.
 void unregisterReplicantCapable(ReplicationCapable aReplicant)
          Unregisters a ReplicantCapable.
 
Methods inherited from class org.apache.geronimo.messaging.GBeanBaseEndPoint
doFail, doStart, doStop
 
Methods inherited from class org.apache.geronimo.messaging.BaseEndPoint
getID, getMsgConsumerOut, handleRequest, handleResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.geronimo.messaging.EndPoint
getID
 
Methods inherited from interface org.apache.geronimo.messaging.MsgConsumer
getMsgConsumerOut
 

Field Detail

GBEAN_INFO

public static final org.apache.geronimo.gbean.GBeanInfo GBEAN_INFO
Constructor Detail

ReplicationMemberImpl

public ReplicationMemberImpl(Node aNode,
                             Object anID,
                             NodeInfo[] aTargetNodes)
Creates a replication group member.

Parameters:
aNode - Node containing this instance.
anID - Replication group identifier.
aTargetNodes - Nodes hosting the other members of the replication group containing this member.
Method Detail

getReplicationGroupID

public Object getReplicationGroupID()
Description copied from interface: ReplicationMember
Gets the replication group identifier.

Specified by:
getReplicationGroupID in interface ReplicationMember
Returns:
Identifier.

setMsgProducerOut

public void setMsgProducerOut(MsgOutInterceptor aMsgOut)
Description copied from interface: MsgProducer
Sets a mean to this instance to push Msgs to the outside world.

Specified by:
setMsgProducerOut in interface MsgProducer
Overrides:
setMsgProducerOut in class BaseEndPoint

fireUpdateEvent

public void fireUpdateEvent(UpdateEvent anEvent)
                     throws ReplicationException
Description copied from interface: UpdateListener
Fire an UpdateEvent on this listener.

Specified by:
fireUpdateEvent in interface UpdateListener
Parameters:
anEvent - UpdateEvent to be fired.
Throws:
ReplicationException - Indicates that the event can not be processed (the event can not be merged).

mergeWithUpdate

public void mergeWithUpdate(UpdateEvent anEvent)
                     throws ReplicationException
Merges an UpdateEvent with a registered ReplicationCapable.

Specified by:
mergeWithUpdate in interface ReplicationMember
Parameters:
anEvent - Update event to be merged.
Throws:
ReplicationException - Indicates that the merge can not be performed.

registerReplicantCapable

public void registerReplicantCapable(ReplicationCapable aReplicant)
Registers a ReplicantCapable. From now, UpdateEvents multicasted by the provided ReplicantCapable are also pushed to the replication group.

Specified by:
registerReplicantCapable in interface ReplicationMember
Parameters:
aReplicant - ReplicantCapable to be controlled by this group.

unregisterReplicantCapable

public void unregisterReplicantCapable(ReplicationCapable aReplicant)
Description copied from interface: ReplicationMember
Unregisters a ReplicantCapable.

Specified by:
unregisterReplicantCapable in interface ReplicationMember
Parameters:
aReplicant - ReplicantCapable to be removed from the replication group.

registerLocalReplicantCapable

public void registerLocalReplicantCapable(ReplicationCapable aReplicant)
This method is for internal use only.
It registers with this member a ReplicationCapable, which has been registered by a remote member.

Specified by:
registerLocalReplicantCapable in interface ReplicationMember
Parameters:
aReplicant - ReplicantCapable to be locally registered.

retrieveReplicantCapable

public ReplicationCapable retrieveReplicantCapable(Object anID)
Retrieves the ReplicationCapable having the specified id.

Specified by:
retrieveReplicantCapable in interface ReplicationMember
Parameters:
anID - Replicant identifier.
Returns:
ReplicantCapable having the specified id or null if such an identifier is not known.

getGBeanInfo

public static org.apache.geronimo.gbean.GBeanInfo getGBeanInfo()


Copyright © 2003-2005 Apache Software Foundation. All Rights Reserved.