KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > celtix > bus > ws > rm > RMContextUtils


1 package org.objectweb.celtix.bus.ws.rm;
2
3 import javax.xml.ws.handler.MessageContext;
4
5 import org.objectweb.celtix.ws.rm.JAXWSRMConstants;
6 import org.objectweb.celtix.ws.rm.RMProperties;
7
8 /**
9  * 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(MessageContext context, boolean outbound) {
21         return (RMProperties)context.get(getRMPropertiesKey(outbound));
22     }
23     
24     public static void storeRMProperties(MessageContext context, RMProperties rmps, boolean outbound) {
25         String JavaDoc key = getRMPropertiesKey(outbound);
26         context.put(key, rmps);
27         context.setScope(key, MessageContext.Scope.HANDLER);
28     }
29     
30     private static String JavaDoc getRMPropertiesKey(boolean outbound) {
31         return outbound ? JAXWSRMConstants.RM_PROPERTIES_OUTBOUND : JAXWSRMConstants.RM_PROPERTIES_INBOUND;
32     }
33     
34 }
35
Popular Tags