lumis.portal.cluster.multiserver
Class JGroupsClusterManager

Package class diagram package JGroupsClusterManager
java.lang.Object
  extended by lumis.portal.cluster.AbstractClusterManager
      extended by lumis.portal.cluster.multiserver.JGroupsClusterManager
All Implemented Interfaces:
IClusterManager, MessageReceiver.IProcessMessageCallback

public class JGroupsClusterManager
extends AbstractClusterManager
implements MessageReceiver.IProcessMessageCallback

A ClusterManager that uses the JGroups library for communication between the cluster nodes.

Since:
4.0.0

Field Summary
 
Fields inherited from class lumis.portal.cluster.AbstractClusterManager
processTransmissionsReceived, serverId
 
Constructor Summary
JGroupsClusterManager()
           
 
Method Summary
 void destroy()
          Destroys the cluster manager.
 IClusterConfig getClusterConfig(ITransaction transaction)
          Returns a persistent cluster configuration object.
 IClusterMember getLocalMember()
          Returns the current cluster member object.
 Collection<IClusterMember> getMembers()
          Returns a collection with information about the current members of this cluster.
 void init()
          Initializes the cluster manager.
 long processAllPendingMessages(long lastTransmissionOrder)
          Processes all pending messages in the database.
 void processMessage(org.jgroups.Message message)
          Processes a message.
 void send(IClusterTransmission transmission)
          Sends a transmission.
protected  void transmissionReceived(IClusterTransmission transmission)
          Processes a received transmission.
 void updateAck(long transmissionOrder)
          Updates the acknowledgment persisted as the specified last transmission order.
 
Methods inherited from class lumis.portal.cluster.AbstractClusterManager
createClusterCommand, createClusterMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JGroupsClusterManager

public JGroupsClusterManager()
Method Detail

init

public void init()
Description copied from interface: IClusterManager
Initializes the cluster manager. This method should start the monitoring and connections necessary for the cluster manager to execute its communications.

Specified by:
init in interface IClusterManager
Overrides:
init in class AbstractClusterManager

destroy

public void destroy()
Description copied from interface: IClusterManager
Destroys the cluster manager. This method should close all resources used by the cluster manager.

Specified by:
destroy in interface IClusterManager
Overrides:
destroy in class AbstractClusterManager

transmissionReceived

protected void transmissionReceived(IClusterTransmission transmission)
Description copied from class: AbstractClusterManager
Processes a received transmission. Subclasses should call this method whenever a transmission is received. AbstractClusterManager.processTransmissionsReceived may be used to disable the processing done by this method.

Overrides:
transmissionReceived in class AbstractClusterManager
Parameters:
transmission - the transmission received.

send

public void send(IClusterTransmission transmission)
Description copied from interface: IClusterManager
Sends a transmission.

Specified by:
send in interface IClusterManager
Specified by:
send in class AbstractClusterManager
Parameters:
transmission - the transmission. It must have been created using one of the factory methods available in IClusterManager.
See Also:
IClusterManager.createClusterCommand(Runnable), IClusterManager.createClusterMessage(String, Serializable)

getMembers

public Collection<IClusterMember> getMembers()
Description copied from interface: IClusterManager
Returns a collection with information about the current members of this cluster.

Specified by:
getMembers in interface IClusterManager
Returns:
a collection with information about the current members of this cluster.

getLocalMember

public IClusterMember getLocalMember()
Description copied from interface: IClusterManager
Returns the current cluster member object. The object returned represents the member where this method is executed on.

Specified by:
getLocalMember in interface IClusterManager
Returns:
this server cluster member object.

getClusterConfig

public IClusterConfig getClusterConfig(ITransaction transaction)
                                throws PortalException
Description copied from interface: IClusterManager
Returns a persistent cluster configuration object. The object contains the cluster configurations, and any changes will be applied on transaction commit.

Specified by:
getClusterConfig in interface IClusterManager
Parameters:
transaction - the transaction for persistence access.
Returns:
a persistent cluster configuration instance.
Throws:
PortalException

processAllPendingMessages

public long processAllPendingMessages(long lastTransmissionOrder)
Description copied from interface: MessageReceiver.IProcessMessageCallback
Processes all pending messages in the database.

Specified by:
processAllPendingMessages in interface MessageReceiver.IProcessMessageCallback
Parameters:
lastTransmissionOrder - the current last processed transmission order, or -1 if none was processed.
Returns:
the last processed transmission order, or, if none was processed (before and during the call to this method), -1 is returned.

processMessage

public void processMessage(org.jgroups.Message message)
Description copied from interface: MessageReceiver.IProcessMessageCallback
Processes a message.

Specified by:
processMessage in interface MessageReceiver.IProcessMessageCallback
Parameters:
message - the message.

updateAck

public void updateAck(long transmissionOrder)
Description copied from interface: MessageReceiver.IProcessMessageCallback
Updates the acknowledgment persisted as the specified last transmission order.

Specified by:
updateAck in interface MessageReceiver.IProcessMessageCallback


Lumisportal  6.2.0.120405 - Copyright © 2006–2012 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.