Author: ips Date: Wed Jan 26 14:25:45 2005 New Revision: 126549 URL: http://svn.apache.org/viewcvs?view=rev&rev=126549 Log: various Added: incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/ResourcePropertyValueChangeTopic.java incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/ResourcePropertyValueChangeTopicImpl.java incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/util/ incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/util/TopicUtils.java incubator/hermes/trunk/src/templates/NotificationProducer-AbstractResource_init.txt incubator/hermes/trunk/src/templates/NotificationProducer-Resource_init.txt incubator/hermes/trunk/src/templates/NotificationProducerResource.txt Modified: incubator/hermes/trunk/ (props changed) incubator/hermes/trunk/project.xml incubator/hermes/trunk/src/java/org/apache/ws/notification/tool/v1_2/NotificationConsumerPortType2JavaInfo.java incubator/hermes/trunk/src/java/org/apache/ws/notification/tool/v1_2/NotificationProducerPortType2JavaInfo.java incubator/hermes/trunk/src/java/org/apache/ws/notification/tool/v1_2/SubscriptionManagerPortType2JavaInfo.java incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/TopicSpaceSet.java incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/SimpleSubscriptionTopicListener.java incubator/hermes/trunk/src/templates/NotificationProducerPortType.txt incubator/hermes/trunk/wsn-xbeans/ (props changed) incubator/hermes/trunk/wsn-xbeans/src/ (props changed)
Modified: incubator/hermes/trunk/project.xml Url: http://svn.apache.org/viewcvs/incubator/hermes/trunk/project.xml?view=diff&rev=126549&p1=incubator/hermes/trunk/project.xml&r1=126548&p2=incubator/hermes/trunk/project.xml&r2=126549 ============================================================================== --- incubator/hermes/trunk/project.xml (original) +++ incubator/hermes/trunk/project.xml Wed Jan 26 14:25:45 2005 @@ -414,9 +414,11 @@ </dependencies> <build> + <nagEmailAddress>[EMAIL PROTECTED]</nagEmailAddress> <sourceDirectory>src/java</sourceDirectory> <unitTestSourceDirectory>src/test</unitTestSourceDirectory> + <unitTest> <includes> <include>**/*TestCase.java</include> @@ -425,7 +427,9 @@ <exclude>**/Abstract*TestCase.java</exclude> </excludes> </unitTest> + <resources> + <resource> <directory>${basedir}/src/java</directory> <excludes> @@ -434,22 +438,17 @@ </excludes> <filtering>false</filtering> </resource> + <resource> - <directory>${basedir}/src/test</directory> - <excludes> - <exclude>**/*.java</exclude> - <exclude>**/package.html</exclude> - </excludes> - <filtering>false</filtering> - </resource> - <resource> - <directory>${basedir}/src</directory> + <directory>src</directory> <includes> - <include>wsdl/jmuws/**</include> + <include>templates/**</include> </includes> <filtering>false</filtering> - </resource> + </resource> + </resources> + </build> <reports> Modified: incubator/hermes/trunk/src/java/org/apache/ws/notification/tool/v1_2/NotificationConsumerPortType2JavaInfo.java Url: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/notification/tool/v1_2/NotificationConsumerPortType2JavaInfo.java?view=diff&rev=126549&p1=incubator/hermes/trunk/src/java/org/apache/ws/notification/tool/v1_2/NotificationConsumerPortType2JavaInfo.java&r1=126548&p2=incubator/hermes/trunk/src/java/org/apache/ws/notification/tool/v1_2/NotificationConsumerPortType2JavaInfo.java&r2=126549 ============================================================================== --- incubator/hermes/trunk/src/java/org/apache/ws/notification/tool/v1_2/NotificationConsumerPortType2JavaInfo.java (original) +++ incubator/hermes/trunk/src/java/org/apache/ws/notification/tool/v1_2/NotificationConsumerPortType2JavaInfo.java Wed Jan 26 14:25:45 2005 @@ -26,7 +26,7 @@ * * @author Ian Springer (ian DOT springer AT hp DOT com) */ -public class NotificationConsumerPortType2JavaInfo implements PortType2JavaInfo +public class NotificationConsumerPortType2JavaInfo extends PortType2JavaInfo { public QName getName() @@ -34,19 +34,9 @@ return NotificationConsumerPortType.NAME; } - public String getResourceInterfaceName() - { - return null; - } - public String getServiceInterfaceName() { return NotificationConsumerPortType.class.getName(); - } - - public String getResourceTemplateFileName() - { - return null; } public String getServiceTemplateFileName() Modified: incubator/hermes/trunk/src/java/org/apache/ws/notification/tool/v1_2/NotificationProducerPortType2JavaInfo.java Url: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/notification/tool/v1_2/NotificationProducerPortType2JavaInfo.java?view=diff&rev=126549&p1=incubator/hermes/trunk/src/java/org/apache/ws/notification/tool/v1_2/NotificationProducerPortType2JavaInfo.java&r1=126548&p2=incubator/hermes/trunk/src/java/org/apache/ws/notification/tool/v1_2/NotificationProducerPortType2JavaInfo.java&r2=126549 ============================================================================== --- incubator/hermes/trunk/src/java/org/apache/ws/notification/tool/v1_2/NotificationProducerPortType2JavaInfo.java (original) +++ incubator/hermes/trunk/src/java/org/apache/ws/notification/tool/v1_2/NotificationProducerPortType2JavaInfo.java Wed Jan 26 14:25:45 2005 @@ -26,7 +26,7 @@ * * @author Ian Springer (ian DOT springer AT hp DOT com) */ -public class NotificationProducerPortType2JavaInfo implements PortType2JavaInfo +public class NotificationProducerPortType2JavaInfo extends PortType2JavaInfo { public QName getName() @@ -44,14 +44,24 @@ return NotificationProducerPortType.class.getName(); } + public String getServiceTemplateFileName() + { + return "templates/NotificationProducerPortType.txt"; + } + public String getResourceTemplateFileName() { - return null; + return "templates/NotificationProducerResource.txt"; } - public String getServiceTemplateFileName() + public String getAbstractResourceInitMethodIncludeLocation() { - return "templates/NotificationProducerPortType.txt"; + return "templates/NotificationProducer-AbstractResource_init.txt"; + } + + public String getResourceInitMethodIncludeLocation() + { + return "templates/NotificationProducer-Resource_init.txt"; } } Modified: incubator/hermes/trunk/src/java/org/apache/ws/notification/tool/v1_2/SubscriptionManagerPortType2JavaInfo.java Url: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/notification/tool/v1_2/SubscriptionManagerPortType2JavaInfo.java?view=diff&rev=126549&p1=incubator/hermes/trunk/src/java/org/apache/ws/notification/tool/v1_2/SubscriptionManagerPortType2JavaInfo.java&r1=126548&p2=incubator/hermes/trunk/src/java/org/apache/ws/notification/tool/v1_2/SubscriptionManagerPortType2JavaInfo.java&r2=126549 ============================================================================== --- incubator/hermes/trunk/src/java/org/apache/ws/notification/tool/v1_2/SubscriptionManagerPortType2JavaInfo.java (original) +++ incubator/hermes/trunk/src/java/org/apache/ws/notification/tool/v1_2/SubscriptionManagerPortType2JavaInfo.java Wed Jan 26 14:25:45 2005 @@ -25,7 +25,7 @@ * * @author Ian Springer (ian DOT springer AT hp DOT com) */ -public class SubscriptionManagerPortType2JavaInfo implements PortType2JavaInfo +public class SubscriptionManagerPortType2JavaInfo extends PortType2JavaInfo { public QName getName() @@ -33,19 +33,9 @@ return SubscriptionManagerPortType.NAME; } - public String getResourceInterfaceName() - { - return null; - } - public String getServiceInterfaceName() { return SubscriptionManagerPortType.class.getName(); - } - - public String getResourceTemplateFileName() - { - return null; } public String getServiceTemplateFileName() Added: incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/ResourcePropertyValueChangeTopic.java Url: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/ResourcePropertyValueChangeTopic.java?view=auto&rev=126549 ============================================================================== --- (empty file) +++ incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/ResourcePropertyValueChangeTopic.java Wed Jan 26 14:25:45 2005 @@ -0,0 +1,31 @@ +/*=============================================================================* + * Copyright 2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *=============================================================================*/ +package org.apache.ws.notification.topics; + +import org.apache.ws.resource.properties.ResourcePropertyValueChangeListener; +import org.apache.ws.resource.properties.ResourceProperty; + +/** + * TODO + * + * @author Ian Springer (ian DOT springer AT hp DOT com) + */ +public interface ResourcePropertyValueChangeTopic extends Topic, ResourcePropertyValueChangeListener +{ + + ResourceProperty getResourceProperty(); + +} Modified: incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/TopicSpaceSet.java Url: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/TopicSpaceSet.java?view=diff&rev=126549&p1=incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/TopicSpaceSet.java&r1=126548&p2=incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/TopicSpaceSet.java&r2=126549 ============================================================================== --- incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/TopicSpaceSet.java (original) +++ incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/TopicSpaceSet.java Wed Jan 26 14:25:45 2005 @@ -15,7 +15,6 @@ *=============================================================================*/ package org.apache.ws.notification.topics; -import org.apache.ws.notification.topics.topicexpression.impl.TopicExpressionResolutionException; import org.apache.ws.notification.topics.topicexpression.impl.TopicExpressionException; import javax.xml.soap.SOAPEnvelope; @@ -37,5 +36,5 @@ TopicSpace[] getTopicSpaces(); - Collection evaluateExpression(TopicExpression topicExpr, SOAPEnvelope envelope) throws TopicExpressionException; + Collection evaluateExpression( TopicExpression topicExpr, SOAPEnvelope envelope ) throws TopicExpressionException; } Added: incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/ResourcePropertyValueChangeTopicImpl.java Url: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/ResourcePropertyValueChangeTopicImpl.java?view=auto&rev=126549 ============================================================================== --- (empty file) +++ incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/ResourcePropertyValueChangeTopicImpl.java Wed Jan 26 14:25:45 2005 @@ -0,0 +1,63 @@ +/*=============================================================================* + * Copyright 2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *=============================================================================*/ +package org.apache.ws.notification.topics.impl; + +import org.apache.ws.notification.topics.ResourcePropertyValueChangeTopic; +import org.apache.ws.resource.properties.ResourceProperty; +import org.apache.ws.resource.properties.ResourcePropertyValueChangeEvent; +import org.apache.ws.XmlObjectWrapper; + +/** + * TODO + */ +public class ResourcePropertyValueChangeTopicImpl extends TopicImpl implements ResourcePropertyValueChangeTopic +{ + private ResourceProperty m_prop; + + public ResourcePropertyValueChangeTopicImpl( ResourceProperty prop ) + { + super( prop.getMetaData().getName().getLocalPart() ); + m_prop = prop; + } + + public ResourceProperty getResourceProperty() + { + return m_prop; + } + + public void propertyChanged( ResourcePropertyValueChangeEvent event ) + { + Object msg; + if ( event instanceof XmlObjectWrapper ) + { + msg = ((XmlObjectWrapper)event).getXmlObject(); + } + else + { + msg = event; + } + try + { + publish( msg ); + } + catch ( Exception e ) + { + // TODO: do we want to throw this and cause the SetRP request to fault? + e.printStackTrace(); + } + } + +} Modified: incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/SimpleSubscriptionTopicListener.java Url: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/SimpleSubscriptionTopicListener.java?view=diff&rev=126549&p1=incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/SimpleSubscriptionTopicListener.java&r1=126548&p2=incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/SimpleSubscriptionTopicListener.java&r2=126549 ============================================================================== --- incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/SimpleSubscriptionTopicListener.java (original) +++ incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/SimpleSubscriptionTopicListener.java Wed Jan 26 14:25:45 2005 @@ -98,11 +98,11 @@ * @param subscription The subscription for which to send the notification * @param topicPath The topic path of the topic that caused the * notification - * @param newValue The new value of the topic + * @param msg The new value of the topic * @throws Exception */ protected void notify( - Subscription subscription, List topicPath, Object newValue) + Subscription subscription, List topicPath, Object msg) throws Exception { @@ -110,7 +110,7 @@ { if(!subscription.isPaused()) { - System.out.println("+++++++++++++++++++++We just got notified!!!!! value: " + newValue); + System.out.println("Notification received for subscription with Id " + subscription.getID() + "; value: " + msg); /* EndpointReferenceType consumerEPR = subscription.getNotificationConsumer().getEPR(); Added: incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/util/TopicUtils.java Url: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/util/TopicUtils.java?view=auto&rev=126549 ============================================================================== --- (empty file) +++ incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/util/TopicUtils.java Wed Jan 26 14:25:45 2005 @@ -0,0 +1,86 @@ +/*=============================================================================* + * Copyright 2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *=============================================================================*/ +package org.apache.ws.notification.topics.util; + +import org.apache.ws.notification.topics.TopicSpaceSet; +import org.apache.ws.notification.topics.ResourcePropertyValueChangeTopic; +import org.apache.ws.notification.topics.Topic; +import org.apache.ws.notification.topics.TopicSpace; +import org.apache.ws.notification.topics.impl.ResourcePropertyValueChangeTopicImpl; +import org.apache.ws.notification.topics.impl.TopicSpaceImpl; +import org.apache.ws.resource.properties.ResourceProperty; +import org.apache.ws.resource.properties.ResourcePropertySet; + +import java.util.Iterator; +import java.util.ArrayList; +import java.util.List; + +/** + * TODO + */ +public class TopicUtils +{ + + /** + * Adds a topic for the specified property to the specified topic set. + * + * @param prop + * @param topicSet + * @return + */ + public static Topic addResourcePropertyValueChangeTopic( ResourceProperty prop, TopicSpaceSet topicSet ) + { + if ( prop.getMetaData().isReadOnly() ) + { + throw new IllegalArgumentException( "Property " + prop.getMetaData().getName() + " is readonly!" ); + } + ResourcePropertyValueChangeTopic valueChangeTopic = new ResourcePropertyValueChangeTopicImpl( prop ); + prop.setChangeListener( valueChangeTopic ); + String topicNsURI = prop.getMetaData().getName().getNamespaceURI(); + TopicSpace topicSpace = topicSet.getTopicSpace( topicNsURI ); + if ( topicSpace == null ) + { + topicSpace = new TopicSpaceImpl( topicNsURI ); + topicSet.addTopicSpace( topicSpace ); + } + topicSpace.addTopic( valueChangeTopic ); + return valueChangeTopic; + } + + /** + * Adds topics for all non-readonly properties from the specified property set to the specified topic set. + * + * @param propSet + * @param topicSet + * @return + */ + public static Topic[] addResourcePropertyValueChangeTopics( ResourcePropertySet propSet, TopicSpaceSet topicSet ) + { + List topicList = new ArrayList(); + Iterator propIter = propSet.iterator(); + while ( propIter.hasNext() ) + { + ResourceProperty prop = (ResourceProperty) propIter.next(); + if ( ! prop.getMetaData().isReadOnly() ) + { + Topic topic = addResourcePropertyValueChangeTopic( prop, topicSet ); + topicList.add( topic ); + } + } + return (Topic[]) topicList.toArray( new Topic[0] ); + } + +} Added: incubator/hermes/trunk/src/templates/NotificationProducer-AbstractResource_init.txt Url: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/templates/NotificationProducer-AbstractResource_init.txt?view=auto&rev=126549 ============================================================================== --- (empty file) +++ incubator/hermes/trunk/src/templates/NotificationProducer-AbstractResource_init.txt Wed Jan 26 14:25:45 2005 @@ -0,0 +1,10 @@ + + // initialize wsrl:Topic property + // TODO + + // initialize wsrl:FixedTopicSet property + // TODO + + // initialize wsrl:TopicExpressionDialects property + // TODO + Added: incubator/hermes/trunk/src/templates/NotificationProducer-Resource_init.txt Url: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/templates/NotificationProducer-Resource_init.txt?view=auto&rev=126549 ============================================================================== --- (empty file) +++ incubator/hermes/trunk/src/templates/NotificationProducer-Resource_init.txt Wed Jan 26 14:25:45 2005 @@ -0,0 +1,2 @@ + + org.apache.ws.notification.topics.util.TopicUtils.addResourcePropertyValueChangeTopics( getResourcePropertySet(), getTopicSpaceSet() ); Modified: incubator/hermes/trunk/src/templates/NotificationProducerPortType.txt Url: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/templates/NotificationProducerPortType.txt?view=diff&rev=126549&p1=incubator/hermes/trunk/src/templates/NotificationProducerPortType.txt&r1=126548&p2=incubator/hermes/trunk/src/templates/NotificationProducerPortType.txt&r2=126549 ============================================================================== --- incubator/hermes/trunk/src/templates/NotificationProducerPortType.txt (original) +++ incubator/hermes/trunk/src/templates/NotificationProducerPortType.txt Wed Jan 26 14:25:45 2005 @@ -7,7 +7,7 @@ */ public org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.SubscribeResponseDocument subscribe( org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.SubscribeDocument requestDoc ) { - return new org.apache.ws.resource.lifetime.v1_2.porttype.impl.NotificationProducerPortTypeImpl( getResourceContext( ) ).subscribe( requestDoc ); + return new org.apache.ws.notification.base.v1_2.porttype.impl.NotificationProducerPortTypeImpl( getResourceContext( ) ).subscribe( requestDoc ); } /** @@ -19,6 +19,6 @@ */ public org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.GetCurrentMessageResponseDocument getCurrentMessage( org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.GetCurrentMessageDocument requestDoc ) { - return new org.apache.ws.resource.lifetime.v1_2.porttype.impl.NotificationProducerPortTypeImpl( getResourceContext( ) ).getCurrentMessage( requestDoc ); + return new org.apache.ws.notification.base.v1_2.porttype.impl.NotificationProducerPortTypeImpl( getResourceContext( ) ).getCurrentMessage( requestDoc ); } Added: incubator/hermes/trunk/src/templates/NotificationProducerResource.txt Url: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/templates/NotificationProducerResource.txt?view=auto&rev=126549 ============================================================================== --- (empty file) +++ incubator/hermes/trunk/src/templates/NotificationProducerResource.txt Wed Jan 26 14:25:45 2005 @@ -0,0 +1,7 @@ + + org.apache.ws.notification.topics.TopicSpaceSet m_topicSpaceSet = new org.apache.ws.notification.topics.impl.TopicSpaceSetImpl(); + + public org.apache.ws.notification.topics.TopicSpaceSet getTopicSpaceSet() + { + return m_topicSpaceSet; + } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
