|
||||||||||
| 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 |
addDynamicServer(ClusterServer server)
Adds a new server to the cluster. |
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. |
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 |
createJdbcStore()
|
Machine |
createMachine()
Adds a new server to the cluster. |
protected StoreManager |
createPersistentStore(java.lang.String type)
Creates a persistent store instance. |
protected Server |
createResinServer(ClusterServer clusterServer)
|
ClusterServer |
createServer()
Adds a new server to the cluster. |
static int |
decode(int code)
|
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 |
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. |
ClusterServer |
findServer(java.lang.String address,
int port)
Finds the first server with the given server-id. |
void |
generateBackup(java.lang.StringBuilder sb,
int index)
|
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. |
static Cluster |
getCluster(java.lang.ClassLoader loader)
Returns the currently active local cluster. |
static Cluster |
getCurrent()
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. |
int |
getPrimaryIndex(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. |
int |
getSecondaryIndex(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. |
int |
getTertiaryIndex(java.lang.String id,
int offset)
Returns the tertiary server. |
long |
getVersion()
Returns the version |
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. |
void |
setRootDirectory(Path rootDirectory)
Sets the root directory. |
protected void |
setStore(StoreManager store)
Sets the cluster store. |
void |
start()
Initializes the cluster. |
void |
startClusterUpdate()
|
void |
startPersistentStore()
|
void |
startRemote()
Start any work in notifying other members in the cluster that the server is active. |
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 getCurrent()
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 void setDynamicServerEnable(boolean isEnable)
public boolean isDynamicServerEnable()
public long getVersion()
public ClusterMXBean getAdmin()
public ClusterServer findServer(java.lang.String id)
public ClusterServer findServer(java.lang.String address,
int port)
public void addServerDefault(ContainerProgram program)
public Machine createMachine()
public ClusterServer createServer()
public void addServer(ClusterServer server)
throws ConfigException
ConfigException
public void addDynamicServer(java.lang.String serverId,
java.lang.String address,
int port)
throws ConfigException
ConfigException
public void addDynamicServer(ClusterServer server)
throws ConfigException
ConfigException
public void removeDynamicServer(ClusterServer server)
throws ConfigException
ConfigException
public ServerConnector findConnector(java.lang.String address,
int port)
public StoreManager getStore()
protected void setStore(StoreManager store)
public StoreManager createJdbcStore()
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)
protected Server createResinServer(ClusterServer clusterServer)
public long generateBackupCode(int index)
public void generateBackupCode(java.lang.StringBuilder cb,
long backupCode)
public void generateBackup(java.lang.StringBuilder sb,
int index)
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 int getPrimaryIndex(java.lang.String id,
int offset)
public int getSecondaryIndex(java.lang.String id,
int offset)
public int getTertiaryIndex(java.lang.String id,
int offset)
public void classLoaderInit(DynamicClassLoader loader)
public void classLoaderDestroy(DynamicClassLoader loader)
public void startRemote()
protected StoreManager createPersistentStore(java.lang.String type)
public void startPersistentStore()
public void startClusterUpdate()
public void environmentConfigure(EnvironmentClassLoader loader)
environmentConfigure in interface EnvironmentListenerpublic void environmentBind(EnvironmentClassLoader loader)
environmentBind in interface EnvironmentListenerpublic 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 | |||||||||