public abstract class Cluster extends java.lang.Object implements EnvironmentListener, SchemaBean
Modifier and Type | Class and Description |
---|---|
class |
Cluster.ClusterVar
EL variables
|
Modifier | Constructor and Description |
---|---|
protected |
Cluster(Resin resin) |
Modifier and Type | Method and Description |
---|---|
void |
addContentProgram(ConfigProgram program)
Adds a program.
|
void |
addDynamicServer(java.lang.String serverId,
java.lang.String address,
int port)
Adds a new server to the cluster.
|
void |
addServer(ClusterServer server)
Adds a new server to the cluster during configuration.
|
void |
addServerDefault(ContainerProgram program)
Adds a new server to the cluster.
|
void |
classLoaderDestroy(DynamicClassLoader loader)
Handles the case where a class loader is dropped.
|
void |
classLoaderInit(DynamicClassLoader loader)
Handles the case where a class loader has completed initialization
|
void |
close()
Closes the cluster.
|
protected void |
configureServerDefault(ClusterServer server)
Configure the default values for the server
|
ClusterPod |
createPod()
Adds a new pod to the cluster
|
abstract ClusterServer |
createServer()
Adds a new server to the cluster during configuration.
|
void |
environmentBind(EnvironmentClassLoader loader)
Handles the case where the environment is starting (after init).
|
void |
environmentConfigure(EnvironmentClassLoader loader)
Handles the case where the environment is configured (after init).
|
void |
environmentStart(EnvironmentClassLoader loader)
Handles the case where the environment is starting (after init).
|
void |
environmentStop(EnvironmentClassLoader loader)
Handles the case where the environment is stopping
|
ClusterPod |
findPod(int podIndex)
Finds the first server with the given server-id.
|
ClusterServer |
findServer(int podIndex,
int index)
Finds the first server with the given server-id.
|
ClusterServer |
findServer(java.lang.String id)
Finds the first server with the given server-id.
|
ClusterServer |
findServer(java.lang.String address,
int port)
Finds the first server with the given server-id.
|
ClusterServer |
findServerByPrefix(java.lang.String prefix)
Finds the first server with the given server-id.
|
ClusterMXBean |
getAdmin()
Returns the admin.
|
java.lang.String |
getId()
Gets the cluster id.
|
abstract ClusterPod[] |
getPodList()
Returns the list of pods for the cluster
|
Resin |
getResin()
Returns the owning resin container.
|
java.lang.String |
getSchema()
Returns the relax schema.
|
ServletService |
getServer()
Returns the server
|
long |
getVersion()
Returns the version
|
void |
init()
Initializes the cluster.
|
boolean |
isActive()
Returns true if the cluster is active
|
boolean |
isDynamicServerEnable()
Enables dynamic servers
|
void |
removeDynamicServer(ClusterServer server)
Adds a new server to the cluster.
|
void |
setDynamicServerEnable(boolean isEnable)
Enables dynamic servers
|
void |
setId(java.lang.String id)
Sets the cluster id.
|
protected void |
setSelfServer(ClusterServer server) |
void |
start()
Start the cluster.
|
void |
startRemote()
Start any work in notifying other members in the cluster
that the server is active.
|
java.lang.String |
toString() |
protected Cluster(Resin resin)
public void setId(java.lang.String id)
public java.lang.String getId()
public Resin getResin()
public ServletService getServer()
public java.lang.String getSchema()
getSchema
in interface SchemaBean
public void setDynamicServerEnable(boolean isEnable)
public boolean isDynamicServerEnable()
public long getVersion()
public ClusterMXBean getAdmin()
public abstract ClusterPod[] getPodList()
public ClusterServer findServer(java.lang.String id)
public ClusterServer findServer(int podIndex, int index)
public ClusterPod findPod(int podIndex)
public ClusterServer findServerByPrefix(java.lang.String prefix)
public ClusterServer findServer(java.lang.String address, int port)
public void addServerDefault(ContainerProgram program)
public ClusterPod createPod()
public abstract ClusterServer createServer()
public void addServer(ClusterServer server)
protected void configureServerDefault(ClusterServer server)
public void addDynamicServer(java.lang.String serverId, java.lang.String address, int port) throws ConfigException
ConfigException
protected void setSelfServer(ClusterServer server)
public void removeDynamicServer(ClusterServer server) throws ConfigException
ConfigException
public void addContentProgram(ConfigProgram program)
public boolean isActive()
@PostConstruct public void init() throws ConfigException
ConfigException
public void start() throws ConfigException
ConfigException
public void classLoaderInit(DynamicClassLoader loader)
public void classLoaderDestroy(DynamicClassLoader loader)
public void startRemote()
public void environmentConfigure(EnvironmentClassLoader loader)
environmentConfigure
in interface EnvironmentListener
public void environmentBind(EnvironmentClassLoader loader)
environmentBind
in interface EnvironmentListener
public void environmentStart(EnvironmentClassLoader loader)
environmentStart
in interface EnvironmentListener
public void environmentStop(EnvironmentClassLoader loader)
environmentStop
in interface EnvironmentListener
public void close()
public java.lang.String toString()
toString
in class java.lang.Object