Handler (Java EE 5)

Java EE API


javax.xml.ws.handler Interface Handler<C extends MessageContext>

All Known Subinterfaces:
LogicalHandler<C>, SOAPHandler<T>

public interface Handler<C extends MessageContext>

Implemented by: GenericHandler

javax.xml.rpc.handler.Handler 接口需要由 SOAP 消息处理程序实现。用于 SOAP 消息处理程序的 handleRequesthandleResponsehandleFault 方法将能够访问 SOAPMessageContextSOAPMessage。这些方法的实现可以修改 SOAPMessage,包括头和正文元素。
英文文档:

The Handler interface is the base interface for JAX-WS handlers.

Since:
JAX-WS 2.0

Method Summary
 void
 boolean
 boolean
 

Method Detail

英文文档:

handleMessage

boolean handleMessage(C context)
The handleMessage method is invoked for normal processing of inbound and outbound messages. Refer to the description of the handler framework in the JAX-WS specification for full details.

Parameters:
context - the message context.
Returns:
An indication of whether handler processing should continue for the current message
  • Return true to continue processing.
  • Return false to block processing.
Throws:
RuntimeException - Causes the JAX-WS runtime to cease handler processing and generate a fault.
ProtocolException - Causes the JAX-WS runtime to switch to fault message processing.

英文文档:

handleFault

boolean handleFault(C context)
The handleFault method is invoked for fault message processing. Refer to the description of the handler framework in the JAX-WS specification for full details.

Parameters:
context - the message context
Returns:
An indication of whether handler fault processing should continue for the current message
  • Return true to continue processing.
  • Return false to block processing.
Throws:
RuntimeException - Causes the JAX-WS runtime to cease handler fault processing and dispatch the fault.
ProtocolException - Causes the JAX-WS runtime to cease handler fault processing and dispatch the fault.

英文文档:

close

void close(MessageContext context)
Called at the conclusion of a message exchange pattern just prior to the JAX-WS runtime disptaching a message, fault or exception. Refer to the description of the handler framework in the JAX-WS specification for full details.

Parameters:
context - the message context


Submit a bug or feature

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

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

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