|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.interceptor Interface InvocationContext
public interface InvocationContext
传递给 AroundInvoke 和 Interceptor 类生命周期回调方法的上下文信息。
Context information passed to AroundInvoke and Interceptor-class lifecycle callback methods.
Method Summary | |
---|---|
Map<String,Object> |
getContextData()
Returns the context data associated with this invocation or lifecycle callback. |
Method |
getMethod()
Returns the method of the bean class for which the interceptor was invoked. |
Object[] |
getParameters()
Returns the parameters that will be used to invoke the business method. |
Object |
getTarget()
Returns the target instance. |
Object |
proceed()
Proceed to the next entry in the interceptor chain. |
void |
setParameters(Object[] params)
Sets the parameters that will be used to invoke the business method. |
Method Detail |
---|
public Object
getTarget()
返回目标实例。
英文文档:
getTarget
Object getTarget()
- Returns the target instance.
public Method
getMethod()
返回调用 Interceptor 的 Bean 类的方法。对于 AroundInvoke 方法,这是 Bean 类的业务方法。对于生命周期回调方法,返回 null。
英文文档:
getMethod
Method getMethod()
- Returns the method of the bean class for which the interceptor
was invoked. For AroundInvoke methods, this is the business
method on the bean class. For lifecycle callback methods,
returns null.
public Object[]
getParameters()
返回将用来调用业务方法的参数。如果已经调用了 setParameters,则 getParameters() 返回设置的参数值。
Throws | IllegalStateException: 如果在生命周期回调方法中调用。 |
getParameters
Object[] getParameters()
- Returns the parameters that will be used to invoke
the business method. If setParameters has been called,
getParameters() returns the values to which the parameters
have been set.
- Throws:
IllegalStateException
- if invoked within a lifecycle callback method.
public void
setParameters(Object[] params)
设置将用来调用业务方法的参数。
Throws | IllegalStateException: 如果在生命周期回调方法中调用。 |
Throws | IllegalArgumentException: 如果参数类型与业务方法的类型不匹配,或者提供的参数数量与业务方法的参数数量不相等。 |
setParameters
void setParameters(Object[] params)
- Sets the parameters that will be used to invoke the
business method.
- Throws:
IllegalStateException
- if invoked within a lifecycle callback method.IllegalArgumentException
- if the parameter types do not match the types for the business method, or the number of parameters supplied does not equal the number of parameters for the business method.
public java.util.Map<K, V>
getContextData()
返回与此调用或生命周期回调关联的上下文数据。如果没有上下文数据,将返回一个空 Map 对象。
英文文档:
getContextData
Map<String,Object> getContextData()
- Returns the context data associated with this invocation or
lifecycle callback. If there is no context data, an
empty Map
object will be returned.
public Object
proceed() throws Exception
继续处理 Interceptor 链的下一个条目。proceed 方法返回调用的下一个方法的结果。如果该方法返回 void,那么 proceed 返回 null。
英文文档:
proceed
Object proceed() throws Exception
- Proceed to the next entry in the interceptor chain.
The proceed method returns the result of the next
method invoked. If the method returns void, proceed
returns null.
- Throws:
Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!