Author: ips
Date: Thu Apr 21 11:54:29 2005
New Revision: 164098
URL: http://svn.apache.org/viewcvs?rev=164098&view=rev
Log:
fix
Added:
incubator/apollo/site/tutorial/method_impls/sysprops_home_getinstance.txt
incubator/apollo/site/tutorial/method_impls/sysprops_resource_init.txt
Removed:
incubator/apollo/site/tutorial/method_impls/syspros_home_getinstance.txt
incubator/apollo/site/tutorial/method_impls/syspros_resource_init.txt
Modified:
incubator/apollo/site/tutorial/FileSystem.wsdl
incubator/apollo/site/tutorial/SysProps.wsdl
Modified: incubator/apollo/site/tutorial/FileSystem.wsdl
URL:
http://svn.apache.org/viewcvs/incubator/apollo/site/tutorial/FileSystem.wsdl?rev=164098&r1=164097&r2=164098&view=diff
==============================================================================
--- incubator/apollo/site/tutorial/FileSystem.wsdl (original)
+++ incubator/apollo/site/tutorial/FileSystem.wsdl Thu Apr 21 11:54:29 2005
@@ -11,10 +11,10 @@
xmlns:wsrlw="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.wsdl">
<import
namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl"
- location="../spec/wsrf/WS-ResourceProperties-1_2.wsdl"/>
+ location="../spec/wsrf/WS-ResourceProperties-1_2-Draft_01.wsdl"/>
<import
namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.wsdl"
- location="../spec/wsrf/WS-ResourceLifetime-1_2.wsdl"/>
+ location="../spec/wsrf/WS-ResourceLifetime-1_2-Draft_01.wsdl"/>
<types>
<schema elementFormDefault="qualified"
@@ -25,10 +25,10 @@
xmlns:wsbf="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-01.xsd">
<xsd:import
namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-01.xsd"
- schemaLocation="../spec/wsrf/WS-BaseFaults-1_2.xsd"/>
+
schemaLocation="../spec/wsrf/WS-BaseFaults-1_2-Draft_01.xsd"/>
<xsd:import
namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd"
-
schemaLocation="../spec/wsrf/WS-ResourceLifetime-1_2.xsd"/>
+
schemaLocation="../spec/wsrf/WS-ResourceLifetime-1_2-Draft_01.xsd"/>
<element name="DeviceSpecialFile" type="xsd:string"/>
<element name="MountPointDirectory" type="xsd:string"/>
Modified: incubator/apollo/site/tutorial/SysProps.wsdl
URL:
http://svn.apache.org/viewcvs/incubator/apollo/site/tutorial/SysProps.wsdl?rev=164098&r1=164097&r2=164098&view=diff
==============================================================================
--- incubator/apollo/site/tutorial/SysProps.wsdl (original)
+++ incubator/apollo/site/tutorial/SysProps.wsdl Thu Apr 21 11:54:29 2005
@@ -2,7 +2,7 @@
<definitions name="JavaSystemPropertiesResourceDefinition"
targetNamespace="http://ws.apache.org/resource/example/sysprops"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://ws.apache.org/resource/example/sysprops"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsrp="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd"
xmlns:wsrpw="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl">
- <import
namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl"
location="../spec/wsrf/WS-ResourceProperties-1_2.wsdl"/>
+ <import
namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl"
location="../spec/wsrf/WS-ResourceProperties-1_2-Draft_01.wsdl"/>
<types>
<schema elementFormDefault="qualified"
targetNamespace="http://ws.apache.org/resource/example/sysprops"
xmlns="http://www.w3.org/2001/XMLSchema">
Added: incubator/apollo/site/tutorial/method_impls/sysprops_home_getinstance.txt
URL:
http://svn.apache.org/viewcvs/incubator/apollo/site/tutorial/method_impls/sysprops_home_getinstance.txt?rev=164098&view=auto
==============================================================================
--- incubator/apollo/site/tutorial/method_impls/sysprops_home_getinstance.txt
(added)
+++ incubator/apollo/site/tutorial/method_impls/sysprops_home_getinstance.txt
Thu Apr 21 11:54:29 2005
@@ -0,0 +1,32 @@
+public Resource getInstance( ResourceContext resourceContext )
+ throws ResourceException,
+ ResourceContextException,
+ ResourceUnknownException
+ {
+ ResourceKey key = resourceContext.getResourceKey();
+ Resource resource = null;
+ try
+ {
+ resource = find( key );
+ }
+ catch ( ResourceException re )
+ {
+ //todo add any checking for key validity
+ }
+
+ if ( resource == null )
+ {
+ try
+ {
+ resource = createInstance( key );
+ }
+ catch ( Exception e )
+ {
+ throw new ResourceException( e );
+ }
+
+ add( key, resource );
+ }
+
+ return resource;
+ }
Added: incubator/apollo/site/tutorial/method_impls/sysprops_resource_init.txt
URL:
http://svn.apache.org/viewcvs/incubator/apollo/site/tutorial/method_impls/sysprops_resource_init.txt?rev=164098&view=auto
==============================================================================
--- incubator/apollo/site/tutorial/method_impls/sysprops_resource_init.txt
(added)
+++ incubator/apollo/site/tutorial/method_impls/sysprops_resource_init.txt Thu
Apr 21 11:54:29 2005
@@ -0,0 +1,29 @@
+public void init()
+ {
+ super.init();
+ //create a resource metadata and resource property
+ org.apache.ws.resource.properties.ResourcePropertyMetaData propMetaData
= new org.apache.ws.resource.properties.impl.AnyResourcePropertyMetaData( new
javax.xml.namespace.QName( SyspropsService.TARGET_NSURI, "property" ) );
+ org.apache.ws.resource.properties.ResourceProperty prop = new
org.apache.ws.resource.properties.impl.XmlBeansResourceProperty( propMetaData,
(org.apache.ws.resource.properties.impl.XmlBeansResourcePropertySet) m_propSet
);
+ //add the property to the prop set
+ m_propSet.add( prop );
+
+ //get the current sys properties
+ java.util.Properties sysProps = System.getProperties();
+ java.util.Iterator iterator = sysProps.keySet().iterator();
+ //iterate the sysprops and add to property set
+ while ( iterator.hasNext() )
+ {
+ String sysPropKey = (String) iterator.next();
+ String sysPropValue = sysProps.getProperty( sysPropKey );
+ try
+ {
+ //build an arbitrary XmlObject out of the sysprop data
+ org.apache.xmlbeans.XmlObject propElem =
org.apache.xmlbeans.XmlObject.Factory.parse( "<" +
SyspropsService.TARGET_NSPREFIX + ":" + "property" + " name=\"" + sysPropKey +
"\" value=\"" + sysPropValue + "\" xmlns:" + SyspropsService.TARGET_NSPREFIX +
"=\"" + SyspropsService.TARGET_NSURI + "\"/>" );
+ prop.add( propElem );
+ }
+ catch ( org.apache.xmlbeans.XmlException e )
+ {
+ e.printStackTrace();
+ }
+ }
+ }
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]