public class CacheServiceContainer extends Object implements IServiceContainer
Constructor and Description |
---|
CacheServiceContainer(IServiceContainer container)
Create a new service container.
|
CacheServiceContainer(IServiceContainer container,
int max,
long ttl)
Create a new service container.
|
Modifier and Type | Method and Description |
---|---|
void |
addInterceptor(IServiceInvocationInterceptor interceptor,
Object service,
int pos)
Add a service interceptor.
|
void |
addRequiredServiceInfos(RequiredServiceInfo[] requiredservices)
Add required services for a given prefix.
|
IFuture |
addService(IInternalService service,
ProvidedServiceInfo info)
Add a service to the platform.
|
IFuture |
getChildren()
Get the children container.
|
IComponentIdentifier |
getId()
Get the globally unique id of the provider.
|
IServiceInvocationInterceptor[] |
getInterceptors(Object service)
Get the interceptors of a service.
|
IFuture |
getParent()
Get the parent service container.
|
IService |
getProvidedService(String name)
Get provided (declared) service.
|
IService[] |
getProvidedServices(Class clazz)
Get provided (declared) service.
|
IFuture |
getRequiredService(String name)
Get a required service of a given name.
|
IFuture |
getRequiredService(String name,
boolean rebind)
Get a required service.
|
RequiredServiceInfo |
getRequiredServiceInfo(String name)
Get the required service info.
|
RequiredServiceInfo[] |
getRequiredServiceInfos()
Get the required service infos.
|
IIntermediateFuture |
getRequiredServices(String name)
Get a required services of a given name.
|
IIntermediateFuture |
getRequiredServices(String name,
boolean rebind)
Get a required services.
|
IFuture |
getService(Class type,
IComponentIdentifier cid)
Get one service of a type from a specific component.
|
IIntermediateFuture |
getServices(ISearchManager manager,
IVisitDecider decider,
IResultSelector selector)
Get all services of a type.
|
String |
getType()
Get the type of the service provider (e.g. enclosing component type).
|
void |
removeInterceptor(IServiceInvocationInterceptor interceptor,
Object service)
Remove a service interceptor.
|
IFuture |
removeService(IServiceIdentifier sid)
Removes a service from the platform (shutdowns also the service).
|
IFuture |
searchService(Class type)
Get one service of a type.
|
IFuture |
searchService(Class type,
String scope)
Get one service of a type.
|
IIntermediateFuture |
searchServices(Class type)
Get all services of a type.
|
IIntermediateFuture |
searchServices(Class type,
String scope)
Get all services of a type.
|
IFuture |
searchServiceUpwards(Class type)
Get one service of a type and only search upwards (parents).
|
void |
setRequiredServiceInfos(RequiredServiceInfo[] requiredservices)
Set the required services.
|
IFuture |
shutdown()
Shutdown the service.
|
IFuture |
start()
Start the service.
|
String |
toString()
Get the string representation.
|
public CacheServiceContainer(IServiceContainer container)
public CacheServiceContainer(IServiceContainer container, int max, long ttl)
public IIntermediateFuture getServices(ISearchManager manager, IVisitDecider decider, IResultSelector selector)
getServices
in interface IServiceProvider
type
- The class.public IFuture getParent()
getParent
in interface IServiceProvider
public IFuture getChildren()
getChildren
in interface IServiceProvider
public IComponentIdentifier getId()
getId
in interface IServiceProvider
public String getType()
getType
in interface IServiceProvider
public IFuture start()
start
in interface IServiceContainer
public IFuture shutdown()
shutdown
in interface IServiceContainer
public IFuture addService(IInternalService service, ProvidedServiceInfo info)
addService
in interface IServiceContainer
name
- The name.service
- The service.public IFuture removeService(IServiceIdentifier sid)
removeService
in interface IServiceContainer
name
- The name.service
- The service.public String toString()
public IFuture getService(Class type, IComponentIdentifier cid)
getService
in interface IServiceContainer
type
- The class.cid
- The component identifier of the target component.public IService getProvidedService(String name)
getProvidedService
in interface IServiceContainer
name
- The service name.public IService[] getProvidedServices(Class clazz)
IServiceContainer
getProvidedServices
in interface IServiceContainer
clazz
- The interface.public RequiredServiceInfo[] getRequiredServiceInfos()
IServiceContainer
getRequiredServiceInfos
in interface IServiceContainer
public RequiredServiceInfo getRequiredServiceInfo(String name)
IServiceContainer
getRequiredServiceInfo
in interface IServiceContainer
name
- The name.public void setRequiredServiceInfos(RequiredServiceInfo[] requiredservices)
IServiceContainer
setRequiredServiceInfos
in interface IServiceContainer
public void addRequiredServiceInfos(RequiredServiceInfo[] requiredservices)
IServiceContainer
addRequiredServiceInfos
in interface IServiceContainer
public IFuture getRequiredService(String name)
IServiceContainer
getRequiredService
in interface IServiceContainer
name
- The service name.public IIntermediateFuture getRequiredServices(String name)
IServiceContainer
getRequiredServices
in interface IServiceContainer
name
- The services name.public IFuture getRequiredService(String name, boolean rebind)
IServiceContainer
getRequiredService
in interface IServiceContainer
public IIntermediateFuture getRequiredServices(String name, boolean rebind)
IServiceContainer
getRequiredServices
in interface IServiceContainer
public void addInterceptor(IServiceInvocationInterceptor interceptor, Object service, int pos)
IServiceContainer
addInterceptor
in interface IServiceContainer
interceptor
- The interceptor.service
- The service.pos
- The position (0=first).public void removeInterceptor(IServiceInvocationInterceptor interceptor, Object service)
IServiceContainer
removeInterceptor
in interface IServiceContainer
interceptor
- The interceptor.service
- The service.public IServiceInvocationInterceptor[] getInterceptors(Object service)
IServiceContainer
getInterceptors
in interface IServiceContainer
service
- The service.public IFuture searchService(Class type)
searchService
in interface IServiceContainer
type
- The class.public IFuture searchService(Class type, String scope)
searchService
in interface IServiceContainer
type
- The class.public IFuture searchServiceUpwards(Class type)
searchServiceUpwards
in interface IServiceContainer
type
- The class.public IIntermediateFuture searchServices(Class type)
searchServices
in interface IServiceContainer
type
- The class.public IIntermediateFuture searchServices(Class type, String scope)
searchServices
in interface IServiceContainer
type
- The class.Copyright © 2012. All Rights Reserved.