Class ServiceRegistryImpl
- java.lang.Object
-
- com.anaptecs.jeaf.core.servicechannel.base.ServiceRegistryImpl
-
- All Implemented Interfaces:
com.anaptecs.jeaf.core.servicechannel.api.ServiceRegistry
public final class ServiceRegistryImpl extends java.lang.Object implements com.anaptecs.jeaf.core.servicechannel.api.ServiceRegistry
Service registry contains all service implementations and the corresponding proxy objects.- Version:
- 1.0
- Author:
- JEAF Development Team
-
-
Constructor Summary
Constructors Constructor Description ServiceRegistryImpl()
Initialize object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<com.anaptecs.jeaf.core.spi.ServiceImplementation>
getAllServiceInstances()
Method returns all available service instances.java.util.Collection<com.anaptecs.jeaf.core.servicechannel.api.ServiceProxy>
getAllServiceProxies()
Method returns all service proxies that are stored in this service registry.java.util.Collection<java.lang.Class<? extends com.anaptecs.jeaf.core.api.Service>>
getAvailableServiceClasses()
Method returns the class objects of all services that are available through this service registry.com.anaptecs.jeaf.core.spi.ServiceImplementation
getServiceInstance(java.lang.Class<? extends com.anaptecs.jeaf.core.api.Service> pServiceType)
Method return a service instance that implements the passed service interface.com.anaptecs.jeaf.core.servicechannel.api.ServiceProxy
getServiceProxy(java.lang.Class<? extends com.anaptecs.jeaf.core.api.Service> pServiceType)
Method returns a proxy object for the service that implements the passed service interface.boolean
isServiceAvailable(java.lang.Class<? extends com.anaptecs.jeaf.core.api.Service> pServiceClass)
Method checks if the service registry contains of service of the passed class.void
registerService(com.anaptecs.jeaf.core.spi.ServiceImplementation pServiceInstance, com.anaptecs.jeaf.core.servicechannel.api.ServiceProxy pServiceProxy)
Method registers the service that is provided via the passed service factory.
-
-
-
Method Detail
-
registerService
public void registerService(com.anaptecs.jeaf.core.spi.ServiceImplementation pServiceInstance, com.anaptecs.jeaf.core.servicechannel.api.ServiceProxy pServiceProxy)
Method registers the service that is provided via the passed service factory.- Specified by:
registerService
in interfacecom.anaptecs.jeaf.core.servicechannel.api.ServiceRegistry
- Parameters:
pServiceInstance
- Service instance that should be registered. The parameter must not be null.pServiceProxy
- Service proxy that belongs to the service implementation. The parameter must not be null.
-
getServiceInstance
public com.anaptecs.jeaf.core.spi.ServiceImplementation getServiceInstance(java.lang.Class<? extends com.anaptecs.jeaf.core.api.Service> pServiceType)
Method return a service instance that implements the passed service interface.- Specified by:
getServiceInstance
in interfacecom.anaptecs.jeaf.core.servicechannel.api.ServiceRegistry
- Parameters:
pServiceType
- Type of service whose implementation object should be returned. The parameter must not be null.- Returns:
- Service Service implementation of the passed type. The method never returns null.
-
getAllServiceInstances
public java.util.Collection<com.anaptecs.jeaf.core.spi.ServiceImplementation> getAllServiceInstances()
Method returns all available service instances.- Specified by:
getAllServiceInstances
in interfacecom.anaptecs.jeaf.core.servicechannel.api.ServiceRegistry
- Returns:
- Collection All available service instances. The method never returns null and all objects within the collection are INSTANCE of class com.anaptecs.jeaf.fwk.core.ServiceImplementation. The collection is immutable.
-
getServiceProxy
public com.anaptecs.jeaf.core.servicechannel.api.ServiceProxy getServiceProxy(java.lang.Class<? extends com.anaptecs.jeaf.core.api.Service> pServiceType)
Method returns a proxy object for the service that implements the passed service interface.- Specified by:
getServiceProxy
in interfacecom.anaptecs.jeaf.core.servicechannel.api.ServiceRegistry
- Parameters:
pServiceType
- Type of service whose proxy object should be returned. The parameter must not be null.- Returns:
- Service Service implementation of the passed type. The method never returns null.
-
getAllServiceProxies
public java.util.Collection<com.anaptecs.jeaf.core.servicechannel.api.ServiceProxy> getAllServiceProxies()
Method returns all service proxies that are stored in this service registry.- Specified by:
getAllServiceProxies
in interfacecom.anaptecs.jeaf.core.servicechannel.api.ServiceRegistry
- Returns:
Collection
Collection with all service proxies of this service registry. The method never returns null.
-
getAvailableServiceClasses
public java.util.Collection<java.lang.Class<? extends com.anaptecs.jeaf.core.api.Service>> getAvailableServiceClasses()
Method returns the class objects of all services that are available through this service registry.- Specified by:
getAvailableServiceClasses
in interfacecom.anaptecs.jeaf.core.servicechannel.api.ServiceRegistry
- Returns:
- Collection Class objects of all service interfaces that are available this service registry. The method never returns null and all objects within the collection are instances of java.lang.Class.
-
isServiceAvailable
public boolean isServiceAvailable(java.lang.Class<? extends com.anaptecs.jeaf.core.api.Service> pServiceClass)
Method checks if the service registry contains of service of the passed class.- Specified by:
isServiceAvailable
in interfacecom.anaptecs.jeaf.core.servicechannel.api.ServiceRegistry
- Parameters:
pServiceClass
- Class of service that should be checked. The parameter must not be null- Returns:
- boolean Method returns true if the service registry contains the passed service and false in all other cases.
-
-