|
OSMQ v2.0.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectosmq.clients.PublisherBase
osmq.clients.PublisherBean
osmq.clients.ThreadedPublisherBean
A multi-threaded class derived from the PublisherBean class. When an application puts a message to this class, the message is written to a local fifo.
A seperate aggregate thread reads from that fifo and writes the fifo's messages to the PublisherBean's socket stream that is attached to a remote message broker.
Constructor Summary | |
ThreadedPublisherBean()
|
|
ThreadedPublisherBean(PubConnectionHandler handler)
|
|
ThreadedPublisherBean(RemoteService si)
|
Method Summary | |
void |
close()
Closes the publisher's connection to the message broker. |
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. |
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. |
int |
getPortID()
Returns the port id that will be used to connect to the message broker. |
long |
getQueuedCount()
|
boolean |
isAutoCommit()
Returns true if the publisher is in auto-commit mode. |
void |
open()
Locates and connects to the remote message broker, and performs the necessary publisher authentication. |
void |
setAutoCommit(boolean autocommit)
Turns on or off the autocommitment of published messages to the message broker. |
void |
setBrokerName(java.lang.String broker)
Defines the named message broker to use for message processing (sending and receiving). |
void |
setClientID(java.lang.String id)
Sets the identity of the application as a message originator (publisher) |
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 |
setPortID(int port)
Overrides the port id of the remote server; |
void |
stop()
|
Methods inherited from class osmq.clients.PublisherBean |
commit, getCommitTransactionCount, getConnectionPublishedCount, getPublishedCount, isOpen, isThreaded, onException, publish, rollback, setThreaded |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface osmq.clients.Publisher |
commit, getConnectionPublishedCount, getPublishedCount, isOpen, publish, rollback |
Constructor Detail |
public ThreadedPublisherBean()
public ThreadedPublisherBean(PubConnectionHandler handler)
public ThreadedPublisherBean(RemoteService si)
Method Detail |
public void open() throws java.io.IOException
Publisher
open
in interface Publisher
open
in class PublisherBean
java.io.IOException
public void close()
PublisherBean
close
in interface Publisher
close
in class PublisherBean
public void stop()
public long getQueuedCount()
public void setClientID(java.lang.String id)
setClientID
in interface Publisher
setClientID
in class PublisherBean
id
- a unique name identifying the client application
to the message broker.public java.lang.String getClientID()
getClientID
in interface Publisher
getClientID
in class PublisherBean
public void setBrokerName(java.lang.String broker)
setBrokerName
in interface Publisher
setBrokerName
in class PublisherBean
public java.lang.String getBrokerName()
getBrokerName
in interface Publisher
getBrokerName
in class PublisherBean
public void setPortID(int port)
NOTE: Normally this method should NOT be called by the client application.
setPortID
in interface Publisher
setPortID
in class PublisherBean
public int getPortID()
Publisher
getPortID
in interface Publisher
getPortID
in class PublisherBean
public void setHostName(java.lang.String hostname)
NOTE: Normally this method should NOT be called by the client application.
setHostName
in interface Publisher
setHostName
in class PublisherBean
public java.lang.String getHostName()
Publisher
getHostName
in interface Publisher
getHostName
in class PublisherBean
public void setExceptionListener(ExceptionListener listener)
setExceptionListener
in interface Publisher
setExceptionListener
in class PublisherBean
public ExceptionListener getExceptionListener()
getExceptionListener
in interface Publisher
getExceptionListener
in class PublisherBean
public void setAutoCommit(boolean autocommit) throws java.io.IOException
When autocommit is ON, each message that is published gets transmitted to the message broker for distribution.
When autocommit is OFF, the user must call commit()
to send published messages to the broker. Published messages that have not
been committed can be discarded by a call to the method rollback().
The commit() method transmits all messages that were published since the last call to commit() or rollback().
NOTE: The default mode is autocommit ON.
setAutoCommit
in interface Publisher
setAutoCommit
in class PublisherBean
java.io.IOException
- an attempt to set autocommit to true when
there are messages that have been published but not commited
or rolled back.PublisherBase.commit()
,
PublisherBase.rollback()
public boolean isAutoCommit()
Publisher
isAutoCommit
in interface Publisher
isAutoCommit
in class PublisherBean
|
(c) 2000 - 2003 MQue Systems All Rights Reserved |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |