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/08/01 18:30:26 UTC
svn commit: r226836 - in /webservices/wsrf/trunk/src:
examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/
site/content/xdocs/tutorial/
Author: ips
Date: Mon Aug 1 09:30:21 2005
New Revision: 226836
URL: http://svn.apache.org/viewcvs?rev=226836&view=rev
Log:
updated a few comments
Modified:
webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java
webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java
webservices/wsrf/trunk/src/site/content/xdocs/tutorial/mod_resource.xml
Modified: webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java?rev=226836&r1=226835&r2=226836&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java (original)
+++ webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java Mon Aug 1 09:30:21 2005
@@ -1,37 +1,39 @@
-
package org.apache.ws.resource.example.filesystem;
import org.apache.ws.addressing.EndpointReference;
/**
- * **** WARNING: This file will be overwritten during generation ****
- *
+ * **** WARNING: This file will be overwritten during generation ****
+ * <p/>
* An abstract Filesystem WS-Resource.
* <p/>
- * NOTE: This class is generated and is NOT meant to be modified.
+ * NOTE: This class is generated and is NOT meant to be modified.
*/
-public abstract class AbstractFilesystemResource implements org.apache.ws.resource.lifetime.ScheduledResourceTerminationResource, org.apache.ws.resource.PropertiesResource {
-
+public abstract class AbstractFilesystemResource
+ implements org.apache.ws.resource.lifetime.ScheduledResourceTerminationResource,
+ org.apache.ws.resource.PropertiesResource
+{
+
/**
- * The resource ID of the instance.
+ * The unique identifier for this resource.
+ */
+ private String m_id;
+
+ /**
+ * The EndpointReference (EPR) for this resource.
*/
- protected String m_id;
-
- /** The EndpointReference for this resource **/
protected EndpointReference m_endpointReference;
- /**
+ /**
* The set of properties associated with this resource.
*/
protected org.apache.ws.resource.properties.ResourcePropertySet m_propSet;
-
-
+
/**
* A list of termination listeners to be notified when the resource is terminated.
*/
- private java.util.List m_terminationListeners = new java.util.ArrayList();
-
-
+ private java.util.List m_terminationListeners = new java.util.ArrayList();
+
/**
* DOCUMENT_ME
*
@@ -59,9 +61,9 @@
*
* @param listener DOCUMENT_ME
*/
- public void addTerminationListener( org.apache.ws.resource.lifetime.ResourceTerminationListener listener)
- {
- m_terminationListeners.add(listener);
+ public void addTerminationListener( org.apache.ws.resource.lifetime.ResourceTerminationListener listener )
+ {
+ m_terminationListeners.add( listener );
}
/**
@@ -76,62 +78,64 @@
public void destroy()
{
- org.apache.ws.resource.lifetime.ResourceTerminationEvent rte = new org.apache.ws.resource.lifetime.impl.ResourceTerminationEventImpl(getID(),"Resource Destroyed");
- for (int i = 0; i < m_terminationListeners.size(); i++)
- {
- org.apache.ws.resource.lifetime.ResourceTerminationListener resourceTerminationEventListener = (org.apache.ws.resource.lifetime.ResourceTerminationListener) m_terminationListeners.get(i);
- resourceTerminationEventListener.terminationOccurred(rte);
- }
+ org.apache.ws.resource.lifetime.ResourceTerminationEvent rte = new org.apache.ws.resource.lifetime.impl.ResourceTerminationEventImpl(
+ getID(), "Resource Destroyed" );
+ for ( int i = 0; i < m_terminationListeners.size(); i++ )
+ {
+ org.apache.ws.resource.lifetime.ResourceTerminationListener resourceTerminationEventListener = (org.apache.ws.resource.lifetime.ResourceTerminationListener) m_terminationListeners.get(
+ i );
+ resourceTerminationEventListener.terminationOccurred( rte );
+ }
return;
}
public void init()
{
-
- org.apache.ws.resource.example.filesystem.FileSystemPropertiesDocument propsDoc = org.apache.ws.resource.example.filesystem.FileSystemPropertiesDocument.Factory.newInstance();
+ org.apache.ws.resource.example.filesystem.FileSystemPropertiesDocument propsDoc = org.apache.ws.resource.example.filesystem.FileSystemPropertiesDocument.Factory.newInstance();
m_propSet = new org.apache.ws.resource.properties.impl.XmlBeansResourcePropertySet( propsDoc );
-
- // initialize wsrl:CurrentTime property
- org.apache.ws.resource.properties.ResourceProperty prop = m_propSet.get( org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType.PROP_QNAME_CURRENT_TIME );
- org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.CurrentTimeDocument currTime = org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.CurrentTimeDocument.Factory.newInstance();
- currTime.setCurrentTime( java.util.Calendar.getInstance() );
- prop.add( currTime );
- prop.setCallback( new org.apache.ws.resource.lifetime.callback.CurrentTimeCallback() );
-
- // initialize wsrl:TerminationTime property
- prop = m_propSet.get( org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType.PROP_QNAME_TERMINATION_TIME );
- org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.TerminationTimeDocument termTime = org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.TerminationTimeDocument.Factory.newInstance();
- termTime.setNilTerminationTime();
- prop.add( termTime );
-
-
-
- }
-
- /**
- * Returns the EndpointReference associated with this Resource.
- *
- * @return The Resource's EndpointReference or null if the EndpointReference has not been set.
- *
- * Note: It is the responsibility of the Resource creator to set the EndpointReference (i.e. ResourceHome impl)
- */
+
+ // initialize wsrl:CurrentTime property
+ org.apache.ws.resource.properties.ResourceProperty prop = m_propSet.get(
+ org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType.PROP_QNAME_CURRENT_TIME );
+ org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.CurrentTimeDocument currTime = org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.CurrentTimeDocument.Factory.newInstance();
+ currTime.setCurrentTime( java.util.Calendar.getInstance() );
+ prop.add( currTime );
+ prop.setCallback( new org.apache.ws.resource.lifetime.callback.CurrentTimeCallback() );
+
+ // initialize wsrl:TerminationTime property
+ prop =
+ m_propSet.get(
+ org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType.PROP_QNAME_TERMINATION_TIME );
+ org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.TerminationTimeDocument termTime = org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.TerminationTimeDocument.Factory.newInstance();
+ termTime.setNilTerminationTime();
+ prop.add( termTime );
+ }
+
+ /**
+ * Returns the EndpointReference associated with this Resource.
+ *
+ * @return The Resource's EndpointReference or null if the EndpointReference has not been set.
+ * <p/>
+ * Note: It is the responsibility of the Resource creator to set the EndpointReference (i.e. ResourceHome
+ * impl)
+ */
public EndpointReference getEndpointReference()
{
- return m_endpointReference;
+ return m_endpointReference;
}
-
- /**
- * Sets the EndpointReference associated with this Resource.
- *
- * @param epr The Resource's EndpointReference.
- *
- * Note: It is the responsibility of the Resource creator to set the EndpointReference (i.e. ResourceHome impl)
- */
- public void setEndpointReference(EndpointReference epr)
+
+ /**
+ * Sets the EndpointReference associated with this Resource.
+ *
+ * @param epr The Resource's EndpointReference.
+ * <p/>
+ * Note: It is the responsibility of the Resource creator to set the EndpointReference (i.e. ResourceHome
+ * impl)
+ */
+ public void setEndpointReference( EndpointReference epr )
{
- m_endpointReference = epr;
+ m_endpointReference = epr;
}
-
/**
* DOCUMENT_ME
@@ -140,7 +144,9 @@
*/
public void setTerminationTime( java.util.Calendar time )
{
- org.apache.ws.resource.properties.XmlBeansResourcePropertyUtils.setDateTimePropertyValue( (org.apache.ws.resource.properties.impl.XmlBeansResourceProperty) getResourcePropertySet().get( org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType.PROP_QNAME_TERMINATION_TIME ),
+ org.apache.ws.resource.properties.XmlBeansResourcePropertyUtils.setDateTimePropertyValue(
+ (org.apache.ws.resource.properties.impl.XmlBeansResourceProperty) getResourcePropertySet().get(
+ org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType.PROP_QNAME_TERMINATION_TIME ),
time );
}
@@ -149,11 +155,12 @@
*
* @return java.util.Calendar
*/
- public java.util.Calendar getCurrentTime()
- {
- return org.apache.ws.resource.properties.XmlBeansResourcePropertyUtils.getDateTimePropertyValue( (org.apache.ws.resource.properties.impl.XmlBeansResourceProperty) m_propSet.get( org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType.PROP_QNAME_CURRENT_TIME ) );
- }
-
+ public java.util.Calendar getCurrentTime()
+ {
+ return org.apache.ws.resource.properties.XmlBeansResourcePropertyUtils.getDateTimePropertyValue(
+ (org.apache.ws.resource.properties.impl.XmlBeansResourceProperty) m_propSet.get(
+ org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType.PROP_QNAME_CURRENT_TIME ) );
+ }
/**
* DOCUMENT_ME
@@ -162,8 +169,11 @@
*/
public java.util.Calendar getTerminationTime()
{
- return org.apache.ws.resource.properties.XmlBeansResourcePropertyUtils.getDateTimePropertyValue( (org.apache.ws.resource.properties.impl.XmlBeansResourceProperty) m_propSet.get( org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType.PROP_QNAME_TERMINATION_TIME ) );
+ return org.apache.ws.resource.properties.XmlBeansResourcePropertyUtils.getDateTimePropertyValue(
+ (org.apache.ws.resource.properties.impl.XmlBeansResourceProperty) m_propSet.get(
+ org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType.PROP_QNAME_TERMINATION_TIME ) );
}
+
/**
* @see org.apache.ws.resource.PropertiesResource#setResourcePropertySet(org.apache.ws.resource.properties.ResourcePropertySet)
*/
@@ -178,5 +188,6 @@
public org.apache.ws.resource.properties.ResourcePropertySet getResourcePropertySet()
{
return m_propSet;
- }
+ }
+
}
Modified: webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java?rev=226836&r1=226835&r2=226836&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java (original)
+++ webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java Mon Aug 1 09:30:21 2005
@@ -16,6 +16,9 @@
*/
public static final org.apache.ws.resource.properties.v2004_06.impl.NamespaceVersionHolderImpl SPEC_NAMESPACE_SET = new org.apache.ws.resource.properties.v2004_06.impl.NamespaceVersionHolderImpl();
+ /*
+ * An mock object representing the filesystem being exposed as a WS-Resource.
+ */
private example.filesystem.backend.FileSystem m_filesystem;
/**
@@ -26,11 +29,7 @@
super.init();
- /*
- * This is where you should associate the backend instance with
- * the resource instance for a given id.
- */
- m_filesystem = new example.filesystem.backend.UnixFileSystem( m_id );
+ m_filesystem = new example.filesystem.backend.UnixFileSystem( (String)getID() ); // create a mock filesystem object
/*
* The resource property set which contains all of resource properties that were defined in the WSDL.
Modified: webservices/wsrf/trunk/src/site/content/xdocs/tutorial/mod_resource.xml
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/site/content/xdocs/tutorial/mod_resource.xml?rev=226836&r1=226835&r2=226836&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/site/content/xdocs/tutorial/mod_resource.xml (original)
+++ webservices/wsrf/trunk/src/site/content/xdocs/tutorial/mod_resource.xml Mon Aug 1 09:30:21 2005
@@ -31,11 +31,7 @@
super.init();
- /*
- * This is where you should associate the backend instance with
- * the resource instance for a given id.
- */
- m_filesystem = new example.filesystem.backend.UnixFileSystem( (String)getID() );
+ m_filesystem = new example.filesystem.backend.UnixFileSystem( (String)getID() ); // create a mock filesystem object
/*
* The resource property set which contains all of resource properties that were defined in the WSDL.