public class BasicServiceInvocationHandler extends Object implements InvocationHandler
Modifier and Type | Field and Description |
---|---|
static String |
PROXYTYPE_DECOUPLED
The (default) decoupled proxy type (decouples from caller thread to component thread).
|
static String |
PROXYTYPE_DIRECT
The direct proxy type (supports custom interceptors, but uses caller thread).
|
static String |
PROXYTYPE_RAW
The raw proxy type (i.e. no proxy).
|
Constructor and Description |
---|
BasicServiceInvocationHandler(IServiceIdentifier sid,
Logger logger)
Create a new invocation handler.
|
BasicServiceInvocationHandler(IService service,
Logger logger)
Create a new invocation handler.
|
BasicServiceInvocationHandler(ServiceInfo service,
Logger logger)
Create a new invocation handler.
|
Modifier and Type | Method and Description |
---|---|
void |
addFirstServiceInterceptor(IServiceInvocationInterceptor interceptor)
Add an interceptor.
|
static void |
addPojoServiceProxy(Object pojo,
IService proxy)
Add a service proxy.
|
void |
addServiceInterceptor(IServiceInvocationInterceptor interceptor)
Add an interceptor.
|
void |
addServiceInterceptor(IServiceInvocationInterceptor interceptor,
int pos)
Add an interceptor.
|
static IInternalService |
createDelegationProvidedServiceProxy(IExternalAccess ea,
IComponentAdapter adapter,
IServiceIdentifier sid,
RequiredServiceInfo info,
RequiredServiceBinding binding,
ClassLoader classloader,
IThreadPoolService tp)
Static method for creating a delegation service proxy for
provided service that is not offered by the component itself.
|
static IInternalService |
createProvidedServiceProxy(IInternalAccess ia,
IComponentAdapter adapter,
Object service,
String name,
Class type,
String proxytype,
IServiceInvocationInterceptor[] ics,
boolean copy,
boolean realtime,
IResourceIdentifier rid,
IThreadPoolService tp)
Static method for creating a standard service proxy for a provided service.
|
static IService |
createRequiredServiceProxy(IInternalAccess ia,
IExternalAccess ea,
IComponentAdapter adapter,
IService service,
IRequiredServiceFetcher fetcher,
RequiredServiceInfo info,
RequiredServiceBinding binding,
IThreadPoolService tp)
Static method for creating a standard service proxy for a required service.
|
boolean |
equals(Object obj)
Test if two objects are equal.
|
Object |
getDomainService()
Get the domain service.
|
IServiceInvocationInterceptor[] |
getInterceptors()
Get interceptors.
|
static IService |
getPojoServiceProxy(Object pojo)
Get the proxy of a pojo service.
|
Object |
getService()
Get the service.
|
IServiceIdentifier |
getServiceIdentifier()
Get the sid.
|
int |
hashCode()
Return the hash code.
|
Object |
invoke(Object proxy,
Method method,
Object[] args)
A proxy method has been invoked.
|
static void |
removePojoServiceProxy(IServiceIdentifier sid)
Remove a pojo - proxy pair.
|
void |
removeServiceInterceptor(IServiceInvocationInterceptor interceptor)
Remove an interceptor.
|
String |
toString()
Get a string representation.
|
public static final String PROXYTYPE_RAW
public static final String PROXYTYPE_DIRECT
public static final String PROXYTYPE_DECOUPLED
public BasicServiceInvocationHandler(IServiceIdentifier sid, Logger logger)
public BasicServiceInvocationHandler(IService service, Logger logger)
public BasicServiceInvocationHandler(ServiceInfo service, Logger logger)
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
invoke
in interface InvocationHandler
Throwable
public IServiceIdentifier getServiceIdentifier()
public Object getService()
public Object getDomainService()
public void addFirstServiceInterceptor(IServiceInvocationInterceptor interceptor)
public void addServiceInterceptor(IServiceInvocationInterceptor interceptor, int pos)
public void addServiceInterceptor(IServiceInvocationInterceptor interceptor)
public void removeServiceInterceptor(IServiceInvocationInterceptor interceptor)
public IServiceInvocationInterceptor[] getInterceptors()
public boolean equals(Object obj)
public static IInternalService createProvidedServiceProxy(IInternalAccess ia, IComponentAdapter adapter, Object service, String name, Class type, String proxytype, IServiceInvocationInterceptor[] ics, boolean copy, boolean realtime, IResourceIdentifier rid, IThreadPoolService tp)
public static IInternalService createDelegationProvidedServiceProxy(IExternalAccess ea, IComponentAdapter adapter, IServiceIdentifier sid, RequiredServiceInfo info, RequiredServiceBinding binding, ClassLoader classloader, IThreadPoolService tp)
public static IService createRequiredServiceProxy(IInternalAccess ia, IExternalAccess ea, IComponentAdapter adapter, IService service, IRequiredServiceFetcher fetcher, RequiredServiceInfo info, RequiredServiceBinding binding, IThreadPoolService tp)
public static void addPojoServiceProxy(Object pojo, IService proxy)
pojo
- The pojo.proxy
- The proxy.public static void removePojoServiceProxy(IServiceIdentifier sid)
sid
- The service identifier.Copyright © 2012. All Rights Reserved.