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) |
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) |
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) |
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() |
void |
start(Context context) |
void |
start(Server server) |
void |
status(Engine engine) |
void |
stop(Context context) |
boolean |
stop(long timeout,
TimeUnit unit)
Attempts to gracefully stops all web applications, within the specified timeout.
|
void |
stop(Server server) |
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)
init
in interface ContainerEventHandler
public Set<String> getExcludedContexts(Host host)
ContextFilter
getExcludedContexts
in interface ContextFilter
public boolean isAutoEnableContexts()
ContextFilter
isAutoEnableContexts
in interface ContextFilter
public void shutdown()
shutdown
in interface ContainerEventHandler
public void start(Server server)
start
in interface ContainerEventHandler
public void stop(Server server)
stop
in interface ContainerEventHandler
protected 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)
add
in interface ContainerEventHandler
public void start(Context context)
start
in interface ContainerEventHandler
public void stop(Context context)
stop
in interface ContainerEventHandler
public void remove(Context context)
remove
in interface ContainerEventHandler
protected void removeAll(Engine engine)
public void status(Engine engine)
status
in interface ContainerEventHandler
public 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 © 2017 JBoss by Red Hat. All rights reserved.