public class ModClusterService extends Object implements ModClusterServiceMBean, ContainerEventHandler, LoadBalanceFactorProvider, MCMPConnectionListener, ContextFilter
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PORT |
| Modifier | Constructor and Description |
|---|---|
|
ModClusterService(ModClusterConfig config,
LoadBalanceFactorProvider loadBalanceFactorProvider) |
|
ModClusterService(ModClusterConfig config,
LoadBalanceFactorProviderFactory loadBalanceFactorProviderFactory) |
|
ModClusterService(ModClusterConfiguration config,
LoadBalanceFactorProvider loadBalanceFactorProvider) |
protected |
ModClusterService(NodeConfiguration nodeConfig,
BalancerConfiguration balancerConfig,
MCMPHandlerConfiguration mcmpConfig,
AdvertiseConfiguration advertiseConfig,
LoadBalanceFactorProviderFactory loadBalanceFactorProviderFactory,
MCMPRequestFactory requestFactory,
MCMPResponseParser responseParser,
ResetRequestSource resetRequestSource,
MCMPHandler mcmpHandler,
AdvertiseListenerFactory listenerFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Context context)
Indicates the deployment of a new web application.
|
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) |
Set<String> |
getExcludedContexts(Host host)
Returns the contexts that will *not* be registered in any proxy for the given host.
|
int |
getLoadBalanceFactor(Engine engine) |
Map<InetSocketAddress,String> |
getProxyConfiguration()
Retrieves the full proxy configuration.
|
Map<InetSocketAddress,String> |
getProxyInfo()
Retrieves the full proxy info message.
|
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()
Ping httpd.
|
Map<InetSocketAddress,String> |
ping(String jvmRoute)
Ping a node from httpd.
|
Map<InetSocketAddress,String> |
ping(String scheme,
String host,
int port)
Ping a node defined protocol, host and port from httpd.
|
void |
refresh()
Refresh configuration.
|
void |
remove(Context context)
Indicates the undeployment of the specified 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()
Reset a DOWN connection to the proxy up to ERROR, where the configuration will be refreshed.
|
void |
shutdown()
Triggers the shutdown of mod_cluster.
|
void |
start(Context context)
Indicates the specified web application context was started.
|
void |
start(Server server)
Indicates the servlet container has been started.
|
void |
status(Engine engine)
This is a periodic event that triggers a STATUS command containing newly calculated load factor.
|
void |
stop(Context context)
Indicates the specified web application context was stopped.
|
boolean |
stop(long timeout,
TimeUnit unit)
Attempts to gracefully stops all web applications, within the specified timeout.
|
void |
stop(Server server)
Indicates the servlet container has been stopped.
|
boolean |
stopContext(String host,
String path,
long timeout,
TimeUnit unit)
Attempts to gracefully stops a single web application, within the specified timeout.
|
public static final int DEFAULT_PORT
public ModClusterService(ModClusterConfiguration config, LoadBalanceFactorProvider loadBalanceFactorProvider)
public ModClusterService(ModClusterConfig config, LoadBalanceFactorProvider loadBalanceFactorProvider)
public ModClusterService(ModClusterConfig config, LoadBalanceFactorProviderFactory loadBalanceFactorProviderFactory)
protected ModClusterService(NodeConfiguration nodeConfig, BalancerConfiguration balancerConfig, MCMPHandlerConfiguration mcmpConfig, AdvertiseConfiguration advertiseConfig, LoadBalanceFactorProviderFactory loadBalanceFactorProviderFactory, MCMPRequestFactory requestFactory, MCMPResponseParser responseParser, ResetRequestSource resetRequestSource, MCMPHandler mcmpHandler, AdvertiseListenerFactory listenerFactory)
public void init(Server server)
ContainerEventHandlerContainerEventHandler.start(Server) event.init in interface ContainerEventHandlerserver - a serverpublic Set<String> getExcludedContexts(Host host)
ContextFiltergetExcludedContexts in interface ContextFilterpublic boolean isAutoEnableContexts()
ContextFilterisAutoEnableContexts in interface ContextFilterpublic void shutdown()
ContainerEventHandlerContainerEventHandler.init(Server).shutdown in interface ContainerEventHandlerpublic void start(Server server)
ContainerEventHandlerstart in interface ContainerEventHandlerserver - the started serverpublic void stop(Server server)
ContainerEventHandlerstop in interface ContainerEventHandlerserver - the stopped serverprotected void config(Engine engine)
public boolean isEstablished()
isEstablished in interface MCMPConnectionListenerpublic void connectionEstablished(InetAddress localAddress)
connectionEstablished in interface MCMPConnectionListenerprotected void establishJvmRoute(Engine engine)
public void add(Context context)
ContainerEventHandleradd in interface ContainerEventHandlercontext - the added contextpublic void start(Context context)
ContainerEventHandlerstart in interface ContainerEventHandlercontext - the started contextpublic void stop(Context context)
ContainerEventHandlerContainerEventHandler.start(Context).stop in interface ContainerEventHandlercontext - the stopped contextpublic void remove(Context context)
ContainerEventHandlerremove in interface ContainerEventHandlercontext - the removed contextprotected void removeAll(Engine engine)
public void status(Engine engine)
ContainerEventHandlerstatus in interface ContainerEventHandlerengine - the engine to be processedpublic int getLoadBalanceFactor(Engine engine)
getLoadBalanceFactor in interface LoadBalanceFactorProviderpublic void addProxy(String host, int port)
ModClusterServiceMBeanMCMPHandler.status().addProxy in interface ModClusterServiceMBeanhost - the hostname of the proxy; a string suitable for passing to InetAddress.getByHost(...)port - the port on which the proxy listens for MCMP requestspublic void removeProxy(String host, int port)
ModClusterServiceMBeanMCMPHandler.status().removeProxy in interface ModClusterServiceMBeanhost - the hostname of the proxy; a string suitable for passing to InetAddress.getByHost(...)port - the port on which the proxy listens for MCMP requestspublic Map<InetSocketAddress,String> getProxyConfiguration()
ModClusterServiceMBeanDUMP request to all proxies, returning the responses grouped by proxy address.getProxyConfiguration in interface ModClusterServiceMBeanpublic Map<InetSocketAddress,String> getProxyInfo()
ModClusterServiceMBeanINFO request to all proxies, returning the responses grouped by proxy address.getProxyInfo in interface ModClusterServiceMBeanpublic Map<InetSocketAddress,String> ping()
ModClusterServiceMBeanping in interface ModClusterServiceMBeanpublic Map<InetSocketAddress,String> ping(String jvmRoute)
ModClusterServiceMBeanping in interface ModClusterServiceMBeanjvmRoute - a jvm route.public Map<InetSocketAddress,String> ping(String scheme, String host, int port)
ModClusterServiceMBeanping in interface ModClusterServiceMBeanscheme - ajp, http or httpshost - name or IP of a the hostpublic void reset()
ModClusterServiceMBeanreset in interface ModClusterServiceMBeanpublic void refresh()
ModClusterServiceMBeanrefresh in interface ModClusterServiceMBeanpublic boolean disable()
ModClusterServiceMBeandisable in interface ModClusterServiceMBeanpublic boolean enable()
ModClusterServiceMBeanenable in interface ModClusterServiceMBeanpublic boolean disableContext(String host, String path)
ModClusterServiceMBeandisableContext in interface ModClusterServiceMBeanhost - host name of the target webapppath - context path of the target webapppublic boolean enableContext(String host, String path)
ModClusterServiceMBeanenableContext in interface ModClusterServiceMBeanhost - host name of the target webapppath - context path of the target webapppublic boolean stop(long timeout,
TimeUnit unit)
ModClusterServiceMBeanstop in interface ModClusterServiceMBeantimeout - 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 parameterpublic boolean stopContext(String host, String path, long timeout, TimeUnit unit)
ModClusterServiceMBeanstopContext in interface ModClusterServiceMBeantimeout - 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 parameterCopyright © 2023 JBoss by Red Hat. All rights reserved.