com.liferay.portal.cluster
Class ClusterExecutorImpl

java.lang.Object
  extended by com.liferay.portal.cluster.ClusterBase
      extended by com.liferay.portal.cluster.ClusterExecutorImpl
All Implemented Interfaces:
com.liferay.portal.kernel.cluster.ClusterExecutor, com.liferay.portal.util.PortalPortEventListener

public class ClusterExecutorImpl
extends ClusterBase
implements com.liferay.portal.kernel.cluster.ClusterExecutor, com.liferay.portal.util.PortalPortEventListener

Author:
Tina Tian, Shuyang Zhou

Field Summary
 java.util.concurrent.ScheduledExecutorService _scheduledExecutorService
           
 
Fields inherited from class com.liferay.portal.cluster.ClusterBase
bindInetAddress
 
Constructor Summary
ClusterExecutorImpl()
           
 
Method Summary
 void addClusterEventListener(com.liferay.portal.kernel.cluster.ClusterEventListener clusterEventListener)
           
 void afterPropertiesSet()
           
 void destroy()
           
 com.liferay.portal.kernel.cluster.FutureClusterResponses execute(com.liferay.portal.kernel.cluster.ClusterRequest clusterRequest)
           
protected  void fireClusterEvent(com.liferay.portal.kernel.cluster.ClusterEvent clusterEvent)
           
 java.util.List<com.liferay.portal.kernel.cluster.ClusterEventListener> getClusterEventListeners()
           
 java.util.List<com.liferay.portal.kernel.cluster.Address> getClusterNodeAddresses()
           
 java.util.List<com.liferay.portal.kernel.cluster.ClusterNode> getClusterNodes()
           
protected  org.jgroups.JChannel getControlChannel()
           
protected  com.liferay.portal.kernel.cluster.FutureClusterResponses getExecutionResults(java.lang.String uuid)
           
 com.liferay.portal.kernel.cluster.ClusterNode getLocalClusterNode()
           
 com.liferay.portal.kernel.cluster.Address getLocalClusterNodeAddress()
           
protected  void initChannels()
           
 void initialize()
           
protected  void initLocalClusterNode()
           
 boolean isClusterNodeAlive(com.liferay.portal.kernel.cluster.Address address)
           
 boolean isClusterNodeAlive(java.lang.String clusterNodeId)
           
 boolean isEnabled()
           
protected  boolean isShortcutLocalMethod()
           
protected  void notify(com.liferay.portal.kernel.cluster.Address address, com.liferay.portal.kernel.cluster.ClusterNode clusterNode, long expirationTime)
           
 void portalPortConfigured(int port)
           
protected  java.util.List<com.liferay.portal.kernel.cluster.Address> prepareAddresses(com.liferay.portal.kernel.cluster.ClusterRequest clusterRequest)
           
 void removeClusterEventListener(com.liferay.portal.kernel.cluster.ClusterEventListener clusterEventListener)
           
protected  void removeExpiredInstances()
           
protected  com.liferay.portal.kernel.cluster.ClusterNodeResponse runLocalMethod(com.liferay.portal.kernel.util.MethodHandler methodHandler)
           
protected  void sendMulticastRequest(com.liferay.portal.kernel.cluster.ClusterRequest clusterRequest)
           
protected  void sendUnicastRequest(com.liferay.portal.kernel.cluster.ClusterRequest clusterRequest, java.util.List<com.liferay.portal.kernel.cluster.Address> addresses)
           
 void setClusterEventListeners(java.util.List<com.liferay.portal.kernel.cluster.ClusterEventListener> clusterEventListeners)
           
 void setShortcutLocalMethod(boolean shortcutLocalMethod)
           
 
Methods inherited from class com.liferay.portal.cluster.ClusterBase
createJChannel, getAddresses, initBindAddress, initSystemProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_scheduledExecutorService

public java.util.concurrent.ScheduledExecutorService _scheduledExecutorService
Constructor Detail

ClusterExecutorImpl

public ClusterExecutorImpl()
Method Detail

addClusterEventListener

public void addClusterEventListener(com.liferay.portal.kernel.cluster.ClusterEventListener clusterEventListener)
Specified by:
addClusterEventListener in interface com.liferay.portal.kernel.cluster.ClusterExecutor

afterPropertiesSet

public void afterPropertiesSet()
Overrides:
afterPropertiesSet in class ClusterBase

destroy

public void destroy()
Specified by:
destroy in interface com.liferay.portal.kernel.cluster.ClusterExecutor
Specified by:
destroy in class ClusterBase

execute

public com.liferay.portal.kernel.cluster.FutureClusterResponses execute(com.liferay.portal.kernel.cluster.ClusterRequest clusterRequest)
                                                                 throws com.liferay.portal.kernel.exception.SystemException
Specified by:
execute in interface com.liferay.portal.kernel.cluster.ClusterExecutor
Throws:
com.liferay.portal.kernel.exception.SystemException

getClusterEventListeners

public java.util.List<com.liferay.portal.kernel.cluster.ClusterEventListener> getClusterEventListeners()
Specified by:
getClusterEventListeners in interface com.liferay.portal.kernel.cluster.ClusterExecutor

getClusterNodeAddresses

public java.util.List<com.liferay.portal.kernel.cluster.Address> getClusterNodeAddresses()
Specified by:
getClusterNodeAddresses in interface com.liferay.portal.kernel.cluster.ClusterExecutor

getClusterNodes

public java.util.List<com.liferay.portal.kernel.cluster.ClusterNode> getClusterNodes()
Specified by:
getClusterNodes in interface com.liferay.portal.kernel.cluster.ClusterExecutor

getLocalClusterNode

public com.liferay.portal.kernel.cluster.ClusterNode getLocalClusterNode()
Specified by:
getLocalClusterNode in interface com.liferay.portal.kernel.cluster.ClusterExecutor

getLocalClusterNodeAddress

public com.liferay.portal.kernel.cluster.Address getLocalClusterNodeAddress()
Specified by:
getLocalClusterNodeAddress in interface com.liferay.portal.kernel.cluster.ClusterExecutor

initialize

public void initialize()
Specified by:
initialize in interface com.liferay.portal.kernel.cluster.ClusterExecutor

isClusterNodeAlive

public boolean isClusterNodeAlive(com.liferay.portal.kernel.cluster.Address address)
Specified by:
isClusterNodeAlive in interface com.liferay.portal.kernel.cluster.ClusterExecutor

isClusterNodeAlive

public boolean isClusterNodeAlive(java.lang.String clusterNodeId)
Specified by:
isClusterNodeAlive in interface com.liferay.portal.kernel.cluster.ClusterExecutor

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface com.liferay.portal.kernel.cluster.ClusterExecutor
Overrides:
isEnabled in class ClusterBase

portalPortConfigured

public void portalPortConfigured(int port)
Specified by:
portalPortConfigured in interface com.liferay.portal.util.PortalPortEventListener

removeClusterEventListener

public void removeClusterEventListener(com.liferay.portal.kernel.cluster.ClusterEventListener clusterEventListener)
Specified by:
removeClusterEventListener in interface com.liferay.portal.kernel.cluster.ClusterExecutor

setClusterEventListeners

public void setClusterEventListeners(java.util.List<com.liferay.portal.kernel.cluster.ClusterEventListener> clusterEventListeners)

setShortcutLocalMethod

public void setShortcutLocalMethod(boolean shortcutLocalMethod)

fireClusterEvent

protected void fireClusterEvent(com.liferay.portal.kernel.cluster.ClusterEvent clusterEvent)

getControlChannel

protected org.jgroups.JChannel getControlChannel()

getExecutionResults

protected com.liferay.portal.kernel.cluster.FutureClusterResponses getExecutionResults(java.lang.String uuid)

initChannels

protected void initChannels()
Specified by:
initChannels in class ClusterBase

initLocalClusterNode

protected void initLocalClusterNode()
                             throws com.liferay.portal.kernel.exception.SystemException
Throws:
com.liferay.portal.kernel.exception.SystemException

isShortcutLocalMethod

protected boolean isShortcutLocalMethod()

notify

protected void notify(com.liferay.portal.kernel.cluster.Address address,
                      com.liferay.portal.kernel.cluster.ClusterNode clusterNode,
                      long expirationTime)

prepareAddresses

protected java.util.List<com.liferay.portal.kernel.cluster.Address> prepareAddresses(com.liferay.portal.kernel.cluster.ClusterRequest clusterRequest)

removeExpiredInstances

protected void removeExpiredInstances()

runLocalMethod

protected com.liferay.portal.kernel.cluster.ClusterNodeResponse runLocalMethod(com.liferay.portal.kernel.util.MethodHandler methodHandler)

sendMulticastRequest

protected void sendMulticastRequest(com.liferay.portal.kernel.cluster.ClusterRequest clusterRequest)
                             throws com.liferay.portal.kernel.exception.SystemException
Throws:
com.liferay.portal.kernel.exception.SystemException

sendUnicastRequest

protected void sendUnicastRequest(com.liferay.portal.kernel.cluster.ClusterRequest clusterRequest,
                                  java.util.List<com.liferay.portal.kernel.cluster.Address> addresses)
                           throws com.liferay.portal.kernel.exception.SystemException
Throws:
com.liferay.portal.kernel.exception.SystemException