|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.server.cluster.Cluster
public class Cluster
Defines a set of clustered servers.
| Nested Class Summary | |
|---|---|
class |
Cluster.ServerVar
|
class |
Cluster.Var
EL variables |
| Field Summary | |
|---|---|
protected static EnvironmentLocal<Cluster> |
_clusterLocal
|
protected static EnvironmentLocal<java.lang.String> |
_serverIdLocal
|
| Constructor Summary | |
|---|---|
Cluster()
|
|
Cluster(Resin resin)
|
|
| Method Summary | |
|---|---|
void |
addBuilderProgram(ConfigProgram program)
Adds a program. |
void |
addServer(ClusterServer server)
Adds a new server to the cluster. |
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. |
StoreManager |
createClusterStore()
|
StoreManager |
createFileStore()
|
StoreManager |
createJdbcStore()
|
Machine |
createMachine()
Adds a new server to the cluster. |
StoreManager |
createPrivateFileStore()
|
ClusterServer |
createServer()
Adds a new server to the cluster. |
static int |
decode(int code)
|
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 |
ServerConnector |
findConnector(java.lang.String address,
int port)
Adds a srun server. |
ClusterServer |
findServer(java.lang.String id)
Finds the first server with the given server-id. |
long |
generateBackupCode(int index)
Generate the primary, secondary, tertiary, returning the value encoded in a long. |
void |
generateBackupCode(java.lang.StringBuilder cb,
long backupCode)
Adds the primary/backup/third digits to the id. |
ClusterMXBean |
getAdmin()
Returns the admin. |
java.lang.ClassLoader |
getClassLoader()
Returns the environment class loader. |
long |
getClientConnectTimeout()
Gets the connect timeout. |
long |
getClientFailRecoverTime()
Gets the client fail-recover time. |
long |
getClientMaxIdleTime()
Gets the live time. |
long |
getClientReadTimeout()
Gets the read timeout. |
long |
getClientWarmupTime()
Gets the client warmup time. |
static Cluster |
getCluster(java.lang.ClassLoader loader)
Returns the currently active local cluster. |
java.lang.String |
getId()
Gets the cluster id. |
static Cluster |
getLocal()
Returns the currently active local cluster. |
java.util.ArrayList<Machine> |
getMachineList()
Returns the machine list. |
javax.management.ObjectName |
getObjectName()
Returns the JMX object name. |
ClusterServer |
getPrimary(java.lang.String id,
int offset)
Returns the primary server. |
Resin |
getResin()
Returns the owning resin server. |
Path |
getRootDirectory()
Gets the root directory. |
java.lang.String |
getSchema()
Returns the relax schema. |
ClusterServer |
getSecondary(java.lang.String id,
int offset)
Returns the secondary server. |
ClusterServer |
getSelfServer()
Returns the server corresponding to the current server-id. |
ClusterServer |
getServer(int index)
Returns the server with the matching index. |
ClusterServer |
getServer(java.lang.String serverId)
Returns the server in the cluster with the given server-id. |
static java.lang.String |
getServerId()
Returns the server id. |
ClusterServer[] |
getServerList()
Returns the server list. |
java.util.ArrayList<ClusterPort> |
getServerPorts(java.lang.String serverId)
Returns the matching ports. |
StoreManager |
getStore()
Returns the cluster store. |
ClusterServer |
getTertiary(java.lang.String id,
int offset)
Returns the tertiary server. |
void |
setClientConnectTimeout(Period period)
Sets the connect timeout. |
void |
setClientDeadTime(Period period)
Deprecated. |
void |
setClientFailRecoverTime(Period period)
Sets the client connection fail-recover time. |
void |
setClientLiveTime(Period period)
Deprecated. |
void |
setClientMaxIdleTime(Period period)
Sets the max-idle time. |
void |
setClientReadTimeout(Period period)
Sets the read timeout. |
void |
setClientWarmupTime(Period period)
Sets the client warmup time. |
void |
setClientWriteTimeout(Period period)
Sets the write timeout. |
void |
setId(java.lang.String id)
Sets the cluster id. |
void |
setRootDirectory(Path rootDirectory)
Sets the root directory. |
void |
start()
Initializes the cluster. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final EnvironmentLocal<java.lang.String> _serverIdLocal
protected static final EnvironmentLocal<Cluster> _clusterLocal
| Constructor Detail |
|---|
public Cluster(Resin resin)
public Cluster()
| Method Detail |
|---|
public static Cluster getLocal()
public static Cluster getCluster(java.lang.ClassLoader loader)
public void setId(java.lang.String id)
public java.lang.String getId()
public Resin getResin()
public java.lang.ClassLoader getClassLoader()
getClassLoader in interface EnvironmentBeanpublic java.lang.String getSchema()
getSchema in interface SchemaBeanpublic Path getRootDirectory()
public void setRootDirectory(Path rootDirectory)
public ClusterMXBean getAdmin()
public ClusterServer findServer(java.lang.String id)
public void addServerDefault(ContainerProgram program)
throws java.lang.Throwable
java.lang.Throwable
public Machine createMachine()
throws java.lang.Exception
java.lang.Exception
public ClusterServer createServer()
throws java.lang.Exception
java.lang.Exception
public void addServer(ClusterServer server)
throws ConfigException
ConfigException
public ServerConnector findConnector(java.lang.String address,
int port)
public StoreManager getStore()
public void setClientMaxIdleTime(Period period)
public long getClientMaxIdleTime()
public void setClientLiveTime(Period period)
public void setClientFailRecoverTime(Period period)
public long getClientFailRecoverTime()
public void setClientDeadTime(Period period)
public void setClientWarmupTime(Period period)
public long getClientWarmupTime()
public void setClientConnectTimeout(Period period)
public long getClientConnectTimeout()
public void setClientReadTimeout(Period period)
public long getClientReadTimeout()
public void setClientWriteTimeout(Period period)
public StoreManager createJdbcStore()
throws ConfigException
ConfigException
public StoreManager createPrivateFileStore()
throws ConfigException
ConfigException
public StoreManager createFileStore()
throws ConfigException
ConfigException
public StoreManager createClusterStore()
throws ConfigException
ConfigExceptionpublic void addBuilderProgram(ConfigProgram program)
public void start()
throws ConfigException
ConfigExceptionpublic static java.lang.String getServerId()
public javax.management.ObjectName getObjectName()
public ClusterServer getSelfServer()
public ClusterServer[] getServerList()
public java.util.ArrayList<Machine> getMachineList()
public ClusterServer getServer(java.lang.String serverId)
public ClusterServer getServer(int index)
public java.util.ArrayList<ClusterPort> getServerPorts(java.lang.String serverId)
public long generateBackupCode(int index)
public void generateBackupCode(java.lang.StringBuilder cb,
long backupCode)
public ClusterServer getPrimary(java.lang.String id,
int offset)
public ClusterServer getSecondary(java.lang.String id,
int offset)
public ClusterServer getTertiary(java.lang.String id,
int offset)
public void classLoaderInit(DynamicClassLoader loader)
public void classLoaderDestroy(DynamicClassLoader loader)
public void environmentStart(EnvironmentClassLoader loader)
environmentStart in interface EnvironmentListenerpublic void environmentStop(EnvironmentClassLoader loader)
environmentStop in interface EnvironmentListenerpublic void close()
public java.lang.String toString()
toString in class java.lang.Objectpublic static int decode(int code)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||