[prev in list] [next in list] [prev in thread] [next in thread]
List: pubscribe-commits
Subject: svn commit: r292835 - in /webservices/pubscribe/trunk/src:
From: ips () apache ! org
Date: 2005-09-30 18:30:24
Message-ID: 20050930183029.90778.qmail () minotaur ! apache ! org
[Download RAW message or body]
Author: ips
Date: Fri Sep 30 11:30:12 2005
New Revision: 292835
URL: http://svn.apache.org/viewcvs?rev=292835&view=rev
Log:
added getNamespaceSet() method to Resource interface
Modified:
webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/NotifRequestUtils.java
webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java
webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java
webservices/pubscribe/trunk/src/java/org/apache/ws/eventing/Subscription.java
webservices/pubscribe/trunk/src/java/org/apache/ws/eventing/pubsub/Subscription.java
webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/NotificationProducerResource.java
webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/SubscriptionManager.java
webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/impl/NotificationProducerHelper.java
webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/BaseNotificationConstants.java
webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/impl/SubscriptionResource.java
webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/impl/WsnNamespaceVersionHolderImpl.java
webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/NotificationProducerPortType.java
webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/SubscriptionManagerPortType.java
webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/impl/NotificationProducerPortTypeImpl.java
webservices/pubscribe/trunk/src/java/org/apache/ws/notification/pubsub/Subscription.java
webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicsTypeReader.java
webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicsTypeWriter.java
webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/v2004_06/TopicsConstants.java
webservices/pubscribe/trunk/src/templates/NotificationProducer-AbstractResource_init.txt
webservices/pubscribe/trunk/src/templates/NotificationProducer-Resource_init.txt
webservices/pubscribe/trunk/src/templates/NotificationProducerResource.txt
webservices/pubscribe/trunk/src/test/org/apache/ws/notification/base/impl/UnitResource.java
webservices/pubscribe/trunk/src/test/org/apache/ws/notification/base/v2004_06/porttype/impl/NotificationProducerPortTypeImplTest.java
Modified: webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/NotifRequestUtils.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem \
/src/java/example/NotifRequestUtils.java?rev=292835&r1=292834&r2=292835&view=diff \
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/NotifRequestUtils.java \
(original)
+++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/NotifRequestUtils.java \
Fri Sep 30 11:30:12 2005 @@ -1,9 +1,9 @@
package example;
-import org.apache.axis.message.addressing.Constants;
import org.apache.ws.XmlObjectWrapper;
import org.apache.ws.addressing.EndpointReference;
import org.apache.ws.addressing.XmlBeansEndpointReference;
+import org.apache.ws.addressing.v2003_03.AddressingConstants;
import org.apache.ws.util.XmlBeanUtils;
import org.apache.ws.util.soap.SoapClient;
import org.apache.xmlbeans.XmlObject;
@@ -111,7 +111,7 @@
XmlObject eprXBean = ((XmlObjectWrapper) epr).getXmlObject();
XmlObject toElem;
XmlObject actionElem;
- if (eprXBean.schemaType().getName().getNamespaceURI().equals(Constants.NS_URI_ADDRESSING_2003_03))
+ if (eprXBean.schemaType().getName().getNamespaceURI().equals(AddressingConstants.NSURI_ADDRESSING_SCHEMA))
{
org.xmlsoap.schemas.ws.x2003.x03.addressing.ToDocument toDoc = \
org.xmlsoap.schemas.ws.x2003.x03.addressing.ToDocument.Factory.newInstance();
org.xmlsoap.schemas.ws.x2003.x03.addressing.AttributedURI attributedURI \
= toDoc.addNewTo(); @@ -136,7 +136,7 @@
XmlBeanUtils.addChildElement(header, toElem);
XmlBeanUtils.addChildElement(header, actionElem);
XmlBeansEndpointReference newepr = null;
- if (eprXBean.schemaType().getName().getNamespaceURI().equals(Constants.NS_URI_ADDRESSING_2003_03))
+ if (eprXBean.schemaType().getName().getNamespaceURI().equals(AddressingConstants.NSURI_ADDRESSING_SCHEMA))
{
newepr = new \
XmlBeansEndpointReference((org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType) \
eprXBean); }
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=292835&r1=292834&r2=292835&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 Sep 30 11:30:12 2005 @@ -1,21 +1,16 @@
package org.apache.ws.resource.example.filesystem;
import org.apache.ws.addressing.EndpointReference;
-import org.apache.ws.resource.properties.impl.CallbackFailedException;
-import org.apache.ws.resource.properties.query.QueryExpression;
-import org.apache.ws.resource.ResourceHome;
-import org.apache.ws.resource.WsrfRuntime;
-import org.apache.ws.notification.topics.expression.TopicExpression;
-import org.apache.ws.notification.topics.expression.TopicExpressionException;
-import org.apache.ws.notification.topics.expression.InvalidTopicExpressionException;
-import org.apache.ws.notification.topics.expression.TopicPathDialectUnknownException;
import org.apache.ws.notification.base.impl.MessageTypeNotSupportedException;
import org.apache.ws.notification.base.impl.NotificationProducerHelper;
import org.apache.ws.notification.base.impl.SubscribeCreationFailedException;
-import org.apache.ws.notification.base.v2004_06.impl.SubscriptionHome;
+import org.apache.ws.notification.topics.expression.InvalidTopicExpressionException;
+import org.apache.ws.notification.topics.expression.TopicExpression;
+import org.apache.ws.notification.topics.expression.TopicExpressionException;
+import org.apache.ws.notification.topics.expression.TopicPathDialectUnknownException;
+import org.apache.ws.resource.properties.NamespaceVersionHolder;
+import org.apache.ws.resource.properties.query.QueryExpression;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
import java.util.Calendar;
/**
@@ -30,6 +25,8 @@
org.apache.ws.resource.PropertiesResource, \
org.apache.ws.notification.base.NotificationProducerResource {
+ private static final \
org.apache.ws.notification.base.v2004_06.impl.WsnNamespaceVersionHolderImpl \
SPEC_NAMESPACE_SET = new \
org.apache.ws.notification.base.v2004_06.impl.WsnNamespaceVersionHolderImpl(); +
/**
* The resource ID of the instance.
*/
@@ -143,12 +140,14 @@
org.apache.ws.notification.base.TopicExpressionDialectsResourcePropertyCallback \
topicExpressionDialectsPropCallback = new \
org.apache.ws.notification.base.TopicExpressionDialectsResourcePropertyCallback();
topicExpressionDialectsPropCallback.refreshProperty( \
topicExpressionDialectsProp );
topicExpressionDialectsProp.setCallback( \
topicExpressionDialectsPropCallback ); +
+ org.apache.ws.notification.topics.util.TopicUtils.addResourcePropertyValueChangeListeners( \
this ); + \
org.apache.ws.notification.topics.util.TopicUtils.addResourceTerminationListener( \
this, SPEC_NAMESPACE_SET ); }
- catch ( CallbackFailedException cfe )
+ catch ( Exception e )
{
- throw new RuntimeException( cfe );
+ throw new RuntimeException( e );
}
-
}
/**
@@ -230,6 +229,11 @@
return m_propSet;
}
+ public NamespaceVersionHolder getNamespaceSet()
+ {
+ return SPEC_NAMESPACE_SET;
+ }
+
org.apache.ws.notification.topics.TopicSet m_topicSet = new \
org.apache.ws.notification.topics.impl.TopicSetImpl();
public org.apache.ws.notification.topics.TopicSet getTopicSet()
@@ -259,18 +263,6 @@
public Object getCurrentMessage( TopicExpression topicExpr ) throws \
TopicExpressionException {
return m_producerHelper.getCurrentMessage( topicExpr );
- }
-
- public ResourceHome getSubscriptionHome()
- {
- try
- {
- return (SubscriptionHome) new InitialContext().lookup( \
WsrfRuntime.getRuntime().getHomeJndiName( \
SubscriptionHome.SERVICE_NAME.getLocalPart() ) );
- }
- catch ( NamingException ne )
- {
- throw new RuntimeException( ne );
- }
}
}
Modified: webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem \
/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java?rev=292835&r1=292834&r2=292835&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java \
(original)
+++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java \
Fri Sep 30 11:30:12 2005 @@ -105,37 +105,6 @@
// Resource Property \
{http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd}Topic \
is implemented by the framework. // Resource Property \
{http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd}TopicExpressionDialects \
is implemented by the framework.
- /**
- * This method enables the ResourceTermination Topic for notifications
- * about this resource's termination. If you would not like this
- * behaviour either comment or remove the line of code.
- */
- try
- {
- org.apache.ws.notification.topics.util.TopicUtils.addResourceTerminationListener( \
this, SPEC_NAMESPACE_SET );
- }
- catch ( Exception e )
- {
- throw new javax.xml.rpc.JAXRPCException(
- "Unable to init the ResourceTermination topic. Cause: " + \
e.getLocalizedMessage(), e );
- }
-
- /**
- * This method call will make all resource properties be exposed
- * as Topics. If you would like to change that behaviour you can
- * call TopicUtils.addResourcePropertyValueChangeTopic for each
- * Topic you'd like to expose property change notifications for.
- */
- try
- {
- org.apache.ws.notification.topics.util.TopicUtils.addResourcePropertyValueChangeListeners( \
this );
- }
- catch ( Exception e )
- {
- throw new javax.xml.rpc.JAXRPCException(
- "Unable to init the ResourceProperty Changed topics. Cause: " + \
e.getLocalizedMessage(), e );
- }
-
}
public void mount() throws Exception
@@ -152,6 +121,5 @@
{
return m_filesystem.isMounted();
}
-
}
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/eventing/Subscription.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/eventing/Subscription.java?rev=292835&r1=292834&r2=292835&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/eventing/Subscription.java \
(original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/eventing/Subscription.java Fri \
Sep 30 11:30:12 2005 @@ -20,6 +20,8 @@
import org.apache.commons.logging.LogFactory;
import org.apache.ws.pubsub.Filter;
import org.apache.ws.resource.lifetime.ScheduledResourceTerminationResource;
+import org.apache.ws.resource.properties.NamespaceVersionHolder;
+
import java.util.Calendar;
/**
@@ -143,4 +145,9 @@
destroy( );
}
+
+ public NamespaceVersionHolder getNamespaceSet()
+ {
+ return null; // TODO
+ }
}
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/eventing/pubsub/Subscription.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/eventing/pubsub/Subscription.java?rev=292835&r1=292834&r2=292835&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/eventing/pubsub/Subscription.java \
(original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/eventing/pubsub/Subscription.java \
Fri Sep 30 11:30:12 2005 @@ -21,6 +21,7 @@
import org.apache.ws.addressing.EndpointReference;
import org.apache.ws.eventing.AbstractSubscription;
import org.apache.ws.pubsub.wsaSOAPConnection;
+import org.apache.ws.resource.properties.NamespaceVersionHolder;
import org.xmlsoap.schemas.ws.x2004.x08.eventing.RenewDocument;
import org.xmlsoap.schemas.ws.x2004.x08.eventing.UnsubscribeDocument;
import javax.xml.soap.MessageFactory;
@@ -155,4 +156,10 @@
e.printStackTrace( );
}
}
+
+ public NamespaceVersionHolder getNamespaceSet()
+ {
+ return null; // TODO
+ }
+
}
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/NotificationProducerResource.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/ \
notification/base/NotificationProducerResource.java?rev=292835&r1=292834&r2=292835&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/NotificationProducerResource.java \
(original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/NotificationProducerResource.java \
Fri Sep 30 11:30:12 2005 @@ -15,17 +15,16 @@
*=============================================================================*/
package org.apache.ws.notification.base;
+import org.apache.ws.addressing.EndpointReference;
import org.apache.ws.notification.base.impl.MessageTypeNotSupportedException;
import org.apache.ws.notification.base.impl.SubscribeCreationFailedException;
import org.apache.ws.notification.topics.TopicSet;
+import org.apache.ws.notification.topics.expression.InvalidTopicExpressionException;
import org.apache.ws.notification.topics.expression.TopicExpression;
import org.apache.ws.notification.topics.expression.TopicExpressionException;
-import org.apache.ws.notification.topics.expression.InvalidTopicExpressionException;
import org.apache.ws.notification.topics.expression.TopicPathDialectUnknownException;
import org.apache.ws.resource.PropertiesResource;
-import org.apache.ws.resource.ResourceHome;
import org.apache.ws.resource.properties.query.QueryExpression;
-import org.apache.ws.addressing.EndpointReference;
import java.util.Calendar;
@@ -79,10 +78,5 @@
* @return
*/
Object getCurrentMessage( TopicExpression topicExpr ) throws \
TopicExpressionException;
-
- /**
- * @return the home in charge of managing {@link Subscription} resources for \
this notification producer resource
- */
- ResourceHome getSubscriptionHome();
}
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/SubscriptionManager.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/ \
notification/base/SubscriptionManager.java?rev=292835&r1=292834&r2=292835&view=diff \
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/SubscriptionManager.java \
(original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/SubscriptionManager.java \
Fri Sep 30 11:30:12 2005 @@ -16,8 +16,14 @@
package org.apache.ws.notification.base;
import org.apache.ws.notification.topics.Topic;
+import org.apache.ws.notification.base.v2004_06.BaseNotificationConstants;
+import org.apache.ws.notification.base.v2004_06.impl.SubscriptionHome;
import org.apache.ws.resource.ResourceException;
+import org.apache.ws.resource.ResourceHome;
+import org.apache.ws.resource.WsrfRuntime;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -104,6 +110,7 @@
List subscriptionIds = (List) topicToSubscriptionMap.get( topic );
if ( subscriptionIds != null )
{
+ ResourceHome subMgrHome = getSubscriptionManagerHome( \
producerResource ); synchronized ( subscriptionIds )
{
for ( int i = 0; i < subscriptionIds.size(); i++ )
@@ -113,7 +120,7 @@
try
{
subscription =
- (Subscription) \
producerResource.getSubscriptionHome().find( subscriptionId ); + \
(Subscription) subMgrHome.find( subscriptionId ); }
catch ( ResourceException re )
{
@@ -126,6 +133,29 @@
}
}
return (Subscription[]) subscriptions.toArray( new Subscription[0] );
+ }
+
+ public ResourceHome getSubscriptionManagerHome( NotificationProducerResource \
producerResource ) + {
+ String baseNotifXsdNsURI = \
((WsnNamespaceVersionHolder)producerResource.getNamespaceSet()).getBaseNotificationXsdNamespace();
+ String subMgrServiceName;
+ if ( baseNotifXsdNsURI.equals( BaseNotificationConstants.NSURI_WSNT_SCHEMA ) \
) + {
+ subMgrServiceName = "SubscriptionManager";
+ }
+ else
+ {
+ throw new IllegalArgumentException( "Unsupported WS-BaseNotification XSD \
namespace URI: " + baseNotifXsdNsURI ); + }
+ String subMgrHomeJndiName = WsrfRuntime.getRuntime().getHomeJndiName( \
subMgrServiceName ); + try
+ {
+ return (SubscriptionHome) new InitialContext().lookup( \
subMgrHomeJndiName ); + }
+ catch ( NamingException ne )
+ {
+ throw new RuntimeException( "Failed to lookup subscription manager home \
from JNDI using name: " + subMgrHomeJndiName ); + }
}
private Map getTopicToSubscriptionMap( Subscription subscription )
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/impl/NotificationProducerHelper.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/ \
notification/base/impl/NotificationProducerHelper.java?rev=292835&r1=292834&r2=292835&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/impl/NotificationProducerHelper.java \
(original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/impl/NotificationProducerHelper.java \
Fri Sep 30 11:30:12 2005 @@ -78,6 +78,9 @@
/**
* A helper class for a notification producer resource that keeps track of \
subscriptions and publishes messages. + * Note, this class is specification version \
neutral. + *
+ * @author Ian Springer
*/
public class NotificationProducerHelper
{
@@ -176,7 +179,7 @@
{
throw new InvalidTopicExpressionException( "Given TopicExpression did \
not match any Topics supported by this NotificationProducer - the WS-BaseN spec \
mandates that it match at least one." ); }
- SubscriptionHome subscriptionHome = (SubscriptionHome) \
m_producerResource.getSubscriptionHome(); + SubscriptionHome subscriptionHome \
= (SubscriptionHome) SubscriptionManager.getInstance().getSubscriptionManagerHome( \
m_producerResource ); Subscription subscription = null;
try
{
@@ -309,7 +312,7 @@
AddressingConstants.NSPREFIX_ADDRESSING_SCHEMA,
AddressingConstants.NSURI_ADDRESSING_SCHEMA ) );
- headerElem.addTextNode( \
BaseNotificationConstants.NOTIFY_ACTION_URI.toString() ); + \
headerElem.addTextNode( BaseNotificationConstants.NOTIFY_ACTION_URI ); \
addReferencePropertyHeaders( header, consumerEPR ); }
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/BaseNotificationConstants.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/ \
notification/base/v2004_06/BaseNotificationConstants.java?rev=292835&r1=292834&r2=292835&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/BaseNotificationConstants.java \
(original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/BaseNotificationConstants.java \
Fri Sep 30 11:30:12 2005 @@ -15,8 +15,6 @@
*=============================================================================*/
package org.apache.ws.notification.base.v2004_06;
-import java.net.URI;
-
/**
* Constants defined by the WS-BaseNotification 1.2 Draft 01 specification.
*/
@@ -25,7 +23,7 @@
/**
* Namespace URI of the WS-BaseNotification 1.2 Draft 01 schema.
*/
- URI NSURI_WSNT_SCHEMA = URI.create( \
"http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd" ); \
+ String NSURI_WSNT_SCHEMA = \
"http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd";
/**
* Namespace prefix for the WS-BaseNotification 1.2 Draft 01 schema.
@@ -35,7 +33,7 @@
/**
* Namespace URI of the WS-BaseNotification 1.2 Draft 01 WSDL.
*/
- URI NSURI_WSNT_WSDL = URI.create( \
"http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.wsdl" ); \
+ String NSURI_WSNT_WSDL = \
"http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.wsdl";
/**
* Namespace prefix for the WS-BaseNotification 1.2 Draft 01 WSDL.
@@ -45,5 +43,5 @@
/**
* The value to use for the wsa:Action header in outgoing Notify messages.
*/
- URI NOTIFY_ACTION_URI = URI.create( BaseNotificationConstants.NSURI_WSNT_WSDL + \
"/Notify" ); + String NOTIFY_ACTION_URI = BaseNotificationConstants.NSURI_WSNT_WSDL \
+ "/Notify"; }
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/impl/SubscriptionResource.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/ \
notification/base/v2004_06/impl/SubscriptionResource.java?rev=292835&r1=292834&r2=292835&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/impl/SubscriptionResource.java \
(original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/impl/SubscriptionResource.java \
Fri Sep 30 11:30:12 2005 @@ -23,6 +23,7 @@
import org.apache.ws.notification.base.v2004_06.porttype.SubscriptionManagerPortType;
import org.apache.ws.notification.base.service.subscriptionManager.SubscriptionManagerRPDocument;
import org.apache.ws.notification.base.service.subscriptionManager.ProducerReferenceDocument;
+import org.apache.ws.notification.base.WsnNamespaceVersionHolder;
import org.apache.ws.notification.topics.TopicsTypeWriter;
import org.apache.ws.notification.topics.expression.TopicExpression;
import org.apache.ws.notification.topics.v2004_06.TopicsConstants;
@@ -31,6 +32,7 @@
import org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType;
import org.apache.ws.resource.properties.ResourceProperty;
import org.apache.ws.resource.properties.ResourcePropertySetMetaData;
+import org.apache.ws.resource.properties.NamespaceVersionHolder;
import org.apache.ws.resource.properties.impl.XmlBeansResourcePropertySet;
import org.apache.ws.resource.properties.impl.XmlBeansResourcePropertySetMetaData;
import org.apache.ws.resource.properties.query.impl.XmlBeansQueryExpression;
@@ -50,11 +52,14 @@
import javax.xml.namespace.QName;
/**
- * The resource for the builtin SubscriptionManager service.
+ * The resource for the builtin 2004/06 SubscriptionManager service.
*/
public class SubscriptionResource
extends AbstractSubscription
{
+
+ private static final WsnNamespaceVersionHolder WSN_2004_06_NAMESPACE_SET = new \
org.apache.ws.notification.base.v2004_06.impl.WsnNamespaceVersionHolderImpl(); +
private static final QName[] READ_ONLY_PROP_NAMES =
{
ScheduledResourceTerminationPortType.PROP_QNAME_CURRENT_TIME,
@@ -169,4 +174,13 @@
prop.add( subPolicyDoc );
}
}
+
+ /**
+ * @see org.apache.ws.resource.Resource#getNamespaceSet()
+ */
+ public NamespaceVersionHolder getNamespaceSet()
+ {
+ return WSN_2004_06_NAMESPACE_SET;
+ }
+
}
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/impl/WsnNamespaceVersionHolderImpl.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/ \
notification/base/v2004_06/impl/WsnNamespaceVersionHolderImpl.java?rev=292835&r1=292834&r2=292835&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/impl/WsnNamespaceVersionHolderImpl.java \
(original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/impl/WsnNamespaceVersionHolderImpl.java \
Fri Sep 30 11:30:12 2005 @@ -34,7 +34,7 @@
*/
public String getBaseNotificationXsdNamespace( )
{
- return BaseNotificationConstants.NSURI_WSNT_SCHEMA.toString();
+ return BaseNotificationConstants.NSURI_WSNT_SCHEMA;
}
/**
@@ -54,6 +54,6 @@
*/
public String getTopicsXsdNamespace( )
{
- return TopicsConstants.NSURI_WSTOP_SCHEMA.toString();
+ return TopicsConstants.NSURI_WSTOP_SCHEMA;
}
}
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/NotificationProducerPortType.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/ \
notification/base/v2004_06/porttype/NotificationProducerPortType.java?rev=292835&r1=292834&r2=292835&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/NotificationProducerPortType.java \
(original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/NotificationProducerPortType.java \
Fri Sep 30 11:30:12 2005 @@ -23,7 +23,7 @@
import javax.xml.namespace.QName;
/**
- * The WS-BaseNotification NotificationProducer portType.
+ * The WS-BaseNotification 2004/06 NotificationProducer portType.
*/
public interface NotificationProducerPortType
{
@@ -31,35 +31,35 @@
* QName of NotificationProducer.
*/
QName NAME =
- new QName( BaseNotificationConstants.NSURI_WSNT_WSDL.toString(), \
"NotificationProducer", + new QName( BaseNotificationConstants.NSURI_WSNT_WSDL, \
"NotificationProducer", BaseNotificationConstants.NSPREFIX_WSNT_WSDL );
/**
* QName of NotificationProducerRP Resource Properties Document.
*/
QName PROPS_DOC_NAME =
- new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA.toString(), \
"NotificationProducerRP", + new QName( \
BaseNotificationConstants.NSURI_WSNT_SCHEMA, "NotificationProducerRP", \
BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
/**
* Topic property name.
*/
QName PROP_QNAME_TOPIC =
- new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA.toString(), "Topic",
+ new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA, "Topic",
BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
/**
* FixedTopicSet property name.
*/
QName PROP_QNAME_FIXED_TOPIC_SET =
- new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA.toString(), \
"FixedTopicSet", + new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA, \
"FixedTopicSet", BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
/**
* TopicExpressionDialects property name.
*/
QName PROP_QNAME_TOPIC_EXPRESSION_DIALECTS =
- new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA.toString(), \
"TopicExpressionDialects", + new QName( \
BaseNotificationConstants.NSURI_WSNT_SCHEMA, "TopicExpressionDialects", \
BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
/**
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/SubscriptionManagerPortType.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/ \
notification/base/v2004_06/porttype/SubscriptionManagerPortType.java?rev=292835&r1=292834&r2=292835&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/SubscriptionManagerPortType.java \
(original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/SubscriptionManagerPortType.java \
Fri Sep 30 11:30:12 2005 @@ -23,7 +23,7 @@
import javax.xml.namespace.QName;
/**
- * The WS-BaseNotification SubscriptionManager portType.
+ * The WS-BaseNotification 2004/06 SubscriptionManager portType.
*/
public interface SubscriptionManagerPortType
{
@@ -31,21 +31,21 @@
* QName of SubscriptionManager
*/
QName NAME =
- new QName( BaseNotificationConstants.NSURI_WSNT_WSDL.toString(), \
"SubscriptionManager", + new QName( BaseNotificationConstants.NSURI_WSNT_WSDL, \
"SubscriptionManager", BaseNotificationConstants.NSPREFIX_WSNT_WSDL );
/**
* QName of the SubscriptionManagerRP Resource Property Document
*/
QName PROPS_DOC_NAME =
- new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA.toString(), \
"SubscriptionManagerRP", + new QName( \
BaseNotificationConstants.NSURI_WSNT_SCHEMA, "SubscriptionManagerRP", \
BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
/**
* ConsumerReference property name.
*/
QName PROP_QNAME_CONSUMER_REFERENCE =
- new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA.toString(), \
"ConsumerReference", + new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA, \
"ConsumerReference", BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
/**
@@ -60,42 +60,42 @@
* TopicExpression property name.
*/
QName PROP_QNAME_TOPIC_EXPRESSION =
- new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA.toString(), \
"TopicExpression", + new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA, \
"TopicExpression", BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
/**
* UseNotify property name.
*/
QName PROP_QNAME_USE_NOTIFY =
- new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA.toString(), \
"UseNotify", + new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA, \
"UseNotify", BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
/**
* Precondition property name.
*/
QName PROP_QNAME_PRECONDITION =
- new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA.toString(), \
"Precondition", + new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA, \
"Precondition", BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
/**
* Selector property name.
*/
QName PROP_QNAME_SELECTOR =
- new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA.toString(), "Selector",
+ new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA, "Selector",
BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
/**
* SubscriptionPolicy property name.
*/
QName PROP_QNAME_SUBSCRIPTION_POLICY =
- new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA.toString(), \
"SubscriptionPolicy", + new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA, \
"SubscriptionPolicy", BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
/**
* CreationTime property name.
*/
QName PROP_QNAME_CREATION_TIME =
- new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA.toString(), \
"CreationTime", + new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA, \
"CreationTime", BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
/**
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/impl/NotificationProducerPortTypeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/ \
notification/base/v2004_06/porttype/impl/NotificationProducerPortTypeImpl.java?rev=292835&r1=292834&r2=292835&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/impl/NotificationProducerPortTypeImpl.java \
(original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/impl/NotificationProducerPortTypeImpl.java \
Fri Sep 30 11:30:12 2005 @@ -48,7 +48,6 @@
import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.TopicExpressionType;
import org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType;
-import java.net.URI;
import java.util.Calendar;
/**
@@ -61,8 +60,7 @@
implements NotificationProducerPortType
{
- private static final WsnNamespaceVersionHolder NAMESPACE_SET = new \
WsnNamespaceVersionHolderImpl();
- private static final TopicsTypeReader TOPICS_TYPE_READER = \
TopicsTypeReader.newInstance( URI.create( NAMESPACE_SET.getTopicsXsdNamespace() ) ); \
+ private static final WsnNamespaceVersionHolder WSN_2004_06_NAMESPACE_SET = new \
WsnNamespaceVersionHolderImpl();
private NotificationProducerResource m_producerResource;
@@ -115,15 +113,15 @@
}
catch ( SubscribeCreationFailedException scfe )
{
- throw new SubscribeCreationFailedFaultException( NAMESPACE_SET );
+ throw new SubscribeCreationFailedFaultException( \
WSN_2004_06_NAMESPACE_SET ); }
catch ( InvalidTopicExpressionException itee )
{
- throw new InvalidTopicExpressionFaultException( NAMESPACE_SET, \
itee.getLocalizedMessage() ); + throw new \
InvalidTopicExpressionFaultException( WSN_2004_06_NAMESPACE_SET, \
itee.getLocalizedMessage() ); }
catch ( TopicPathDialectUnknownException tpdue )
{
- throw new TopicPathDialectUnknownFaultException( NAMESPACE_SET, \
tpdue.getLocalizedMessage() ); + throw new \
TopicPathDialectUnknownFaultException( WSN_2004_06_NAMESPACE_SET, \
tpdue.getLocalizedMessage() ); }
return buildSubscribeResponseDocument( subscriptionEPR );
}
@@ -142,7 +140,7 @@
}
catch ( InvalidTopicExpressionException itee )
{
- throw new InvalidTopicExpressionFaultException( NAMESPACE_SET, \
itee.getLocalizedMessage() ); + throw new \
InvalidTopicExpressionFaultException( WSN_2004_06_NAMESPACE_SET, \
itee.getLocalizedMessage() ); }
catch ( TopicExpressionException tee )
{
@@ -150,7 +148,7 @@
}
if ( currentMsg == null )
{
- throw new NoCurrentMessageOnTopicFaultException( NAMESPACE_SET );
+ throw new NoCurrentMessageOnTopicFaultException( \
WSN_2004_06_NAMESPACE_SET ); }
return buildGetCurrentMessageResponseDocument( currentMsg );
}
@@ -189,13 +187,14 @@
private TopicExpression toTopicExpression( TopicExpressionType topicExprType )
{
+ TopicsTypeReader topicsTypeReader = TopicsTypeReader.newInstance( \
WSN_2004_06_NAMESPACE_SET.getTopicsXsdNamespace() ); try
{
- return TOPICS_TYPE_READER.toTopicExpression( topicExprType );
+ return topicsTypeReader.toTopicExpression( topicExprType );
}
catch ( InvalidTopicExpressionException itee )
{
- throw new InvalidTopicExpressionFaultException( NAMESPACE_SET, \
itee.getLocalizedMessage() ); + throw new \
InvalidTopicExpressionFaultException( WSN_2004_06_NAMESPACE_SET, \
itee.getLocalizedMessage() ); }
}
@@ -206,7 +205,7 @@
*/
protected NamespaceVersionHolder getNamespaceSet()
{
- return NAMESPACE_SET;
+ return WSN_2004_06_NAMESPACE_SET;
}
}
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/pubsub/Subscription.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/pubsub/Subscription.java?rev=292835&r1=292834&r2=292835&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/pubsub/Subscription.java \
(original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/pubsub/Subscription.java \
Fri Sep 30 11:30:12 2005 @@ -19,6 +19,7 @@
import org.apache.ws.addressing.XmlBeansEndpointReference;
import org.apache.ws.notification.base.impl.AbstractSubscription;
import org.apache.ws.pubsub.SubscriptionEndConsumer;
+import org.apache.ws.resource.properties.NamespaceVersionHolder;
import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.SubscribeResponseDocument;
import org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType;
import java.util.Calendar;
@@ -77,4 +78,10 @@
public void init( )
{
}
+
+ public NamespaceVersionHolder getNamespaceSet()
+ {
+ return null; // TODO
+ }
+
}
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicsTypeReader.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/ \
notification/topics/TopicsTypeReader.java?rev=292835&r1=292834&r2=292835&view=diff \
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicsTypeReader.java \
(original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicsTypeReader.java \
Fri Sep 30 11:30:12 2005 @@ -16,21 +16,19 @@
package org.apache.ws.notification.topics;
import org.apache.ws.UnsupportedNamespaceException;
-import org.apache.ws.notification.topics.expression.TopicExpression;
import org.apache.ws.notification.topics.expression.InvalidTopicExpressionException;
+import org.apache.ws.notification.topics.expression.TopicExpression;
import org.apache.ws.notification.topics.v2004_06.TopicsConstants;
import org.apache.ws.notification.topics.v2004_06.TopicsTypeReaderImpl;
import org.apache.xmlbeans.XmlObject;
-import java.net.URI;
-
/**
* TODO
*/
public abstract class TopicsTypeReader
{
- public static TopicsTypeReader newInstance( URI schemaNamespace ) throws \
UnsupportedNamespaceException + public static TopicsTypeReader newInstance( String \
schemaNamespace ) throws UnsupportedNamespaceException {
if ( schemaNamespace.equals( TopicsConstants.NSURI_WSTOP_SCHEMA ) )
{
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicsTypeWriter.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/ \
notification/topics/TopicsTypeWriter.java?rev=292835&r1=292834&r2=292835&view=diff \
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicsTypeWriter.java \
(original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicsTypeWriter.java \
Fri Sep 30 11:30:12 2005 @@ -17,15 +17,14 @@
import org.apache.commons.lang.StringUtils;
import org.apache.ws.UnsupportedNamespaceException;
-import org.apache.ws.util.XmlBeanUtils;
import org.apache.ws.notification.topics.expression.TopicExpression;
import org.apache.ws.notification.topics.v2004_06.TopicsConstants;
import org.apache.ws.notification.topics.v2004_06.TopicsTypeWriterImpl;
+import org.apache.ws.util.XmlBeanUtils;
import org.apache.xmlbeans.XmlCursor;
import org.apache.xmlbeans.XmlObject;
import javax.xml.namespace.QName;
-import java.net.URI;
/**
* A writer that can serialize various WS-Topics types to strongly-typed {@link \
XmlObject}s. @@ -34,7 +33,7 @@
public abstract class TopicsTypeWriter
{
- public static TopicsTypeWriter newInstance( URI schemaNamespace ) throws \
UnsupportedNamespaceException + public static TopicsTypeWriter newInstance( String \
schemaNamespace ) throws UnsupportedNamespaceException {
if ( schemaNamespace.equals( TopicsConstants.NSURI_WSTOP_SCHEMA ) )
{
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/v2004_06/TopicsConstants.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/ \
notification/topics/v2004_06/TopicsConstants.java?rev=292835&r1=292834&r2=292835&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/v2004_06/TopicsConstants.java \
(original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/v2004_06/TopicsConstants.java \
Fri Sep 30 11:30:12 2005 @@ -15,8 +15,6 @@
*=============================================================================*/
package org.apache.ws.notification.topics.v2004_06;
-import java.net.URI;
-
/**
* Constants defined by the WS-Topics 1.2 Draft 01 specification.
*/
@@ -26,7 +24,7 @@
/**
* Namespace URI of the WS-Topics 1.2 Draft 01 schema.
*/
- URI NSURI_WSTOP_SCHEMA = URI.create( \
"http://docs.oasis-open.org/wsn/2004/06/wsn-WS-Topics-1.2-draft-01.xsd" ); + String \
NSURI_WSTOP_SCHEMA = \
"http://docs.oasis-open.org/wsn/2004/06/wsn-WS-Topics-1.2-draft-01.xsd";
/**
* Namespace prefix for the WS-Topics 1.2 Draft 01 schema.
Modified: webservices/pubscribe/trunk/src/templates/NotificationProducer-AbstractResource_init.txt
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/templates/NotificationProducer-AbstractResource_init.txt?rev=292835&r1=292834&r2=292835&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/templates/NotificationProducer-AbstractResource_init.txt \
(original)
+++ webservices/pubscribe/trunk/src/templates/NotificationProducer-AbstractResource_init.txt \
Fri Sep 30 11:30:12 2005 @@ -1,9 +1,28 @@
- 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() ) \
); + try
+ {
+ org.apache.ws.resource.properties.ResourceProperty topicProp = \
getResourcePropertySet().get( \
org.apache.ws.notification.base.v2004_06.porttype.NotificationProducerPortType.PROP_QNAME_TOPIC \
); + org.apache.ws.resource.properties.ResourcePropertyCallback \
topicPropCallback = new \
org.apache.ws.notification.base.TopicResourcePropertyCallback( getTopicSet() ); + \
topicPropCallback.refreshProperty( topicProp ); + topicProp.setCallback( \
topicPropCallback );
- 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 fixedTopicSetProp = \
getResourcePropertySet().get( \
org.apache.ws.notification.base.v2004_06.porttype.NotificationProducerPortType.PROP_QNAME_FIXED_TOPIC_SET \
); + org.apache.ws.notification.base.FixedTopicSetResourcePropertyCallback \
fixedTopicSetPropCallback = new \
org.apache.ws.notification.base.FixedTopicSetResourcePropertyCallback( getTopicSet() \
); + fixedTopicSetPropCallback.refreshProperty( fixedTopicSetProp );
+ fixedTopicSetProp.setCallback( fixedTopicSetPropCallback );
- 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() \
);
-
\ No newline at end of file
+ org.apache.ws.resource.properties.ResourceProperty \
topicExpressionDialectsProp = getResourcePropertySet().get( \
org.apache.ws.notification.base.v2004_06.porttype.NotificationProducerPortType.PROP_QNAME_TOPIC_EXPRESSION_DIALECTS \
); + org.apache.ws.notification.base.TopicExpressionDialectsResourcePropertyCallback \
topicExpressionDialectsPropCallback = new \
org.apache.ws.notification.base.TopicExpressionDialectsResourcePropertyCallback(); + \
topicExpressionDialectsPropCallback.refreshProperty( topicExpressionDialectsProp ); + \
topicExpressionDialectsProp.setCallback( topicExpressionDialectsPropCallback ); +
+#if( $propChange )
+ org.apache.ws.notification.topics.util.TopicUtils.addResourcePropertyValueChangeListeners( \
this ); +#end
+#if( $resourceTermination )
+ org.apache.ws.notification.topics.util.TopicUtils.addResourceTerminationListener( \
this, SPEC_NAMESPACE_SET ); +#end
+ }
+ catch ( Exception e )
+ {
+ throw new RuntimeException( e );
+ }
Modified: webservices/pubscribe/trunk/src/templates/NotificationProducer-Resource_init.txt
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/templates/NotificationProducer-Resource_init.txt?rev=292835&r1=292834&r2=292835&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/templates/NotificationProducer-Resource_init.txt \
(original)
+++ webservices/pubscribe/trunk/src/templates/NotificationProducer-Resource_init.txt \
Fri Sep 30 11:30:12 2005 @@ -1,35 +0,0 @@
-#set( $propchange = $propChange)
-#set( $termination = $resourceTermination)
-
-
-#if($termination )
- /**
- * This method enables the ResourceTermination Topic for notifications
- * about this resource's termination. If you would not like this
- * behaviour either comment or remove the line of code.
- */
- try
- {
- org.apache.ws.notification.topics.util.TopicUtils.addResourceTerminationTopic( \
getTopicSpaceSet(), this, SPEC_NAMESPACE_SET );
- }
- catch (Exception e)
- {
- throw new javax.xml.rpc.JAXRPCException("Unable to init the ResourceTermination \
topic. Cause: " + e.getLocalizedMessage(), e);
- }
-#end
-#if($propchange )
- /**
- * This method call will make all resource properties be exposed
- * as Topics. If you would like to change that behaviour you can
- * call TopicUtils.addResourcePropertyValueChangeTopic for each
- * Topic you'd like to expose property change notifications for.
- */
- try
- {
- org.apache.ws.notification.topics.util.TopicUtils.addResourcePropertyValueChangeTopics( \
getResourcePropertySet(), getTopicSpaceSet() );
- }
- catch (Exception e)
- {
- throw new javax.xml.rpc.JAXRPCException("Unable to init the ResourceProperty \
Changed topics. Cause: " + e.getLocalizedMessage(), e);
- }
-#end
\ No newline at end of file
Modified: webservices/pubscribe/trunk/src/templates/NotificationProducerResource.txt
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/templates/NotificationProducerResource.txt?rev=292835&r1=292834&r2=292835&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/templates/NotificationProducerResource.txt \
(original)
+++ webservices/pubscribe/trunk/src/templates/NotificationProducerResource.txt Fri \
Sep 30 11:30:12 2005 @@ -1,7 +1,32 @@
-
- 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;
- }
+
+ private org.apache.ws.notification.base.impl.NotificationProducerHelper \
m_producerHelper = new \
org.apache.ws.notification.base.impl.NotificationProducerHelper( this ); +
+ private org.apache.ws.notification.topics.TopicSet m_topicSet = new \
org.apache.ws.notification.topics.impl.TopicSetImpl(); +
+ public org.apache.ws.notification.topics.TopicSet getTopicSet()
+ {
+ return m_topicSet;
+ }
+
+ public void setTopicSet( org.apache.ws.notification.topics.TopicSet topicSet )
+ {
+ m_topicSet = topicSet;
+ }
+
+ public void publish( \
org.apache.ws.notification.topics.expression.TopicExpression topicExpr, Object msg ) \
throws TopicExpressionException, MessageTypeNotSupportedException + {
+ m_producerHelper.publish( topicExpr, msg );
+ }
+
+ public EndpointReference subscribe( EndpointReference consumerEPR, \
org.apache.ws.notification.topics.expression.TopicExpression topicExpr, Boolean \
useNotify, + QueryExpression precondition, \
QueryExpression selector, + Object \
subscriptionPolicy, Calendar initialTerminationtime ) + throws \
SubscribeCreationFailedException, InvalidTopicExpressionException, \
TopicPathDialectUnknownException + {
+ return m_producerHelper.subscribe( consumerEPR, topicExpr, useNotify, \
precondition, selector, subscriptionPolicy, initialTerminationtime ); + }
+
+ public Object getCurrentMessage( \
org.apache.ws.notification.topics.expression.TopicExpression topicExpr ) throws \
TopicExpressionException + {
+ return m_producerHelper.getCurrentMessage( topicExpr );
+ }
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=292835&r1=292834&r2=292835&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 Sep 30 11:30:12 2005 @@ -24,6 +24,8 @@
import org.apache.ws.resource.ResourceHome;
import org.apache.ws.resource.lifetime.ResourceTerminationListener;
import org.apache.ws.resource.properties.ResourcePropertySet;
+import org.apache.ws.resource.properties.NamespaceVersionHolder;
+import org.apache.ws.resource.properties.v2004_06.impl.NamespaceVersionHolderImpl;
import org.apache.ws.resource.properties.query.QueryExpression;
import org.apache.ws.resource.properties.impl.XmlBeansResourcePropertySet;
import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.NotificationProducerRPDocument;
@@ -177,11 +179,6 @@
return null; //To change body of implemented methods use File | Settings | \
File Templates. }
- public ResourceHome getSubscriptionHome()
- {
- return null; //To change body of implemented methods use File | Settings | \
File Templates.
- }
-
public EndpointReference subscribe( EndpointReference consumerEPR, \
TopicExpression topicExpr, Boolean useNotify,
QueryExpression precondition, \
QueryExpression selector,
Object subscriptionPolicy, Calendar \
initialTerminationtime ) @@ -189,5 +186,10 @@
{
return null; //To change body of implemented methods use File | Settings | \
File Templates. }
-
+
+ public NamespaceVersionHolder getNamespaceSet()
+ {
+ return new NamespaceVersionHolderImpl();
+ }
+
}
Modified: webservices/pubscribe/trunk/src/test/org/apache/ws/notification/base/v2004_06/porttype/impl/NotificationProducerPortTypeImplTest.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/test/org/apache/ws/ \
notification/base/v2004_06/porttype/impl/NotificationProducerPortTypeImplTest.java?rev=292835&r1=292834&r2=292835&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/test/org/apache/ws/notification/base/v2004_06/porttype/impl/NotificationProducerPortTypeImplTest.java \
(original)
+++ webservices/pubscribe/trunk/src/test/org/apache/ws/notification/base/v2004_06/porttype/impl/NotificationProducerPortTypeImplTest.java \
Fri Sep 30 11:30:12 2005 @@ -167,7 +167,7 @@
//get notify
XmlObject[] bodyElems =
XmlBeanUtils.getChildElements( body,
- new QName( \
BaseNotificationConstants.NSURI_WSNT_SCHEMA.toString(), "Notify" ) ); + \
new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA, "Notify" ) );
assertEquals( "The SOAP Body does not contain exactly one wsnt:Notify \
element.", 1, bodyElems.length ); XmlObject notifyDoc = bodyElems[0];
assertTrue( "The SOAP Body does not contain a wrapped notification with a \
Notify element.", @@ -177,7 +177,7 @@
{ //see what this should be
XmlObject[] bodyElems =
XmlBeanUtils.getChildElements( body,
- new QName( \
BaseNotificationConstants.NSURI_WSNT_SCHEMA.toString(), "Notify" ) ); + \
new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA, "Notify" ) ); }
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic