lumis.portal.cluster
Interface IClusterManager

Package class diagram package IClusterManager
All Known Implementing Classes:
AbstractClusterManager, JGroupsClusterManager, SingleServerClusterManager

@StableMinor(version="5.5",
             sinceVersion="4.1")
public interface IClusterManager

Provides operations on the portal cluster.

A message may be sent by creating it using createClusterMessage(String, Serializable) and sending the IClusterMessage object returned by calling send(IClusterTransmission). When received, the message generates a ClusterMessageReceivedEvent.

A command may be sent by creating it using createClusterCommand(Runnable) and sending the IClusterCommand object returned by calling send(IClusterTransmission). When received, the command executes the corresponding Runnable code.

Either the message or the command, can be further configured before sending by using the available methods in the returned object.

Since:
4.0.0
See Also:
IClusterMessage, IClusterCommand

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.
 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.
 void send(IClusterTransmission transmission)
          Sends a transmission.
 

Method Detail

init

void init()
Initializes the cluster manager. This method should start the monitoring and connections necessary for the cluster manager to execute its communications.


destroy

void destroy()
Destroys the cluster manager. This method should close all resources used by the cluster manager.


send

void send(IClusterTransmission transmission)
Sends a transmission.

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

getMembers

Collection<IClusterMember> getMembers()
                                      throws PortalException
Returns a collection with information about the current members of this cluster.

Returns:
a collection with information about the current members of this cluster.
Throws:
PortalException
Since:
4.0.11

getLocalMember

IClusterMember getLocalMember()
Returns the current cluster member object. The object returned represents the member where this method is executed on.

Returns:
this server cluster member object.
Since:
4.2.0

createClusterMessage

IClusterMessage createClusterMessage(String group,
                                     Serializable data)
Creates a cluster message instance and returns it.

Parameters:
group - the destination group for the message.
data - the data sent in the message.
Returns:
the cluster message created.
Since:
4.1.0
See Also:
IClusterMessage

createClusterCommand

IClusterCommand createClusterCommand(Runnable runnable)
Creates a cluster command instance and returns it.

Parameters:
runnable - the runnable that contains the command's execution. It must be serializable.
Since:
4.1.0
See Also:
IClusterCommand

getClusterConfig

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

Parameters:
transaction - the transaction for persistence access.
Returns:
a persistent cluster configuration instance.
Throws:
PortalException
Since:
4.1.0


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