|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ws.notification.topics.impl.TopicImpl
Simple in-memory implementation of the Topic interface
Field Summary | |
protected java.lang.Object |
m_currentMsg
|
protected java.util.Collection |
m_listeners
|
protected java.lang.String |
m_name
|
protected TopicExpression |
m_reference
|
protected java.util.Map |
m_subTopics
|
protected java.util.List |
m_topicPath
|
protected TopicSpace |
m_topicSpace
|
Constructor Summary | |
TopicImpl(java.util.Map subTopics,
TopicExpression reference,
java.util.Collection listeners,
java.lang.String name,
java.lang.Object current,
java.util.List topicPath)
Create a topic with the given parameters |
|
TopicImpl(java.lang.String name)
Create a topic with the given name |
Method Summary | |
Topic |
addTopic(java.lang.String name)
Creates a new Topic object with the specified name and adds it to this set. |
Topic |
addTopic(Topic topic)
Adds the specified topic to this set. |
void |
addTopicListener(TopicListener listener)
Add a topic listener |
boolean |
containsTopic(java.lang.String name)
Returns true if this set contains a topic with the specified name. |
java.lang.Object |
getCurrentMessage()
Get the latest notification message published to this topic. |
java.lang.String |
getName()
Get the name of this topic. |
Topic |
getParent()
|
Topic |
getTopic(java.lang.String topicName)
Gets the topic with the specified name. |
java.util.List |
getTopicPath()
Get the topic path. |
TopicExpression |
getTopicReference()
Get the topic expression for the topic(s) that this topic references. |
TopicSpace |
getTopicSpace()
gets the TopicSpace this Topic is part of |
boolean |
isReference()
Is this a topic reference? |
void |
publish(java.lang.Object msg)
Publish a notification message to this topic. |
void |
removeTopic(java.lang.String name)
Removes the topic with the specified name from this set. |
void |
removeTopic(Topic topic)
|
void |
removeTopicListener(TopicListener listener)
Remove a topic listener |
void |
setTopicPath(java.util.List topicPath)
Set the topic path. |
void |
setTopicReference(TopicExpression topicPath)
Set the topic expression that resolves to a set of topics that this topic references. |
void |
setTopicSpace(TopicSpace topicSpace)
Set the TopicSpace this Topic is part of |
void |
topicAdded(Topic topic)
Called when a topic is added |
void |
topicChanged(Topic topic)
Called when the value of the topic changes |
java.util.Iterator |
topicIterator()
Gets an iterator of the topics in this set. |
java.util.Iterator |
topicListenerIterator()
Get a iterator for the list of TopicListeners |
void |
topicRemoved(Topic topic)
Called when a topic is removed |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.util.Map m_subTopics
protected TopicExpression m_reference
protected java.util.Collection m_listeners
protected java.lang.String m_name
protected java.lang.Object m_currentMsg
protected java.util.List m_topicPath
protected TopicSpace m_topicSpace
Constructor Detail |
public TopicImpl(java.lang.String name)
name
- The name of the created topicpublic TopicImpl(java.util.Map subTopics, TopicExpression reference, java.util.Collection listeners, java.lang.String name, java.lang.Object current, java.util.List topicPath)
subTopics
- A map of child topicsreference
- A topic expression (only used if this is a topic alias)listeners
- A collection of topic listenersname
- The name of this topiccurrent
- The current value of this topictopicPath
- The concrete topic path of this topicMethod Detail |
public Topic addTopic(Topic topic) throws java.lang.Exception
TopicSet
addTopic
in interface TopicSet
topic
- the topic to add
java.lang.Exception
- if topic is null or has the same name as a topic already in this setpublic Topic addTopic(java.lang.String name) throws java.lang.Exception
TopicSet
addTopic
in interface TopicSet
name
- the name of the topic to add
java.lang.Exception
- if name is null, invalid (contains '/', '*', or '.'), or is the same as the name of a topic
already in this setpublic void removeTopic(java.lang.String name)
TopicSet
removeTopic
in interface TopicSet
name
- the name of the topic to removepublic void addTopicListener(TopicListener listener)
TopicListenerList
addTopicListener
in interface TopicListenerList
listener
- The topic listener to addTopicListener
public java.lang.String getName()
Topic
getName
in interface Topic
public Topic getTopic(java.lang.String topicName)
TopicSet
getTopic
in interface TopicSet
topicName
- the name of the topic to get
public boolean containsTopic(java.lang.String name)
TopicSet
containsTopic
in interface TopicSet
name
- the name
public TopicExpression getTopicReference()
getTopicReference
in interface Topic
public boolean isReference()
Topic
isReference
in interface Topic
public java.util.Iterator topicIterator()
TopicSet
topicIterator
in interface TopicSet
public void publish(java.lang.Object msg) throws java.lang.Exception
Topic
publish
in interface Topic
msg
- the notification message to be published
java.lang.Exception
- on errorpublic java.lang.Object getCurrentMessage()
Topic
getCurrentMessage
in interface Topic
public void removeTopic(Topic topic)
public void removeTopicListener(TopicListener listener)
TopicListenerList
removeTopicListener
in interface TopicListenerList
listener
- The topic listener to remove.TopicListener
public java.util.Iterator topicListenerIterator()
TopicListenerList
topicListenerIterator
in interface TopicListenerList
TopicListener
public void setTopicReference(TopicExpression topicPath)
Topic
setTopicReference
in interface Topic
topicPath
- The topic expression to set.public void setTopicPath(java.util.List topicPath)
Topic
setTopicPath
in interface Topic
topicPath
- The topic path to associate with this topicpublic java.util.List getTopicPath()
Topic
getTopicPath
in interface Topic
public void topicAdded(Topic topic)
TopicListener
topicAdded
in interface TopicListener
topic
- The topic being addedpublic void topicChanged(Topic topic)
TopicListener
topicChanged
in interface TopicListener
topic
- The topic that changedpublic void topicRemoved(Topic topic)
TopicListener
topicRemoved
in interface TopicListener
topic
- The topic being removedpublic Topic getParent()
public java.lang.String toString()
public void setTopicSpace(TopicSpace topicSpace)
Topic
setTopicSpace
in interface Topic
topicSpace
- The TopicSpace this Topic is part ofpublic TopicSpace getTopicSpace()
Topic
getTopicSpace
in interface Topic
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |