This content has been marked as final. Show 3 replies
hi, I have configured invocation service to start automatically as below, however, it did not work. And I need to code in application to get the service by CacheFactory.getService("MyInvocationService") to start it... why this is so? thanks.
the autostart property provides information to the DefaultCacheServer.startServices() method and to methods it calls. That method will start the service if it is marked to be autostarted. The DefaultCacheServer class (the standalone cache server node script starts this application) is the only class which out-of-the-box calls that method (or possibly there are a few other ones like MBeanConnector).
But if you use your own main class then it is not automatically called, it is your responsibility to call that method (or DefaultCacheServer.start()) if you want the services to autostart. Read the javadoc of the DefaultCacheServer class for more info on methods in that class and variations between them (e.g. monitoring thread, which configurable cache factory is used, etc).
922963 wrote:Hi Henry,
thanks. Yes, I have my own Main class. In order to leverage the start and monitor etc already provided by DefaultCacheServer, should my Main class extend DefaultCacheServer? or any better way to do this?
just call DefaultCacheServer.start() which will start the services (but won't start the monitoring thread which restarts the Coherence services if the node was kicked out of the cluster, automatically).
If you want the monitoring thread, too, then, I believe, you can call DefaultCacheServer.startDaemon().
Stopping the services and the monitoring thread is with DefaultCacheServer.shutdown().