KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > xml > ws > handler > Handler


1 /*
2  * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
3  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4  */

5
6 package javax.xml.ws.handler;
7
8 import javax.xml.ws.ProtocolException;
9 import javax.xml.ws.handler.MessageContext;
10
11 /** The <code>Handler</code> interface
12  * is the base interface for JAX-WS handlers.
13  *
14  * @since JAX-WS 2.0
15 **/

16 public interface Handler<C extends MessageContext> {
17
18   /** The <code>handleMessage</code> method is invoked for normal processing
19    * of inbound and outbound messages. Refer to the description of the handler
20    * framework in the JAX-WS specification for full details.
21    *
22    * @param context the message context.
23    * @return An indication of whether handler processing should continue for
24    * the current message
25    * <ul>
26    * <li>Return <code>true</code> to continue
27    * processing.</li>
28    * <li>Return <code>false</code> to block
29    * processing.</li>
30    * </ul>
31    * @throws RuntimeException Causes the JAX-WS runtime to cease
32    * handler processing and generate a fault.
33    * @throws ProtocolException Causes the JAX-WS runtime to switch to
34    * fault message processing.
35   **/

36   public boolean handleMessage(C context);
37
38   /** The <code>handleFault</code> method is invoked for fault message
39    * processing. Refer to the description of the handler
40    * framework in the JAX-WS specification for full details.
41    *
42    * @param context the message context
43    * @return An indication of whether handler fault processing should continue
44    * for the current message
45    * <ul>
46    * <li>Return <code>true</code> to continue
47    * processing.</li>
48    * <li>Return <code>false</code> to block
49    * processing.</li>
50    * </ul>
51    * @throws RuntimeException Causes the JAX-WS runtime to cease
52    * handler fault processing and dispatch the fault.
53    * @throws ProtocolException Causes the JAX-WS runtime to cease
54    * handler fault processing and dispatch the fault.
55   **/

56   public boolean handleFault(C context);
57
58   /**
59    * Called at the conclusion of a message exchange pattern just prior to
60    * the JAX-WS runtime disptaching a message, fault or exception. Refer to
61    * the description of the handler
62    * framework in the JAX-WS specification for full details.
63    *
64    * @param context the message context
65   **/

66   public void close(MessageContext context);
67 }
68
Popular Tags