KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > celtix > handlers > HandlerInvoker


1 package org.objectweb.celtix.handlers;
2
3
4 import javax.xml.ws.handler.MessageContext;
5
6 import org.objectweb.celtix.context.InputStreamMessageContext;
7 import org.objectweb.celtix.context.ObjectMessageContext;
8 import org.objectweb.celtix.context.OutputStreamMessageContext;
9
10
11
12 /**
13  * Invokes the handlers associated with a binding. The client and
14  * server bindings invoke their handlers using the HandlerInvoker.
15  * For details of how the invokers should be invoked, see the JAXWS
16  * 2.0 specification.
17  */

18 public interface HandlerInvoker {
19
20     /**
21      * Invoke the logical handlers.
22      *
23      * @param requestor true if being invoked on the request initiator
24      */

25     boolean invokeLogicalHandlers(boolean requestor, ObjectMessageContext objectContext);
26         
27     /**
28      * Invoke the protocol handlers.
29      *
30      * @param requestor true if being invoked on the request initiator
31      * @param bindingContext binding specific MessageContext
32      */

33     boolean invokeProtocolHandlers(boolean requestor, MessageContext bindingContext);
34     
35      
36     /**
37      * Invoke the stream level handlers with an InputStream.
38      *
39      * @param context the InputStreamMessageContext for the message
40      * exchange
41      */

42     boolean invokeStreamHandlers(InputStreamMessageContext context);
43         
44
45     /**
46      * Invoke the stream level handlers with an OutputStream.
47      *
48      * @param context the OutputStreamMessageContext for the message exchange
49      */

50     boolean invokeStreamHandlers(OutputStreamMessageContext context);
51
52     /**
53      * Close all handlers that have previously invoked
54      */

55     void closeHandlers();
56     
57     /**
58      * Indicates if a fault has been raised
59      *
60      * @return true if an exception has been thrown by an invoked
61      * handler.
62      */

63     boolean faultRaised(MessageContext context);
64
65     /**
66      * Is the current message direction outbound
67      *
68      * @return true if current message direction is outbound
69      */

70     boolean isOutbound();
71     
72     /**
73      * Is the current message direction inbound
74      *
75      * @return true if current message direction is inbound
76      */

77     boolean isInbound();
78     
79     
80     /**
81      * set the current message direction to inbound
82      */

83     void setInbound();
84
85     /**
86      * set the current message direction to outabound
87      */

88     void setOutbound();
89
90     /**
91      * set the invoker into fault processing mode. This method is
92      * invoked when a client transport indicates that a fault has been
93      * raised by the server but the message has not yet been read or
94      * unmarshalled.
95      */

96     void setFault(boolean faultExpected);
97
98     /**
99      * Invoke handlers at the end of an MEP calling close on each.
100      */

101     void mepComplete(MessageContext context);
102
103
104     /**
105      * Indicates that the invoker is closed. When closed, only *
106      * #mepComplete may be called. The invoker will become closed if
107      * during a invocation of handlers, a handler throws a runtime
108      * exception that is not a protocol exception and no futher
109      * handler or message processing is possible.
110      *
111      */

112     boolean isClosed();
113     
114     /**
115      * Allows an the logical handler chain for one invoker to be used
116      * as an alternate chain for another.
117      *
118      * @param invoker the invoker encalsulting the alternate logical handler
119      * chain
120      */

121     void adoptLogicalHandlers(HandlerInvoker invoker);
122 }
123
124
Popular Tags