public class ModClusterService extends Object implements ModClusterServiceMBean, ContainerEventHandler, LoadBalanceFactorProvider, MCMPConnectionListener, ContextFilter
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_PORT |
protected org.jboss.logging.Logger |
log |
Modifier | Constructor and Description |
---|---|
|
ModClusterService(ModClusterConfig config,
LoadBalanceFactorProvider loadBalanceFactorProvider) |
|
ModClusterService(ModClusterConfig config,
LoadBalanceFactorProviderFactory loadBalanceFactorProviderFactory) |
protected |
ModClusterService(NodeConfiguration nodeConfig,
BalancerConfiguration balancerConfig,
MCMPHandlerConfiguration mcmpConfig,
LoadBalanceFactorProviderFactory loadBalanceFactorProviderFactory,
MCMPRequestFactory requestFactory,
MCMPResponseParser responseParser,
ResetRequestSource resetRequestSource,
MCMPHandler mcmpHandler,
AdvertiseListenerFactory listenerFactory) |
Modifier and Type | Method and Description |
---|---|
void |
add(Context context) |
void |
addProxy(String host,
int port)
Add a proxy to the list of those with which this handler communicates.
|
protected void |
config(Engine engine)
Configures the specified engine.
|
void |
connectionEstablished(InetAddress localAddress) |
boolean |
disable()
Disable all webapps for all engines.
|
boolean |
disableContext(String host,
String path)
Disables the webapp with the specified host and context path.
|
boolean |
enable()
Enable all webapps for all engines.
|
boolean |
enableContext(String host,
String path)
Enables the webapp with the specified host and context path.
|
protected void |
establishJvmRoute(Engine engine) |
Map<Host,Set<String>> |
getExcludedContexts()
Returns the contexts that will *not* be registered in any proxy.
|
int |
getLoadBalanceFactor(Engine engine) |
Map<InetSocketAddress,String> |
getProxyConfiguration() |
Map<InetSocketAddress,String> |
getProxyInfo() |
void |
init(Server server)
Triggers the initialization of mod_cluster.
|
boolean |
isAutoEnableContexts()
Indicates when contexts should auto-enable by default.
|
boolean |
isEstablished() |
Map<InetSocketAddress,String> |
ping() |
Map<InetSocketAddress,String> |
ping(String jvmRoute) |
Map<InetSocketAddress,String> |
ping(String scheme,
String host,
int port) |
void |
refresh()
Refresh configuration.
|
void |
remove(Context context) |
protected void |
removeAll(Engine engine)
Sends REMOVE-APP *, if engine was initialized
|
void |
removeProxy(String host,
int port)
Remove a proxy from the list of those with which this handler communicates.
|
void |
reset() |
void |
shutdown()
Triggers the shutdown of mod_cluster.
|
void |
start(Context context) |
void |
start(Server server)
Indicates the servlet container has been started.
|
void |
status(Engine engine) |
void |
stop(Context context) |
boolean |
stop(long timeout,
TimeUnit unit) |
void |
stop(Server server) |
boolean |
stopContext(String host,
String path,
long timeout,
TimeUnit unit) |
public static final int DEFAULT_PORT
protected final org.jboss.logging.Logger log
public ModClusterService(ModClusterConfig config, LoadBalanceFactorProvider loadBalanceFactorProvider)
public ModClusterService(ModClusterConfig config, LoadBalanceFactorProviderFactory loadBalanceFactorProviderFactory)
protected ModClusterService(NodeConfiguration nodeConfig, BalancerConfiguration balancerConfig, MCMPHandlerConfiguration mcmpConfig, LoadBalanceFactorProviderFactory loadBalanceFactorProviderFactory, MCMPRequestFactory requestFactory, MCMPResponseParser responseParser, ResetRequestSource resetRequestSource, MCMPHandler mcmpHandler, AdvertiseListenerFactory listenerFactory)
public void init(Server server)
ContainerEventHandler
ContainerEventHandler.start(Server)
event.init
in interface ContainerEventHandler
server
- a serverorg.jboss.modcluster.ContainerEventHandler#init(java.lang.Object)
public Map<Host,Set<String>> getExcludedContexts()
getExcludedContexts
in interface ContextFilter
ContextFilter.getExcludedContexts()
public boolean isAutoEnableContexts()
isAutoEnableContexts
in interface ContextFilter
ContextFilter.isAutoEnableContexts()
public void shutdown()
ContainerEventHandler
ContainerEventHandler.init(Server)
.shutdown
in interface ContainerEventHandler
org.jboss.modcluster.ContainerEventHandler#shutdown()
public void start(Server server)
ContainerEventHandler
start
in interface ContainerEventHandler
server
- the started serverorg.jboss.modcluster.ContainerEventHandler#start(java.lang.Object)
public void stop(Server server)
stop
in interface ContainerEventHandler
server
- the stopped serverorg.jboss.modcluster.ContainerEventHandler#stop(org.jboss.modcluster.Server)
protected void config(Engine engine)
engine
- public boolean isEstablished()
isEstablished
in interface MCMPConnectionListener
MCMPConnectionListener.isEstablished()
public void connectionEstablished(InetAddress localAddress)
connectionEstablished
in interface MCMPConnectionListener
MCMPConnectionListener.connectionEstablished(java.net.InetAddress)
protected void establishJvmRoute(Engine engine)
public void add(Context context)
add
in interface ContainerEventHandler
context
- the added contextorg.jboss.modcluster.ContainerEventHandler#add(org.jboss.modcluster.Context)
public void start(Context context)
start
in interface ContainerEventHandler
context
- the started contextorg.jboss.modcluster.ContainerEventHandler#start(org.jboss.modcluster.Context)
public void stop(Context context)
stop
in interface ContainerEventHandler
context
- the stopped contextorg.jboss.modcluster.ContainerEventHandler#stop(org.jboss.modcluster.Context)
public void remove(Context context)
remove
in interface ContainerEventHandler
context
- the removed contextorg.jboss.modcluster.ContainerEventHandler#remove(org.jboss.modcluster.Context)
protected void removeAll(Engine engine)
engine
- public void status(Engine engine)
status
in interface ContainerEventHandler
engine
- the engine to be processedorg.jboss.modcluster.ContainerEventHandler#status(org.jboss.modcluster.Engine)
public int getLoadBalanceFactor(Engine engine)
getLoadBalanceFactor
in interface LoadBalanceFactorProvider
org.jboss.modcluster.load.LoadBalanceFactorProvider#getLoadBalanceFactor()
public void addProxy(String host, int port)
ModClusterServiceMBean
#status()
.addProxy
in interface ModClusterServiceMBean
host
- the hostname of the proxy; a string suitable for passing to InetAddress.getByHost(...)
port
- the port on which the proxy listens for MCMP requestsModClusterServiceMBean.addProxy(java.lang.String, int)
public void removeProxy(String host, int port)
ModClusterServiceMBean
#status()
.removeProxy
in interface ModClusterServiceMBean
host
- the hostname of the proxy; a string suitable for passing to InetAddress.getByHost(...)
port
- the port on which the proxy listens for MCMP requestsModClusterServiceMBean.removeProxy(java.lang.String, int)
public Map<InetSocketAddress,String> getProxyConfiguration()
getProxyConfiguration
in interface ModClusterServiceMBean
ModClusterServiceMBean.getProxyConfiguration()
public Map<InetSocketAddress,String> getProxyInfo()
getProxyInfo
in interface ModClusterServiceMBean
ModClusterServiceMBean.getProxyInfo()
public Map<InetSocketAddress,String> ping()
ping
in interface ModClusterServiceMBean
ModClusterServiceMBean.ping()
public Map<InetSocketAddress,String> ping(String jvmRoute)
ping
in interface ModClusterServiceMBean
jvmRoute
- a jvm route.ModClusterServiceMBean.ping(java.lang.String)
public Map<InetSocketAddress,String> ping(String scheme, String host, int port)
ping
in interface ModClusterServiceMBean
scheme
- (ajp, http or https)host
- (name or ip of a the host)ModClusterServiceMBean.ping(java.lang.String, java.lang.String, int)
public void reset()
reset
in interface ModClusterServiceMBean
ModClusterServiceMBean.reset()
public void refresh()
ModClusterServiceMBean
refresh
in interface ModClusterServiceMBean
ModClusterServiceMBean.refresh()
public boolean disable()
ModClusterServiceMBean
disable
in interface ModClusterServiceMBean
ModClusterServiceMBean.disable()
public boolean enable()
ModClusterServiceMBean
enable
in interface ModClusterServiceMBean
ModClusterServiceMBean.enable()
public boolean disableContext(String host, String path)
ModClusterServiceMBean
disableContext
in interface ModClusterServiceMBean
host
- host name of the target webapppath
- context path of the target webapporg.jboss.modcluster.ModClusterServiceMBean#disable(java.lang.String, java.lang.String)
public boolean enableContext(String host, String path)
ModClusterServiceMBean
enableContext
in interface ModClusterServiceMBean
host
- host name of the target webapppath
- context path of the target webapporg.jboss.modcluster.ModClusterServiceMBean#enable(java.lang.String, java.lang.String)
public boolean stop(long timeout, TimeUnit unit)
stop
in interface ModClusterServiceMBean
timeout
- number of units of time for which to wait for sessions to drain. Negative or zero timeout value will wait
forever.unit
- unit of time represented in timeout parameterModClusterServiceMBean.stop(long, java.util.concurrent.TimeUnit)
public boolean stopContext(String host, String path, long timeout, TimeUnit unit)
stopContext
in interface ModClusterServiceMBean
timeout
- number of units of time for which to wait for sessions to drain. Negative or zero timeout value will wait
forever.unit
- unit of time represented in timeout parameterModClusterServiceMBean.stopContext(java.lang.String, java.lang.String, long,
java.util.concurrent.TimeUnit)
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.