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/06/29 16:05:23 UTC
svn commit: r202378 - in
/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src:
javax/xml/rpc/handler/soap/ org/apache/axis/jaxrpc/
Author: ashutosh
Date: Wed Jun 29 07:05:22 2005
New Revision: 202378
URL: http://svn.apache.org/viewcvs?rev=202378&view=rev
Log:
Implementation of JAXRPCContext, BindingProvider and related files.
Added:
webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/javax/xml/rpc/handler/soap/SOAPMessageContext.java
webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/BindingProviderImpl.java
webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCContextImpl.java
webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCRequestContext.java
webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCResponseContext.java
Modified:
webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/ServiceFactoryImpl.java
Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/javax/xml/rpc/handler/soap/SOAPMessageContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/javax/xml/rpc/handler/soap/SOAPMessageContext.java?rev=202378&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/javax/xml/rpc/handler/soap/SOAPMessageContext.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/javax/xml/rpc/handler/soap/SOAPMessageContext.java Wed Jun 29 07:05:22 2005
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package javax.xml.rpc.handler.soap;
+
+import javax.xml.rpc.handler.MessageContext;
+import javax.xml.rpc.JAXRPCException;
+
+/**
+ * public interface SOAPMessageContext
+ * extends <code>MessageContext</code>
+ * <p>
+ * The interface javax.xml.rpc.handler.soap.SOAPMessageContext provides access to the SOAP message for either RPC
+ * request or response. The javax.xml.soap.SOAPMessage specifies the standard Java API for the representation of a SOAP
+ * 1.1 message with attachments.
+ * @version 1.0
+ * @author shaas02
+ * @see SOAPMessage
+ */
+public interface SOAPMessageContext extends MessageContext {
+
+ /**
+ * Gets the SOAPMessage from this message context. Modifications to the returned SOAPMessage change the message
+ * in-place, there is no need to susequently call setMessage.
+ * @return Returns the SOAPMessage; returns null if no SOAPMessage is present in this message context
+ */
+ javax.xml.soap.SOAPMessage getMessage();
+
+ /**
+ * Sets the SOAPMessage in this message context
+ * @param message - SOAP message
+ * @throws JAXRPCException - If any error during the setting of the SOAPMessage in this message context
+ * @throws java.lang.UnsupportedOperationException - If this operation is not supported
+ *
+ */
+ void setMessage(javax.xml.soap.SOAPMessage message) throws JAXRPCException, java.lang.UnsupportedOperationException;
+
+ /**
+ * Gets headers that have a particular qualified name from the message in the message context. Note that a SOAP message
+ * can contain multiple headers with the same qualified name.
+ * @param header - The XML qualified name of the SOAP header(s).
+ * @param context - The JAXBContext that should be used to unmarshall the header
+ * @param allRoles - If true then returns headers for all SOAP roles, if false then only returns headers targetted at the
+ * roles currently being played by this SOAP node, see getRoles.
+ * @return An array of unmarshalled headers; returns an empty array if no message is present in this message context or no
+ * headers match the supplied qualified name.
+ * @throws JAXRPCException - If an error occurs when using the supplied JAXBContext to unmarshall. The cause of the
+ * JAXRPCException is the original JAXBException.
+ */
+ java.lang.Object[] getHeaders(javax.xml.namespace.QName header,
+ javax.xml.bind.JAXBContext context,
+ boolean allRoles) throws JAXRPCException;
+
+ /**
+ * Gets the SOAP actor roles associated with an execution of the handler chain. Note that SOAP actor roles apply to the
+ * SOAP node and are managed using SOAPBinding.setRoles and SOAPBinding.getRoles. Handler instances in the
+ * handler chain use this information about the SOAP actor roles to process the SOAP header blocks. Note that the SOAP
+ * actor roles are invariant during the processing of SOAP message through the handler chain.
+ * @return Array of URIs for SOAP actor roles
+ * @see <code>SOAPBinding.setRoles(java.util.Set)</code> , <code>SOAPBinding.getRoles()</code>
+ */
+ java.lang.String[] getRoles();
+}
Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/BindingProviderImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/BindingProviderImpl.java?rev=202378&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/BindingProviderImpl.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/BindingProviderImpl.java Wed Jun 29 07:05:22 2005
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis.jaxrpc;
+
+import javax.xml.rpc.Binding;
+import javax.xml.rpc.BindingProvider;
+import javax.xml.rpc.JAXRPCContext;
+
+public class BindingProviderImpl implements BindingProvider {
+
+ protected JAXRPCRequestContext requestContext;
+ protected JAXRPCResponseContext responseContext;
+
+ public JAXRPCContext getRequestContext() {
+ if(requestContext == null)
+ requestContext = new JAXRPCRequestContext(this);
+ return requestContext;
+ }
+
+ public JAXRPCContext getResponseContext() {
+ if(responseContext == null)
+ responseContext = new JAXRPCResponseContext(this);
+ return null;
+ }
+
+ public Binding getBinding() {
+
+ return null;
+ }
+
+}
Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCContextImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCContextImpl.java?rev=202378&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCContextImpl.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCContextImpl.java Wed Jun 29 07:05:22 2005
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis.jaxrpc;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.rpc.BindingProvider;
+import javax.xml.rpc.JAXRPCContext;
+import javax.xml.rpc.JAXRPCException;
+
+public class JAXRPCContextImpl implements JAXRPCContext {
+
+ protected static List<String> standardProperties;
+ protected static Map properties;
+ protected Object associatedObject;
+
+ public JAXRPCContextImpl(BindingProvider provider){
+
+ associatedObject = provider;
+
+ properties = new HashMap();
+
+ standardProperties = new ArrayList();
+ standardProperties.add("javax.xml.rpc.binding.attachments");
+ standardProperties.add("javax.xml.rpc.wsdl.description");
+ standardProperties.add("javax.xml.rpc.wsdl.service");
+ standardProperties.add("javax.xml.rpc.wsdl.port");
+ standardProperties.add("javax.xml.rpc.wsdl.interface");
+ standardProperties.add("javax.xml.rpc.wsdl.operation");
+ }
+
+ public void setProperty(String name, Object value)
+ throws IllegalArgumentException {
+ validateProperty(name, value);
+ properties.put(name, value);
+ }
+
+ public void removeProperty(String name) throws IllegalArgumentException {
+ validateProperty(name, null);
+ properties.remove(name);
+ }
+
+ public Object getProperty(String name) throws IllegalArgumentException {
+ validateProperty(name, null);
+ return properties.get(name);
+ }
+
+ public Iterator getPropertyNames() {
+ if(properties != null)
+ return properties.keySet().iterator();
+ else
+ return null;
+ }
+
+ private void validateProperty(String name, Object value){
+ if(name == null)
+ throw new JAXRPCException("User-defined property name can not be null");
+ if(standardProperties.indexOf(name) == -1 && name.startsWith("javax.xml.rpc"))
+ throw new JAXRPCException("User-Defined property can not start with javax.ml.rpc");
+
+ }
+
+}
Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCRequestContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCRequestContext.java?rev=202378&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCRequestContext.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCRequestContext.java Wed Jun 29 07:05:22 2005
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis.jaxrpc;
+
+import javax.xml.rpc.BindingProvider;
+
+public class JAXRPCRequestContext extends JAXRPCContextImpl {
+
+ public JAXRPCRequestContext(BindingProvider provider){
+ super(provider);
+ }
+
+}
Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCResponseContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCResponseContext.java?rev=202378&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCResponseContext.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/JAXRPCResponseContext.java Wed Jun 29 07:05:22 2005
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis.jaxrpc;
+
+import javax.xml.rpc.BindingProvider;
+
+public class JAXRPCResponseContext extends JAXRPCContextImpl {
+
+ public JAXRPCResponseContext(BindingProvider provider){
+ super(provider);
+ }
+}
Modified: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/ServiceFactoryImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/ServiceFactoryImpl.java?rev=202378&r1=202377&r2=202378&view=diff
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/ServiceFactoryImpl.java (original)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/ServiceFactoryImpl.java Wed Jun 29 07:05:22 2005
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.apache.axis.jaxrpc;
import java.net.URL;