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 sc...@apache.org on 2005/10/17 18:36:58 UTC
svn commit: r325923 [6/6] - in /webservices/pubscribe/trunk: ./
src/java/org/apache/ws/ src/java/org/apache/ws/eventing/
src/java/org/apache/ws/eventing/porttype/impl/
src/java/org/apache/ws/eventing/pubsub/
src/java/org/apache/ws/notification/ src/jav...
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/v2004_06/TopicsTypeWriterImpl.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/v2004_06/TopicsTypeWriterImpl.java?rev=325923&r1=325922&r2=325923&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/v2004_06/TopicsTypeWriterImpl.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/v2004_06/TopicsTypeWriterImpl.java Mon Oct 17 09:36:17 2005
@@ -1,64 +1,79 @@
-/*=============================================================================*
- * Copyright 2005 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.v2004_06;
-
-import org.apache.ws.notification.base.v2004_06.porttype.NotificationProducerPortType;
-import org.apache.ws.notification.topics.TopicNamespace;
-import org.apache.ws.notification.topics.TopicsTypeWriter;
-import org.apache.ws.notification.topics.expression.TopicExpression;
-import org.apache.xmlbeans.XmlObject;
-import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.TopicDocument;
-import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.TopicExpressionDocument;
-import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.TopicExpressionType;
-import org.oasisOpen.docs.wsn.x2004.x06.wsnWSTopics12Draft01.TopicSpaceDocument;
-import org.oasisOpen.docs.wsn.x2004.x06.wsnWSTopics12Draft01.TopicSpaceType;
-
-import javax.xml.namespace.QName;
-
-/**
- * A topics type writer for the 2004/06 version of the WS-Topics specification.
- */
-public class TopicsTypeWriterImpl extends TopicsTypeWriter
-{
-
- public XmlObject toXmlObject( TopicExpression topicExpr, QName elemName )
- {
- TopicExpressionType topicExprType;
- if ( elemName.equals( NotificationProducerPortType.PROP_QNAME_TOPIC ) )
- {
- TopicDocument topicDoc = TopicDocument.Factory.newInstance();
- topicExprType = topicDoc.addNewTopic();
- }
- else
- {
- TopicExpressionDocument topicExprDoc = TopicExpressionDocument.Factory.newInstance();
- topicExprType = topicExprDoc.addNewTopicExpression();
- }
- topicExprType.setDialect( topicExpr.getDialect().toString() );
- copyContent( topicExpr, topicExprType );
- return topicExprType;
- }
-
-
- public XmlObject toXmlObject( TopicNamespace topicNs )
- {
- TopicSpaceDocument topicSpaceDoc = TopicSpaceDocument.Factory.newInstance();
- TopicSpaceType topicSpaceType = topicSpaceDoc.addNewTopicSpace();
- // TODO: finish this
- return topicSpaceType;
- }
-
-}
+/*=============================================================================*
+ * 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.v2004_06;
+
+import org.apache.ws.notification.base.v2004_06.porttype.NotificationProducerPortType;
+import org.apache.ws.notification.topics.TopicNamespace;
+import org.apache.ws.notification.topics.TopicsTypeWriter;
+import org.apache.ws.notification.topics.expression.TopicExpression;
+import org.apache.xmlbeans.XmlObject;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.TopicDocument;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.TopicExpressionDocument;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.TopicExpressionType;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSTopics12Draft01.TopicSpaceDocument;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSTopics12Draft01.TopicSpaceType;
+import javax.xml.namespace.QName;
+
+/**
+ * A topics type writer for the 2004/06 version of the WS-Topics specification.
+ */
+public class TopicsTypeWriterImpl
+ extends TopicsTypeWriter
+{
+ /**
+ * DOCUMENT_ME
+ *
+ * @param topicExpr DOCUMENT_ME
+ * @param elemName DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public XmlObject toXmlObject( TopicExpression topicExpr,
+ QName elemName )
+ {
+ TopicExpressionType topicExprType;
+ if ( elemName.equals( NotificationProducerPortType.PROP_QNAME_TOPIC ) )
+ {
+ TopicDocument topicDoc = TopicDocument.Factory.newInstance( );
+ topicExprType = topicDoc.addNewTopic( );
+ }
+ else
+ {
+ TopicExpressionDocument topicExprDoc = TopicExpressionDocument.Factory.newInstance( );
+ topicExprType = topicExprDoc.addNewTopicExpression( );
+ }
+
+ topicExprType.setDialect( topicExpr.getDialect( ).toString( ) );
+ copyContent( topicExpr, topicExprType );
+ return topicExprType;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param topicNs DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public XmlObject toXmlObject( TopicNamespace topicNs )
+ {
+ TopicSpaceDocument topicSpaceDoc = TopicSpaceDocument.Factory.newInstance( );
+ TopicSpaceType topicSpaceType = topicSpaceDoc.addNewTopicSpace( );
+
+ // TODO: finish this
+ return topicSpaceType;
+ }
+}
\ No newline at end of file
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/pubsub/FilterFactory.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/pubsub/FilterFactory.java?rev=325923&r1=325922&r2=325923&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/pubsub/FilterFactory.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/pubsub/FilterFactory.java Mon Oct 17 09:36:17 2005
@@ -30,7 +30,7 @@
private static final Log LOG = LogFactory.getLog( FilterFactory.class.getName( ) );
/** DOCUMENT_ME */
- public static String xpathuri = "http://www.w3.org/TR/1999/REC-xpath-19991116";
+ public static String xpathuri = "http://www.w3.org/TR/1999/REC-xpath-19991116";
/** DOCUMENT_ME */
public static String topicsuri = "http://docs.oasis-open.org/wsn/2004/06/TopicExpression/Concrete";
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/pubsub/PublisherFactory.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/pubsub/PublisherFactory.java?rev=325923&r1=325922&r2=325923&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/pubsub/PublisherFactory.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/pubsub/PublisherFactory.java Mon Oct 17 09:36:17 2005
@@ -15,6 +15,7 @@
*=============================================================================*/
package org.apache.ws.pubsub;
+
/**
* DOCUMENT_ME
*
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/pubsub/TopicFilter.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/pubsub/TopicFilter.java?rev=325923&r1=325922&r2=325923&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/pubsub/TopicFilter.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/pubsub/TopicFilter.java Mon Oct 17 09:36:17 2005
@@ -48,7 +48,7 @@
}
}
- m_targetNamespace = t.getTopicNamespace( ).getTargetNamespace( ).toString();
+ m_targetNamespace = t.getTopicNamespace( ).getTargetNamespace( ).toString( );
super.setURI( FilterFactory.topicsuri );
super.setContent( parse( topicexpr ) );
}
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/pubsub/emitter/EmitterTask.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/pubsub/emitter/EmitterTask.java?rev=325923&r1=325922&r2=325923&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/pubsub/emitter/EmitterTask.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/pubsub/emitter/EmitterTask.java Mon Oct 17 09:36:17 2005
@@ -22,7 +22,6 @@
import org.apache.ws.pubsub.i18n.MessagesImpl;
import org.apache.ws.util.i18n.Messages;
import org.xml.sax.SAXException;
-
import javax.xml.soap.SOAPMessage;
import java.lang.reflect.InvocationTargetException;
import java.net.URL;
@@ -56,6 +55,7 @@
{
PROTOCOL_EMITTER_MAP = new HashMap( );
PROTOCOL_EMITTER_MAP.put( HttpEmitterTask.PROTOCOL, HttpEmitterTask.class );
+
//PROTOCOL_EMITTER_MAP.put( FileEmitterTask.PROTOCOL, FileEmitterTask.class );
//PROTOCOL_EMITTER_MAP.put( HttpsNotificationEmitterTask.PROTOCOL, HttpsNotificationEmitterTask.class );
//PROTOCOL_EMITTER_MAP.put( MailtoNotificationEmitterTask.PROTOCOL, MailtoNotificationEmitterTask.class );
@@ -83,6 +83,19 @@
}
/**
+ * Configures a notification emitter to handle emitting notifications
+ * to consumer EPRs with addresses of the specified protocol type.
+ *
+ * @param protocol a URL protocol (e.g. http, https, or mailto)
+ * @param emitterClass the emitter class - must extend {@link EmitterTask}
+ */
+ public static void addEmitter( String protocol,
+ Class emitterClass )
+ {
+ PROTOCOL_EMITTER_MAP.put( protocol, emitterClass );
+ }
+
+ /**
* Factory method that creates the appropriate emitter task based on the
* protocol required to send the notification.
*
@@ -222,17 +235,4 @@
*/
protected abstract void emit( )
throws EmitterException;
-
- /**
- * Configures a notification emitter to handle emitting notifications
- * to consumer EPRs with addresses of the specified protocol type.
- *
- * @param protocol a URL protocol (e.g. http, https, or mailto)
- * @param emitterClass the emitter class - must extend {@link EmitterTask}
- */
- public static void addEmitter( String protocol, Class emitterClass )
- {
- PROTOCOL_EMITTER_MAP.put( protocol, emitterClass );
- }
-
}
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/pubsub/emitter/SoapMessageEmitter.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/pubsub/emitter/SoapMessageEmitter.java?rev=325923&r1=325922&r2=325923&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/pubsub/emitter/SoapMessageEmitter.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/pubsub/emitter/SoapMessageEmitter.java Mon Oct 17 09:36:17 2005
@@ -1,37 +1,35 @@
-/*=============================================================================*
- * Copyright 2005 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.pubsub.emitter;
-
-import org.apache.ws.addressing.EndpointReference;
-
-import javax.xml.soap.SOAPMessage;
-
-/**
- * TODO
- *
- * @author Ian Springer (ian DOT springer AT hp DOT com)
- */
-public interface SoapMessageEmitter
-{
-
- /**
- *
- * @param soapMsg
- * @param epr
- */
- void emit( SOAPMessage soapMsg, EndpointReference epr );
-
-}
+/*=============================================================================*
+ * 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.pubsub.emitter;
+
+import org.apache.ws.addressing.EndpointReference;
+import javax.xml.soap.SOAPMessage;
+
+/**
+ * TODO
+ *
+ * @author Ian Springer (ian DOT springer AT hp DOT com)
+ */
+public interface SoapMessageEmitter
+{
+ /**
+ *
+ * @param soapMsg
+ * @param epr
+ */
+ void emit( SOAPMessage soapMsg,
+ EndpointReference epr );
+}
\ No newline at end of file
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/pubsub/emitter/SoapMessageEmitterEngine.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/pubsub/emitter/SoapMessageEmitterEngine.java?rev=325923&r1=325922&r2=325923&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/pubsub/emitter/SoapMessageEmitterEngine.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/pubsub/emitter/SoapMessageEmitterEngine.java Mon Oct 17 09:36:17 2005
@@ -1,76 +1,82 @@
-/*=============================================================================*
- * Copyright 2005 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.pubsub.emitter;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-/**
- * The engine for configuring SOAP message emitters for various protocols and
- * spawning emitter tasks.
- *
- * @author Ian Springer
- */
-public class SoapMessageEmitterEngine
-{
-
- private static final SoapMessageEmitterEngine INSTANCE = new SoapMessageEmitterEngine();
-
- private SoapMessageEmitterEngine()
- {
- }
-
- public static SoapMessageEmitterEngine getInstance()
- {
- return INSTANCE;
- }
-
- /*
- * <String>protocol -> <SoapMessageEmitter>emitter
- */
- private final Map m_emitterMap = new HashMap();
-
- /**
- * Loads each of the TopicNamespace documents from the URLs in the specified set and
- * adds them to this registry.
- *
- * @param emitterMap a set of Strings representing class names of {@link EmitterTask}s
- */
- public synchronized void setEmitterMap( Map emitterMap )
- {
- for ( Iterator iterator = emitterMap.keySet().iterator(); iterator.hasNext() ; )
- {
- String protocol = (String) iterator.next();
- String emitterClassName = (String) emitterMap.get( protocol );
- Class emitterClass;
- try
- {
- emitterClass = Class.forName( emitterClassName );
- }
- catch ( ClassNotFoundException cnfe )
- {
- throw new RuntimeException( cnfe );
- }
- if ( !( emitterClass.isAssignableFrom( SoapMessageEmitter.class ) ) )
- {
- throw new RuntimeException( "Class " + emitterClass.getName() + " does not implement the " + SoapMessageEmitter.class.getName() + " interface." );
- }
- m_emitterMap.put( protocol, emitterClass );
- }
- }
-
-}
+/*=============================================================================*
+ * 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.pubsub.emitter;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * The engine for configuring SOAP message emitters for various protocols and
+ * spawning emitter tasks.
+ *
+ * @author Ian Springer
+ */
+public class SoapMessageEmitterEngine
+{
+ private static final SoapMessageEmitterEngine INSTANCE = new SoapMessageEmitterEngine( );
+
+ /*
+ * <String>protocol -> <SoapMessageEmitter>emitter
+ */
+ private final Map m_emitterMap = new HashMap( );
+
+ private SoapMessageEmitterEngine( )
+ {
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public static SoapMessageEmitterEngine getInstance( )
+ {
+ return INSTANCE;
+ }
+
+ /**
+ * Loads each of the TopicNamespace documents from the URLs in the specified set and
+ * adds them to this registry.
+ *
+ * @param emitterMap a set of Strings representing class names of {@link EmitterTask}s
+ */
+ public synchronized void setEmitterMap( Map emitterMap )
+ {
+ for ( Iterator iterator = emitterMap.keySet( ).iterator( ); iterator.hasNext( ); )
+ {
+ String protocol = (String) iterator.next( );
+ String emitterClassName = (String) emitterMap.get( protocol );
+ Class emitterClass;
+ try
+ {
+ emitterClass = Class.forName( emitterClassName );
+ }
+ catch ( ClassNotFoundException cnfe )
+ {
+ throw new RuntimeException( cnfe );
+ }
+
+ if ( !( emitterClass.isAssignableFrom( SoapMessageEmitter.class ) ) )
+ {
+ throw new RuntimeException( "Class " + emitterClass.getName( ) + " does not implement the "
+ + SoapMessageEmitter.class.getName( ) + " interface." );
+ }
+
+ m_emitterMap.put( protocol, emitterClass );
+ }
+ }
+}
\ No newline at end of file