Invocation API 1.1.0.Final

org.jboss.invocation
Class SimpleInvocationContext

java.lang.Object
  extended by org.jboss.invocation.SimpleInvocationContext
All Implemented Interfaces:
javax.interceptor.InvocationContext

public class SimpleInvocationContext
extends Object
implements javax.interceptor.InvocationContext

A base class for invocation contexts. Also can act as the last interceptor in a chain which does not proceed.

Author:
David M. Lloyd

Constructor Summary
SimpleInvocationContext(Object target, Method method, Object[] parameters)
          Construct a new instance.
SimpleInvocationContext(Object target, Method method, Object[] parameters, Map<String,Object> contextData, Object timer)
          Construct a new instance.
SimpleInvocationContext(Object target, Method method, Object[] parameters, Object timer)
          Construct a new instance.
 
Method Summary
 Map<String,Object> getContextData()
          
 Method getMethod()
          
 Object[] getParameters()
          
 Object getTarget()
          
 Object getTimer()
          
 Object proceed()
          Throw an exception indicating that the end of the interceptor chain was reached without an invocation being performed.
 void setParameters(Object[] parameters)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleInvocationContext

public SimpleInvocationContext(Object target,
                               Method method,
                               Object[] parameters,
                               Map<String,Object> contextData,
                               Object timer)
Construct a new instance.

Parameters:
target - the target object instance
method - the invocation method (may be null)
parameters - the invocation parameters (may be null)
contextData - the context data map to use
timer - the associated timer (may be null)

SimpleInvocationContext

public SimpleInvocationContext(Object target,
                               Method method,
                               Object[] parameters,
                               Object timer)
Construct a new instance.

Parameters:
target - the target object instance
method - the invocation method (may be null)
parameters - the invocation parameters (may be null)
timer - the associated timer (may be null)

SimpleInvocationContext

public SimpleInvocationContext(Object target,
                               Method method,
                               Object[] parameters)
Construct a new instance.

Parameters:
target - the target object instance
method - the invocation method (may be null)
parameters - the invocation parameters (may be null)
Method Detail

getTarget

public Object getTarget()

Specified by:
getTarget in interface javax.interceptor.InvocationContext

getMethod

public Method getMethod()

Specified by:
getMethod in interface javax.interceptor.InvocationContext

getParameters

public Object[] getParameters()

Specified by:
getParameters in interface javax.interceptor.InvocationContext

setParameters

public void setParameters(Object[] parameters)

Specified by:
setParameters in interface javax.interceptor.InvocationContext

getContextData

public Map<String,Object> getContextData()

Specified by:
getContextData in interface javax.interceptor.InvocationContext

getTimer

public Object getTimer()

Specified by:
getTimer in interface javax.interceptor.InvocationContext

proceed

public Object proceed()
               throws Exception
Throw an exception indicating that the end of the interceptor chain was reached without an invocation being performed. This method should be overridden to provide a specific implementation. Though this method always throws CannotProceedException, it is declared to throw Exception so that subclasses can override this method in a spec-compliant way.

Specified by:
proceed in interface javax.interceptor.InvocationContext
Returns:
nothing
Throws:
Exception - always (in particular, CannotProceedException)

Invocation API 1.1.0.Final

Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.