You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsrf-commits@ws.apache.org by ip...@apache.org on 2005/07/16 03:23:24 UTC

svn commit: r219275 [1/3] - in /webservices/wsrf/trunk: ./ jndi-config/ jndi-config/src/schema/ src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/ src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Dra...

Author: ips
Date: Fri Jul 15 18:23:20 2005
New Revision: 219275

URL: http://svn.apache.org/viewcvs?rev=219275&view=rev
Log:
upgraded to Axis 1.2.1 and fixed error in web.xml; removed ResourceKey class and all usages of it - resource identifiers are now simply represented as Objects; removed unused Globus impl classes from axis package


Added:
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/webapp/WsrfServer.java
    webservices/wsrf/trunk/src/site/cwiki_quickref.htm
    webservices/wsrf/trunk/src/webapp/images/wsrf-logo.jpg
      - copied unchanged from r219097, webservices/wsrf/trunk/src/webapp/images/apollo-logo.jpg
Removed:
    webservices/wsrf/trunk/README.html
    webservices/wsrf/trunk/cwiki_quickref.htm
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/ResourceKey.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/AnyHelper.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/AxisResourceKey.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/ContainerConfig.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/ObjectDeserializationContext.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/ObjectDeserializer.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/ObjectSerializer.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/ServiceHost.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceKey.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/SimpleTypeResourceKey.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/XmlBeanResourceKey.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/XmlStringResourceKey.java
    webservices/wsrf/trunk/src/webapp/images/apollo-logo.jpg
Modified:
    webservices/wsrf/trunk/jndi-config/project.xml
    webservices/wsrf/trunk/jndi-config/src/schema/jndi-schema.xsd
    webservices/wsrf/trunk/maven.xml
    webservices/wsrf/trunk/project.xml
    webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java
    webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/Filesystem_jndi-config.xml
    webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/JobPortHome.java
    webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/JobPort_jndi-config.xml
    webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterFactoryHome.java
    webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterFactory_jndi-config.xml
    webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterPortHome.java
    webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterPort_jndi-config.xml
    webservices/wsrf/trunk/src/examples/interop/src/test/org/oasisOpen/docs/wsrf/InteropTestCase.java
    webservices/wsrf/trunk/src/java/org/apache/ws/addressing/XmlBeansEndpointReference.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/AbstractPortType.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/ResourceContext.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/ResourceHome.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/ResourceHandler.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/AxisResourceContext.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/GenericAxisHandler.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/ResourceProvider.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceContext.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceHome.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/ResourceSweeper.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/v2004_06/porttype/impl/ImmediateResourceTerminationPortTypeImpl.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/v2004_06/porttype/impl/ScheduledResourceTerminationPortTypeImpl.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/v2004_11/porttype/impl/ImmediateResourceTerminationPortTypeImpl.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/lifetime/v2004_11/porttype/impl/ScheduledResourceTerminationPortTypeImpl.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/webapp/WsrfServletContextListener.java
    webservices/wsrf/trunk/src/java/org/apache/ws/util/jndi/DefaultParameters.java
    webservices/wsrf/trunk/src/java/org/apache/ws/util/jndi/JNDIUtils.java
    webservices/wsrf/trunk/src/java/org/apache/ws/util/jndi/XmlBeanJndiUtils.java
    webservices/wsrf/trunk/src/templates/jndi.vm
    webservices/wsrf/trunk/src/test/org/apache/ws/resource/metadataexchange/v2004_09/MetadataExchangePortTypeTest.java
    webservices/wsrf/trunk/src/test/org/apache/ws/resource/properties/SushiHome.java
    webservices/wsrf/trunk/src/test/org/apache/ws/resource/properties/SushiResourceContext.java
    webservices/wsrf/trunk/src/webapp/WEB-INF/classes/jndi-config.xml
    webservices/wsrf/trunk/src/webapp/WEB-INF/web.xml
    webservices/wsrf/trunk/src/webapp/index.html

Modified: webservices/wsrf/trunk/jndi-config/project.xml
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/jndi-config/project.xml?rev=219275&r1=219274&r2=219275&view=diff
==============================================================================
--- webservices/wsrf/trunk/jndi-config/project.xml (original)
+++ webservices/wsrf/trunk/jndi-config/project.xml Fri Jul 15 18:23:20 2005
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 
-<!-- WSRF JNDI-CONFIG Project Descriptor - defines Project Object Model (POM) -->
+<!-- WSRF JNDI-Config Project Descriptor - defines Project Object Model (POM) -->
 
 <!-- Schema for this file is at:    http://maven.apache.org/xsd/maven-project-3.0.0.xsd -->
 <!-- Reference for this file is at: http://maven.apache.org/reference/project-descriptor.html -->
@@ -9,7 +9,7 @@
          xsi:noNamespaceSchemaLocation="http://maven.apache.org/xsd/maven-project-3.0.0.xsd">
 
   <pomVersion>3</pomVersion>
-  <name>WSRF JNDI-Config XmlBean Generation</name>
+  <name>WSRF JNDI-Config</name>
   <id>wsrf-jndi-config</id>
   <groupId>wsrf</groupId>
   <currentVersion>SNAPSHOT</currentVersion>
@@ -52,7 +52,7 @@
     <dependency>
       <groupId>xmlbeans</groupId>
       <artifactId>xbean</artifactId>
-      <version>1.0.4</version>
+      <version>2.0.0</version>
       <url>http://xmlbeans.apache.org/</url>
       <properties>
         <license>ApacheLicense-2.0.txt</license>
@@ -60,18 +60,30 @@
         <usage>Needed for handling XML types in a platform agnostic way.</usage>
       </properties>
     </dependency>
+    
+    <dependency>
+      <groupId>xmlbeans</groupId>
+      <artifactId>xmlbeans-jsr173-api</artifactId>
+      <version>2.0-dev</version>
+      <url>http://xmlbeans.apache.org/</url>
+      <properties>
+        <license>ApacheLicense-2.0.txt</license>
+        <war.bundle>true</war.bundle>
+        <usage>Needed for handling XML types in a platform agnostic way.</usage>
+      </properties>
+    </dependency>           
 
     <dependency>
       <groupId>wsrf</groupId>
       <artifactId>wsa-xbeans</artifactId>
       <version>SNAPSHOT</version>
-      <url>http://ws.apache.org/ws-fx/wsrf/</url>
+      <url>http://ws.apache.org/wsrf/</url>
       <properties>
         <license>ApacheLicense-2.0.txt</license>
         <usage>XMLBeans for WSA spec types</usage>
         <war.bundle>true</war.bundle>
       </properties>
-    </dependency>    
+    </dependency>   
 
   </dependencies>
 

Modified: webservices/wsrf/trunk/jndi-config/src/schema/jndi-schema.xsd
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/jndi-config/src/schema/jndi-schema.xsd?rev=219275&r1=219274&r2=219275&view=diff
==============================================================================
--- webservices/wsrf/trunk/jndi-config/src/schema/jndi-schema.xsd (original)
+++ webservices/wsrf/trunk/jndi-config/src/schema/jndi-schema.xsd Fri Jul 15 18:23:20 2005
@@ -1,94 +1,108 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0"?>
+
 <xs:schema targetNamespace="http://www.apache.org/wsfx/wsrf/jndi/config" xmlns:tns="http://www.apache.org/wsfx/wsrf/jndi/config" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" elementFormDefault="qualified" attributeFormDefault="unqualified">
-      <xs:import namespace="http://schemas.xmlsoap.org/ws/2004/08/addressing" schemaLocation="../wsa/WS-Addressing-2004_08_10.xsd"/>
-	<xs:element name="global">
-		<xs:complexType>
-			<xs:sequence>
-				<xs:element ref="tns:resource" minOccurs="0" maxOccurs="unbounded"/>
-				<xs:element ref="tns:resourceLink" minOccurs="0" maxOccurs="unbounded"/>
-				<xs:element ref="tns:environment" minOccurs="0" maxOccurs="unbounded"/>
-				<xs:element ref="tns:service" minOccurs="0" maxOccurs="unbounded"/>
-			</xs:sequence>
-		</xs:complexType>
-	</xs:element>
-	<xs:element name="jndiConfig">
-		<xs:complexType>
-			<xs:sequence>
-				<xs:element ref="tns:global" minOccurs="0"/>
-				<xs:element ref="tns:service" minOccurs="0" maxOccurs="unbounded"/>
-			</xs:sequence>
-		</xs:complexType>
-	</xs:element>
-	<xs:element name="name" type="xs:string"/>
-	<xs:element name="parameter">
-		<xs:complexType>
-			<xs:sequence>
-				<xs:element ref="tns:name"/>
-				<xs:element ref="tns:value"/>
-			</xs:sequence>
-		</xs:complexType>
-	</xs:element>
-	<xs:element name="resource">
-		<xs:complexType>
-			<xs:choice>
-				<xs:element ref="tns:resourceParams"/>
-				<xs:element ref="tns:metadata-config"/>
-			</xs:choice>
-			<xs:attribute name="name" type="xs:string" use="required"/>
-			<xs:attribute name="type" type="xs:string" use="required"/>
-			<xs:attribute name="scope" type="xs:string"/>
-			<xs:attribute name="auth" type="xs:string"/>
-			<xs:attribute name="description" type="xs:string"/>
-		</xs:complexType>
-	</xs:element>
-      	<xs:element name="metadata-config">
-      		<xs:complexType>
-		    <xs:sequence>
-		    	<xs:element ref="tns:metadata" minOccurs="1" maxOccurs="unbounded"/>
-		    </xs:sequence>
-		</xs:complexType>
-	</xs:element>
-      	<xs:element name="metadata">
-      		<xs:complexType>
-		    <xs:choice>
-		      <xs:element  name="MetadataReferece" type="wsa:EndpointReferenceType"/>
-		      <xs:element name="Location" type="xs:string"/>
-		    </xs:choice>
-		    <xs:attribute name="Dialect" type="xs:anyURI" use="required"/>
-    		    <xs:attribute name="Identifier" type="xs:anyURI" use="optional"/>
-		</xs:complexType>
-	</xs:element>
-
-	<xs:element name="resourceLink">
-		<xs:complexType>
-			<xs:attribute name="name" type="xs:string" use="required"/>
-			<xs:attribute name="target" type="xs:string" use="required"/>
-		</xs:complexType>
-	</xs:element>
-	<xs:element name="resourceParams">
-		<xs:complexType>
-			<xs:sequence>
-				<xs:element ref="tns:parameter" maxOccurs="unbounded"/>
-			</xs:sequence>
-		</xs:complexType>
-	</xs:element>
-	<xs:element name="service">
-		<xs:complexType>
-			<xs:sequence>
-				<xs:element ref="tns:resourceLink" minOccurs="0" maxOccurs="unbounded"/>
-				<xs:element ref="tns:resource" minOccurs="0" maxOccurs="unbounded"/>
-				<xs:element ref="tns:environment" minOccurs="0" maxOccurs="unbounded"/>
-			</xs:sequence>
-			<xs:attribute name="name" type="xs:string" use="required"/>
-		</xs:complexType>
-	</xs:element>
-	<xs:element name="value" type="xs:string"/>
-	<xs:element name="environment">
-		<xs:complexType>
-			<xs:attribute name="name" type="xs:string" use="required"/>
-			<xs:attribute name="type" type="xs:string" use="required"/>
-			<xs:attribute name="value" type="xs:string" use="required"/>
-			<xs:attribute name="description" type="xs:string"/>
-		</xs:complexType>
-	</xs:element>
+  
+  <xs:import namespace="http://schemas.xmlsoap.org/ws/2004/08/addressing" schemaLocation="../wsa/WS-Addressing-2004_08_10.xsd"/>
+
+  <xs:element name="jndiConfig">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="tns:global" minOccurs="0"/>
+        <xs:element ref="tns:service" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  
+  <xs:element name="global">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="tns:resource" minOccurs="0" maxOccurs="unbounded"/>
+        <xs:element ref="tns:resourceLink" minOccurs="0" maxOccurs="unbounded"/>
+        <xs:element ref="tns:environment" minOccurs="0" maxOccurs="unbounded"/>
+        <xs:element ref="tns:service" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="service">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="tns:resourceLink" minOccurs="0" maxOccurs="unbounded"/>
+        <xs:element ref="tns:resource" minOccurs="0" maxOccurs="unbounded"/>
+        <xs:element ref="tns:environment" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+      <xs:attribute name="name" type="xs:string" use="required"/>
+    </xs:complexType>
+  </xs:element>
+      
+  <xs:element name="parameter">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="tns:name"/>
+        <xs:element ref="tns:value"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  
+  <xs:element name="resource">
+    <xs:complexType>
+      <xs:choice>
+        <xs:element ref="tns:resourceParams"/>
+        <xs:element ref="tns:metadataConfig"/>
+      </xs:choice>
+      <xs:attribute name="name" type="xs:string" use="required"/>
+      <xs:attribute name="type" type="xs:string" use="required"/>
+      <xs:attribute name="scope" type="xs:string"/>
+      <xs:attribute name="auth" type="xs:string"/>
+      <xs:attribute name="description" type="xs:string"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="resourceLink">
+    <xs:complexType>
+      <xs:attribute name="name" type="xs:string" use="required"/>
+      <xs:attribute name="target" type="xs:string" use="required"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="environment">
+    <xs:complexType>
+      <xs:attribute name="name" type="xs:string" use="required"/>
+      <xs:attribute name="type" type="xs:string" use="required"/>
+      <xs:attribute name="value" type="xs:string" use="required"/>
+      <xs:attribute name="description" type="xs:string"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="resourceParams">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="tns:parameter" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  
+  <xs:element name="metadataConfig">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="tns:metadata" minOccurs="1" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  
+  <xs:element name="metadata">
+    <xs:complexType>
+      <xs:choice>
+        <xs:element name="reference" type="wsa:EndpointReferenceType"/>
+        <xs:element name="location" type="xs:anyURI"/>
+      </xs:choice>
+      <xs:attribute name="dialect" type="xs:anyURI" use="required"/>
+      <xs:attribute name="identifier" type="xs:anyURI" use="optional"/>
+    </xs:complexType>
+  </xs:element>
+    
+  <xs:element name="name" type="xs:string"/>
+  
+  <xs:element name="value" type="xs:string"/>
+    
 </xs:schema>

Modified: webservices/wsrf/trunk/maven.xml
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/maven.xml?rev=219275&r1=219274&r2=219275&view=diff
==============================================================================
--- webservices/wsrf/trunk/maven.xml (original)
+++ webservices/wsrf/trunk/maven.xml Fri Jul 15 18:23:20 2005
@@ -151,17 +151,18 @@
     <echo>Extracting WSDLs from ${wsdljar} to ${spec.wsdl.dest.dir} ...</echo>
     <mkdir dir="${maven.build.dir}/temp-wsdl" />
     <mkdir dir="${spec.wsdl.dest.dir}" />   
+    <j:set var="temp.wsdl.dir" value="${maven.build.dir}/temp-wsdl" /> 
     <unzip src="${wsdljar}"
-           dest="${maven.build.dir}/temp-wsdl">
+           dest="${temp.wsdl.dir}">
       <patternset>
-        <include name="**/*.wsdl"/>
-        <include name="**/*.xsd"/>
+        <include name="**/*.wsdl" />
+        <include name="**/*.xsd" />
       </patternset>
     </unzip>
     <copy todir="${spec.wsdl.dest.dir}">
-      <fileset dir="${maven.build.dir}/temp-wsdl/schema/src" />         	
+      <fileset dir="${temp.wsdl.dir}/schemaorg_apache_xmlbeans/src" />         	
     </copy>
-    <delete dir="${maven.build.dir}/temp-wsdl" />
+    <delete dir="${temp.wsdl.dir}" />
   </goal>
 
   <goal name="deploy">
@@ -172,33 +173,51 @@
   <!-- ================================================================== -->
   <!-- D I S T : P R E P A R E - B I N - F I L E S Y S T E M              -->
   <!-- P O S T - G O A L                                                  -->
+  <!-- Copy the following from src/ into the binary dist dir:             -->
+  <!-- docs/, examples/, template/, and webapps/wsrf/                     -->  
   <!-- ================================================================== -->
   <postGoal name="dist:prepare-bin-filesystem">
 
+    <attainGoal name="war:webapp" />
+    <attainGoal name="website" />    
+    
     <!-- Delete the WSRF jar that dist:prepare-bin-filesystem placed in the dist dir. -->
     <delete file="${maven.dist.bin.assembly.dir}/${maven.final.name}.jar" />
 
-    <attainGoal name="war:webapp" />
-    <mkdir dir="${maven.dist.bin.assembly.dir}/webapps/${webapp.name}" />    
-    <copy todir="${maven.dist.bin.assembly.dir}/webapps/${webapp.name}">
-      <fileset dir="${maven.war.webapp.dir}" />
-    </copy>        
+    <copy todir="${maven.dist.bin.assembly.dir}">
+      <fileset dir="${basedir}">
+        <include name="README*" />
+      </fileset>
+    </copy>
 
-    <attainGoal name="website" />    
     <property name="docs.assembly.dir" location="${maven.dist.bin.assembly.dir}/docs" />
     <delete dir="${docs.assembly.dir}" />
     <mkdir dir="${docs.assembly.dir}" />
     <copy todir="${docs.assembly.dir}">
       <fileset dir="${site.dest.dir}" />
     </copy>
-    
 
-    <copy todir="${maven.dist.bin.assembly.dir}">
-      <fileset dir="${basedir}">
-        <include name="README.html" />
-      </fileset>
+    <property name="examples.assembly.dir" location="${maven.dist.bin.assembly.dir}/examples" />
+    <delete dir="${examples.assembly.dir}" />
+    <mkdir dir="${examples.assembly.dir}" />
+    <copy todir="${examples.assembly.dir}">
+      <fileset dir="${maven.src.dir}/examples" />
     </copy>
 
+    <property name="template.assembly.dir" location="${maven.dist.bin.assembly.dir}/template" />
+    <delete dir="${template.assembly.dir}" />
+    <mkdir dir="${template.assembly.dir}" />
+    <copy todir="${template.assembly.dir}">
+      <fileset dir="${maven.src.dir}/template" />
+    </copy>
+       
+    <property name="webapp.assembly.dir" location="${maven.dist.bin.assembly.dir}/webapps/${webapp.name}" />
+    <delete dir="${webapp.assembly.dir}" />
+    <mkdir dir="${webapp.assembly.dir}" />    
+    <copy todir="${webapp.assembly.dir}">
+      <fileset dir="${maven.war.webapp.dir}" />
+    </copy>        
+    
   </postGoal>
 
   <!-- ================================================================== -->
@@ -209,8 +228,6 @@
     <!-- delete the target dir before a dist -->
   	<attainGoal name="clean:clean"/>
   </preGoal>
-
-
 
   <!-- ================================================================== -->
   <!-- D I S T : P R E P A R E - S R C - F I L E S Y S T E M              -->

Modified: webservices/wsrf/trunk/project.xml
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/project.xml?rev=219275&r1=219274&r2=219275&view=diff
==============================================================================
--- webservices/wsrf/trunk/project.xml (original)
+++ webservices/wsrf/trunk/project.xml Fri Jul 15 18:23:20 2005
@@ -100,45 +100,9 @@
     </dependency>
 
     <dependency>
-      <groupId>wsrf</groupId>
-      <artifactId>wsa-xbeans</artifactId>
-      <version>SNAPSHOT</version>
-      <url>http://ws.apache.org/ws-fx/wsrf/</url>
-      <properties>
-        <license>ApacheLicense-2.0.txt</license>
-        <usage>Needed for handling requests. This contains the XmlBeans-generated code from the WSA WSDLs/XSDs. This "could" be eliminated and generated on the fly, but it would make the builds longer.</usage>
-        <war.bundle>true</war.bundle>
-      </properties>
-    </dependency>
-
-    <dependency>
-      <groupId>wsrf</groupId>
-      <artifactId>wsrf-xbeans</artifactId>
-      <version>SNAPSHOT</version>
-      <url>http://ws.apache.org/ws-fx/wsrf/</url>
-      <properties>
-        <license>ApacheLicense-2.0.txt</license>
-        <usage>Needed for handling requests. This contains the XmlBeans-generated code from the WSRF WSDLs/XSDs. This "could" be eliminated and generated on the fly, but it would make the builds longer.</usage>
-        <war.bundle>true</war.bundle>
-      </properties>
-    </dependency>
-
-    <dependency>
-      <groupId>wsrf</groupId>
-      <artifactId>wsrf-jndi-config</artifactId>
-      <version>SNAPSHOT</version>
-      <url>http://ws.apache.org/ws-fx/wsrf/</url>
-      <properties>
-        <license>ApacheLicense-2.0.txt</license>
-        <war.bundle>true</war.bundle>
-        <usage>Needed for handling our JNDI XML config file via XmlBeans. This "could" be removed, but then we'd probably replace it with commons-config.  The reason we avoided that approach is that we leveredge XmlBeans extensively in our codebase.</usage>
-      </properties>
-    </dependency>
-
-    <dependency>
       <groupId>axis</groupId>
       <artifactId>axis</artifactId>
-      <version>1.2</version>
+      <version>1.2.1</version>
       <url>http://ws.apache.org/axis/</url>
       <properties>
         <license>ApacheLicense-2.0.txt</license>
@@ -150,7 +114,7 @@
     <dependency>
       <groupId>axis</groupId>
       <artifactId>axis-jaxrpc</artifactId>
-      <version>1.2</version>
+      <version>1.2.1</version>
       <url>http://ws.apache.org/axis/</url>
       <properties>
         <license>BinaryCodeLicense-JaxRpcApi.txt</license>
@@ -162,7 +126,7 @@
     <dependency>
       <groupId>axis</groupId>
       <artifactId>axis-saaj</artifactId>
-      <version>1.2</version>
+      <version>1.2.1</version>
       <url>http://ws.apache.org/axis/</url>
       <properties>
         <license>BinaryCodeLicense-SaajApi.txt</license>
@@ -172,18 +136,6 @@
     </dependency>
 
     <dependency>
-      <groupId>wsrf</groupId>
-      <artifactId>commonj-twm-api</artifactId>
-      <version>1.1</version>
-      <url>http://dev2dev.bea.com/technologies/commonj/twm/</url>
-      <properties>
-        <license>ApacheLicense-2.0.txt</license>
-        <usage>Timer APIs used for scheduled resource termination</usage>
-        <war.bundle>true</war.bundle>
-      </properties>
-    </dependency>
-
-    <dependency>
       <groupId>commons-cli</groupId>
       <artifactId>commons-cli</artifactId>
       <version>1.0</version>
@@ -398,6 +350,54 @@
         <license>CommonPublicLicense-1.0.txt</license>
         <war.bundle>true</war.bundle>
         <usage>Needed for working with WSDL files as objects.</usage>
+      </properties>
+    </dependency>
+
+    <dependency>
+      <groupId>wsrf</groupId>
+      <artifactId>commonj-twm-api</artifactId>
+      <version>1.1</version>
+      <url>http://dev2dev.bea.com/technologies/commonj/twm/</url>
+      <properties>
+        <license>ApacheLicense-2.0.txt</license>
+        <usage>Timer APIs used for scheduled resource termination</usage>
+        <war.bundle>true</war.bundle>
+      </properties>
+    </dependency>
+
+    <dependency>
+      <groupId>wsrf</groupId>
+      <artifactId>wsa-xbeans</artifactId>
+      <version>SNAPSHOT</version>
+      <url>http://ws.apache.org/ws-fx/wsrf/</url>
+      <properties>
+        <license>ApacheLicense-2.0.txt</license>
+        <usage>Needed for handling requests. This contains the XmlBeans-generated code from the WSA WSDLs/XSDs. This "could" be eliminated and generated on the fly, but it would make the builds longer.</usage>
+        <war.bundle>true</war.bundle>
+      </properties>
+    </dependency>
+
+    <dependency>
+      <groupId>wsrf</groupId>
+      <artifactId>wsrf-xbeans</artifactId>
+      <version>SNAPSHOT</version>
+      <url>http://ws.apache.org/ws-fx/wsrf/</url>
+      <properties>
+        <license>ApacheLicense-2.0.txt</license>
+        <usage>Needed for handling requests. This contains the XmlBeans-generated code from the WSRF WSDLs/XSDs. This "could" be eliminated and generated on the fly, but it would make the builds longer.</usage>
+        <war.bundle>true</war.bundle>
+      </properties>
+    </dependency>
+
+    <dependency>
+      <groupId>wsrf</groupId>
+      <artifactId>wsrf-jndi-config</artifactId>
+      <version>SNAPSHOT</version>
+      <url>http://ws.apache.org/ws-fx/wsrf/</url>
+      <properties>
+        <license>ApacheLicense-2.0.txt</license>
+        <war.bundle>true</war.bundle>
+        <usage>Needed for handling our JNDI XML config file via XmlBeans. This "could" be removed, but then we'd probably replace it with commons-config.  The reason we avoided that approach is that we leveredge XmlBeans extensively in our codebase.</usage>
       </properties>
     </dependency>
 

Modified: webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java?rev=219275&r1=219274&r2=219275&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java (original)
+++ webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java Fri Jul 15 18:23:20 2005
@@ -151,7 +151,7 @@
         return PORT_NAME;
     }
 
-    public QName getResourceKeyNameQName()
+    public QName getResourceIdentifierReferenceParameterQName()
     {
         return RESOURCE_KEY_NAME;
     }

Modified: webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/Filesystem_jndi-config.xml
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/Filesystem_jndi-config.xml?rev=219275&r1=219274&r2=219275&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/Filesystem_jndi-config.xml (original)
+++ webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/Filesystem_jndi-config.xml Fri Jul 15 18:23:20 2005
@@ -18,14 +18,11 @@
             <parameter>
                <name>wsdlTargetNamespace</name>
                <value>http://ws.apache.org/resource/example/filesystem</value>
-            </parameter>
-            
+            </parameter>            
             <parameter>
-               <name>resourceKeyName</name>
+               <name>resourceIdentifierReferenceParameterName</name>
                <value>{http://ws.apache.org/resource/example/filesystem}ResourceIdentifier</value>
-            </parameter>
-            
-
+            </parameter>            
          </resourceParams>
       </resource>
    </service>

Modified: webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/JobPortHome.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/JobPortHome.java?rev=219275&r1=219274&r2=219275&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/JobPortHome.java (original)
+++ webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/JobPortHome.java Fri Jul 15 18:23:20 2005
@@ -182,7 +182,7 @@
         return SERVICE_NAME;
     }
 
-    public QName getResourceKeyNameQName()
+    public QName getResourceIdentifierReferenceParameterQName()
     {
         return QName.valueOf("{http://docs.oasis-open.org/wsrf/2005/01/wsrf-Interop-2.0-draft-03.wsdl}ResourceID");
     }

Modified: webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/JobPort_jndi-config.xml
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/JobPort_jndi-config.xml?rev=219275&r1=219274&r2=219275&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/JobPort_jndi-config.xml (original)
+++ webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/JobPort_jndi-config.xml Fri Jul 15 18:23:20 2005
@@ -16,13 +16,12 @@
             <parameter>
                <name>wsdlTargetNamespace</name>
                <value>http://docs.oasis-open.org/wsrf/2005/01/wsrf-Interop-2.0-draft-03.wsdl</value>
-            </parameter>
-            
-                        <parameter>
-               <name>resourceKeyName</name>
+            </parameter>            
+            <parameter>
+               <name>resourceIdentifierReferenceParameterName</name>
                <value>{http://docs.oasis-open.org/wsrf/2005/01/wsrf-Interop-2.0-draft-03.wsdl}ResourceID</value>
             </parameter>
-                     </resourceParams>
+         </resourceParams>
       </resource>
    </service>
 

Modified: webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterFactoryHome.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterFactoryHome.java?rev=219275&r1=219274&r2=219275&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterFactoryHome.java (original)
+++ webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterFactoryHome.java Fri Jul 15 18:23:20 2005
@@ -72,7 +72,7 @@
         return "PrinterFactory";
     }
 
-    public QName getResourceKeyNameQName()
+    public QName getResourceIdentifierReferenceParameterQName()
     {
         return null;
     }

Modified: webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterFactory_jndi-config.xml
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterFactory_jndi-config.xml?rev=219275&r1=219274&r2=219275&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterFactory_jndi-config.xml (original)
+++ webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterFactory_jndi-config.xml Fri Jul 15 18:23:20 2005
@@ -16,9 +16,8 @@
             <parameter>
                <name>wsdlTargetNamespace</name>
                <value>http://docs.oasis-open.org/wsrf/2005/01/wsrf-Interop-2.0-draft-03.wsdl</value>
-            </parameter>
-                
-            </resourceParams>
+            </parameter>                
+         </resourceParams>
       </resource>
    </service>
 

Modified: webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterPortHome.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterPortHome.java?rev=219275&r1=219274&r2=219275&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterPortHome.java (original)
+++ webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterPortHome.java Fri Jul 15 18:23:20 2005
@@ -142,7 +142,7 @@
         return "PrinterPort";
     }
 
-    public QName getResourceKeyNameQName()
+    public QName getResourceIdentifierReferenceParameterQName()
     {
         return new QName("{http://docs.oasis-open.org/wsrf/2005/01/wsrf-Interop-2.0-draft-03.wsdl}ResourceID");
     }

Modified: webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterPort_jndi-config.xml
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterPort_jndi-config.xml?rev=219275&r1=219274&r2=219275&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterPort_jndi-config.xml (original)
+++ webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterPort_jndi-config.xml Fri Jul 15 18:23:20 2005
@@ -17,11 +17,11 @@
                <name>wsdlTargetNamespace</name>
                <value>http://docs.oasis-open.org/wsrf/2005/01/wsrf-Interop-2.0-draft-03.wsdl</value>
             </parameter>
-                          <parameter>
-               <name>resourceKeyName</name>
+            <parameter>
+               <name>resourceIdentifierReferenceParameterName</name>
                <value>{http://docs.oasis-open.org/wsrf/2005/01/wsrf-Interop-2.0-draft-03.wsdl}ResourceID</value>
             </parameter> 
-                     </resourceParams>
+         </resourceParams>
       </resource>
    </service>
 

Modified: webservices/wsrf/trunk/src/examples/interop/src/test/org/oasisOpen/docs/wsrf/InteropTestCase.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/interop/src/test/org/oasisOpen/docs/wsrf/InteropTestCase.java?rev=219275&r1=219274&r2=219275&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/examples/interop/src/test/org/oasisOpen/docs/wsrf/InteropTestCase.java (original)
+++ webservices/wsrf/trunk/src/examples/interop/src/test/org/oasisOpen/docs/wsrf/InteropTestCase.java Fri Jul 15 18:23:20 2005
@@ -90,7 +90,7 @@
             //reinit urls for axis path
             m_printerFactoryURL = m_baseURL + PRINTER_FACTORY_PORT;
             //init jndi from config
-            XmlBeanJndiUtils.initializeFromInputStream(Thread.currentThread().getContextClassLoader().getResourceAsStream(XmlBeanJndiUtils.JNDI_CONFIG_FILENAME));
+            XmlBeanJndiUtils.initFromInputStream(Thread.currentThread().getContextClassLoader().getResourceAsStream(XmlBeanJndiUtils.JNDI_CONFIG_FILENAME));
         }
 
         //init the printer so its ready

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/addressing/XmlBeansEndpointReference.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/addressing/XmlBeansEndpointReference.java?rev=219275&r1=219274&r2=219275&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/addressing/XmlBeansEndpointReference.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/addressing/XmlBeansEndpointReference.java Fri Jul 15 18:23:20 2005
@@ -16,7 +16,6 @@
 package org.apache.ws.addressing;
 
 import org.apache.ws.XmlObjectWrapper;
-import org.apache.ws.resource.ResourceKey;
 import org.apache.ws.util.XmlBeanUtils;
 import org.apache.xmlbeans.XmlObject;
 import org.xmlsoap.schemas.ws.x2003.x03.addressing.AttributedQName;
@@ -47,10 +46,11 @@
    private QName     m_portTypeQName;
    private String    m_servicePortName;
    private QName     m_serviceQName;
-   private Object[]    m_referenceProps;
-   private String m_addressingVersionURI;
+   private Object[]  m_referenceProps;
+   private String   m_addressingVersionURI;
    private Object[] m_referenceParameters;
-   private ResourceKey m_resourceKey;
+   private Object   m_resourceId;
+   private QName m_resourceIdRefParamName;
 
     /**
      * Constructs an EPR (and the underlying XmlObject representation) given the params.
@@ -253,10 +253,10 @@
             addToProperties(referencePropertiesType, m_referenceProps);
         }
 
-        if(m_resourceKey != null)
+        if(m_resourceId != null)
         {
-            XmlObject resourceKey = XmlBeanUtils.addChildElement(referencePropertiesType, m_resourceKey.getName());
-            XmlBeanUtils.setValue(resourceKey, (String)m_resourceKey.getValue());
+            XmlObject resourceKey = XmlBeanUtils.addChildElement(referencePropertiesType, m_resourceIdRefParamName);
+            XmlBeanUtils.setValue(resourceKey, String.valueOf( m_resourceId ));
         }
 
         return endpointReferenceType;
@@ -286,10 +286,10 @@
           addToProperties(referencePropertiesType, m_referenceProps);
         }
 
-        if(m_resourceKey != null)
+        if(m_resourceId != null)
         {
-            XmlObject resourceKey = XmlBeanUtils.addChildElement(referencePropertiesType, m_resourceKey.getName());
-            XmlBeanUtils.setValue(resourceKey, (String)m_resourceKey.getValue());
+            XmlObject resourceKey = XmlBeanUtils.addChildElement(referencePropertiesType, m_resourceIdRefParamName);
+            XmlBeanUtils.setValue(resourceKey, (String.valueOf( m_resourceId ) ));
         }
 
         if(m_referenceParameters != null)
@@ -345,11 +345,21 @@
     /**
      * Adds the ResourceKey which will be added to the ReferenceProperties
      *
-     * @param resourceKey
+     * @param resourceId
      */
-    public void setResourceKey(ResourceKey resourceKey)
+    public void setResourceIdentifier(Object resourceId)
     {
-        m_resourceKey = resourceKey;
+        m_resourceId = resourceId;
+    }
+
+    /**
+     * Adds the ResourceKey which will be added to the ReferenceProperties
+     *
+     * @param name
+     */
+    public void setResourceIdentifierReferenceParameterName(QName name)
+    {
+        m_resourceIdRefParamName = name;
     }
 
 

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/AbstractPortType.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/AbstractPortType.java?rev=219275&r1=219274&r2=219275&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/AbstractPortType.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/AbstractPortType.java Fri Jul 15 18:23:20 2005
@@ -17,9 +17,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.ws.resource.i18n.Keys;
 import org.apache.ws.resource.i18n.MessagesImpl;
-import org.apache.ws.resource.impl.AbstractResourceHome;
 import org.apache.ws.resource.properties.NamespaceVersionHolder;
 import org.apache.ws.util.i18n.Messages;
 
@@ -35,8 +33,6 @@
     public static final Messages MSG = MessagesImpl.getInstance();
 
     private ResourceContext m_resourceContext;
-    private ResourceHome m_resourceHome;
-    private ResourceKey m_resourceKey;
     private Resource m_resource;
 
     /**
@@ -49,11 +45,7 @@
         m_resourceContext = resourceContext;        
         try
         {
-            m_resourceHome = (AbstractResourceHome) getResourceContext().getResourceHome();
-            m_resourceKey = getResourceContext().getResourceKey();
-            LOG.debug( MSG.getMessage( Keys.PORTTYPE_RECEIVED_REQUEST, m_resourceContext.getServiceName(),
-                    String.valueOf( m_resourceKey ) ) );
-            m_resource = ( (ResourceHome) m_resourceHome ).getInstance( m_resourceContext );
+            m_resource = m_resourceContext.getResource();
         }
         catch ( ResourceUnknownException rue )
         {
@@ -83,26 +75,6 @@
     public ResourceContext getResourceContext()
     {
         return m_resourceContext;
-    }
-
-    /**
-     * DOCUMENT_ME
-     *
-     * @return DOCUMENT_ME
-     */
-    public ResourceHome getResourceHome()
-    {
-        return m_resourceHome;
-    }
-
-    /**
-     * DOCUMENT_ME
-     *
-     * @return DOCUMENT_ME
-     */
-    public ResourceKey getResourceKey()
-    {
-        return m_resourceKey;
     }
 
     protected abstract NamespaceVersionHolder getNamespaceSet();

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/ResourceContext.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/ResourceContext.java?rev=219275&r1=219274&r2=219275&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/ResourceContext.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/ResourceContext.java Fri Jul 15 18:23:20 2005
@@ -15,19 +15,17 @@
  *=============================================================================*/
 package org.apache.ws.resource;
 
-import org.apache.ws.resource.faults.ResourceKeyHeaderNotFoundFaultException;
-
-import javax.xml.namespace.QName;
 import javax.xml.rpc.handler.soap.SOAPMessageContext;
-import javax.xml.soap.SOAPHeaderElement;
 import javax.xml.soap.SOAPMessage;
 import java.net.URL;
 import java.util.Iterator;
 
 /**
- * <code>ResourceContext</code> wraps around a {@link SOAPMessageContext SOAPMessageContext} and provides convenience
- * functions for obtaining {@link ResourceKey ResourceKey}, {@link ResourceHome ResourceHome}, and resource objects
+ * <code>ResourceContext</code> wraps around a {@link SOAPMessageContext SOAPMessageContext} and provides
+ * methods for obtaining the {@link ResourceHome} and {@link Resource} objects
  * associated with the given SOAP message (referenced in <code>SOAPMessageContext</code>).
+ *
+ * TODO: make this an interface instead of an abstract class
  */
 public abstract class ResourceContext
 {
@@ -70,49 +68,8 @@
     * Gets <code>ResourceHome</code> associated with the service.
     *
     * @return <code>ResourceHome</code> associated with the service. Cannot be null.
-    *
-    * @throws NoResourceHomeException  if <code>ResourceHome</code> is not configured for the specified service.
-    * @throws ResourceContextException if any other error.
-    */
-   public abstract ResourceHome getResourceHome(  )
-   throws ResourceContextException;
-
-   /**
-    * Gets <code>ResourceKey</code> of a given name and type.
-    *
-    * @return <code>ResourceKey</code> of the given type and name. Returns null if the key of the specified name was not
-    *         found in the message.
-    *
-    * @throws ResourceContextException if error occurs during lookup.
     */
-   public abstract ResourceKey getResourceKey( QName keyName,
-                                               Class keyClass )
-   throws ResourceContextException, 
-          ResourceKeyHeaderNotFoundFaultException;
-
-   /**
-    * Gets <code>SOAPHeaderElement</code> that contains the resource key for the service using <code>ResourceHome</code>
-    * lookup.
-    *
-    * @return The <code>SOAPHeaderElement</code> that contains the resource key for the service. Returns null if one not
-    *         found.
-    *
-    * @throws ResourceContextException if error occurs during lookup.
-    * @see #getResourceHome()
-    */
-   public abstract SOAPHeaderElement getResourceKeyHeader(  )
-   throws ResourceContextException;
-
-   /**
-    * Gets <code>SOAPHeaderElement</code> of the specified name that contains the resource key.
-    *
-    * @return The <code>SOAPHeaderElement</code> that contains the resource key of the given name. Returns null if one
-    *         not found.
-    *
-    * @throws ResourceContextException if error occurs during lookup.
-    */
-   public abstract SOAPHeaderElement getResourceKeyHeader( QName keyName )
-   throws ResourceContextException;
+   public abstract ResourceHome getResourceHome(  );
 
    /**
     * DOCUMENT_ME
@@ -128,21 +85,9 @@
     */
    public static ResourceContext getResourceContext( SOAPMessageContext soapMsgContext )
    {
-      // TODO: return ResourceContext impl based using configurable factory.
+      // TODO: return ResourceContext impl using configurable factory.
       return null;
    }
-
-   /**
-    * Gets <code>ResourceKey</code> instance using <code>ResourceHome</code> lookup.
-    *
-    * @return <code>ResourceKey</code> of name and type associated with the target service' <code>ResourceHome</code>.
-    *         Returns null if key is not found in the message.
-    *
-    * @throws ResourceContextException if error occurs during lookup.
-    * @see #getResourceHome()
-    */
-   public abstract ResourceKey getResourceKey(  )
-   throws ResourceContextException;
 
    /**
     * Gets path of the service.

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/ResourceHome.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/ResourceHome.java?rev=219275&r1=219274&r2=219275&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/ResourceHome.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/ResourceHome.java Fri Jul 15 18:23:20 2005
@@ -18,28 +18,23 @@
 import org.apache.ws.addressing.EndpointReference;
 
 /**
- * Defines a basic interface through which resources are discovered, and removed. The purpose of
+ * Defines a basic interface through which resources are discovered and removed. The purpose of
  * <code>ResourceHome</code> is to interact with a collection of resources of the same type. Each resource type will
  * have its own custom implementation the <code>ResourceHome</code> interface. The implementation is expected to provide
  * custom methods for creating new resources and optionally methods that act on a set of resource objects.
  */
 public interface ResourceHome extends ResourceCreation, ResourceDestruction
 {
-    /**
-     * The resource key type. The <code>ResourceKey</code> used or passed to this <code>ResourceHome</code> must have
-     * match this type (corresponds to {@link ResourceKey#getValue() ResourceKey.getValue()}).
-     *
-     * @return the type of the key.
-     */
-    String getResourceKeyClassName();
 
     /**
-     * The name of the resource key. The <code>ResourceKey</code> used or passed to this <code>ResourceHome</code> must
-     * have match this name (corresponds to {@link ResourceKey#getName() ResourceKey.getName()}).
+     * Gets the name of the SOAP header element from which this home will extract
+     * a resource identifier.
      *
-     * @return the name of the key.
+     * @return the resource identifier header element name, represented as
+     *         a string as defined by {@link javax.xml.namespace.QName#toString()};
+     *         or null if this home manages a singleton resource
      */
-    String getResourceKeyName();
+    String getResourceIdentifierReferenceParameterName();
 
     /**
      * Sets the classname of the Resource Impl.
@@ -56,18 +51,14 @@
     String getResourceClassName();
 
     /**
-     * Sets the Class of the ResourceKey Impl
-     *
-     * @param className The class name of the ResourceKey impl
-     */
-    void setResourceKeyClassName( String className );
-
-    /**
-     * Sets the ResourceKey QName as a String value. (i.e. QName.toString()... i.e.  {http://...}ResourceId
+     * Sets the name of the SOAP header element from which this home will extract
+     * a resource identifier. Set to null if this home manages a singleton resource.
      *
-     * @param keyName The QName.toString() representation of the ResourceKey
+     * @param name resource identifier header element name, represented as
+     *             a string as defined by {@link javax.xml.namespace.QName#toString()}
+     *             (e.g. "{http://http://ws.apache.org/namespaces/wsrf/}ResourceIdentifier")
      */
-    void setResourceKeyName( String keyName );
+    void setResourceIdentifierReferenceParameterName( String name );
 
     /**
      * Sets the Service Impl's .Class
@@ -98,8 +89,11 @@
     String getWsdlTargetNamespace();
 
     /**
-     * Retrives a resource. <b>Note:</b> This function must not return null. It must return the resource object or throw
-     * an exception if there is no resource with the specified key.
+     * Retrieves a resource. <b>Note:</b> This function must not return null. It must
+     * either return the resource object or throw an exception if there is no resource
+     * with the specified identifier.
+     *
+     * @param resourceId a resource identifier
      *
      * @return non-null resource
      *
@@ -107,22 +101,22 @@
      * @throws InvalidResourceKeyException if the resource key is invalid.
      * @throws ResourceException           if any other error occurs.
      */
-    Resource find( ResourceKey key )
+    Resource find( Object resourceId )
             throws
             ResourceUnknownException,
             InvalidResourceKeyException,
             ResourceException;
 
     /**
-     * Removes a resource. If the resource implements the {@link RemoveCallback RemoveCallback} interface, the
-     * implementation must invoke the remove() operation on the resource itself.
+     * Removes a resource. Invokes the resource's {@link Resource#destroy()} method
+     * prior to removal.
      *
      * @throws ResourceUnknownException    if no resource exists with the given key
      * @throws InvalidResourceKeyException if the resource key is invalid.
      * @throws RemoveNotSupportedException if remove operation is not supported.
      * @throws ResourceException           if any other error occurs.
      */
-    void remove( ResourceKey key )
+    void remove( Object resourceId )
             throws ResourceException,
             ResourceUnknownException,
             InvalidResourceKeyException,
@@ -147,11 +141,23 @@
      * namespace URI.
      * 
      * @param endpointAddress
-     * @param key
+     * @param resourceId
      * @param wsAddressingURI
+     *
      * @return  An EndpointReference
      */
     // TODO: should this be moved to a static utility method?
-    EndpointReference getEndpointReference( String endpointAddress, ResourceKey key, String wsAddressingURI );
+    EndpointReference getEndpointReference( String endpointAddress, Object resourceId, String wsAddressingURI );
+
+    /**
+     * Extracts the resource identifier from the specified resource context -
+     * typically, this is done by deserializing a particular SOAP header
+     * element that contains the identifier.
+     *
+     * @param context a resource context
+     *
+     * @return the resource identifier
+     */
+    Object extractResourceIdentifier( ResourceContext context );
 
 }

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/ResourceHandler.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/ResourceHandler.java?rev=219275&r1=219274&r2=219275&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/ResourceHandler.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/ResourceHandler.java Fri Jul 15 18:23:20 2005
@@ -244,7 +244,8 @@
      *
      * @return a ResourceContext for this request
      */
-    protected abstract ResourceContext createResourceContext( SOAPMessageContext soapMsgContext );
+    protected abstract ResourceContext createResourceContext( SOAPMessageContext soapMsgContext )
+            throws ResourceContextException;
 
     /**
      * DOCUMENT_ME

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/AxisResourceContext.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/AxisResourceContext.java?rev=219275&r1=219274&r2=219275&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/AxisResourceContext.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/AxisResourceContext.java Fri Jul 15 18:23:20 2005
@@ -19,7 +19,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.ws.resource.ResourceContextException;
-import org.apache.ws.resource.handler.ResourceHandler;
 import org.apache.ws.resource.i18n.Keys;
 import org.apache.ws.resource.i18n.MessagesImpl;
 import org.apache.ws.resource.impl.AbstractResourceContext;
@@ -33,34 +32,27 @@
 import java.util.Iterator;
 
 /**
- * LOG-DONE
  * Axis version of a ResourceContext.
  *
  * @author Sal Campana
+ * @author Ian Springer
  */
 public class AxisResourceContext
    extends AbstractResourceContext
 {
-   /**
-    * DOCUMENT_ME
-    */
+
    private static final Log LOG = LogFactory.getLog( AxisResourceContext.class.getName(  ) );
-   public static final Messages MSG = MessagesImpl.getInstance();
-   /**
-    * DOCUMENT_ME
-    */
-   private final String DEFAULT_RESOURCE_KEY_NAME = "ResourceId";
+   private static final Messages MSG = MessagesImpl.getInstance();
 
    /**
     * Creates a new {@link AxisResourceContext} object.
     *
     * @param msgContext SOAPMessageContext
     */
-   public AxisResourceContext( SOAPMessageContext msgContext )
+   public AxisResourceContext( SOAPMessageContext msgContext ) throws ResourceContextException
    {
       super( msgContext );
-      mergeServiceOptions( msgContext );
-      setResourceIdKeyInformation(  );
+      importServiceOptions( msgContext );
    }
 
    /**
@@ -105,42 +97,7 @@
       }
    }
 
-   private void setResourceIdKeyInformation(  )
-   {
-      String keyClassName   = null;
-      Class  keyClass       = null;
-      String keyQNameString = null;
-      try
-      {
-         keyClassName      = getResourceHome(  ).getResourceKeyClassName(  );
-         keyClass          = Class.forName( keyClassName );
-         keyQNameString    = (String) getResourceHome(  ).getResourceKeyName(  );
-      }
-      catch ( ResourceContextException rce )
-      {
-         LOG.debug(MSG.getMessage(Keys.EXCEPTION_GETTING_HOME,rce));
-         rce.printStackTrace( );
-         //todo throw exception.....???
-      }
-      catch ( ClassNotFoundException cnfe )
-      {
-         LOG.debug(MSG.getMessage(Keys.EXCEPTION_CREATING_CLASS, keyClassName ,cnfe));
-         cnfe.printStackTrace( );
-         //todo throw exception...??
-      }
-
-      if ( keyQNameString == null )
-      { //last ditch effort.....
-         keyQNameString =
-            "{" + getProperty( ResourceHandler.SERVICE_OPT_WSDL_TARGET_NAMESPACE ) + "}"
-            + DEFAULT_RESOURCE_KEY_NAME;
-      }
-
-      setResourceKeyQname( keyQNameString );
-      setResourceKeyClass( keyClass );
-   }
-
-   private void mergeServiceOptions( MessageContext msgContext )
+   private void importServiceOptions( MessageContext msgContext )
    {
       org.apache.axis.MessageContext axisMsgContext = (org.apache.axis.MessageContext) msgContext;
       SOAPService                    service  = axisMsgContext.getService(  );

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/GenericAxisHandler.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/GenericAxisHandler.java?rev=219275&r1=219274&r2=219275&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/GenericAxisHandler.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/GenericAxisHandler.java Fri Jul 15 18:23:20 2005
@@ -23,7 +23,7 @@
 import javax.xml.rpc.handler.HandlerInfo;
 
 /**
- * TODO
+ * An Axis handler that serves as a facade for a JAX-RPC handler.
  *
  * @author Ian Springer
  */
@@ -61,20 +61,13 @@
     public void invoke( org.apache.axis.MessageContext msgContext )
             throws AxisFault
     {
-        try
+        if ( !msgContext.getPastPivot() )
         {
-            if ( !msgContext.getPastPivot() )
-            {
-                jaxRpcHandler.handleRequest( msgContext );
-            }
-            else
-            {
-                jaxRpcHandler.handleResponse( msgContext );
-            }
+            jaxRpcHandler.handleRequest( msgContext );
         }
-        catch ( RuntimeException re )
+        else
         {
-            throw AxisFault.makeFault( re );
+            jaxRpcHandler.handleResponse( msgContext );
         }
     }
 

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/ResourceProvider.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/ResourceProvider.java?rev=219275&r1=219274&r2=219275&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/ResourceProvider.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/ResourceProvider.java Fri Jul 15 18:23:20 2005
@@ -26,6 +26,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.ws.resource.ResourceContext;
+import org.apache.ws.resource.ResourceContextException;
 import org.apache.ws.resource.handler.ResourceHandler;
 import org.apache.ws.resource.i18n.Keys;
 import org.apache.ws.resource.i18n.MessagesImpl;
@@ -270,6 +271,7 @@
      * @return DOCUMENT_ME
      */
     protected ResourceContext createResourceContext( SOAPMessageContext soapMsgContext )
+            throws ResourceContextException
     {
         return new AxisResourceContext( soapMsgContext );
     }

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceContext.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceContext.java?rev=219275&r1=219274&r2=219275&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceContext.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceContext.java Fri Jul 15 18:23:20 2005
@@ -20,30 +20,20 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.ws.resource.JndiConstants;
-import org.apache.ws.resource.NoResourceHomeException;
 import org.apache.ws.resource.Resource;
 import org.apache.ws.resource.ResourceContext;
 import org.apache.ws.resource.ResourceContextException;
 import org.apache.ws.resource.ResourceException;
 import org.apache.ws.resource.ResourceHome;
-import org.apache.ws.resource.ResourceKey;
-import org.apache.ws.resource.faults.ResourceKeyHeaderNotFoundFaultException;
 import org.apache.ws.resource.i18n.Keys;
 import org.apache.ws.resource.i18n.MessagesImpl;
 import org.apache.ws.util.i18n.Messages;
 
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
-import javax.xml.namespace.QName;
 import javax.xml.rpc.handler.MessageContext;
 import javax.xml.rpc.handler.soap.SOAPMessageContext;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPHeader;
-import javax.xml.soap.SOAPHeaderElement;
 import javax.xml.soap.SOAPMessage;
-import java.lang.reflect.Constructor;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.Collections;
@@ -52,7 +42,7 @@
 import java.util.Map;
 
 /**
- * LOG-DONE DOCUMENT_ME
+ * An abstract implementation of a resource context.
  */
 public abstract class AbstractResourceContext
         extends ResourceContext
@@ -63,13 +53,9 @@
 
     private SOAPMessage m_msg;
     private ResourceHome m_home;
-    private String m_homeLocation;
     private String m_serviceName;
     private URL m_serviceURL;
     private Map m_propsMap = Collections.synchronizedMap( new HashMap() );
-    private String m_resourceKeyQname;
-    private Class m_resourceKeyClass;
-    private ResourceKey m_resourceKey;
     private String m_baseURL;
     private String m_action;
 
@@ -78,7 +64,7 @@
      *
      * @param soapMsgContext DOCUMENT_ME
      */
-    public AbstractResourceContext( SOAPMessageContext soapMsgContext )
+    public AbstractResourceContext( SOAPMessageContext soapMsgContext ) throws ResourceContextException
     {
         if ( soapMsgContext == null )
         {
@@ -86,6 +72,15 @@
         }
         m_msg = soapMsgContext.getMessage();
         extractFields( soapMsgContext );
+        try
+        {
+            m_home = (ResourceHome) new InitialContext().lookup( getResourceHomeLocation() );
+        }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            throw new ResourceContextException( ne );
+        }
     }
 
     /**
@@ -135,56 +130,17 @@
             ResourceException
     {
         ResourceHome home = getResourceHome();
-        Class resourceKeyClass = null;
-        String resourceKeyClassName = null;
-        try
-        {
-            resourceKeyClassName = home.getResourceKeyClassName();
-            resourceKeyClass = Class.forName( resourceKeyClassName );
-        }
-        catch ( ClassNotFoundException cnfe )
-        {
-            throw new ResourceException( cnfe );
-        }
-
-        String resourceKeyName = home.getResourceKeyName();
-        QName keyName = null;
-        if ( resourceKeyName != null )
-        {
-            keyName = QName.valueOf( resourceKeyName );
-        }
-
-        ResourceKey key = getResourceKey( keyName, resourceKeyClass );
-        LOG.debug( MSG.getMessage( Keys.LOOKUP_RESOURCE_FOR_KEY, String.valueOf( key ) ) );
-        Resource resource = home.find( key );
-        LOG.debug( MSG.getMessage( Keys.FOUND_RESOURCE, resource ) );
-        return resource;
+        Object id = home.extractResourceIdentifier( this );
+        return home.find( id );
     }
 
     /**
      * DOCUMENT_ME
      *
      * @return DOCUMENT_ME
-     *
-     * @throws NoResourceHomeException  DOCUMENT_ME
-     * @throws ResourceContextException DOCUMENT_ME
      */
-    public synchronized ResourceHome getResourceHome()
-            throws ResourceContextException
+    public ResourceHome getResourceHome()
     {
-        if ( m_home == null )
-        {
-            try
-            {
-                m_home = (ResourceHome) new InitialContext().lookup( getResourceHomeLocation() );
-            }
-            catch ( NamingException ne )
-            {
-                ne.printStackTrace();
-                throw new ResourceContextException( ne );
-            }
-        }
-
         return m_home;
     }
 
@@ -195,197 +151,10 @@
      */
     public synchronized String getResourceHomeLocation()
     {
-        if ( m_homeLocation == null )
-        {
-            m_homeLocation = JndiConstants.CONTEXT_NAME_SERVICES + "/" + getServiceName() + "/" +
-                    JndiConstants.ATOMIC_NAME_HOME;
-        }
-        LOG.debug( MSG.getMessage( Keys.JNDI_HOME_LOCATION, m_homeLocation ) );
-        return m_homeLocation;
-    }
-
-    /**
-     * DOCUMENT_ME
-     *
-     * @return DOCUMENT_ME
-     *
-     * @throws ResourceContextException DOCUMENT_ME
-     */
-    public ResourceKey getResourceKey()
-            throws ResourceContextException
-    {
-        if ( m_resourceKey == null )
-        {
-            ResourceHome resourceHome = getResourceHome();
-            Class resourceKeyClass = null;
-            String resourceKeyClassName = null;
-            try
-            {
-                resourceKeyClassName = resourceHome.getResourceKeyClassName();
-                resourceKeyClass = Class.forName( resourceKeyClassName );
-            }
-            catch ( ClassNotFoundException e )
-            {
-                throw new ResourceContextException( e );
-            }
-            String resourceKeyName = resourceHome.getResourceKeyName();
-
-            QName resourceKeyQName = resourceKeyName != null ? QName.valueOf( resourceKeyName ) : null;
-            m_resourceKey = getResourceKey( resourceKeyQName, resourceKeyClass );
-
-        }
-
-        LOG.debug( MSG.getMessage( Keys.RESOURCE_KEY, String.valueOf( m_resourceKey ) ) );
-
-        return m_resourceKey;
-    }
-
-    /**
-     * Creates a resource key for the current request.
-     *
-     * @param keyName  DOCUMENT_ME
-     * @param keyClass DOCUMENT_ME
-     *
-     * @return DOCUMENT_ME
-     *
-     * @throws ResourceContextException DOCUMENT_ME
-     */
-    public ResourceKey getResourceKey( QName keyName,
-                                       Class keyClass )
-            throws ResourceContextException,
-            ResourceKeyHeaderNotFoundFaultException
-    {
-        if ( keyName == null )
-        {
-            LOG.debug( MSG.getMessage( Keys.NULL_RESOURCE_NAME ) );
-            return null;
-        }
-
-        SOAPHeaderElement headerElem = getResourceKeyHeader( keyName );
-        if ( headerElem == null )
-        {
-            throw new ResourceKeyHeaderNotFoundFaultException( keyName );
-        }
-
-        try
-        {
-            Constructor constructor = keyClass.getConstructor( new Class[]{SOAPHeaderElement.class} );
-            return (ResourceKey) constructor.newInstance( new Object[]{headerElem} );
-        }
-        catch ( Exception e )
-        {
-            throw new ResourceContextException( e );
-        }
-    }
-
-    /**
-     * DOCUMENT_ME
-     *
-     * @return DOCUMENT_ME
-     *
-     * @throws ResourceContextException DOCUMENT_ME
-     */
-    public SOAPHeaderElement getResourceKeyHeader()
-            throws ResourceContextException
-    {
-        ResourceHome home = getResourceHome();
-        QName keyName = QName.valueOf( home.getResourceKeyName() );
-        return ( keyName == null ) ? null : getResourceKeyHeader( keyName );
-    }
-
-    /**
-     * DOCUMENT_ME
-     *
-     * @param keyName DOCUMENT_ME
-     *
-     * @return DOCUMENT_ME
-     *
-     * @throws ResourceContextException DOCUMENT_ME
-     */
-    public SOAPHeaderElement getResourceKeyHeader( QName keyName )
-            throws ResourceContextException
-    {
-        try
-        {
-            return AbstractResourceContext.getResourceKeyHeader( this.m_msg, keyName, null );
-        }
-        catch ( SOAPException e )
-        {
-            throw new ResourceContextException( e );
-        }
-    }
-
-    /**
-     * DOCUMENT_ME
-     *
-     * @param msg      DOCUMENT_ME
-     * @param keyName  DOCUMENT_ME
-     * @param actorURI DOCUMENT_ME
-     *
-     * @return DOCUMENT_ME
-     *
-     * @throws SOAPException            DOCUMENT_ME
-     * @throws IllegalArgumentException DOCUMENT_ME
-     */
-    public static SOAPHeaderElement getResourceKeyHeader( SOAPMessage msg,
-                                                          QName keyName,
-                                                          String actorURI )
-            throws SOAPException
-    {
-        LOG.debug( MSG.getMessage( Keys.GET_RESOURCEKEY_HEADER, keyName.toString() ) );
-        if ( msg == null )
-        {
-            throw new IllegalArgumentException( MSG.getMessage( Keys.NULL_SOAPMSGCTX ) );
-        }
-
-        if ( keyName == null )
-        {
-            throw new IllegalArgumentException( MSG.getMessage( Keys.NULL_RESOURCEKEY_QNAME ) );
-        }
-
-        SOAPEnvelope env = msg.getSOAPPart().getEnvelope();
-        SOAPHeader header = env.getHeader();
-
-        if ( header == null )
-        {
-            return null;
-        }
-
-        Iterator iter = header.examineHeaderElements( actorURI );
-        while ( iter.hasNext() )
-        {
-            SOAPHeaderElement headerElem = (SOAPHeaderElement) iter.next();
-            Name headerName = headerElem.getElementName();
-
-            if ( headerName.getLocalName().equals( keyName.getLocalPart() )
-                    && headerName.getURI().equals( keyName.getNamespaceURI() ) )
-            {
-                // found my header element;
-                return headerElem;
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * DOCUMENT_ME
-     *
-     * @param resourceKeyClass DOCUMENT_ME
-     */
-    public void setResourceKeyClass( Class resourceKeyClass )
-    {
-        m_resourceKeyClass = resourceKeyClass;
-    }
-
-    /**
-     * DOCUMENT_ME
-     *
-     * @param resourceKeyQname DOCUMENT_ME
-     */
-    public void setResourceKeyQname( String resourceKeyQname )
-    {
-        m_resourceKeyQname = resourceKeyQname;
+        String homeLocation = JndiConstants.CONTEXT_NAME_SERVICES + "/" + getServiceName() + "/" +
+                JndiConstants.ATOMIC_NAME_HOME;
+        LOG.debug( MSG.getMessage( Keys.JNDI_HOME_LOCATION, homeLocation ) );
+        return homeLocation;
     }
 
     /**
@@ -450,13 +219,6 @@
     protected void setServiceName( String serviceName )
     {
         m_serviceName = serviceName;
-
-        // reset in case
-        synchronized ( this )
-        {
-            m_home = null;
-            m_homeLocation = null;
-        }
     }
 
     /**

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceHome.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceHome.java?rev=219275&r1=219274&r2=219275&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceHome.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceHome.java Fri Jul 15 18:23:20 2005
@@ -20,25 +20,27 @@
 import org.apache.commons.collections.map.ReferenceMap;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.ws.Soap1_1Constants;
 import org.apache.ws.addressing.EndpointReference;
 import org.apache.ws.addressing.XmlBeansEndpointReference;
 import org.apache.ws.resource.InvalidResourceKeyException;
 import org.apache.ws.resource.JndiConstants;
-//todo sjc is it gone ips?? import org.apache.ws.resource.PersistentResource;
 import org.apache.ws.resource.PropertiesResource;
 import org.apache.ws.resource.Resource;
+import org.apache.ws.resource.ResourceContext;
 import org.apache.ws.resource.ResourceCreationEvent;
 import org.apache.ws.resource.ResourceCreationListener;
 import org.apache.ws.resource.ResourceDestructionEvent;
 import org.apache.ws.resource.ResourceDestructionListener;
 import org.apache.ws.resource.ResourceException;
 import org.apache.ws.resource.ResourceHome;
-import org.apache.ws.resource.ResourceKey;
 import org.apache.ws.resource.ResourceUnknownException;
+import org.apache.ws.resource.faults.FaultException;
 import org.apache.ws.resource.i18n.Keys;
 import org.apache.ws.resource.i18n.MessagesImpl;
 import org.apache.ws.resource.lifetime.ScheduledResourceTerminationResource;
 import org.apache.ws.util.Cache;
+import org.apache.ws.util.NameUtils;
 import org.apache.ws.util.i18n.Messages;
 import org.apache.ws.util.jndi.Initializable;
 import org.apache.ws.util.jndi.JNDIUtils;
@@ -49,9 +51,14 @@
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import javax.xml.namespace.QName;
+import javax.xml.rpc.JAXRPCException;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPHeader;
+import javax.xml.soap.SOAPHeaderElement;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -117,6 +124,7 @@
     protected boolean m_resourceIsPersistent;
     private String m_resourceKeyClassName;
     private String m_resourceKeyName;
+    private QName m_resourceIdRefParamName;
     private String m_wsdlTargetNamespace;
     private String m_serviceClassName;
 
@@ -131,7 +139,6 @@
     private boolean m_initialized;
     private Class m_resourceClass;
     private Class m_serviceClass;
-    private Class m_resourceKeyClass;
     private List m_creationListeners = new ArrayList();
     private List m_destructionListeners = new ArrayList();
 
@@ -288,21 +295,21 @@
     /**
      * DOCUMENT_ME
      *
-     * @param key DOCUMENT_ME
+     * @param id DOCUMENT_ME
      *
      * @return DOCUMENT_ME
      *
      * @throws ResourceException           if
      * @throws InvalidResourceKeyException DOCUMENT_ME
      */
-    public Resource find( ResourceKey key )
+    public Resource find( Object id )
             throws ResourceException
     {
 
-        LOG.debug( MSG.getMessage( Keys.FINDING_RESOURCE_WITH_KEY, String.valueOf( key ) ) );
+        LOG.debug( MSG.getMessage( Keys.FINDING_RESOURCE_WITH_KEY, String.valueOf( id ) ) );
 
         Resource resource = null;
-        Lock lock = getLock( key );
+        Lock lock = getLock( id );
         try
         {
             lock.acquire();
@@ -314,7 +321,7 @@
 
         try
         {
-            resource = get( key );
+            resource = get( id );
             if ( m_cache != null )
             {
                 m_cache.update( resource );
@@ -328,10 +335,9 @@
         return resource;
     }
 
-    private synchronized Lock getLock( ResourceKey key )
+    private synchronized Lock getLock( Object id )
     {
-        Object lockKey = getLookupKey( key );
-        return m_lockManager.getLock( lockKey );
+        return m_lockManager.getLock( getNonNullKey( id ) );
     }
 
     /**
@@ -350,10 +356,10 @@
         Class resourceClass = getResourceClass();
 
         //todo sjc is it gone ips??
-   /*     if ( PersistentResource.class.isAssignableFrom( resourceClass ) )
-        {
-            m_resourceIsPersistent = true;
-        }*/
+        /*     if ( PersistentResource.class.isAssignableFrom( resourceClass ) )
+             {
+                 m_resourceIsPersistent = true;
+             }*/
         //end todo
 
         Context initialContext = new InitialContext();
@@ -369,17 +375,17 @@
     /**
      * DOCUMENT_ME
      *
-     * @param key DOCUMENT_ME
+     * @param id DOCUMENT_ME
      *
      * @throws ResourceException           DOCUMENT_ME
      * @throws InvalidResourceKeyException DOCUMENT_ME
      */
-    public void remove( ResourceKey key )
+    public void remove( Object id )
             throws ResourceException
     {
 
         Resource resource = null;
-        Lock lock = getLock( key );
+        Lock lock = getLock( id );
         try
         {
             lock.acquire();
@@ -391,7 +397,7 @@
 
         try
         {
-            resource = get( key );
+            resource = get( id );
 
             try
             {
@@ -402,13 +408,13 @@
                 throw new ResourceException( MSG.getMessage( Keys.FAILED_TO_DESTROY_RESOURCE, resource, re ) );
             }
 
-            Resource removedResource = (Resource) m_resources.remove( getLookupKey( key ) );
+            Resource removedResource = (Resource) m_resources.remove( getNonNullKey( id ) );
             if ( removedResource instanceof PropertiesResource )
             {
                 notifyResourceDeletedListeners( removedResource );
             }
             LOG.debug( MSG.getMessage( Keys.REMOVED_RESOURCE_WITH_KEY, resource.getClass().getName(),
-                    String.valueOf( key ) ) );
+                    String.valueOf( id ) ) );
             if ( m_cache != null )
             {
                 m_cache.remove( resource );
@@ -424,14 +430,14 @@
     /**
      * DOCUMENT_ME
      *
-     * @param key      DOCUMENT_ME
+     * @param id      DOCUMENT_ME
      * @param resource DOCUMENT_ME
      */
-    protected void add( ResourceKey key,
+    protected void add( Object id,
                         Resource resource )
     {
         // TODO: why do we need add() in addition to addResource()?
-        addResource( key, resource );
+        addResource( id, resource );
         if ( m_cache != null )
         {
             m_cache.update( resource );
@@ -445,17 +451,17 @@
      * Note: the returned Resource will not have an EndpointReference associated with it. The caller should next call
      * getEndpointReference and then use a setter on their resource impl.
      *
-     * @param key The resource key for this resource.
+     * @param id the resource identifier
      *
-     * @return The resource type which is associated with this home.
+     * @return a resource of the type associated with this home
      *
      * @throws ResourceException
      * @throws IllegalStateException
      */
-    protected Resource createInstance( ResourceKey key )
+    protected Resource createInstance( Object id )
             throws ResourceException
     {
-        LOG.debug( MSG.getMessage( Keys.CREATING_INSTANCE_WITH_KEY, String.valueOf( key ) ) );
+        LOG.debug( MSG.getMessage( Keys.CREATING_INSTANCE_WITH_KEY, String.valueOf( id ) ) );
         Resource resource;
         try
         {
@@ -465,9 +471,7 @@
         {
             throw new ResourceException( e );
         }
-
-        resource.setID( key != null ? key.getValue() : null );
-
+        resource.setID( id );
         try
         {
             LOG.debug( MSG.getMessage( Keys.INIT_RESOURCE_LIFECYCLE_INSTANCE, resource.getClass().getName() ) );
@@ -477,28 +481,27 @@
         {
             throw new ResourceException( MSG.getMessage( Keys.FAILED_TO_INIT_RESOURCE, resource, re ), re );
         }
-
         return resource;
     }
 
     /**
      * DOCUMENT_ME
      *
-     * @param key DOCUMENT_ME
+     * @param id DOCUMENT_ME
      *
      * @return DOCUMENT_ME
      *
      * @throws ResourceException DOCUMENT_ME
      */
-    protected Resource createNewInstanceAndLoad( ResourceKey key )
+    protected Resource createNewInstanceAndLoad( Object id )
             throws ResourceException
     {
-        Resource resource = createInstance( key );
-        LOG.debug( MSG.getMessage( Keys.LOADING_RESOURCE_FROM_PERSISTENCE, String.valueOf( key ) ) );
-        //todo sjc is it gone ips?? ( (PersistentResource) resource ).load( key );
+        Resource resource = createInstance( id );
+        LOG.debug( MSG.getMessage( Keys.LOADING_RESOURCE_FROM_PERSISTENCE, String.valueOf( id ) ) );
+        //todo sjc is it gone ips?? ( (PersistentResource) resource ).load( id );
         if ( ResourceSweeper.isExpired( resource ) )
         {
-            throw new ResourceUnknownException( getLookupKey( key ), getServicePortName() );
+            throw new ResourceUnknownException( getNonNullKey( id ), getServicePortName() );
         }
         return resource;
     }
@@ -522,17 +525,20 @@
             }
             if ( !Resource.class.isAssignableFrom( m_resourceClass ) )
             {
-                throw new ResourceException( "Specified resource class '" + m_resourceClassName + "' does not implement the " + Resource.class.getName() + " interface." );
+                throw new ResourceException(
+                        "Specified resource class '" + m_resourceClassName + "' does not implement the " +
+                        Resource.class.getName() +
+                        " interface." );
             }
         }
         return m_resourceClass;
     }
 
-    private void addResource( ResourceKey key,
+    private void addResource( Object id,
                               Resource resource )
     {
-        LOG.debug( MSG.getMessage( Keys.ADDING_RESOURCE_FOR_KEY, String.valueOf( key ) ) );
-        m_resources.put( getLookupKey( key ), resource );
+        LOG.debug( MSG.getMessage( Keys.ADDING_RESOURCE_FOR_KEY, String.valueOf( id ) ) );
+        m_resources.put( getNonNullKey( id ), resource );
         // schedule sweeper task if needed
         if ( m_sweeper != null )
         {
@@ -541,27 +547,26 @@
         notifyResourceCreatedListeners( resource );
     }
 
-    private Resource get( ResourceKey key )
+    private Resource get( Object id )
             throws ResourceException
     {
-        LOG.debug( MSG.getMessage( Keys.GET_RESOURCE_FOR_KEY, String.valueOf( key ) ) );
-        Object lookupKey = getLookupKey( key );
-        Resource resource = (Resource) m_resources.get( lookupKey );
+        LOG.debug( MSG.getMessage( Keys.GET_RESOURCE_FOR_KEY, String.valueOf( id ) ) );
+        Object key = getNonNullKey( id );
+        Resource resource = (Resource) m_resources.get( key );
         if ( resource == null )
         {
             if ( !m_resourceIsPersistent )
             {
-                throw new ResourceUnknownException( lookupKey, getServicePortName() );
+                throw new ResourceUnknownException( key, getServicePortName() );
             }
-            addResource( key, createNewInstanceAndLoad( key ) );
+            addResource( key, createNewInstanceAndLoad( id ) );
         }
         return resource;
     }
 
-    private Object getLookupKey( ResourceKey key )
+    Object getNonNullKey( Object obj )
     {
-        Object lookupKey = key != null ? key : (Object) this;
-        return lookupKey;
+        return obj != null ? obj : new Object();
     }
 
     protected void initCachePolicy( Context initialContext )
@@ -633,22 +638,6 @@
         }
 
         /**
-         * DOCUMENT_ME
-         *
-         * @param key DOCUMENT_ME
-         *
-         * @return DOCUMENT_ME
-         *
-         * @throws ResourceException DOCUMENT_ME
-         */
-        protected Resource getResource( ResourceKey key )
-                throws ResourceException
-        {
-            LOG.debug( MSG.getMessage( Keys.GET_RESOURCE_FOR_KEY, key.getValue() ) );
-            return (Resource) m_resources.get( key );
-        }
-
-        /**
          * Schedules this resource sweeper.
          */
         synchronized void schedule()
@@ -751,19 +740,20 @@
      * Returns the EndpointReference associated with this Resource. Only the required fields will be filled in (i.e.
      * Address) AND the ReferenceProperty for the ResourceKey (if not a singleton)
      * <p/>
-     * If the resourceKeyis not equal to null ( not a singleton ), The reference properties will contain the key.
+     * If the resourceKey is not equal to null ( not a singleton ), the reference properties will contain the key.
      *
-     * @param endpointAddress The endpoint url for the service
-     * @param key             The resourceKey for the Resource or null if singleton
-     * @param wsAddressingURI The WS-Addressing URI
+     * @param endpointAddress the endpoint url for the service
+     * @param resourceId      the resource identifier, or null if the resource is a singleton
+     * @param wsAddressingURI the namespace URI of the preferred WS-Addressing version
      *
-     * @return The Resource's EndpointReference
+     * @return an EndpointReference (EPR) for the resource
      */
-    public EndpointReference getEndpointReference( String endpointAddress, ResourceKey key, String wsAddressingURI )
+    public EndpointReference getEndpointReference( String endpointAddress, Object resourceId, String wsAddressingURI )
     {
         XmlBeansEndpointReference xmlBeansEndpointReference = new XmlBeansEndpointReference( endpointAddress,
                 wsAddressingURI );
-        xmlBeansEndpointReference.setResourceKey( key );
+        xmlBeansEndpointReference.setResourceIdentifierReferenceParameterName( getResourceIdentifierReferenceParameterQName() );
+        xmlBeansEndpointReference.setResourceIdentifier( resourceId );
         xmlBeansEndpointReference.setPortTypeQName( getPortType() );
         xmlBeansEndpointReference.setServicePortName( getServicePortName() );
         xmlBeansEndpointReference.setServiceQName( getServiceName() );
@@ -776,6 +766,48 @@
 
     public abstract String getServicePortName();
 
-    public abstract QName getResourceKeyNameQName();
+    public QName getResourceIdentifierReferenceParameterQName()
+    {
+        return m_resourceIdRefParamName;
+    }
+
+    public String getResourceIdentifierReferenceParameterName()
+    {
+        return m_resourceIdRefParamName.toString();
+    }
+
+    public void setResourceIdentifierReferenceParameterName( String name )
+    {
+        m_resourceIdRefParamName = QName.valueOf( name );
+    }
 
+    public Object extractResourceIdentifier( ResourceContext context )
+    {
+        if ( getResourceIdentifierReferenceParameterName() == null )
+        {
+            return null;
+        }
+        try
+        {
+            SOAPHeader soapHeader = context.getSOAPMessage().getSOAPHeader();
+            Iterator resourceIdElemsIter = soapHeader.getChildElements(
+                    NameUtils.toName( getResourceIdentifierReferenceParameterQName() ) );
+            if ( !resourceIdElemsIter.hasNext() )
+            {
+                throw new FaultException( Soap1_1Constants.FAULT_CLIENT,
+                        "The expected resource identifier reference parameter named " + getResourceIdentifierReferenceParameterName() + " was not found in the SOAP header." );
+            }
+            SOAPHeaderElement resourceIdElem = (SOAPHeaderElement) resourceIdElemsIter.next();
+            if ( resourceIdElemsIter.hasNext() )
+            {
+                throw new FaultException( Soap1_1Constants.FAULT_CLIENT,
+                        "More than one resource identifier reference parameter named " + getResourceIdentifierReferenceParameterName() + " was found in the SOAP header. Exactly one is expected." );
+            }
+            return resourceIdElem.getValue();
+        }
+        catch ( SOAPException soape )
+        {
+            throw new JAXRPCException( soape );
+        }
+    }
 }