This class uses the ServiceManager's methods to start all of its services, to respond to service failure and to ensure that when the JVM is shutting down all the services are stopped. @author Luke Sandberg @since 14.0
A service is defined with a minimum set of properties:
jmq.service..type = jmq.service.serviceclass. .class = jmq.service.serviceclass. .props = < , seperated list of properties to watch>
A service called "broker" properties might look like:
# list of known services jmq.service.list = broker,admin,ssl,http,httpadmin # list of active services jmq.service.activelist = broker,admin # definitions for the standard service jmq.service.broker.type=dedicated jmq.service.serviceclass.standard.class= com.sun.messaging.jmq.jmsserver.service.imq.IMQService
ServiceManager
class is an implmentation of the ServiceManager
the central class needed for implementing or using UNO components in Java. The Methods queryInterface
and isSame
delegate calls to the implementing objects and are used instead of casts and identity comparisons.
@version $Revision: 1.10 $ $ $Date: 2008/04/11 11:11:46 $ @author Markus Herzog @see com.sun.star.lang.XMultiServiceFactory @see com.sun.star.container.XSet @see com.sun.star.container.XContentEnumerationAccess @see com.sun.star.lang.XComponent @see com.sun.star.lang.XServiceInfo @see com.sun.star.lang.XInitialization @since UDK1.0
ServiceManager
selects Object
s based on a role. The contract is that all the Object
s implement the differing roles and there is one Object
per role. If you need to select on of many Object
s that implement the same role, then you need to use a ServiceSelector
. Roles are usually the full interface name. A role is better understood by the analogy of a play. There are many different roles in a script. Any actor or actress can play any given part and you get the same results (phrases said, movements made, etc.). The exact nuances of the performance is different. Below is a list of things that might be considered the different roles: ServiceManager
does not specify the methodology of getting the Object
, merely the interface used to get it. Therefore the ServiceManager
can be implemented with a factory pattern, an object pool, or a simple Hashtable.
@author Avalon Development Team
@version CVS $Revision: 1.17 $ $Date: 2004/02/11 14:34:25 $
@see org.apache.avalon.framework.service.Serviceable
@see org.apache.avalon.framework.service.ServiceSelector
Service
classes. Functionality that ServiceManager
provides in addition to ServiceBroker
functionality includes configuration of the manager.
@author Ilkka Priha
@author Martin Poeschl
@author Henning P. Schmiedehausen
@version $Id: ServiceManager.java 264148 2005-08-29 14:21:04Z henning $
Services are divided into discovered services (via {@link java.util.ServiceLoader} and provided services. The latter occursvia {@link org.hibernate.search.cfg.spi.SearchConfiguration#getProvidedServices()} and{@link org.hibernate.search.cfg.spi.SearchConfiguration#getClassLoaderService()}. Provided services are also treated special in the sense that they are not allowed to implemented {@link org.hibernate.search.engine.service.spi.Startable} or{@link org.hibernate.search.engine.service.spi.Stoppable} (an exception is thrown if they do so).It is the responsibility of the provider of these services to manage their life cycle. This also prevents circular dependencies where a service where a service during bootstrapping could request other (uninitialized) services via the {@link org.hibernate.search.engine.service.spi.Startable#start(java.util.Properties,org.hibernate.search.spi.BuildContext)}callback.
Any service requested should be released using {@link #releaseService(Class)} when it's not needed anymore.
@author Hardy Ferentschik
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|