01: package org.objectweb.celtix.context;
02:
03: import java.lang.reflect.Method;
04: import javax.xml.ws.handler.MessageContext;
05:
06: public class ObjectMessageContextImpl extends GenericMessageContext
07: implements ObjectMessageContext {
08: private static final long serialVersionUID = 401275179632507389L;
09:
10: public Object[] getMessageObjects() {
11: return (Object[]) get(ObjectMessageContext.METHOD_PARAMETERS);
12: }
13:
14: public void setMessageObjects(Object... objects) {
15: put(ObjectMessageContext.METHOD_PARAMETERS, objects);
16: setScope(ObjectMessageContext.METHOD_PARAMETERS,
17: MessageContext.Scope.HANDLER);
18: }
19:
20: public void setReturn(Object retVal) {
21: put(ObjectMessageContext.METHOD_RETURN, retVal);
22: setScope(ObjectMessageContext.METHOD_RETURN,
23: MessageContext.Scope.HANDLER);
24: }
25:
26: public Object getReturn() {
27: return get(ObjectMessageContext.METHOD_RETURN);
28: }
29:
30: public void setMethod(Method method) {
31: put(ObjectMessageContext.METHOD_OBJ, method);
32: setScope(ObjectMessageContext.METHOD_OBJ,
33: MessageContext.Scope.HANDLER);
34: }
35:
36: public Method getMethod() {
37: return (Method) get(ObjectMessageContext.METHOD_OBJ);
38: }
39:
40: public void setException(Throwable ex) {
41: put(ObjectMessageContext.METHOD_FAULT, ex);
42: setScope(ObjectMessageContext.METHOD_FAULT,
43: MessageContext.Scope.HANDLER);
44: }
45:
46: public Throwable getException() {
47: return (Throwable) get(ObjectMessageContext.METHOD_FAULT);
48: }
49:
50: public void setRequestorRole(boolean requestor) {
51: put(ObjectMessageContext.REQUESTOR_ROLE_PROPERTY, Boolean
52: .valueOf(requestor));
53: setScope(ObjectMessageContext.REQUESTOR_ROLE_PROPERTY,
54: MessageContext.Scope.HANDLER);
55: }
56:
57: public boolean isRequestorRole() {
58: Boolean b = (Boolean) get(ObjectMessageContext.REQUESTOR_ROLE_PROPERTY);
59: return null == b ? true : b.booleanValue();
60: }
61: }
|