public abstract class BasicServiceContainer extends Object implements IServiceContainer
Constructor and Description |
---|
BasicServiceContainer(IComponentIdentifier id)
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<Void> |
addService(IInternalService service,
ProvidedServiceInfo info)
Add a service to the container.
|
abstract IRequiredServiceFetcher |
createServiceFetcher(String name)
Create a service fetcher.
|
boolean |
equals(Object obj)
Test if the object eqquals another one.
|
abstract IFuture<Collection<IServiceProvider>> |
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.
|
static long |
getMethodTimeout(Class<?>[] interfaces,
Method method,
boolean remote)
Get the default timeout for a method.
|
abstract IFuture<IServiceProvider> |
getParent()
Get the parent service container.
|
IService |
getProvidedService(String name)
Get provided (declared) service.
|
IService[] |
getProvidedServices(Class<?> clazz)
Get provided (declared) service.
|
IFuture<IService> |
getRequiredService(RequiredServiceInfo info,
RequiredServiceBinding binding)
Get a required service.
|
<T> IFuture<T> |
getRequiredService(RequiredServiceInfo info,
RequiredServiceBinding binding,
boolean rebind)
Get a required service.
|
<T> IFuture<T> |
getRequiredService(String name)
Get a required service of a given name.
|
<T> IFuture<T> |
getRequiredService(String name,
boolean rebind)
Get a required service.
|
RequiredServiceInfo |
getRequiredServiceInfo(String name)
Get a required service info.
|
RequiredServiceInfo[] |
getRequiredServiceInfos()
Get the required services.
|
IIntermediateFuture<IService> |
getRequiredServices(RequiredServiceInfo info,
RequiredServiceBinding binding)
Get required services.
|
<T> IIntermediateFuture<T> |
getRequiredServices(RequiredServiceInfo info,
RequiredServiceBinding binding,
boolean rebind)
Get required services.
|
<T> IIntermediateFuture<T> |
getRequiredServices(String name)
Get a required services of a given name.
|
<T> IIntermediateFuture<T> |
getRequiredServices(String name,
boolean rebind)
Get a required services.
|
<T> IFuture<T> |
getService(Class<T> type,
IComponentIdentifier cid)
Get one service of a type from a specific component.
|
IIntermediateFuture<IService> |
getServices(ISearchManager manager,
IVisitDecider decider,
IResultSelector selector)
Get all services of a type.
|
abstract IFuture<Class<?>> |
getServiceType(IServiceIdentifier sid) |
String |
getType()
Get the type of the service provider (e.g. enclosing component type).
|
int |
hashCode()
Get the hashcode.
|
void |
removeInterceptor(IServiceInvocationInterceptor interceptor,
Object service)
Remove a service interceptor.
|
IFuture<Void> |
removeService(IServiceIdentifier sid)
Removes a service from the platform (shutdowns also the service).
|
IFuture<Void> |
serviceShutdowned(IInternalService service)
Called after a service has been shutdowned.
|
IFuture<Void> |
serviceStarted(IInternalService service)
Called after a service has been started.
|
void |
setRequiredServiceInfos(RequiredServiceInfo[] requiredservices)
Set the required services.
|
IFuture<Void> |
shutdown()
Shutdown the service.
|
IFuture<Void> |
start()
Start the service.
|
String |
toString()
Get the string representation.
|
searchService, searchService, searchServices, searchServices, searchServiceUpwards
public BasicServiceContainer(IComponentIdentifier id)
public IIntermediateFuture<IService> getServices(ISearchManager manager, IVisitDecider decider, IResultSelector selector)
getServices
in interface IServiceProvider
clazz
- The class.public abstract IFuture<IServiceProvider> getParent()
getParent
in interface IServiceProvider
public abstract IFuture<Collection<IServiceProvider>> getChildren()
getChildren
in interface IServiceProvider
public IComponentIdentifier getId()
getId
in interface IServiceProvider
public String getType()
getType
in interface IServiceProvider
public IFuture<Void> addService(IInternalService service, ProvidedServiceInfo info)
addService
in interface IServiceContainer
id
- The name.service
- The service.public IFuture<Void> removeService(IServiceIdentifier sid)
removeService
in interface IServiceContainer
id
- The name.service
- The service.public IFuture<Void> start()
start
in interface IServiceContainer
public IFuture<Void> shutdown()
shutdown
in interface IServiceContainer
public IFuture<Void> serviceStarted(IInternalService service)
public IFuture<Void> serviceShutdowned(IInternalService service)
public <T> IFuture<T> getService(Class<T> 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)
getProvidedServices
in interface IServiceContainer
clazz
- The interface.public RequiredServiceInfo[] getRequiredServiceInfos()
getRequiredServiceInfos
in interface IServiceContainer
public void setRequiredServiceInfos(RequiredServiceInfo[] requiredservices)
setRequiredServiceInfos
in interface IServiceContainer
required
- services The required services to set.public void addRequiredServiceInfos(RequiredServiceInfo[] requiredservices)
addRequiredServiceInfos
in interface IServiceContainer
prefix
- The name prefix to use.required
- services The required services to set.public RequiredServiceInfo getRequiredServiceInfo(String name)
getRequiredServiceInfo
in interface IServiceContainer
name
- The name.public IFuture<IService> getRequiredService(RequiredServiceInfo info, RequiredServiceBinding binding)
public IIntermediateFuture<IService> getRequiredServices(RequiredServiceInfo info, RequiredServiceBinding binding)
public <T> IFuture<T> getRequiredService(String name)
getRequiredService
in interface IServiceContainer
name
- The service name.public <T> IIntermediateFuture<T> getRequiredServices(String name)
getRequiredServices
in interface IServiceContainer
name
- The services name.public <T> IFuture<T> getRequiredService(String name, boolean rebind)
getRequiredService
in interface IServiceContainer
public <T> IIntermediateFuture<T> getRequiredServices(String name, boolean rebind)
getRequiredServices
in interface IServiceContainer
public <T> IFuture<T> getRequiredService(RequiredServiceInfo info, RequiredServiceBinding binding, boolean rebind)
public <T> IIntermediateFuture<T> getRequiredServices(RequiredServiceInfo info, RequiredServiceBinding binding, boolean rebind)
public abstract IRequiredServiceFetcher createServiceFetcher(String name)
public void addInterceptor(IServiceInvocationInterceptor interceptor, Object service, int pos)
addInterceptor
in interface IServiceContainer
interceptor
- The interceptor.service
- The service.pos
- The position (0=first, -1=last-1, i.e. one before method invocation).public void removeInterceptor(IServiceInvocationInterceptor interceptor, Object service)
removeInterceptor
in interface IServiceContainer
interceptor
- The interceptor.service
- The service.public IServiceInvocationInterceptor[] getInterceptors(Object service)
getInterceptors
in interface IServiceContainer
service
- The service.public abstract IFuture<Class<?>> getServiceType(IServiceIdentifier sid)
public String toString()
public int hashCode()
public boolean equals(Object obj)
Copyright © 2012. All Rights Reserved.