001: package org.objectweb.celtix.handlers;
002:
003: import javax.xml.ws.handler.MessageContext;
004:
005: import org.objectweb.celtix.context.InputStreamMessageContext;
006: import org.objectweb.celtix.context.ObjectMessageContext;
007: import org.objectweb.celtix.context.OutputStreamMessageContext;
008:
009: /**
010: * Invokes the handlers associated with a binding. The client and
011: * server bindings invoke their handlers using the HandlerInvoker.
012: * For details of how the invokers should be invoked, see the JAXWS
013: * 2.0 specification.
014: */
015: public interface HandlerInvoker {
016:
017: /**
018: * Invoke the logical handlers.
019: *
020: * @param requestor true if being invoked on the request initiator
021: */
022: boolean invokeLogicalHandlers(boolean requestor,
023: ObjectMessageContext objectContext);
024:
025: /**
026: * Invoke the protocol handlers.
027: *
028: * @param requestor true if being invoked on the request initiator
029: * @param bindingContext binding specific MessageContext
030: */
031: boolean invokeProtocolHandlers(boolean requestor,
032: MessageContext bindingContext);
033:
034: /**
035: * Invoke the stream level handlers with an InputStream.
036: *
037: * @param context the InputStreamMessageContext for the message
038: * exchange
039: */
040: boolean invokeStreamHandlers(InputStreamMessageContext context);
041:
042: /**
043: * Invoke the stream level handlers with an OutputStream.
044: *
045: * @param context the OutputStreamMessageContext for the message exchange
046: */
047: boolean invokeStreamHandlers(OutputStreamMessageContext context);
048:
049: /**
050: * Close all handlers that have previously invoked
051: */
052: void closeHandlers();
053:
054: /**
055: * Indicates if a fault has been raised
056: *
057: * @return true if an exception has been thrown by an invoked
058: * handler.
059: */
060: boolean faultRaised(MessageContext context);
061:
062: /**
063: * Is the current message direction outbound
064: *
065: * @return true if current message direction is outbound
066: */
067: boolean isOutbound();
068:
069: /**
070: * Is the current message direction inbound
071: *
072: * @return true if current message direction is inbound
073: */
074: boolean isInbound();
075:
076: /**
077: * set the current message direction to inbound
078: */
079: void setInbound();
080:
081: /**
082: * set the current message direction to outabound
083: */
084: void setOutbound();
085:
086: /**
087: * set the invoker into fault processing mode. This method is
088: * invoked when a client transport indicates that a fault has been
089: * raised by the server but the message has not yet been read or
090: * unmarshalled.
091: */
092: void setFault(boolean faultExpected);
093:
094: /**
095: * Invoke handlers at the end of an MEP calling close on each.
096: */
097: void mepComplete(MessageContext context);
098:
099: /**
100: * Indicates that the invoker is closed. When closed, only *
101: * #mepComplete may be called. The invoker will become closed if
102: * during a invocation of handlers, a handler throws a runtime
103: * exception that is not a protocol exception and no futher
104: * handler or message processing is possible.
105: *
106: */
107: boolean isClosed();
108:
109: /**
110: * Allows an the logical handler chain for one invoker to be used
111: * as an alternate chain for another.
112: *
113: * @param invoker the invoker encalsulting the alternate logical handler
114: * chain
115: */
116: void adoptLogicalHandlers(HandlerInvoker invoker);
117: }
|