MessageContext (Java EE 5)

Java EE API


javax.xml.rpc.handler Interface MessageContext

All Known Subinterfaces:
SOAPMessageContext

public interface MessageContext

Implemented by: SOAPMessageContext

接口 MessageContext 抽象化由 handle 方法中的处理程序处理的消息上下文。

MessageContext 接口提供管理属性集的方法。MessageContext 属性使处理程序链中的处理程序能够共享相关处理状态。

英文文档:

The interface MessageContext abstracts the message context that is processed by a handler in the handle method.

The MessageContext interface provides methods to manage a property set. MessageContext properties enable handlers in a handler chain to share processing related state.

Version:
1.1
Author:
Rahul Sharma, Roberto Chinnici
See Also:
Handler

Method Summary
 boolean
 Object
 Iterator
 void
 void
 

Method Detail

public void setProperty(String name, Object value)
设置与 MessageContext 关联的某个属性的名称和值。如果 MessageContext 包含相同属性的值,则替换旧值。
nameMessageContext 关联的属性的名称
value 属性的值
ThrowsIllegalArgumentException: 如果属性的某些方面不允许它存储在上下文中
ThrowsUnsupportedOperationException: 如果不支持此方法
英文文档:

setProperty

void setProperty(String name,
                 Object value)
Sets the name and value of a property associated with the MessageContext. If the MessageContext contains a value of the same property, the old value is replaced.

Parameters:
name - Name of the property associated with the MessageContext
value - Value of the property
Throws:
IllegalArgumentException - If some aspect of the property is prevents it from being stored in the context
UnsupportedOperationException - If this method is not supported.

public Object getProperty(String name)
获取 MessageContext 中某个特定属性的值。
name 将获取其值的属性的名称
return 属性的值
ThrowsIllegalArgumentException: 如果指定的属性名称不合法
英文文档:

getProperty

Object getProperty(String name)
Gets the value of a specific property from the MessageContext

Parameters:
name - Name of the property whose value is to be retrieved
Returns:
Value of the property
Throws:
IllegalArgumentException - if an illegal property name is specified

public void removeProperty(String name)
MessageContext 中移除某个属性(名称-值对)。
name 将移除的属性的名称
ThrowsIllegalArgumentException: 如果指定的属性名称不合法
英文文档:

removeProperty

void removeProperty(String name)
Removes a property (name-value pair) from the MessageContext

Parameters:
name - Name of the property to be removed
Throws:
IllegalArgumentException - if an illegal property name is specified

public boolean containsProperty(String name)
如果 MessageContext 包含具有指定名称的属性,则返回 true。
name 将测试是否存在的属性的名称
return 如果 MessageContext 包含该属性,则返回 true;否则返回 false
英文文档:

containsProperty

boolean containsProperty(String name)
Returns true if the MessageContext contains a property with the specified name.

Parameters:
name - Name of the property whose presense is to be tested
Returns:
Returns true if the MessageContext contains the property; otherwise false

public java.util.Iterator<E> getPropertyNames()
返回此 MessageContext 中属性名称的 Iterator 视图。
return 属性名称的 Iterator
英文文档:

getPropertyNames

Iterator getPropertyNames()
Returns an Iterator view of the names of the properties in this MessageContext

Returns:
Iterator for the property names


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!