org.apache.aries.blueprint.proxy
Class Collaborator

java.lang.Object
  extended by org.apache.aries.blueprint.proxy.Collaborator
All Implemented Interfaces:
Serializable, org.apache.aries.proxy.InvocationListener

public class Collaborator
extends Object
implements org.apache.aries.proxy.InvocationListener, Serializable

A collaborator which ensures preInvoke and postInvoke occur before and after method invocation

See Also:
Serialized Form

Constructor Summary
Collaborator(org.osgi.service.blueprint.reflect.ComponentMetadata cm, List<org.apache.aries.blueprint.Interceptor> interceptors)
           
 
Method Summary
 void postInvoke(Object token, Object o, Method method, Object returnType)
          Called when the method is called and returned normally
 void postInvokeExceptionalReturn(Object token, Object o, Method method, Throwable exception)
          Called when the method is called and returned with an exception
 Object preInvoke(Object o, Method m, Object[] parameters)
          Invoke the preCall method on the interceptor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Collaborator

public Collaborator(org.osgi.service.blueprint.reflect.ComponentMetadata cm,
                    List<org.apache.aries.blueprint.Interceptor> interceptors)
Method Detail

preInvoke

public Object preInvoke(Object o,
                        Method m,
                        Object[] parameters)
                 throws Throwable
Invoke the preCall method on the interceptor

Specified by:
preInvoke in interface org.apache.aries.proxy.InvocationListener
Parameters:
o - : The Object being invoked
m - : method
parameters - : method paramters
Throws:
Throwable

postInvoke

public void postInvoke(Object token,
                       Object o,
                       Method method,
                       Object returnType)
                throws Throwable
Called when the method is called and returned normally

Specified by:
postInvoke in interface org.apache.aries.proxy.InvocationListener
Parameters:
cm - : component metadata
method - : method
returnType - : return type
Throws:
Throwable

postInvokeExceptionalReturn

public void postInvokeExceptionalReturn(Object token,
                                        Object o,
                                        Method method,
                                        Throwable exception)
                                 throws Throwable
Called when the method is called and returned with an exception

Specified by:
postInvokeExceptionalReturn in interface org.apache.aries.proxy.InvocationListener
Parameters:
cm - : component metadata
method - : method
exception - : exception thrown
Throws:
Throwable


Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.