|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.muse.core.AbstractCapability
org.apache.muse.ws.resource.impl.AbstractWsResourceCapability
org.apache.muse.ws.notification.impl.SimpleNotificationProducer
public class SimpleNotificationProducer
SimpleNotificationProducer is Muse's default implementation of the
WS-Notification NotificationProducer port type.
Resources that implement this port type should be deployed with the
SubscriptionManager type as well; the
subscription resources cannot be managed without this endpoint.
Field Summary |
---|
Fields inherited from interface org.apache.muse.ws.notification.NotificationProducer |
---|
PROPERTIES |
Constructor Summary | |
---|---|
SimpleNotificationProducer()
|
Method Summary | |
---|---|
void |
addSubscription(WsResource sub)
This method is for internal (service-side) code that wishes to add a subscription that has already been created (perhaps from data residing in a persistent data store) and does not require a call to subscribe(). |
Topic |
addTopic(QName topicName)
Creates a topic in the resource's topic set and adds it to the appropriate topic namespace. |
TopicNamespace |
addTopicNamespace(String namespace)
Creates a topic namespace in the resource's topic set using the given URI. |
protected MessageHandler |
createGetCurrentMessageHandler()
|
protected ChangeNotificationListenerFactory |
createNotificationListenerFactory()
Users can override this method to provide an alternative implementation of ChangeNotificationListenerFactory that wraps WS-RP change notifications in a different set of XML content. |
protected NotificationMessage |
createNotificationMessage()
Users can override this method to provide an alternative implementation of NotificationMessage. |
protected MessageHandler |
createSubscribeHandler()
|
void |
deleteProperty(QName property)
|
NotificationMessage |
getCurrentMessage(QName topicPath)
Retrieves the last message published for a given topic. |
boolean |
getFixedTopicSet()
|
protected ChangeNotificationListenerFactory |
getNotificationListenerFactory()
|
Element[] |
getProperty(QName property)
|
QName[] |
getPropertyNames()
Concrete capability classes that define properties MUST override this method and provide the names of the properties. |
protected String |
getSubscriptionContextPath()
|
protected Collection |
getSubscriptions()
|
Topic |
getTopic(QName topicName)
|
QName[] |
getTopicExpression()
|
String[] |
getTopicExpressionDialect()
|
TopicNamespace |
getTopicNamespace(String namespace)
|
TopicSet |
getTopicSet()
|
protected boolean |
hasSubscription(EndpointReference subscriptionEPR)
|
boolean |
hasTopic(QName topicName)
|
void |
initialize()
AbstractWsResourceCapability continues the initialization process by inspecting the concrete class to find all of the getters (and, if applicable, setters) for its resource properties. |
void |
initializeCompleted()
This method is called by the containing Resource after all other capabilities have been initialized via initialize(). |
void |
insertProperty(QName property,
Element[] values)
|
void |
prepareShutdown()
This method is called prior to shutdown() and allows the capability to do any shutdown tasks that require the presence of certain other capabilities. |
void |
publish(QName topicName,
Element content)
Creates a WS-N notification message with the given topic and message content and sends it to the appropriate subscribers. |
void |
publish(QName topicName,
Element[] content)
|
void |
publish(QName topicName,
QName[] contentNames,
Object[] content)
|
void |
publish(QName topicName,
QName contentName,
Object content)
This is a convenience method that calls publish(QName, Element) after the given content object has been serialized to XML using the Muse serializer framework. |
void |
publish(QName topicName,
XmlSerializable content)
This is a convenience method that calls publish(QName, Element) after the XmlSerializable object has been serialized to XML. |
void |
publish(QName topicName,
XmlSerializable[] content)
|
void |
removeSubscription(EndpointReference epr)
This method is for internal (service-side) code that wishes to remove a subscription so that messages are no longer published to its subscriber. |
void |
resourceAdded(EndpointReference epr,
Resource resource)
|
void |
resourceRemoved(EndpointReference epr)
|
WsResource |
subscribe(EndpointReference consumer,
Filter filter,
Date terminationTime,
Policy policy)
Registers a consumer resource to receive events that are published to a certain topic (along with other filtering rules). |
void |
updateProperty(QName property,
Element[] values)
|
Methods inherited from class org.apache.muse.ws.resource.impl.AbstractWsResourceCapability |
---|
createGettersAndSetters, deleteProperty, getGetter, getProperty, getPropertyElements, getSetter, getWsResource, insertProperty, invokeMethod, setResource, updateProperty |
Methods inherited from class org.apache.muse.core.AbstractCapability |
---|
getActions, getCapabilityURI, getEnvironment, getInitializationParameter, getInitializationParameters, getLog, getMessageHandler, getPersistence, getResource, hasBeenInitialized, hasBeenShutdown, setCapabilityURI, setEnvironment, setInitializationParameters, setLog, setMessageHandler, setMessageHandlers, setPersistence, shutdown |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.muse.ws.resource.WsResourceCapability |
---|
getWsResource |
Methods inherited from interface org.apache.muse.core.Capability |
---|
getActions, getCapabilityURI, getEnvironment, getLog, getMessageHandler, getPersistence, getResource, setCapabilityURI, setEnvironment, setLog, setMessageHandlers, setPersistence, setResource |
Methods inherited from interface org.apache.muse.core.Initialization |
---|
hasBeenInitialized |
Methods inherited from interface org.apache.muse.core.InitializationParameters |
---|
getInitializationParameter, getInitializationParameters, setInitializationParameters |
Methods inherited from interface org.apache.muse.core.Shutdown |
---|
hasBeenShutdown, shutdown |
Constructor Detail |
---|
public SimpleNotificationProducer()
Method Detail |
---|
public void addSubscription(WsResource sub)
NotificationProducer
addSubscription
in interface NotificationProducer
public Topic addTopic(QName topicName) throws BaseFault
NotificationProducer
addTopic
in interface NotificationProducer
topicName
- The name of the topic, where the namespace matches the topic
namespace the topic belongs to and the local part is a path
that defines the topic's hierarchy (the path may also be a
simple name, no slashes).
BaseFault
public TopicNamespace addTopicNamespace(String namespace) throws BaseFault
NotificationProducer
addTopicNamespace
in interface NotificationProducer
BaseFault
protected MessageHandler createGetCurrentMessageHandler()
protected ChangeNotificationListenerFactory createNotificationListenerFactory()
protected NotificationMessage createNotificationMessage()
protected MessageHandler createSubscribeHandler()
public NotificationMessage getCurrentMessage(QName topicPath) throws NoCurrentMessageOnTopicFault, TopicNotSupportedFault
NotificationProducer
getCurrentMessage
in interface NotificationProducer
topicPath
- The name of the Topic whose last message you wish to retrieve.
NoCurrentMessageOnTopicFault
TopicNotSupportedFault
public boolean getFixedTopicSet()
getFixedTopicSet
in interface NotificationProducer
protected ChangeNotificationListenerFactory getNotificationListenerFactory()
public QName[] getPropertyNames()
getPropertyNames
in class AbstractWsResourceCapability
protected String getSubscriptionContextPath()
protected Collection getSubscriptions()
public Topic getTopic(QName topicName)
getTopic
in interface NotificationProducer
public QName[] getTopicExpression()
getTopicExpression
in interface NotificationProducer
public String[] getTopicExpressionDialect()
getTopicExpressionDialect
in interface NotificationProducer
public TopicNamespace getTopicNamespace(String namespace)
getTopicNamespace
in interface NotificationProducer
public TopicSet getTopicSet()
getTopicSet
in interface NotificationProducer
protected boolean hasSubscription(EndpointReference subscriptionEPR)
public boolean hasTopic(QName topicName)
hasTopic
in interface NotificationProducer
public void initialize() throws SoapFault
AbstractWsResourceCapability
initialize
in interface Initialization
initialize
in class AbstractWsResourceCapability
SoapFault
public void initializeCompleted() throws SoapFault
Capability
initializeCompleted
in interface Capability
initializeCompleted
in class AbstractCapability
SoapFault
public void prepareShutdown() throws SoapFault
Capability
prepareShutdown
in interface Capability
prepareShutdown
in class AbstractCapability
SoapFault
public void publish(QName topicName, Element content) throws SoapFault
NotificationProducer
publish
in interface NotificationProducer
topicName
- The WS-N topic associated with the message. This is optional (it
can be null).content
- The XML fragment that will be put under the wsnt:Message section
of the notification message. This is also called the 'payload'.
SoapFault
public void publish(QName topicName, Element[] content) throws SoapFault
publish
in interface NotificationProducer
SoapFault
public void publish(QName topicName, XmlSerializable content) throws SoapFault
NotificationProducer
publish
in interface NotificationProducer
SoapFault
public void publish(QName topicName, XmlSerializable[] content) throws SoapFault
publish
in interface NotificationProducer
SoapFault
public void publish(QName topicName, QName contentName, Object content) throws SoapFault
NotificationProducer
publish
in interface NotificationProducer
topicName
- The WS-N topic associated with the message. This is optional (it
can be null).contentName
- The name of the root element of the payload. This will be
passed to Serializer.toXML() when converting the content
value to XML.content
- The value that will be converted to XML and then put under the
wsnt:Message section of the notification message. This is also
called the 'payload'.
SoapFault
public void publish(QName topicName, QName[] contentNames, Object[] content) throws SoapFault
publish
in interface NotificationProducer
SoapFault
public void removeSubscription(EndpointReference epr)
NotificationProducer
removeSubscription
in interface NotificationProducer
public void resourceAdded(EndpointReference epr, Resource resource)
resourceAdded
in interface ResourceManagerListener
epr
- The unique EPR that is being associated with the new resource.
This value should always be used over Resource.getEndpointReference()
because some applications may choose to map multiple EPRs to the
same resource instance, and thus getEndpointReference() will not
provide an accurate value.resource
- The resource instance being associated with the given EPR.public void resourceRemoved(EndpointReference epr)
resourceRemoved
in interface ResourceManagerListener
epr
- The unique EPR of the resource that has been destroyed - the
Resource object is not provided because it would most likely
be in an inconsistent state. At this point, the resource has
already been 'destroyed'.public WsResource subscribe(EndpointReference consumer, Filter filter, Date terminationTime, Policy policy) throws TopicNotSupportedFault, UnacceptableInitialTerminationTimeFault, SubscribeCreationFailedFault
NotificationProducer
subscribe
in interface NotificationProducer
consumer
- The EPR of the resource that will receive the notifications
from the producing resource. This does not have to
be the same component that is making the subscribe() request.
An orchestrating service may be subscribing for the consumer.filter
- Optional filter that allows for messages to be published if
they meet a certain criteria. Filter types include topic names,
message patterns (XPath), and current state (WSRP doc).terminationTime
- Because subscriptions are WS-resources, they may be terminated
with scheduled termination (specifically, the WS-RL TerminationTime
property). If this parameter is null, no termination time is set.policy
- Optional filter that allows for more complex analysis on the
conditions needed to send a message. The implementation must
provide one or more policy languages (dialects) that clients
can use to express how and when a message that is published
to a topic should be sent. If this parameter is null, no
policy is applied.
TopicNotSupportedFault
UnacceptableInitialTerminationTimeFault
SubscribeCreationFailedFault
public void deleteProperty(QName property) throws BaseFault
BaseFault
public Element[] getProperty(QName property) throws BaseFault
BaseFault
public void insertProperty(QName property, Element[] values) throws BaseFault
BaseFault
public void updateProperty(QName property, Element[] values) throws BaseFault
BaseFault
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |