lumis.portal.cluster
Class AbstractClusterManager

Package class diagram package AbstractClusterManager
java.lang.Object
  extended by lumis.portal.cluster.AbstractClusterManager
All Implemented Interfaces:
IClusterManager
Direct Known Subclasses:
JGroupsClusterManager, SingleServerClusterManager

public abstract class AbstractClusterManager
extends Object
implements IClusterManager

Generic implementation for IClusterManager, independent of communication form.

Since:
4.0.0

Field Summary
protected  boolean processTransmissionsReceived
          Indicates whether transmissionReceived(IClusterTransmission) processes the given transmission.
protected  String serverId
          The identifier for this cluster node.
 
Constructor Summary
AbstractClusterManager()
           
 
Method Summary
 IClusterCommand createClusterCommand(Runnable runnable)
          Creates a cluster command instance and returns it.
 IClusterMessage createClusterMessage(String group, Serializable data)
          Creates a cluster message instance and returns it.
 void destroy()
          Destroys the cluster manager.
 void init()
          Initializes the cluster manager.
abstract  void send(IClusterTransmission transmission)
          Sends a transmission.
protected  void transmissionReceived(IClusterTransmission transmission)
          Processes a received transmission.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface lumis.portal.cluster.IClusterManager
getClusterConfig, getMembers
 

Field Detail

serverId

protected String serverId
The identifier for this cluster node.

Since:
4.1.0

processTransmissionsReceived

protected boolean processTransmissionsReceived
Indicates whether transmissionReceived(IClusterTransmission) processes the given transmission.

Since:
4.1.0
Constructor Detail

AbstractClusterManager

public AbstractClusterManager()
Method Detail

transmissionReceived

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

Parameters:
transmission - the transmission received.
Since:
4.1.0

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

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

send

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

Specified by:
send in interface IClusterManager
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)

createClusterCommand

public IClusterCommand createClusterCommand(Runnable runnable)
Description copied from interface: IClusterManager
Creates a cluster command instance and returns it.

Specified by:
createClusterCommand in interface IClusterManager
Parameters:
runnable - the runnable that contains the command's execution. It must be serializable.
See Also:
IClusterCommand

createClusterMessage

public IClusterMessage createClusterMessage(String group,
                                            Serializable data)
Description copied from interface: IClusterManager
Creates a cluster message instance and returns it.

Specified by:
createClusterMessage in interface IClusterManager
Parameters:
group - the destination group for the message.
data - the data sent in the message.
Returns:
the cluster message created.
See Also:
IClusterMessage


Lumisportal  4.1.0.071221 - Copyright © 2001-2007, Lumis. All Rights Reserved.