站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBOSS Portal 2.2 API 英文版文档

Invocation - JBOSS Portal 2.2 API 英文版文档


org.jboss.portal.server.invocation
Class Invocation

java.lang.Object
  extended byorg.jboss.portal.server.invocation.Invocation
Direct Known Subclasses:
ComponentInvocation, ControllerCommand, PageInvocation, ServerInvocation

public abstract class Invocation
extends java.lang.Object

A generic invocation object.


Constructor Summary
Invocation()
           
 
Method Summary
protected abstract  void dispatch()
          Dispatch the call to the target.
 java.lang.Object getAttribute(java.lang.String name)
          Return an attribute from the invocation.
 void invoke(Interceptor[] newInterceptors)
          Execute the invocation through the chain of interceptors.
 void invokeNext()
          Invoke the next interceptor in the chain.
 void removeAttribute(java.lang.String name)
          Remove an attribute from the invocation.
 void setAttribute(java.lang.String name, java.lang.Object value)
          Set an attribute on the invocation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Invocation

public Invocation()
Method Detail

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
                  throws java.lang.IllegalArgumentException
Set an attribute on the invocation. The goal of attributes is to exchange data between interceptors. Indeed they could use the underlying request to exchange informations but it is preferrable to not put such objects visible in the request as they are private to the aspects.

Parameters:
name - the attribute name
value - the attribute value
Throws:
java.lang.IllegalArgumentException - if the attribute name is null

removeAttribute

public void removeAttribute(java.lang.String name)
                     throws java.lang.IllegalArgumentException
Remove an attribute from the invocation.

Parameters:
name - the attribute name
Throws:
java.lang.IllegalArgumentException - if the name is null

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
                              throws java.lang.IllegalArgumentException
Return an attribute from the invocation.

Parameters:
name - the attribute name
Returns:
the attribute value
Throws:
java.lang.IllegalArgumentException - if the name is null

invokeNext

public void invokeNext()
                throws InvocationException,
                       InvocationRuntimeException
Invoke the next interceptor in the chain. If the end of the chain is reached then the dispatch() is invoked.

Throws:
InvocationException
InvocationRuntimeException

invoke

public void invoke(Interceptor[] newInterceptors)
            throws java.lang.IllegalArgumentException,
                   InvocationException,
                   InvocationRuntimeException
Execute the invocation through the chain of interceptors. InvocationException should be raised for checked exception. InvocationRuntimeException should be raised for for non checked exception. RuntimeException should not be raised and are considered to be programmation errors when they go through the chain, so any code in the chain should not throw instances of RuntimeException. When the end of the chain is reached the dispatch() method is invoked.

Throws:
java.lang.IllegalArgumentException - if the new chain is null
InvocationException - considered as a checked exception
InvocationRuntimeException - considered as a non checked exception

dispatch

protected abstract void dispatch()
                          throws InvocationException,
                                 InvocationRuntimeException
Dispatch the call to the target.

Throws:
InvocationException
InvocationRuntimeException