com.ibm.di.api.remote.impl
Class RemoteListenerAdapter

java.lang.Object
  extended by com.ibm.di.api.remote.impl.RemoteListenerAdapter
All Implemented Interfaces:
InvocationHandler

public class RemoteListenerAdapter
extends Object
implements InvocationHandler

This class is used to adapt from Remote to Local listener interfaces. This adapter expects that the methods don't receive Remote references but only serializable objects. Each method is a callback method that is not expected to return a value.


Note: This class is for internal usage only. Any dependency from the end-user will not be supported. Changes to this class will happen without a warning.

Since:
7.1

Method Summary
static
<L extends RemoteListener>
EventListener
create(L fromRemoteListener)
          Creates a new adapter instance for a RemoteListener.
static
<L extends RemoteListener,T extends EventListener>
T
create(L fromRemoteListener, Class<T> toClass)
          Creates a new adapter instance for a RemoteListener
 Object invoke(Object proxy, Method method, Object[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

invoke

public Object invoke(Object proxy,
                     Method method,
                     Object[] args)
              throws Throwable
Specified by:
invoke in interface InvocationHandler
Throws:
Throwable

create

public static final <L extends RemoteListener,T extends EventListener> T create(L fromRemoteListener,
                                                                                Class<T> toClass)
Creates a new adapter instance for a RemoteListener

Type Parameters:
L - The type of the remote lister
T - the type of the local listener to adapt
Parameters:
fromRemoteListener - the remote listener instance to adapt
toClass - the local listener class
Returns:
a proxy instance that implements the specified local listener class and delegates each method invocation to the specified remote listener instance

create

public static final <L extends RemoteListener> EventListener create(L fromRemoteListener)
                                  throws ClassNotFoundException
Creates a new adapter instance for a RemoteListener. Unlike the create(RemoteListener, Class) method this one tries to automatically find the corresponding local listener for which an adapter will be created.

Type Parameters:
L - The type of the remote lister
Parameters:
fromRemoteListener - the remote listener instance to adapt
Returns:
a proxy instance that implements the resolved local listener class and delegates each method invocation to the specified remote listener instance
Throws:
ClassNotFoundException