public abstract class BasicServiceContainer extends Object implements IServiceContainer, IServiceProvider
| 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.
|
ServiceContainerPersistInfo |
getPersistInfo()
Get the current state for snapshot or persistence.
|
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.
|
abstract IFuture<Class<?>> |
getServiceType(IServiceIdentifier sid) |
abstract IFuture<Collection<Class<?>>> |
getServiceTypes(IServiceIdentifier sid) |
String |
getType()
Get the type of the service provider (e.g.
|
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).
|
void |
restore(ServiceContainerPersistInfo info)
Restore a container from a persited state,
|
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, getServiceRegistry, hasRequiredServicePropertyProvider, searchService, searchService, searchServices, searchServices, searchServiceUpwardsgetDeclaredServices, getService, getService, getServicespublic BasicServiceContainer(IComponentIdentifier id)
public abstract IFuture<IServiceProvider> getParent()
public abstract IFuture<Collection<IServiceProvider>> getChildren()
public IComponentIdentifier getId()
getId in interface IServiceProviderpublic String getType()
getType in interface IServiceProviderpublic IFuture<Void> addService(IInternalService service, ProvidedServiceInfo info)
addService in interface IServiceContainerservice - 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 IServiceContainerchainid - The name.service - The service.public IFuture<Void> start()
start in interface IServiceContainerpublic IFuture<Void> shutdown()
shutdown in interface IServiceContainerpublic ServiceContainerPersistInfo getPersistInfo()
getPersistInfo in interface IServiceContainerpublic void restore(ServiceContainerPersistInfo info)
restore in interface IServiceContainerpublic IFuture<Void> serviceStarted(IInternalService service)
public IFuture<Void> serviceShutdowned(IInternalService service)
public IService getProvidedService(String name)
getProvidedService in interface IServiceContainername - The service name.public Object getProvidedServiceRawImpl(Class<?> clazz)
getProvidedServiceRawImpl in interface IServiceContainerclazz - The class.public IService[] getProvidedServices(Class<?> clazz)
getProvidedServices in interface IServiceContainerclazz - The interface.public IService getProvidedService(Class<?> clazz)
getProvidedService in interface IServiceContainerclazz - The interface.public RequiredServiceInfo[] getRequiredServiceInfos()
getRequiredServiceInfos in interface IServiceContainerpublic void setRequiredServiceInfos(RequiredServiceInfo[] requiredservices)
setRequiredServiceInfos in interface IServiceContainerrequired - services The required services to set.public void addRequiredServiceInfos(RequiredServiceInfo[] requiredservices)
addRequiredServiceInfos in interface IServiceContainerprefix - The name prefix to use.required - services The required services to set.public RequiredServiceInfo getRequiredServiceInfo(String name)
getRequiredServiceInfo in interface IServiceContainername - The name.public <T> IFuture<T> getRequiredService(String name)
getRequiredService in interface IServiceContainername - The service name.public <T> ITerminableIntermediateFuture<T> getRequiredServices(String name)
getRequiredServices in interface IServiceContainername - 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 IServiceContainerpublic <T> IFuture<T> getRequiredService(String name, boolean rebind, IRemoteFilter<T> filter)
getRequiredService in interface IServiceContainerpublic <T> ITerminableIntermediateFuture<T> getRequiredServices(String name, boolean rebind)
getRequiredServices in interface IServiceContainerpublic <T> ITerminableIntermediateFuture<T> getRequiredServices(String name, boolean rebind, IRemoteFilter<T> filter)
getRequiredServices in interface IServiceContainerpublic <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 IServiceContainername - The required service name.public <T> Collection<T> getLastRequiredServices(String name)
getLastRequiredServices in interface IServiceContainername - The required services name.public abstract IRequiredServiceFetcher createServiceFetcher(String name)
public void addInterceptor(IServiceInvocationInterceptor interceptor, Object service, int pos)
addInterceptor in interface IServiceContainerinterceptor - 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 IServiceContainerinterceptor - The interceptor.service - The service.public IServiceInvocationInterceptor[] getInterceptors(Object service)
getInterceptors in interface IServiceContainerservice - The service.public void addMethodInvocationListener(IServiceIdentifier sid, MethodInfo mi, IMethodInvocationListener listener)
addMethodInvocationListener in interface IServiceContainerpublic void removeMethodInvocationListener(IServiceIdentifier sid, MethodInfo mi, IMethodInvocationListener listener)
removeMethodInvocationListener in interface IServiceContainerpublic void notifyMethodListeners(IServiceIdentifier sid, boolean start, Object proxy, Method method, Object[] args, Object callid, ServiceInvocationContext context)
notifyMethodListeners in interface IServiceContainerpublic boolean hasMethodListeners(IServiceIdentifier sid, MethodInfo mi)
hasMethodListeners in interface IServiceContainerpublic 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 © 2015. All Rights Reserved.