01: package org.objectweb.celtix.bus.ws.rm;
02:
03: import javax.xml.ws.handler.MessageContext;
04:
05: import org.objectweb.celtix.ws.rm.JAXWSRMConstants;
06: import org.objectweb.celtix.ws.rm.RMProperties;
07:
08: /**
09: * Holder for utility methods relating to contexts.
10: */
11:
12: public final class RMContextUtils {
13:
14: /**
15: * Prevents instantiation.
16: */
17: private RMContextUtils() {
18: }
19:
20: public static RMProperties retrieveRMProperties(
21: MessageContext context, boolean outbound) {
22: return (RMProperties) context.get(getRMPropertiesKey(outbound));
23: }
24:
25: public static void storeRMProperties(MessageContext context,
26: RMProperties rmps, boolean outbound) {
27: String key = getRMPropertiesKey(outbound);
28: context.put(key, rmps);
29: context.setScope(key, MessageContext.Scope.HANDLER);
30: }
31:
32: private static String getRMPropertiesKey(boolean outbound) {
33: return outbound ? JAXWSRMConstants.RM_PROPERTIES_OUTBOUND
34: : JAXWSRMConstants.RM_PROPERTIES_INBOUND;
35: }
36:
37: }
|