dynaop.observer
Class SubjectInterceptor

java.lang.Object
  extended by dynaop.observer.SubjectInterceptor
All Implemented Interfaces:
Interceptor, java.io.Serializable

public class SubjectInterceptor
extends java.lang.Object
implements Interceptor, java.io.Serializable

Notifies observers after the method invocation completes. Does not notify in the event of an exception. Use in conjunction with SubjectMixin.

Author:
Bob Lee (crazybob@crazybob.org)
See Also:
Serialized Form

Constructor Summary
SubjectInterceptor()
           
SubjectInterceptor(java.lang.Object argument)
           
 
Method Summary
protected  java.lang.Object createArgument(Subject subject, Invocation invocation, java.lang.Object result)
          Creates argument that should be passed to observers.
 java.lang.Object intercept(Invocation invocation)
          Intercepts a method invocation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubjectInterceptor

public SubjectInterceptor()

SubjectInterceptor

public SubjectInterceptor(java.lang.Object argument)
Method Detail

createArgument

protected java.lang.Object createArgument(Subject subject,
                                          Invocation invocation,
                                          java.lang.Object result)
Creates argument that should be passed to observers. Default implementation returns null.


intercept

public java.lang.Object intercept(Invocation invocation)
                           throws java.lang.Throwable
Description copied from interface: Interceptor
Intercepts a method invocation.

Specified by:
intercept in interface Interceptor
Throws:
java.lang.Throwable