You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pubscribe-commits@ws.apache.org by ip...@apache.org on 2005/07/29 18:02:55 UTC
svn commit: r226386 - in /webservices/pubscribe/trunk/src:
examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java
test/org/apache/ws/notification/base/impl/UnitResource.java
Author: ips
Date: Fri Jul 29 09:02:49 2005
New Revision: 226386
URL: http://svn.apache.org/viewcvs?rev=226386&view=rev
Log:
updated how producer props are initialized
Modified:
webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java
webservices/pubscribe/trunk/src/test/org/apache/ws/notification/base/impl/UnitResource.java
Modified: webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java?rev=226386&r1=226385&r2=226386&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java (original)
+++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java Fri Jul 29 09:02:49 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, org.apache.ws.notification.base.NotificationProducerResource {
-
+public abstract class AbstractFilesystemResource
+ implements org.apache.ws.resource.lifetime.ScheduledResourceTerminationResource,
+ org.apache.ws.resource.PropertiesResource, org.apache.ws.notification.base.NotificationProducerResource
+{
+
/**
* The resource ID of the instance.
*/
protected String m_id;
-
- /** The EndpointReference for this resource **/
+
+ /**
+ * 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,63 +78,73 @@
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 );
+
+ org.apache.ws.resource.properties.ResourceProperty topicProp = getResourcePropertySet().get( org.apache.ws.notification.base.v2004_06.porttype.NotificationProducerPortType.PROP_QNAME_TOPIC );
+ topicProp.setCallback( new org.apache.ws.notification.base.TopicResourcePropertyCallback( getTopicSpaceSet() ) );
+
+ org.apache.ws.resource.properties.ResourceProperty fixedTopicSetProp = getResourcePropertySet().get( org.apache.ws.notification.base.v2004_06.porttype.NotificationProducerPortType.PROP_QNAME_FIXED_TOPIC_SET );
+ fixedTopicSetProp.setCallback( new org.apache.ws.notification.base.FixedTopicSetResourcePropertyCallback( getTopicSpaceSet() ) );
+
+ org.apache.ws.resource.properties.ResourceProperty topicExpressionDialectsProp = getResourcePropertySet().get( org.apache.ws.notification.base.v2004_06.porttype.NotificationProducerPortType.PROP_QNAME_TOPIC_EXPRESSION_DIALECTS );
+ topicExpressionDialectsProp.setCallback( new org.apache.ws.notification.base.TopicExpressionDialectsResourcePropertyCallback() );
+ }
+
+ /**
+ * 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
@@ -141,7 +153,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 );
}
@@ -150,11 +164,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
@@ -163,8 +178,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)
*/
@@ -179,12 +197,14 @@
public org.apache.ws.resource.properties.ResourcePropertySet getResourcePropertySet()
{
return m_propSet;
- }
- org.apache.ws.notification.topics.TopicSpaceSet m_topicSpaceSet = new org.apache.ws.notification.topics.impl.TopicSpaceSetImpl(true);
-
- public org.apache.ws.notification.topics.TopicSpaceSet getTopicSpaceSet()
- {
- return m_topicSpaceSet;
- }
-
+ }
+
+ org.apache.ws.notification.topics.TopicSpaceSet m_topicSpaceSet = new org.apache.ws.notification.topics.impl.TopicSpaceSetImpl(
+ true );
+
+ public org.apache.ws.notification.topics.TopicSpaceSet getTopicSpaceSet()
+ {
+ return m_topicSpaceSet;
+ }
+
}
Modified: webservices/pubscribe/trunk/src/test/org/apache/ws/notification/base/impl/UnitResource.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/test/org/apache/ws/notification/base/impl/UnitResource.java?rev=226386&r1=226385&r2=226386&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/test/org/apache/ws/notification/base/impl/UnitResource.java (original)
+++ webservices/pubscribe/trunk/src/test/org/apache/ws/notification/base/impl/UnitResource.java Fri Jul 29 09:02:49 2005
@@ -20,11 +20,6 @@
public static final String TOPIC_NAME = "test";
org.apache.ws.notification.topics.TopicSpaceSet m_topicSpaceSet = new org.apache.ws.notification.topics.impl.TopicSpaceSetImpl(true);
- public UnitResource()
- {
-
- }
-
public ResourcePropertySet getResourcePropertySet()
{
return m_resourcePropertySet;
@@ -35,9 +30,9 @@
m_resourcePropertySet = resourcePropertySet;
}
- public void setID(Object o)
+ public void setID(Object resourceId)
{
- m_id = o;
+ m_id = resourceId;
}
public Object getID()
@@ -53,12 +48,19 @@
public void init()
{
NotificationProducerRPDocument notificationProducerRPDocument = NotificationProducerRPDocument.Factory.newInstance();
- NotificationProducerRPDocument.NotificationProducerRP notificationProducerRP = notificationProducerRPDocument.addNewNotificationProducerRP();
+ notificationProducerRPDocument.addNewNotificationProducerRP();
m_resourcePropertySet = new XmlBeansResourcePropertySet(notificationProducerRPDocument);
- TopicSpaceImpl topicSpace = new TopicSpaceImpl(UnitExampleHome.TARGET_NAMESPACE);
+ org.apache.ws.resource.properties.ResourceProperty topicProp = getResourcePropertySet().get( org.apache.ws.notification.base.v2004_06.porttype.NotificationProducerPortType.PROP_QNAME_TOPIC );
+ topicProp.setCallback( new org.apache.ws.notification.base.TopicResourcePropertyCallback( getTopicSpaceSet() ) );
+
+ org.apache.ws.resource.properties.ResourceProperty fixedTopicSetProp = getResourcePropertySet().get( org.apache.ws.notification.base.v2004_06.porttype.NotificationProducerPortType.PROP_QNAME_FIXED_TOPIC_SET );
+ fixedTopicSetProp.setCallback( new org.apache.ws.notification.base.FixedTopicSetResourcePropertyCallback( getTopicSpaceSet() ) );
+ org.apache.ws.resource.properties.ResourceProperty topicExpressionDialectsProp = getResourcePropertySet().get( org.apache.ws.notification.base.v2004_06.porttype.NotificationProducerPortType.PROP_QNAME_TOPIC_EXPRESSION_DIALECTS );
+ topicExpressionDialectsProp.setCallback( new org.apache.ws.notification.base.TopicExpressionDialectsResourcePropertyCallback() );
+ TopicSpaceImpl topicSpace = new TopicSpaceImpl(UnitExampleHome.TARGET_NAMESPACE);
try
{
topicSpace.addTopic(TOPIC_NAME);
@@ -69,8 +71,6 @@
{
throw new javax.xml.rpc.JAXRPCException("Unable to init the ResourceProperty Changed topics. Cause: " + e.getLocalizedMessage(), e);
}
-
- org.apache.ws.notification.topics.util.TopicUtils.initNotificationProducerProperties(getTopicSpaceSet(), getResourcePropertySet());
}
public void addTerminationListener(ResourceTerminationListener resourceTerminationListener)