public class JGroupsClusterManager extends AbstractClusterManager implements lumis.portal.cluster.multiserver.MessageReceiver.IProcessMessageCallback
processTransmissionsReceived, serverId, WAIT_LOCAL_PROCESSING_TIMEOUT_MS
Constructor and Description |
---|
JGroupsClusterManager() |
Modifier and Type | Method and Description |
---|---|
<T extends Serializable> |
call(IClusterCommand<T> command)
Calls a cluster command execution and returns the result of the local execution.
|
protected <T extends Serializable> |
callAndWaitResponsesInternal(IClusterCallable<T> callable,
long timeout) |
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 <T extends Serializable> |
transmissionReceived(IClusterTransmission transmission)
Processes a received transmission.
|
void |
updateAck(long transmissionOrder)
Updates the acknowledgment persisted as the specified
last transmission order.
|
callAndWaitResponses, createClusterCommand, createClusterCommand, createClusterMessage
public void init()
IClusterManager
init
in interface IClusterManager
init
in class AbstractClusterManager
public void destroy()
IClusterManager
destroy
in interface IClusterManager
destroy
in class AbstractClusterManager
protected <T extends Serializable> ITransmissionResult<T> transmissionReceived(IClusterTransmission transmission)
AbstractClusterManager
AbstractClusterManager.processTransmissionsReceived
may be used to disable the processing done by this method.transmissionReceived
in class AbstractClusterManager
transmission
- the transmission received.public void send(IClusterTransmission transmission)
IClusterManager
send
in interface IClusterManager
transmission
- the transmission. It must have been created using
one of the factory methods available in IClusterManager
.IClusterManager.createClusterCommand(IClusterCallable)
,
IClusterManager.createClusterMessage(String, Serializable)
public <T extends Serializable> T call(IClusterCommand<T> command) throws Exception
IClusterManager
This method sends the command through the cluster and gives feedback on the local server execution, in the form of the return value and the raised exception.
It is important to notice that the command will be sent over the cluster despite its execution outcome.
The given command must have been created through IClusterManager.createClusterCommand(IClusterCallable)
.
call
in interface IClusterManager
command
- the command to execute through the cluster.Exception
- the exception thrown during command execution or other unknown exception.protected <T extends Serializable> Map<IClusterMember,T> callAndWaitResponsesInternal(IClusterCallable<T> callable, long timeout) throws ClusterInvocationException, TimeoutException, InterruptedException
callAndWaitResponsesInternal
in class AbstractClusterManager
ClusterInvocationException
TimeoutException
InterruptedException
#callAndWaitResponses(IClusterCommand, long)
public Collection<IClusterMember> getMembers()
IClusterManager
getMembers
in interface IClusterManager
public IClusterMember getLocalMember()
IClusterManager
getLocalMember
in interface IClusterManager
public IClusterConfig getClusterConfig(ITransaction transaction) throws PortalException
IClusterManager
getClusterConfig
in interface IClusterManager
transaction
- the transaction for persistence access.PortalException
public long processAllPendingMessages(long lastTransmissionOrder)
lumis.portal.cluster.multiserver.MessageReceiver.IProcessMessageCallback
processAllPendingMessages
in interface lumis.portal.cluster.multiserver.MessageReceiver.IProcessMessageCallback
lastTransmissionOrder
- the current last processed transmission
order, or -1 if none was processed.public void processMessage(org.jgroups.Message message)
lumis.portal.cluster.multiserver.MessageReceiver.IProcessMessageCallback
processMessage
in interface lumis.portal.cluster.multiserver.MessageReceiver.IProcessMessageCallback
message
- the message.public void updateAck(long transmissionOrder)
lumis.portal.cluster.multiserver.MessageReceiver.IProcessMessageCallback
updateAck
in interface lumis.portal.cluster.multiserver.MessageReceiver.IProcessMessageCallback
LumisXP 12.4.0.200625 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.