de.bea.domingo.service
Class NotesInvocationHandler

java.lang.Object
  extended by de.bea.domingo.service.NotesInvocationHandler
All Implemented Interfaces:
java.lang.reflect.InvocationHandler

public final class NotesInvocationHandler
extends java.lang.Object
implements java.lang.reflect.InvocationHandler

Invocation handler for all dynamic proxies of interfaces of the domingo API.

This class is responsible to separate internal objects from external proxies, where especially arguments and return values must be extracted and wrapped thru each method invocation

.

Author:
Kurt Riede

Constructor Summary
NotesInvocationHandler(java.lang.Object theObject)
          Constructor.
 
Method Summary
static java.lang.Object getNotesProxy(java.lang.Class[] theInterfaces, java.lang.Object theObject)
          Creates a Proxy for an Interface to an Object.
(package private)  java.lang.Object getObject()
          Getter method for object attribute.
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
          Processes a method invocation on a proxy instance and returns the result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotesInvocationHandler

public NotesInvocationHandler(java.lang.Object theObject)
Constructor.

Parameters:
theObject - the wrapped object
Method Detail

getObject

java.lang.Object getObject()
Getter method for object attribute.

Returns:
associated object.

invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Throwable
Processes a method invocation on a proxy instance and returns the result.

All arguments that are proxies to a NotesInvocationHandler are extracted from the proxy to the original objects. If the resulting object is a Notes object, a new proxy will be created.

Further Details from InvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]):

Specified by:
invoke in interface java.lang.reflect.InvocationHandler
Throws:
java.lang.Throwable
See Also:
InvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])

getNotesProxy

public static java.lang.Object getNotesProxy(java.lang.Class[] theInterfaces,
                                             java.lang.Object theObject)
Creates a Proxy for an Interface to an Object.

Parameters:
theInterfaces - array of interface of the proxy
theObject - th object to be wrapped
Returns:
proxy object


Domingo Java-API