Service Activator Toolkit
Version 1.1.0 (20081206)

org.eclipse.soda.sat.core.framework
Class ProxyServiceHandlerAdapter

java.lang.Object
  extended by org.eclipse.soda.sat.core.framework.ProxyServiceHandlerAdapter
All Implemented Interfaces:
IProxyServiceHandler

public class ProxyServiceHandlerAdapter
extends Object
implements IProxyServiceHandler

ProxyServiceHandlerAdapter is a concrete no-op implementation of the IProxyServiceHandler interface. It is intended that this class be subclassed and one or two methods overridden. It is common for a subclass to only implement the createService() method, for example.


Constructor Summary
ProxyServiceHandlerAdapter()
           
 
Method Summary
 Object createService()
          Create the real service Object for which a proxy was created.
 void postInvoke(Object service, Method method, Object[] args, Throwable throwable, Object data)
          This implementation logs throwable parameter as an error if it is not null.
 Object preInvoke(Object service, Method method, Object[] args)
          A hook method that is executed before the proxy has invoked the specified Method on the specified service Object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyServiceHandlerAdapter

public ProxyServiceHandlerAdapter()
Method Detail

createService

public Object createService()
Description copied from interface: IProxyServiceHandler
Create the real service Object for which a proxy was created.

Specified by:
createService in interface IProxyServiceHandler
Returns:
The created service Object.
See Also:
IProxyServiceHandler.createService()

postInvoke

public void postInvoke(Object service,
                       Method method,
                       Object[] args,
                       Throwable throwable,
                       Object data)
This implementation logs throwable parameter as an error if it is not null.

Specified by:
postInvoke in interface IProxyServiceHandler
Parameters:
service - The service Object.
method - The Method that was invoked on the service.
args - The arguments passed to the method.
throwable - The exception thrown by the method, or null.
data - Handler specific data.
See Also:
IProxyServiceHandler.postInvoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[], java.lang.Throwable, java.lang.Object)

preInvoke

public Object preInvoke(Object service,
                        Method method,
                        Object[] args)
Description copied from interface: IProxyServiceHandler
A hook method that is executed before the proxy has invoked the specified Method on the specified service Object. The Object returned by this method is handler-specific and will be passed into the postInvoke method; for example, the current time in milliseconds could be returned as a Long, allowing the postInvoke method to calculate approximately how long the service method took to execute.

Specified by:
preInvoke in interface IProxyServiceHandler
Parameters:
service - The service Object.
method - The Method that will be invoked on the service.
args - The arguments that will be passed to the method.
Returns:
Handler specific data.
See Also:
IProxyServiceHandler.preInvoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])

Service Activator Toolkit
Version 1.1.0 (20081206)