public class NetworkClusterSystem extends AbstractResinSubSystem
Modifier and Type | Field and Description |
---|---|
static int |
START_PRIORITY |
START_PRIORITY_CACHE_SERVICE, START_PRIORITY_CLASSLOADER, START_PRIORITY_CLUSTER_SERVICE, START_PRIORITY_DATABASE_SYSTEM, START_PRIORITY_DEFAULT, START_PRIORITY_ENV_SYSTEM, START_PRIORITY_NETWORK_CLUSTER, STOP_PRIORITY_CLASSLOADER
Constructor and Description |
---|
NetworkClusterSystem(CloudServer selfServer) |
Modifier and Type | Method and Description |
---|---|
void |
addClusterExtensionProtocol(int id,
Protocol protocol) |
void |
addLinkListener(ClusterLinkListener listener) |
void |
addServerListener(ClusterServerListener listener) |
static void |
configServer(java.lang.Object server,
CloudServer cloudServer) |
static void |
createAndAddService(NetworkClusterSystem clusterSystem)
Creates a new network cluster service.
|
TcpPort |
getClusterListener()
Returns the cluster port.
|
static NetworkClusterSystem |
getCurrent()
Returns the current network service.
|
static CloudServer |
getCurrentSelfServer()
Returns the current network service.
|
static java.util.ArrayList<java.net.InetAddress> |
getLocalAddresses() |
NetworkAddressResult |
getLocalSocketAddress(ClusterServer clusterServer)
Returns the local ip address for a server configured with
external-address.
|
CloudServer |
getSelfServer()
Returns the self server for the network.
|
java.lang.String |
getServerId()
Returns the active server id.
|
int |
getStartPriority()
Returns the start priority of the service, used to determine which
services to start first.
|
protected void |
notifyHeartbeatStart(ClusterServer server) |
protected void |
notifyHeartbeatStop(ClusterServer server) |
void |
notifyLinkClose(java.lang.Object payload) |
void |
removeServerListener(com.caucho.cloud.network.NetworkClusterSystem.ServerListener listener) |
void |
start()
Starts the service.
|
void |
stop()
Closes the server.
|
java.lang.String |
toString() |
destroy, getStopPriority, isActive, preCreate
public static final int START_PRIORITY
public NetworkClusterSystem(CloudServer selfServer)
public static void createAndAddService(NetworkClusterSystem clusterSystem)
public static NetworkClusterSystem getCurrent()
public static CloudServer getCurrentSelfServer()
public CloudServer getSelfServer()
public java.lang.String getServerId()
public TcpPort getClusterListener()
public void addServerListener(ClusterServerListener listener)
public void removeServerListener(com.caucho.cloud.network.NetworkClusterSystem.ServerListener listener)
protected void notifyHeartbeatStart(ClusterServer server)
protected void notifyHeartbeatStop(ClusterServer server)
public void addLinkListener(ClusterLinkListener listener)
public void notifyLinkClose(java.lang.Object payload)
public void addClusterExtensionProtocol(int id, Protocol protocol)
public int getStartPriority()
ResinSubSystem
getStartPriority
in interface ResinSubSystem
getStartPriority
in class AbstractResinSubSystem
public void start() throws java.lang.Exception
ResinSubSystem
start
in interface ResinSubSystem
start
in class AbstractResinSubSystem
java.lang.Exception
public void stop() throws java.lang.Exception
stop
in interface ResinSubSystem
stop
in class AbstractResinSubSystem
java.lang.Exception
public NetworkAddressResult getLocalSocketAddress(ClusterServer clusterServer)
public static void configServer(java.lang.Object server, CloudServer cloudServer)
public static java.util.ArrayList<java.net.InetAddress> getLocalAddresses()
public java.lang.String toString()
toString
in class AbstractResinSubSystem