You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by as...@apache.org on 2005/07/05 16:07:46 UTC

svn commit: r209273 - in /webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src: javax/xml/rpc/handler/ org/apache/axis/jaxrpc/handler/ org/apache/axis/jaxrpc/handler/soap/

Author: ashutosh
Date: Tue Jul  5 07:07:45 2005
New Revision: 209273

URL: http://svn.apache.org/viewcvs?rev=209273&view=rev
Log:
MessageContext implementation and partial implementation of SOAPMessageContext

Added:
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/handler/
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/handler/MessageContextImpl.java
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/handler/soap/
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/handler/soap/SOAPMessageContextImpl.java
Modified:
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/javax/xml/rpc/handler/MessageContext.java

Modified: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/javax/xml/rpc/handler/MessageContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/javax/xml/rpc/handler/MessageContext.java?rev=209273&r1=209272&r2=209273&view=diff
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/javax/xml/rpc/handler/MessageContext.java (original)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/javax/xml/rpc/handler/MessageContext.java Tue Jul  5 07:07:45 2005
@@ -27,8 +27,9 @@
  */
 public interface MessageContext {
 	
-	static class Scope {
-		
+	public static enum Scope {
+		APPLICATION,
+		HANDLER;
 	}
 	
 	/**
@@ -36,14 +37,14 @@
 	 * <p>
 	 * Type: boolean
 	 */
-	static final java.lang.String MESSAGE_OUTBOUND_PROPERTY = null;
+	static final java.lang.String MESSAGE_OUTBOUND_PROPERTY = "javax.xml.rpc.handler.message.outbound";
 	
 	/**
 	 * Standard property: security configuration.
 	 * <p>
 	 * Type: javax.xml.rpc.security.SecurityConfiguration
 	 */
-	static final java.lang.String MESSAGE_SECURITY_CONFIGURATION = null;
+	static final java.lang.String MESSAGE_SECURITY_CONFIGURATION = "javax.xml.rpc.security.configuration";
 	
 	/**
 	 * Sets the scope of a property.

Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/handler/MessageContextImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/handler/MessageContextImpl.java?rev=209273&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/handler/MessageContextImpl.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/handler/MessageContextImpl.java Tue Jul  5 07:07:45 2005
@@ -0,0 +1,98 @@
+package org.apache.axis.jaxrpc.handler;
+
+import java.util.HashMap;
+import java.util.Iterator;
+
+import javax.xml.rpc.handler.MessageContext;
+
+public class MessageContextImpl implements MessageContext {
+	
+	/**
+	 * HashMap to hold peroperties, key is the propertyName, and value is a
+	 * class with keyValue and scopeValue
+	 */
+	protected HashMap<String, PropVals> properties;
+	
+	protected class PropVals{
+		Object value;
+		Scope propScope;
+		
+		PropVals(Object value, Scope scope){
+			this.value = value;
+			this.propScope = scope;
+		}
+	}
+	
+	public MessageContextImpl(){
+		properties = new HashMap<String, PropVals>();
+	}
+
+	public void setPropertyScope(String name, Scope scope)
+			throws IllegalArgumentException {
+		
+		PropVals property = properties.get(name);
+		if(property != null)
+			property.propScope = scope;
+
+	}
+
+	public Scope getPropertyScope(String name) throws IllegalArgumentException {
+		
+		PropVals property = properties.get(name);
+		if(property != null)
+			return property.propScope;
+		return null;
+	}
+
+	public void setProperty(String name, Object value)
+			throws IllegalArgumentException, UnsupportedOperationException {
+		
+		PropVals property = properties.get(name);
+		if(property != null)
+			property.value = value;
+		else
+			properties.put(name, new PropVals(value, Scope.HANDLER)); //Using HANDLER as the default scope
+										// not sure which one should be default or if scope can be null
+
+	}
+
+	public void setProperty(String name, Object value, Scope scope)
+			throws IllegalArgumentException, UnsupportedOperationException {
+		
+		PropVals property = properties.get(name);
+		if(property != null){
+			property.value = value;
+			property.propScope = scope;
+		} else
+			properties.put(name, new PropVals(value, scope));
+
+	}
+
+	public Object getProperty(String name) throws IllegalArgumentException {
+		
+		PropVals property = properties.get(name);
+		if(property != null)
+			return property.value;
+		return null;
+	}
+
+	public void removeProperty(String name) throws IllegalArgumentException {
+		
+		properties.remove(name);
+	}
+
+	public boolean containsProperty(String name) {
+		
+		PropVals property = properties.get(name);
+		if(property != null)
+			return true;
+		else
+			return false;
+	}
+
+	public Iterator getPropertyNames() {
+		
+		return properties.keySet().iterator();
+	}
+
+}

Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/handler/soap/SOAPMessageContextImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/handler/soap/SOAPMessageContextImpl.java?rev=209273&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/handler/soap/SOAPMessageContextImpl.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/handler/soap/SOAPMessageContextImpl.java Tue Jul  5 07:07:45 2005
@@ -0,0 +1,45 @@
+package org.apache.axis.jaxrpc.handler.soap;
+
+import java.util.Iterator;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.JAXRPCException;
+import javax.xml.rpc.handler.soap.SOAPMessageContext;
+import javax.xml.soap.SOAPMessage;
+
+import org.apache.axis.jaxrpc.handler.MessageContextImpl;
+
+public class SOAPMessageContextImpl extends MessageContextImpl implements SOAPMessageContext {
+
+	private SOAPMessage message;
+	private String[] roles;
+	
+	
+	public SOAPMessage getMessage() {
+		
+		return message;
+	}
+
+	public void setMessage(SOAPMessage message) throws JAXRPCException,
+			UnsupportedOperationException {
+		this.message = message;
+	}
+
+	public Object[] getHeaders(QName header, JAXBContext context,
+			boolean allRoles) throws JAXRPCException {
+		// TODO 
+		return null;
+	}
+
+	public String[] getRoles() {
+		
+		return roles;
+	}
+	
+	public void setRoles(String[] roles){
+		
+		this.roles = roles;
+	}
+
+}