|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.mq.Connection
This class implements javax.jms.Connection.
It is also the gateway through wich all calls to the JMS server is done. To do its work it needs a ServerIL to invoke (@see org.jboss.mq.server.ServerIL).
The (new from february 2002) logic for clientID is the following: if logging in with a user and passwork a preconfigured clientID may be automatically delivered from the server.
If the client wants to set it's own clientID it must do so on a connection wich does not have a prefonfigured clientID and it must do so before it calls any other methods on the connection (even getClientID()). It is not allowable to use a clientID that either looks like JBossMQ internal one (beginning with ID) or a clientID that is allready in use by someone, or a clientID that is already preconfigured in the server.
If a preconfigured ID is not get, or a valid one is not set, the server will set an internal ID. This ID is NEVER possible to use for durable subscriptions. If a prefconfigured ID or one manually set is possible to use to create a durable subscriptions is governed by the security configuration of JBossMQ. In the default setup, only preconfigured clientID's are possible to use. If using a SecurityManager, permissions to create a surable subscriptions is * the resiult of a combination of the following:
- The clientID is not one of JBossMQ's internal.
- The user is authenticated and has a role that has create set to true in the security config of the destination.
Notes for JBossMQ developers: All calls, except close(), that is possible to do on a connection must call checkClientID()
Field Summary | |
protected String |
clientID
This is the clientID |
protected ClientILService |
clientILService
The object that sets up the client IL |
protected static EDU.oswego.cs.dl.util.concurrent.ClockDaemon |
clockDaemon
Manages the thread that pings the connection to see if it is 'alive' |
protected boolean |
closing
Set a soon as close() is called on the connection. |
protected ConnectionToken |
connectionToken
The connection token is used to identify our connection to the server. |
HashMap |
destinationSubscriptions
Maps a destination to a LinkedList of Subscriptions |
boolean |
modeStop
Is the connection stopped ? |
protected long |
pingPeriod
How often to ping the connection |
protected boolean |
ponged
This feild is reset when a ping is sent, set when ponged. |
protected ServerIL |
serverIL
This is our connection to the JMS server |
HashMap |
subscriptions
Maps a a subsction id to a Subscription |
Method Summary | |
protected void |
askForAnID()
Ask the server for an id |
protected void |
askForAnID(String userName,
String password)
Ask the server for an id |
void |
asynchClose()
Notification from the server that the connection is closed |
void |
asynchDeleteTemporaryDestination(SpyDestination dest)
Called by a TemporaryDestination which is going to be deleted() |
void |
asynchDeliver(ReceiveRequest[] requests)
Gets the first consumer that is listening to a destination. |
void |
asynchFailure(String reason,
Exception e)
Notification of a failure on this connection |
void |
asynchPong(long serverTime)
Invoked when the server pong us |
protected void |
authenticate(String userName,
String password)
Authenticate a user |
protected void |
checkClientID()
Check that a clientID exists. |
void |
close()
|
void |
deleteTemporaryDestination(SpyDestination dest)
Called by a TemporaryDestination which is going to be deleted |
void |
doStop()
Stop delivery |
String |
getClientID()
|
javax.jms.ExceptionListener |
getExceptionListener()
|
javax.jms.ConnectionMetaData |
getMetaData()
|
ServerIL |
getServerIL()
Gets the ServerIL attribute of the Connection object |
static ThreadGroup |
getThreadGroup()
|
protected void |
send(AcknowledgementRequest item)
Acknowledge/Nack a message |
protected void |
send(TransactionRequest transaction)
Commit/rollback |
void |
setClientID(String cID)
|
void |
setExceptionListener(javax.jms.ExceptionListener listener)
|
void |
start()
|
protected void |
startILService()
Start the il |
void |
stop()
|
protected void |
stopILService()
Stop the il |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static EDU.oswego.cs.dl.util.concurrent.ClockDaemon clockDaemon
public HashMap destinationSubscriptions
public HashMap subscriptions
public boolean modeStop
protected ServerIL serverIL
protected String clientID
protected ConnectionToken connectionToken
protected ClientILService clientILService
protected long pingPeriod
protected boolean ponged
protected volatile boolean closing
Method Detail |
public static ThreadGroup getThreadGroup()
public ServerIL getServerIL()
public void asynchClose()
public void asynchDeleteTemporaryDestination(SpyDestination dest)
dest
- the temporary destinationpublic void asynchDeliver(ReceiveRequest[] requests)
requests
- the receive requestspublic void asynchFailure(String reason, Exception e)
reason
- the reason for the failuree
- the exceptionpublic void asynchPong(long serverTime)
serverTime
- the server timepublic void deleteTemporaryDestination(SpyDestination dest) throws javax.jms.JMSException
dest
- the temporary destination
javax.jms.JMSException
- for any errorpublic void setClientID(String cID) throws javax.jms.JMSException
setClientID
in interface javax.jms.Connection
javax.jms.JMSException
public String getClientID() throws javax.jms.JMSException
getClientID
in interface javax.jms.Connection
javax.jms.JMSException
public javax.jms.ExceptionListener getExceptionListener() throws javax.jms.JMSException
getExceptionListener
in interface javax.jms.Connection
javax.jms.JMSException
public void setExceptionListener(javax.jms.ExceptionListener listener) throws javax.jms.JMSException
setExceptionListener
in interface javax.jms.Connection
javax.jms.JMSException
public javax.jms.ConnectionMetaData getMetaData() throws javax.jms.JMSException
getMetaData
in interface javax.jms.Connection
javax.jms.JMSException
public void close() throws javax.jms.JMSException
close
in interface javax.jms.Connection
javax.jms.JMSException
public void start() throws javax.jms.JMSException
start
in interface javax.jms.Connection
javax.jms.JMSException
public void stop() throws javax.jms.JMSException
stop
in interface javax.jms.Connection
javax.jms.JMSException
public String toString()
protected void checkClientID() throws javax.jms.JMSException
javax.jms.JMSException
- if clientID is null as post conditionprotected void askForAnID() throws javax.jms.JMSException
javax.jms.JMSException
- for any errorprotected void askForAnID(String userName, String password) throws javax.jms.JMSException
userName
- the userpassword
- the password
javax.jms.JMSException
- for any errorprotected void authenticate(String userName, String password) throws javax.jms.JMSException
userName
- the userpassword
- the password
javax.jms.JMSException
- for any errorprotected void send(AcknowledgementRequest item) throws javax.jms.JMSException
item
- the acknowledgement
javax.jms.JMSException
- for any errorprotected void send(TransactionRequest transaction) throws javax.jms.JMSException
transaction
- the transaction request
javax.jms.JMSException
- for any errorprotected void startILService() throws javax.jms.JMSException
javax.jms.JMSException
- for any errorprotected void stopILService() throws javax.jms.JMSException
javax.jms.JMSException
- for any errorpublic void doStop() throws javax.jms.JMSException
javax.jms.JMSException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |