Author: scamp
Date: Wed Feb 2 09:53:54 2005
New Revision: 149540
URL: http://svn.apache.org/viewcvs?view=rev&rev=149540
Log:
made it take a URL instead of String
Modified:
incubator/hermes/trunk/src/java/org/apache/ws/pubsub/emitter/EmitterTask.java
incubator/hermes/trunk/src/java/org/apache/ws/pubsub/emitter/file/FileEmitterTask.java
incubator/hermes/trunk/src/java/org/apache/ws/pubsub/emitter/http/HttpEmitterTask.java
Modified:
incubator/hermes/trunk/src/java/org/apache/ws/pubsub/emitter/EmitterTask.java
URL:
http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/pubsub/emitter/EmitterTask.java?view=diff&r1=149539&r2=149540
==============================================================================
---
incubator/hermes/trunk/src/java/org/apache/ws/pubsub/emitter/EmitterTask.java
(original)
+++
incubator/hermes/trunk/src/java/org/apache/ws/pubsub/emitter/EmitterTask.java
Wed Feb 2 09:53:54 2005
@@ -15,24 +15,23 @@
*=============================================================================*/
package org.apache.ws.pubsub.emitter;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.ws.pubsub.emitter.file.FileEmitterTask;
import org.apache.ws.pubsub.emitter.http.HttpEmitterTask;
-import org.apache.ws.pubsub.i18n.MessagesImpl;
import org.apache.ws.pubsub.i18n.Keys;
+import org.apache.ws.pubsub.i18n.MessagesImpl;
import org.apache.ws.util.i18n.Messages;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.xml.sax.SAXException;
-import org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType;
+
import javax.xml.soap.SOAPMessage;
import java.lang.reflect.InvocationTargetException;
-import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
/**
* This task is to be used to send notifications to client subscriber
destinations. This class contains
- * a factory method, [EMAIL PROTECTED] #createEmitterTask(SOAPMessage,
EndpointReferenceType)}, that creates a task specific to the
+ * a factory method, [EMAIL PROTECTED] #createEmitterTask(SOAPMessage, URL)},
that creates a task specific to the
* protocol for the given destination; this factory method must be used to
create emitter tasks.
* All subclasses to this class will be responsible for sending notifications
over particular protocol
* transports. Each subclass must have a constructor that takes a XML string
(the notification message itself),
@@ -73,7 +72,7 @@
/**
* Constructor to build the task. This is protected to enforce that fact
that only
- * [EMAIL PROTECTED] #createEmitterTask(javax.xml.soap.SOAPMessage, String)}
+ * [EMAIL PROTECTED] #createEmitterTask(javax.xml.soap.SOAPMessage, URL)}
* should be used by clients to create these task objects.
*
* @param notif notification to send
@@ -98,7 +97,7 @@
* @throws EmitterException if failed to create the task
*/
public static EmitterTask createEmitterTask( SOAPMessage notif,
- String destination
)
+ URL destination )
throws EmitterException
{
EmitterTask task;
@@ -108,19 +107,7 @@
try
{
- URL url;
-
- try
- {
- url = new URL( destination );
- }
- catch ( MalformedURLException murle )
- {
- LOG.error( MSG.getMessage( Keys.NOTIF_EMITTER_CREATION_FAILURE,
destination, murle ) );
- throw new EmitterException( murle );
- }
-
- task_class = (Class) PROTOCOL_EMITTER_MAP.get( url.getProtocol( ) );
+ task_class = (Class) PROTOCOL_EMITTER_MAP.get(
destination.getProtocol( ) );
if ( task_class != null )
{
@@ -132,7 +119,7 @@
Object[] params = new Object[]
{
notif,
- url
+ destination
};
task = (EmitterTask) task_class.getConstructor( sig ).newInstance(
params );
Modified:
incubator/hermes/trunk/src/java/org/apache/ws/pubsub/emitter/file/FileEmitterTask.java
URL:
http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/pubsub/emitter/file/FileEmitterTask.java?view=diff&r1=149539&r2=149540
==============================================================================
---
incubator/hermes/trunk/src/java/org/apache/ws/pubsub/emitter/file/FileEmitterTask.java
(original)
+++
incubator/hermes/trunk/src/java/org/apache/ws/pubsub/emitter/file/FileEmitterTask.java
Wed Feb 2 09:53:54 2005
@@ -101,7 +101,7 @@
throw new EmitterException( MSG.getMessage(
Keys.EX_FAILED_TO_STORE_NOTIFICATION_TO_FILE,
getDestinationUrl( ) ),
ioe );
}
- catch ( SOAPException e )
+ catch ( SOAPException e )
{
throw new EmitterException( MSG.getMessage(
Keys.EX_FAILED_TO_STORE_NOTIFICATION_TO_FILE,
getDestinationUrl( ) ),
e );
Modified:
incubator/hermes/trunk/src/java/org/apache/ws/pubsub/emitter/http/HttpEmitterTask.java
URL:
http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/pubsub/emitter/http/HttpEmitterTask.java?view=diff&r1=149539&r2=149540
==============================================================================
---
incubator/hermes/trunk/src/java/org/apache/ws/pubsub/emitter/http/HttpEmitterTask.java
(original)
+++
incubator/hermes/trunk/src/java/org/apache/ws/pubsub/emitter/http/HttpEmitterTask.java
Wed Feb 2 09:53:54 2005
@@ -37,7 +37,7 @@
{
/** This emitter's protocol */
public static final String PROTOCOL = "http";
-
+
/** object used to obtain I18N messages */
private static final Messages MSG = MessagesImpl.getInstance( );
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]