org.obligate.annotations.contract.proxy
Class IndirectContractProxy

java.lang.Object
  extended by org.obligate.annotations.contract.proxy.ContractProxy
      extended by org.obligate.annotations.contract.proxy.IndirectContractProxy
All Implemented Interfaces:
java.lang.reflect.InvocationHandler, ContractVariables

public class IndirectContractProxy
extends ContractProxy

This class acts as a proxy for EJB calls, this has to do indirection between the external interface and the EJB interface, the reason for this is due to the issue of the slightly odd way that EJB separates the implementation from the generated interfaces. There are several different approaches that are possible including the dynamic generation of the runtime class that performs the indirection. One challenge on Remote EJBs is the addition of RemoteExceptions which must be bundled up and not passed on as such but wrapped in an unchecked exception.

Since:
23-Jan-2006
Author:
Steve Jones

Field Summary
 
Fields inherited from interface org.obligate.annotations.contract.proxy.ContractVariables
POSTCONDITION_ID, PRECONDITION_ID
 
Constructor Summary
IndirectContractProxy(java.lang.Object ejbProxy, java.lang.Class serviceInterface)
          Create the proxy from the reference to the (either) EJB Remote or EJB Local interface and the external interface being promoted.
 
Method Summary
protected  java.lang.Object internalInvocation(java.lang.reflect.Method method, java.lang.Object[] arguments)
          The abstract method that needs to be implemented to perform the actual call
 
Methods inherited from class org.obligate.annotations.contract.proxy.ContractProxy
doValidation, invoke, toMethodCallString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndirectContractProxy

public IndirectContractProxy(java.lang.Object ejbProxy,
                             java.lang.Class serviceInterface)
Create the proxy from the reference to the (either) EJB Remote or EJB Local interface and the external interface being promoted.

Parameters:
ejbProxy -
serviceInterface -
Method Detail

internalInvocation

protected java.lang.Object internalInvocation(java.lang.reflect.Method method,
                                              java.lang.Object[] arguments)
                                       throws java.lang.Throwable
Description copied from class: ContractProxy
The abstract method that needs to be implemented to perform the actual call

Specified by:
internalInvocation in class ContractProxy
Parameters:
method - the method to call
arguments - the arguments for the call
Returns:
the result of the call
Throws:
java.lang.Throwable
See Also:
ContractProxy.internalInvocation(java.lang.reflect.Method, java.lang.Object[])