|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.2) E26043-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.util.Base
com.tangosol.net.DefaultCacheServer
public class DefaultCacheServer
DefaultCacheServer is a simple command line facility and convenience API that starts all services that are declared as requiring an "autostart" in the configurable factory XML descriptor.
DefaultCacheServer can also monitor services it started to ensure they exist. Monitoring services is enabled by default.
Nested Class Summary | |
---|---|
static class |
DefaultCacheServer.GarServer GarServer provides the functionality of DefaultCacheServer under the context of a GAR file. |
protected class |
DefaultCacheServer.ShutdownProcess ShutdownHook implementation. |
Field Summary | |
---|---|
static long |
DEFAULT_WAIT_MILLIS The default number of milliseconds between checks for service restart. |
protected boolean |
m_fShutdown Flag that indicates whether of not the shutdown was initiated. |
protected ServiceMonitor |
m_serviceMon The ServiceMonitor used to monitor services. |
protected java.lang.Thread |
m_threadShutdown Shutdown hook thread. |
Constructor Summary | |
---|---|
DefaultCacheServer(ConfigurableCacheFactory factory) Construct a DefaultCacheServer using the provided factory. |
Method Summary | |
---|---|
protected java.lang.String |
getServiceBanner(Cluster cluster) Create a list of running services in the given Cluster. |
protected java.lang.String |
getServiceName(XmlElement xmlScheme) Based on the provided XmlElement, which represents the caching scheme, determine the service name that will be used for the service. |
protected void |
handleEnsureServiceException(java.lang.RuntimeException e) Invoked if starting a service raises an exception. |
protected void |
initialStartServices(boolean fMonitor) Start the services. |
static void |
main(java.lang.String[] asArg) Entry point: start the cache server under two possible contexts: With a "coherence-cache-config.xsd" compliant configuration file. |
protected void |
monitorServices(long cWaitMillis) Check the ServiceMonitor status ensuring it is monitoring services and DefaultCacheServer has not been shutdown. |
protected void |
setUp(long cWaitMillis) Setup any necessary resources. |
static void |
shutdown() Shutdown the cache server. |
void |
shutdownServer() Shutdown the DefaultCacheServer. |
static java.util.List |
start() Start all services that are declared as requiring an "autostart" in the default configurable factory XML descriptor. |
static java.util.List |
start(ConfigurableCacheFactory factory) Start all services that are declared as requiring an "autostart" in the configurable factory XML descriptor. |
void |
startAndMonitor(long cWaitMillis) Start the cache server and check the service status periodically, restarting any stopped services. |
static void |
startDaemon() Start the cache server on a dedicated daemon thread. |
static void |
startDaemon(java.io.File fileGar) Start the cache server on a dedicated daemon thread using the given File reference to a GAR. |
static void |
startDaemon(java.io.File fileGar, java.lang.String sAppName) Start the cache server on a dedicated daemon thread using the given File reference to a GAR. |
void |
startDaemon(long cWaitMillis) Start the cache server and asynchronously check the service status periodically, restarting any services that have stopped. |
java.util.List |
startServices() Start all services that are declared as requiring an "autostart" in the configurable factory XML descriptor. |
protected java.util.Map |
startServicesInternal() Starts the services marked with autostart returning a map of service name to the created service. |
protected java.util.Map |
startServicesInternal(boolean fMonitor) Starts the services marked with autostart returning a map of service name to the created service. |
protected void |
stopMonitoring() Ensures the DCS instance has shutdown and the associated ServiceMonitor is no longer monitoring services. |
Field Detail |
---|
public static final long DEFAULT_WAIT_MILLIS
protected ServiceMonitor m_serviceMon
protected volatile boolean m_fShutdown
protected java.lang.Thread m_threadShutdown
Constructor Detail |
---|
public DefaultCacheServer(ConfigurableCacheFactory factory)
factory
- the ConfigurableCacheFactoryMethod Detail |
---|
public void startAndMonitor(long cWaitMillis)
This method will block the calling thread.
cWaitMillis
- the number of milliseconds between checkspublic void startDaemon(long cWaitMillis)
cWaitMillis
- the number of milliseconds between checkspublic java.util.List startServices()
public void shutdownServer()
public static void shutdown()
public static void startDaemon()
public static void startDaemon(java.io.File fileGar)
fileGar
- file reference to either a GAR file or a directory containing the contents of the GARpublic static void startDaemon(java.io.File fileGar, java.lang.String sAppName)
fileGar
- file reference to either a GAR file or a directory containing the contents of the GARsAppName
- name to be used for the applicationpublic static void main(java.lang.String[] asArg)
Default configuration file is "coherence-cache-config.xml"; default keep alive interval is 5 sec.
Example: java -server -Xms512m -Xmx512m com.tangosol.net.DefaultCacheServer coherence-cache-config.xml 5 GAR Example: java -server -Xms512m -Xmx512m com.tangosol.net.DefaupltCacheServer my-application.gar MyGarApp 5
asArg
- the command line argumentspublic static java.util.List start()
public static java.util.List start(ConfigurableCacheFactory factory)
factory
- ConfigurableCacheFactory to useprotected void stopMonitoring()
protected java.util.Map startServicesInternal()
protected java.util.Map startServicesInternal(boolean fMonitor)
fMonitor
- whether to monitor the started services to ensure their existenceprotected java.lang.String getServiceName(XmlElement xmlScheme)
xmlScheme
- the caching scheme to derive a service name fromprotected void setUp(long cWaitMillis)
cWaitMillis
- the interval, in milliseconds, to monitor servicesprotected void initialStartServices(boolean fMonitor)
fMonitor
- whether the started services should be monitoredprotected void monitorServices(long cWaitMillis)
cWaitMillis
- the number of milliseconds between checksprotected void handleEnsureServiceException(java.lang.RuntimeException e)
e
- the RuntimeExceptionstartServices()
protected java.lang.String getServiceBanner(Cluster cluster)
cluster
- Cluster for which to create a list of running services
|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.2) E26043-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |