org.jboss.mq.il.uil2
Class UILServerIL

java.lang.Object
  extended by org.jboss.mq.il.uil2.UILServerIL
All Implemented Interfaces:
Serializable, Cloneable, ServerIL, MsgTypes, Recoverable

public class UILServerIL
extends Object
implements Cloneable, MsgTypes, Serializable, ServerIL, Recoverable

The UILServerIL is created on the server and copied to the client during connection factory lookups. It represents the transport interface to the JMS server.

Version:
$Revision: 57198 $
Author:
Scott.Stark@jboss.org
See Also:
Serialized Form

Field Summary
protected  Socket socket
          Description of the Field
protected  SocketManager socketMgr
          Description of the Field
 
Fields inherited from interface org.jboss.mq.il.uil2.msgs.MsgTypes
m_acknowledge, m_addMessage, m_authenticate, m_browse, m_checkID, m_checkUser, m_close, m_connectionClosing, m_createQueue, m_createTopic, m_deleteTemporaryDestination, m_destroySubscription, m_getID, m_getTemporaryQueue, m_getTemporaryTopic, m_ping, m_pong, m_receive, m_receiveRequest, m_recover, m_setEnabled, m_setSpyDistributedConnection, m_subscribe, m_transact, m_unsubscribe
 
Constructor Summary
UILServerIL(InetAddress addr, int port, String socketFactoryName, boolean enableTcpNoDelay, int bufferSize, int chunkSize, int soTimeout, String connectAddress, int connectPort)
           
 
Method Summary
 void acknowledge(ConnectionToken dc, AcknowledgementRequest item)
          #Description of the Method
 void addMessage(ConnectionToken dc, SpyMessage val)
          Adds a message to the destination specifyed in the message.
 String authenticate(String username, String password)
          Authenticate the user.
 SpyMessage[] browse(ConnectionToken dc, javax.jms.Destination dest, String selector)
          #Description of the Method
protected  void checkConnection()
           
 void checkID(String id)
          Check if clientID is a valid ID.
 String checkUser(String username, String password)
          Get a clientID for a given user/password.
 Object clone()
           
 ServerIL cloneServerIL()
          #Description of the Method
 void connectionClosing(ConnectionToken dc)
          The client is closing the connection.
protected  void createConnection()
          Used to establish a new connection to the server
 javax.jms.Queue createQueue(ConnectionToken dc, String destName)
          #Description of the Method
 javax.jms.Topic createTopic(ConnectionToken dc, String destName)
          #Description of the Method
 void deleteTemporaryDestination(ConnectionToken dc, SpyDestination dest)
          #Description of the Method
protected  void destroyConnection()
          Used to close the current connection with the server
 void destroySubscription(ConnectionToken dc, DurableSubscriptionID id)
          Unsubscribe from a durable subscription.
 String getID()
          Get a clientID from the server.
 javax.jms.TemporaryQueue getTemporaryQueue(ConnectionToken dc)
          Gets the TemporaryQueue attribute of the ServerIL object
 javax.jms.TemporaryTopic getTemporaryTopic(ConnectionToken dc)
          Gets the TemporaryTopic attribute of the ServerIL object
 void ping(ConnectionToken dc, long clientTime)
          Ping the server.
 SpyMessage receive(ConnectionToken dc, int subscriberId, long wait)
          Get a message synchronously.
 Xid[] recover(ConnectionToken dc, int flags)
          Recover
 void setConnectionToken(ConnectionToken dest)
           
 void setEnabled(ConnectionToken dc, boolean enabled)
          Sets the Enabled attribute of the ServerIL object
 void subscribe(ConnectionToken dc, Subscription s)
           
 void transact(ConnectionToken dc, TransactionRequest t)
          #Description of the Method
 void unsubscribe(ConnectionToken dc, int subscriptionID)
          Remove a consumer.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

socket

protected transient Socket socket
Description of the Field


socketMgr

protected transient SocketManager socketMgr
Description of the Field

Constructor Detail

UILServerIL

public UILServerIL(InetAddress addr,
                   int port,
                   String socketFactoryName,
                   boolean enableTcpNoDelay,
                   int bufferSize,
                   int chunkSize,
                   int soTimeout,
                   String connectAddress,
                   int connectPort)
            throws Exception
Throws:
Exception
Method Detail

setConnectionToken

public void setConnectionToken(ConnectionToken dest)
                        throws Exception
Specified by:
setConnectionToken in interface ServerIL
Parameters:
dest - org.jboss.mq.ConnectionToken
Throws:
Exception - The exception description.

setEnabled

public void setEnabled(ConnectionToken dc,
                       boolean enabled)
                throws javax.jms.JMSException,
                       Exception
Description copied from interface: ServerIL
Sets the Enabled attribute of the ServerIL object

Specified by:
setEnabled in interface ServerIL
Parameters:
dc - The new Enabled value
enabled - The new Enabled value
Throws:
Exception - Description of Exception
javax.jms.JMSException

getID

public String getID()
             throws Exception
Description copied from interface: ServerIL
Get a clientID from the server. It is up to the server side components to update the ConectionToken if this method returns normaly.

Specified by:
getID in interface ServerIL
Returns:
an internally generated clientID.
Throws:
Exception - Description of Exception

getTemporaryQueue

public javax.jms.TemporaryQueue getTemporaryQueue(ConnectionToken dc)
                                           throws javax.jms.JMSException,
                                                  Exception
Description copied from interface: ServerIL
Gets the TemporaryQueue attribute of the ServerIL object

Specified by:
getTemporaryQueue in interface ServerIL
Parameters:
dc - Description of Parameter
Returns:
The TemporaryQueue value
Throws:
Exception - Description of Exception
javax.jms.JMSException

getTemporaryTopic

public javax.jms.TemporaryTopic getTemporaryTopic(ConnectionToken dc)
                                           throws javax.jms.JMSException,
                                                  Exception
Description copied from interface: ServerIL
Gets the TemporaryTopic attribute of the ServerIL object

Specified by:
getTemporaryTopic in interface ServerIL
Parameters:
dc - Description of Parameter
Returns:
The TemporaryTopic value
Throws:
Exception - Description of Exception
javax.jms.JMSException

acknowledge

public void acknowledge(ConnectionToken dc,
                        AcknowledgementRequest item)
                 throws javax.jms.JMSException,
                        Exception
Description copied from interface: ServerIL
#Description of the Method

Specified by:
acknowledge in interface ServerIL
Parameters:
dc - Description of Parameter
item - Description of Parameter
Throws:
Exception - Description of Exception
javax.jms.JMSException

addMessage

public void addMessage(ConnectionToken dc,
                       SpyMessage val)
                throws Exception
Description copied from interface: ServerIL
Adds a message to the destination specifyed in the message.

Specified by:
addMessage in interface ServerIL
Parameters:
dc - The feature to be added to the Message attribute
val - The feature to be added to the Message attribute
Throws:
Exception - Description of Exception

browse

public SpyMessage[] browse(ConnectionToken dc,
                           javax.jms.Destination dest,
                           String selector)
                    throws javax.jms.JMSException,
                           Exception
Description copied from interface: ServerIL
#Description of the Method

Specified by:
browse in interface ServerIL
Parameters:
dc - Description of Parameter
dest - Description of Parameter
selector - Description of Parameter
Returns:
Description of the Returned Value
Throws:
Exception - Description of Exception
javax.jms.JMSException

checkID

public void checkID(String id)
             throws javax.jms.JMSException,
                    Exception
Description copied from interface: ServerIL
Check if clientID is a valid ID. This method should be called when the client tries to set its own clientID. It is up to the server side components to update the ConectionToken if this method returns normaly.

Specified by:
checkID in interface ServerIL
Parameters:
id - a clientID set by the client.
Throws:
Exception - if the clientID was not vallid.
javax.jms.JMSException

checkUser

public String checkUser(String username,
                        String password)
                 throws javax.jms.JMSException,
                        Exception
Description copied from interface: ServerIL
Get a clientID for a given user/password. May also be used for autentication if StateManager is used as authenticator.

Specified by:
checkUser in interface ServerIL
Parameters:
username - a valid user name that the StateManager knows about.
password - a password
Returns:
a preconfigured clientID or null.
Throws:
Exception - Description of Exception
javax.jms.JMSException

authenticate

public String authenticate(String username,
                           String password)
                    throws javax.jms.JMSException,
                           Exception
Description copied from interface: ServerIL
Authenticate the user. If using a securityManager the user will be autenticated by that.

Specified by:
authenticate in interface ServerIL
Parameters:
username - a username.
password - a password.
Returns:
a sessionid, valid only for the life of this connection.
Throws:
Exception - Description of Exception
javax.jms.JMSException

clone

public Object clone()
             throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException

cloneServerIL

public ServerIL cloneServerIL()
                       throws Exception
Description copied from interface: ServerIL
#Description of the Method

Specified by:
cloneServerIL in interface ServerIL
Returns:
Description of the Returned Value
Throws:
Exception - Description of Exception

connectionClosing

public void connectionClosing(ConnectionToken dc)
                       throws javax.jms.JMSException,
                              Exception
Description copied from interface: ServerIL
The client is closing the connection.

Specified by:
connectionClosing in interface ServerIL
Parameters:
dc - Description of Parameter
Throws:
Exception - Description of Exception
javax.jms.JMSException

createQueue

public javax.jms.Queue createQueue(ConnectionToken dc,
                                   String destName)
                            throws javax.jms.JMSException,
                                   Exception
Description copied from interface: ServerIL
#Description of the Method

Specified by:
createQueue in interface ServerIL
Parameters:
dc - Description of Parameter
destName - Description of Parameter
Returns:
Description of the Returned Value
Throws:
Exception - Description of Exception
javax.jms.JMSException

createTopic

public javax.jms.Topic createTopic(ConnectionToken dc,
                                   String destName)
                            throws javax.jms.JMSException,
                                   Exception
Description copied from interface: ServerIL
#Description of the Method

Specified by:
createTopic in interface ServerIL
Parameters:
dc - Description of Parameter
destName - Description of Parameter
Returns:
Description of the Returned Value
Throws:
Exception - Description of Exception
javax.jms.JMSException

deleteTemporaryDestination

public void deleteTemporaryDestination(ConnectionToken dc,
                                       SpyDestination dest)
                                throws javax.jms.JMSException,
                                       Exception
Description copied from interface: ServerIL
#Description of the Method

Specified by:
deleteTemporaryDestination in interface ServerIL
Parameters:
dc - Description of Parameter
dest - Description of Parameter
Throws:
Exception - Description of Exception
javax.jms.JMSException

destroySubscription

public void destroySubscription(ConnectionToken dc,
                                DurableSubscriptionID id)
                         throws javax.jms.JMSException,
                                Exception
Description copied from interface: ServerIL
Unsubscribe from a durable subscription.

Specified by:
destroySubscription in interface ServerIL
id - Description of Parameter
Throws:
Exception - Description of Exception
javax.jms.JMSException

ping

public void ping(ConnectionToken dc,
                 long clientTime)
          throws Exception
Description copied from interface: ServerIL
Ping the server.

Specified by:
ping in interface ServerIL
Parameters:
dc - Description of Parameter
clientTime - Description of Parameter
Throws:
Exception - Description of Exception

receive

public SpyMessage receive(ConnectionToken dc,
                          int subscriberId,
                          long wait)
                   throws Exception,
                          Exception
Description copied from interface: ServerIL
Get a message synchronously.

Specified by:
receive in interface ServerIL
Parameters:
dc - Description of Parameter
subscriberId - Description of Parameter
wait - Description of Parameter
Returns:
Description of the Returned Value
Throws:
Exception - Description of Exception

subscribe

public void subscribe(ConnectionToken dc,
                      Subscription s)
               throws javax.jms.JMSException,
                      Exception
Specified by:
subscribe in interface ServerIL
Parameters:
dc - org.jboss.mq.ConnectionToken
s - org.jboss.mq.Subscription
Throws:
Exception - The exception description.
javax.jms.JMSException

transact

public void transact(ConnectionToken dc,
                     TransactionRequest t)
              throws javax.jms.JMSException,
                     Exception
Description copied from interface: ServerIL
#Description of the Method

Specified by:
transact in interface ServerIL
Parameters:
dc - Description of Parameter
t - Description of Parameter
Throws:
Exception - Description of Exception
javax.jms.JMSException

recover

public Xid[] recover(ConnectionToken dc,
                     int flags)
              throws Exception
Description copied from interface: Recoverable
Recover

Specified by:
recover in interface Recoverable
Parameters:
dc - the connnection token
flags - the recovery flags
Returns:
the xids
Throws:
Exception - for any error

unsubscribe

public void unsubscribe(ConnectionToken dc,
                        int subscriptionID)
                 throws javax.jms.JMSException,
                        Exception
Description copied from interface: ServerIL
Remove a consumer. Is NOT the same as the topic session unsubscribe.

Specified by:
unsubscribe in interface ServerIL
Parameters:
dc - Description of Parameter
subscriptionID - Description of Parameter
Throws:
Exception - Description of Exception
javax.jms.JMSException

checkConnection

protected void checkConnection()
                        throws Exception
Throws:
Exception

createConnection

protected void createConnection()
                         throws Exception
Used to establish a new connection to the server

Throws:
Exception - Description of Exception

destroyConnection

protected void destroyConnection()
Used to close the current connection with the server



Copyright © 2002 JBoss Group, LLC. All Rights Reserved.