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 |
addMethodInvocationListener(IServiceIdentifier sid,
MethodInfo mi,
IMethodInvocationListener listener)
Add a method invocation handler.
|
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.
|
abstract IInternalAccess |
getComponent() |
IComponentIdentifier |
getId()
Get the globally unique id of the provider.
|
IServiceInvocationInterceptor[] |
getInterceptors(Object service)
Get the interceptors of a service.
|
<T> T |
getLastRequiredService(String name)
Get the result of the last search.
|
<T> Collection<T> |
getLastRequiredServices(String name)
Get the result of the last search.
|
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(Class<?> clazz)
Get provided (declared) service.
|
IService |
getProvidedService(String name)
Get provided (declared) service.
|
Object |
getProvidedServiceRawImpl(Class<?> clazz)
Get the raw implementation of the provided service.
|
IService[] |
getProvidedServices(Class<?> clazz)
Get provided (declared) service.
|
<T> IFuture<T> |
getRequiredService(RequiredServiceInfo info,
RequiredServiceBinding binding)
Get a required service.
|
<T> IFuture<T> |
getRequiredService(RequiredServiceInfo info,
RequiredServiceBinding binding,
boolean rebind,
IRemoteFilter<T> filter)
Get a required service.
|
<T> IFuture<T> |
getRequiredService(RequiredServiceInfo info,
RequiredServiceBinding binding,
IRemoteFilter<T> filter)
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.
|
<T> IFuture<T> |
getRequiredService(String name,
boolean rebind,
IRemoteFilter<T> filter)
Get a required service.
|
RequiredServiceInfo |
getRequiredServiceInfo(String name)
Get a required service info.
|
RequiredServiceInfo[] |
getRequiredServiceInfos()
Get the required services.
|
<T> IIntermediateFuture<T> |
getRequiredServices(RequiredServiceInfo info,
RequiredServiceBinding binding)
Get required services.
|
<T> ITerminableIntermediateFuture<T> |
getRequiredServices(RequiredServiceInfo info,
RequiredServiceBinding binding,
boolean rebind,
IRemoteFilter<T> filter)
Get required services.
|
<T> IIntermediateFuture<T> |
getRequiredServices(RequiredServiceInfo info,
RequiredServiceBinding binding,
IRemoteFilter<T> filter)
Get required services.
|
<T> ITerminableIntermediateFuture<T> |
getRequiredServices(String name)
Get a required services of a given name.
|
<T> ITerminableIntermediateFuture<T> |
getRequiredServices(String name,
boolean rebind)
Get a required services.
|
<T> ITerminableIntermediateFuture<T> |
getRequiredServices(String name,
boolean rebind,
IRemoteFilter<T> filter)
Get a required services.
|
ITerminableIntermediateFuture<IService> |
getServices(ISearchManager manager,
IVisitDecider decider,
IResultSelector selector)
Get all services of a type.
|
abstract IFuture<Class<?>> |
getServiceType(IServiceIdentifier sid) |
abstract IFuture<Collection<Class<?>>> |
getServiceTypes(IServiceIdentifier sid) |
String |
getType()
Get the type of the service provider (e.g. enclosing component type).
|
int |
hashCode()
Get the hashcode.
|
boolean |
hasMethodListeners(IServiceIdentifier sid,
MethodInfo mi)
Test if service and method has listeners.
|
void |
notifyMethodListeners(IServiceIdentifier sid,
boolean start,
Object proxy,
Method method,
Object[] args,
Object callid,
ServiceInvocationContext context)
Notify listeners that a service method has been called.
|
void |
removeInterceptor(IServiceInvocationInterceptor interceptor,
Object service)
Remove a service interceptor.
|
void |
removeMethodInvocationListener(IServiceIdentifier sid,
MethodInfo mi,
IMethodInvocationListener listener)
Remove a method invocation handler.
|
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.
|
getRequiredServicePropertyProvider, getService, hasRequiredServicePropertyProvider, searchService, searchService, searchServices, searchServices, searchServiceUpwards
public BasicServiceContainer(IComponentIdentifier id)
public ITerminableIntermediateFuture<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
service
- The service.info
- The provided service info.componentfetcher
- Helper to fetch corrent object for component injection based on field type.public IFuture<Void> removeService(IServiceIdentifier sid)
removeService
in interface IServiceContainer
chainid
- 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 IService getProvidedService(String name)
getProvidedService
in interface IServiceContainer
name
- The service name.public Object getProvidedServiceRawImpl(Class<?> clazz)
getProvidedServiceRawImpl
in interface IServiceContainer
clazz
- The class.public IService[] getProvidedServices(Class<?> clazz)
getProvidedServices
in interface IServiceContainer
clazz
- The interface.public IService getProvidedService(Class<?> clazz)
getProvidedService
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 <T> IFuture<T> getRequiredService(String name)
getRequiredService
in interface IServiceContainer
name
- The service name.public <T> ITerminableIntermediateFuture<T> getRequiredServices(String name)
getRequiredServices
in interface IServiceContainer
name
- The services name.public <T> IFuture<T> getRequiredService(RequiredServiceInfo info, RequiredServiceBinding binding)
public <T> IIntermediateFuture<T> getRequiredServices(RequiredServiceInfo info, RequiredServiceBinding binding)
public <T> IFuture<T> getRequiredService(RequiredServiceInfo info, RequiredServiceBinding binding, IRemoteFilter<T> filter)
public <T> IIntermediateFuture<T> getRequiredServices(RequiredServiceInfo info, RequiredServiceBinding binding, IRemoteFilter<T> filter)
public <T> IFuture<T> getRequiredService(String name, boolean rebind)
getRequiredService
in interface IServiceContainer
public <T> IFuture<T> getRequiredService(String name, boolean rebind, IRemoteFilter<T> filter)
getRequiredService
in interface IServiceContainer
public <T> ITerminableIntermediateFuture<T> getRequiredServices(String name, boolean rebind)
getRequiredServices
in interface IServiceContainer
public <T> ITerminableIntermediateFuture<T> getRequiredServices(String name, boolean rebind, IRemoteFilter<T> filter)
getRequiredServices
in interface IServiceContainer
public <T> IFuture<T> getRequiredService(RequiredServiceInfo info, RequiredServiceBinding binding, boolean rebind, IRemoteFilter<T> filter)
public <T> ITerminableIntermediateFuture<T> getRequiredServices(RequiredServiceInfo info, RequiredServiceBinding binding, boolean rebind, IRemoteFilter<T> filter)
public <T> T getLastRequiredService(String name)
getLastRequiredService
in interface IServiceContainer
name
- The required service name.public <T> Collection<T> getLastRequiredServices(String name)
getLastRequiredServices
in interface IServiceContainer
name
- The required services name.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 void addMethodInvocationListener(IServiceIdentifier sid, MethodInfo mi, IMethodInvocationListener listener)
addMethodInvocationListener
in interface IServiceContainer
public void removeMethodInvocationListener(IServiceIdentifier sid, MethodInfo mi, IMethodInvocationListener listener)
removeMethodInvocationListener
in interface IServiceContainer
public void notifyMethodListeners(IServiceIdentifier sid, boolean start, Object proxy, Method method, Object[] args, Object callid, ServiceInvocationContext context)
notifyMethodListeners
in interface IServiceContainer
public boolean hasMethodListeners(IServiceIdentifier sid, MethodInfo mi)
hasMethodListeners
in interface IServiceContainer
public abstract IInternalAccess getComponent()
public abstract IFuture<Class<?>> getServiceType(IServiceIdentifier sid)
public abstract IFuture<Collection<Class<?>>> getServiceTypes(IServiceIdentifier sid)
public String toString()
public int hashCode()
public boolean equals(Object obj)
Copyright © 2013. All Rights Reserved.