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)
ContainerEventHandler
ContainerEventHandler.start(Server)
event.init
in interface ContainerEventHandler
server
- a serverpublic Set<String> getExcludedContexts(Host host)
ContextFilter
getExcludedContexts
in interface ContextFilter
public boolean isAutoEnableContexts()
ContextFilter
isAutoEnableContexts
in interface ContextFilter
public void shutdown()
ContainerEventHandler
ContainerEventHandler.init(Server)
.shutdown
in interface ContainerEventHandler
public void start(Server server)
ContainerEventHandler
start
in interface ContainerEventHandler
server
- the started serverpublic void stop(Server server)
ContainerEventHandler
stop
in interface ContainerEventHandler
server
- the stopped serverprotected void config(Engine engine)
public boolean isEstablished()
isEstablished
in interface MCMPConnectionListener
public void connectionEstablished(InetAddress localAddress)
connectionEstablished
in interface MCMPConnectionListener
protected void establishJvmRoute(Engine engine)
public void add(Context context)
ContainerEventHandler
add
in interface ContainerEventHandler
context
- the added contextpublic void start(Context context)
ContainerEventHandler
start
in interface ContainerEventHandler
context
- the started contextpublic void stop(Context context)
ContainerEventHandler
ContainerEventHandler.start(Context)
.stop
in interface ContainerEventHandler
context
- the stopped contextpublic void remove(Context context)
ContainerEventHandler
remove
in interface ContainerEventHandler
context
- the removed contextprotected void removeAll(Engine engine)
public void status(Engine engine)
ContainerEventHandler
status
in interface ContainerEventHandler
engine
- the engine to be processedpublic int getLoadBalanceFactor(Engine engine)
getLoadBalanceFactor
in interface LoadBalanceFactorProvider
public void addProxy(String host, int port)
ModClusterServiceMBean
MCMPHandler.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 requestspublic void removeProxy(String host, int port)
ModClusterServiceMBean
MCMPHandler.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 requestspublic Map<InetSocketAddress,String> getProxyConfiguration()
ModClusterServiceMBean
DUMP
request to all proxies, returning the responses grouped by proxy address.getProxyConfiguration
in interface ModClusterServiceMBean
public Map<InetSocketAddress,String> getProxyInfo()
ModClusterServiceMBean
INFO
request to all proxies, returning the responses grouped by proxy address.getProxyInfo
in interface ModClusterServiceMBean
public Map<InetSocketAddress,String> ping()
ModClusterServiceMBean
ping
in interface ModClusterServiceMBean
public Map<InetSocketAddress,String> ping(String jvmRoute)
ModClusterServiceMBean
ping
in interface ModClusterServiceMBean
jvmRoute
- a jvm route.public Map<InetSocketAddress,String> ping(String scheme, String host, int port)
ModClusterServiceMBean
ping
in interface ModClusterServiceMBean
scheme
- ajp, http or httpshost
- name or IP of a the hostpublic void reset()
ModClusterServiceMBean
reset
in interface ModClusterServiceMBean
public void refresh()
ModClusterServiceMBean
refresh
in interface ModClusterServiceMBean
public boolean disable()
ModClusterServiceMBean
disable
in interface ModClusterServiceMBean
public boolean enable()
ModClusterServiceMBean
enable
in interface ModClusterServiceMBean
public boolean disableContext(String host, String path)
ModClusterServiceMBean
disableContext
in interface ModClusterServiceMBean
host
- host name of the target webapppath
- context path of the target webapppublic boolean enableContext(String host, String path)
ModClusterServiceMBean
enableContext
in interface ModClusterServiceMBean
host
- host name of the target webapppath
- context path of the target webapppublic boolean stop(long timeout, TimeUnit unit)
ModClusterServiceMBean
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 parameterpublic boolean stopContext(String host, String path, long timeout, TimeUnit unit)
ModClusterServiceMBean
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 parameterCopyright © 2023 JBoss by Red Hat. All rights reserved.