Service Activator Toolkit
Version 1.1.0 (20081206)

org.eclipse.soda.sat.core.framework.interfaces
Interface IProxyServiceHandler

All Known Implementing Classes:
ProxyServiceHandlerAdapter

public interface IProxyServiceHandler

An IProxyServiceHandler is responsible for handling call backs for a proxy service. This is a simple interface that provides API for creating the service for which the proxy exists, handling pre-invoke behavior and handling post-invoke behavior.


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)
          A hook method that is executed after the proxy has invoked the specified Method on the specified service Object.
 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.
 

Method Detail

createService

Object createService()
Create the real service Object for which a proxy was created.

Returns:
The created service Object.

postInvoke

void postInvoke(Object service,
                Method method,
                Object[] args,
                Throwable throwable,
                Object data)
A hook method that is executed after the proxy has invoked the specified Method on the specified service Object. The data parameter is particularly interesting in that it is the Object returned by the preInvoke method.

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.

preInvoke

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. 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.

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.

Service Activator Toolkit
Version 1.1.0 (20081206)