|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.ws.pubsub.emitter.EmitterTask
This task is to be used to send notifications to client subscriber destinations. This class contains
a factory method, 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 SOAP message (the notification message itself)
and a destination URL. These constructors are called by this class' factory method.
TODO (ips): refactor the code from this class into SoapMessageEmitterEngine
Constructor Summary | |
protected |
EmitterTask(javax.xml.soap.SOAPMessage notif,
java.net.URL url)
Constructor to build the task. |
Method Summary | |
static void |
addEmitter(java.lang.String protocol,
java.lang.Class emitterClass)
Configures a notification emitter to handle emitting notifications to consumer EPRs with addresses of the specified protocol type. |
static EmitterTask |
createEmitterTask(javax.xml.soap.SOAPMessage notif,
java.net.URL destination)
Factory method that creates the appropriate emitter task based on the protocol required to send the notification. |
protected abstract void |
emit()
Method that will actually send the notification to the destination via the appropriate protocol transport. |
protected java.net.URL |
getDestinationUrl()
Returns the destination URL where the notification will be sent |
protected javax.xml.soap.SOAPMessage |
getNotification()
Returns the actual notification object that is to be emitted. |
void |
run()
This template method runs the task's thread and will call the appropriate emitter task's emit() method to send the notification. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected EmitterTask(javax.xml.soap.SOAPMessage notif, java.net.URL url)
createEmitterTask(javax.xml.soap.SOAPMessage, URL)
should be used by clients to create these task objects.
notif
- notification to sendurl
- endpoint URL of notification consumerMethod Detail |
public static void addEmitter(java.lang.String protocol, java.lang.Class emitterClass)
protocol
- a URL protocol (e.g. http, https, or mailto)emitterClass
- the emitter class - must extend EmitterTask
public static EmitterTask createEmitterTask(javax.xml.soap.SOAPMessage notif, java.net.URL destination) throws EmitterException
notif
- notification to senddestination
- notification is to be sent to this destination endpoint
EmitterException
- if failed to create the taskpublic void run()
emit()
method to send the notification.
run
in interface java.lang.Runnable
Runnable.run()
protected java.net.URL getDestinationUrl()
protected javax.xml.soap.SOAPMessage getNotification()
protected abstract void emit() throws EmitterException
EmitterException
- on error attempting to send notification
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |