|
OSMQ v2.0.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectosmq.clients.SubscriberBean
A class used by client applications to receive messages. The SubscriberBean connects to a message broker and allows the client application to subscribe to topical messages and receive both publish / subscribe and point-to-point (addressed) message.
Constructor Summary | |
SubscriberBean()
|
|
SubscriberBean(RemoteService rs)
|
|
SubscriberBean(osmq.clients.SubConnectionHandler connectionhandler)
|
Method Summary | |
void |
addTopic(java.lang.String topic)
Registers a topic for this subscriber. |
void |
close()
Closes the message queues and halts message flow to the subscriber. |
java.lang.String |
getBrokerName()
Returns the name of the remote message broker for this session. |
java.lang.String |
getClientID()
Returns the client identifier used by this session to communicate with the message broker. |
SubscriberCountManager |
getConnectionCount()
Returns a SubscriberCountManager that accumulates message counts for all ClientSubcribers associated with this connection. |
osmq.clients.SubConnectionHandler |
getConnectionHandler()
|
ExceptionListener |
getExceptionListener()
Return the ExceptionListener that will be notified when there is an exception due to an inability to connect with the broker, or due to an I/O or communications failure. |
java.lang.String |
getHostName()
Returns the message broker's host address as a DNS host name or IP address. |
MessageListener |
getMessageListener()
Returns a reference to the MessageListener object that currently receives all topical and point-to-point messages for this client. |
int |
getPortID()
Returns the port ID that will be used to connect to the message broker. |
SubscriberCountManager |
getSessionCount()
Returns a SubscriberCountManager that accumulates message counts for this ClientSubscriber instance. |
int |
getThreadPriority()
Returns the thread priority that will be used by the message subscriber thread. |
boolean |
isOpen()
Returns true if the open() method was called. |
boolean |
isPersistentTopics()
Returns true if the session is using persistent topics. |
void |
open()
Commences sending messages to the MessageListeners that have been registered by this ClientSubscriber instance. |
void |
removeTopic(java.lang.String topic)
Terminates receiving messages for a specific topic. |
void |
setBrokerName(java.lang.String broker)
Defines (overrides) the named message broker to be used for message processing (sending and receiving). |
void |
setClientID(java.lang.String id)
Sets the identity of the application as a message recipient/subscriber |
void |
setExceptionListener(ExceptionListener listener)
Sets an ExceptionListener that will be notified when there is an exception due to an inability to connect with the broker, or due to an I/O or communications failure. |
void |
setHostName(java.lang.String hostname)
Overrides the host name / IP address of the remote server; |
void |
setMessageListener(MessageListener listener)
Defines the listener that will be passed a Message when a one arrives that is addressed specificially to this client or contains a topic to which the client has subscribed. |
void |
setPersistentTopics(boolean b)
A method used to identify whether topical message subscription should persist after the ClientSubscriber has terminated. |
void |
setPortID(int port)
Overrides the port id of the remote server; |
void |
setThreadPriority(int priority)
Sets the thread priority for the subscriber notification thread. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SubscriberBean()
public SubscriberBean(RemoteService rs)
public SubscriberBean(osmq.clients.SubConnectionHandler connectionhandler)
Method Detail |
public final void addTopic(java.lang.String topic) throws java.io.IOException
addTopic
in interface Subscriber
java.io.IOException
setMessageListener(MessageListener)
,
open()
public osmq.clients.SubConnectionHandler getConnectionHandler()
public final void removeTopic(java.lang.String topic) throws java.io.IOException
removeTopic
in interface Subscriber
java.io.IOException
public void setExceptionListener(ExceptionListener listener)
setExceptionListener
in interface Subscriber
public ExceptionListener getExceptionListener()
getExceptionListener
in interface Subscriber
public final void setMessageListener(MessageListener listener)
setMessageListener
in interface Subscriber
public MessageListener getMessageListener()
Subscriber
getMessageListener
in interface Subscriber
Subscriber.setMessageListener(MessageListener)
public void setThreadPriority(int priority)
Subscriber
setThreadPriority
in interface Subscriber
public int getThreadPriority()
Subscriber
getThreadPriority
in interface Subscriber
public SubscriberCountManager getConnectionCount()
getConnectionCount
in interface Subscriber
public SubscriberCountManager getSessionCount()
getSessionCount
in interface Subscriber
public void setPersistentTopics(boolean b)
setPersistentTopics
in interface Subscriber
public boolean isPersistentTopics()
Subscriber
isPersistentTopics
in interface Subscriber
public void close()
Subscriber
close
in interface Subscriber
public boolean isOpen()
isOpen
in interface Subscriber
public void setClientID(java.lang.String id)
setClientID
in interface Subscriber
id
- a unique name identifying the client application
to the message broker.public java.lang.String getClientID()
getClientID
in interface Subscriber
public void setPortID(int port)
NOTE: Normally this method should NOT be called by the client application.
setPortID
in interface Subscriber
public int getPortID()
Subscriber
getPortID
in interface Subscriber
Subscriber.setPortID(int)
public void setHostName(java.lang.String hostname)
NOTE: Normally this method should NOT be called by the client application.
setHostName
in interface Subscriber
public java.lang.String getHostName()
Subscriber
getHostName
in interface Subscriber
Subscriber.setHostName(String)
public void setBrokerName(java.lang.String broker)
setBrokerName
in interface Subscriber
public java.lang.String getBrokerName()
getBrokerName
in interface Subscriber
public void open() throws java.io.IOException
open
in interface Subscriber
java.io.IOException
Subscriber.setMessageListener(MessageListener)
,
Subscriber.close()
|
(c) 2000 - 2003 MQue Systems All Rights Reserved |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |