[jboss-svn-commits] JBossWS SVN: r880 - branches/tdiesler/trunk/src/main/java/org/jboss/ws/common

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Sep 1 06:58:28 EDT 2006


Author: thomas.diesler at jboss.com
Date: 2006-09-01 06:58:27 -0400 (Fri, 01 Sep 2006)
New Revision: 880

Added:
   branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/CommonMessageContext.java
Log:
Refactor MessageContext JAXRPC/JAXWS to use a CommonMessageContext
Remove questionable association of SOAPEnvelope with NamespaceRegistry

Added: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/CommonMessageContext.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/CommonMessageContext.java	2006-09-01 10:56:57 UTC (rev 879)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/CommonMessageContext.java	2006-09-01 10:58:27 UTC (rev 880)
@@ -0,0 +1,114 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.common;
+
+// $Id$
+
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.jboss.ws.metadata.EndpointMetaData;
+import org.jboss.ws.metadata.OperationMetaData;
+import org.jboss.xb.binding.NamespaceRegistry;
+
+/**
+ * The common JAXRPC/JAXWS MessageContext
+ * 
+ * @author Thomas.Diesler at jboss.org
+ * @since 1-Sep-2006
+ */
+public abstract class CommonMessageContext
+{
+   // The operation for this message ctx
+   private EndpointMetaData epMetaData;
+   // The operation for this message ctx
+   private OperationMetaData opMetaData;
+   // The map of the properties
+   protected HashMap<String, Object> props = new HashMap<String, Object>();
+
+   public EndpointMetaData getEndpointMetaData()
+   {
+      if (epMetaData == null && opMetaData != null)
+         epMetaData = opMetaData.getEndpointMetaData();
+
+      return epMetaData;
+   }
+
+   public void setEndpointMetaData(EndpointMetaData epMetaData)
+   {
+      this.epMetaData = epMetaData;
+   }
+
+   public OperationMetaData getOperationMetaData()
+   {
+      return opMetaData;
+   }
+
+   public void setOperationMetaData(OperationMetaData opMetaData)
+   {
+      this.opMetaData = opMetaData;
+   }
+
+   /**
+    * Returns true if the MessageContext contains a property with the specified name.
+    */
+   public boolean containsProperty(String name)
+   {
+      return props.containsKey(name);
+   }
+
+   /**
+    * Gets the value of a specific property from the MessageContext
+    */
+   public Object getProperty(String name)
+   {
+      return props.get(name);
+   }
+
+   /**
+    * Returns an Iterator view of the names of the properties in this MessageContext
+    */
+   public Iterator getPropertyNames()
+   {
+      return props.keySet().iterator();
+   }
+
+   /**
+    * Removes a property (name-value pair) from the MessageContext
+    */
+   public void removeProperty(String name)
+   {
+      props.remove(name);
+   }
+
+   /**
+    * Sets the name and value of a property associated with the MessageContext.
+    * If the MessageContext contains a value of the same property, the old value is replaced.
+    */
+   public void setProperty(String name, Object value)
+   {
+      props.put(name, value);
+   }
+   
+   /** Gets the namespace registry for this message context */
+   public abstract NamespaceRegistry getNamespaceRegistry();
+}


Property changes on: branches/tdiesler/trunk/src/main/java/org/jboss/ws/common/CommonMessageContext.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF




More information about the jboss-svn-commits mailing list