org.exolab.jms.client.http
Class HttpJmsServerStub

java.lang.Object
  |
  +--org.exolab.jms.client.http.HttpJmsServerStub
All Implemented Interfaces:
JmsServerStubIfc
Direct Known Subclasses:
SslHttpJmsServerStub

public class HttpJmsServerStub
extends java.lang.Object
implements JmsServerStubIfc

This class is repsonsible for opening an http connection to the server and creating HttpJmsConnections.

Version:
$Revision: 1.8 $ $Date: 2003/08/07 13:32:51 $
Author:
Jim Mourikis
See Also:
HttpClient

Constructor Summary
HttpJmsServerStub()
          Default constructor
HttpJmsServerStub(java.util.Hashtable env)
          The constructor has a collection of environment variables which it uses to construct a connection to the remote server
HttpJmsServerStub(java.lang.String url)
          Instantiate an instance of this stub with the specified URL
 
Method Summary
protected  java.lang.Object checkReply(org.exolab.core.http.HttpClient connection, java.lang.String method)
          A convenience method to check the success of operations which return a true on sucess.
 JmsConnectionStubIfc createConnection(java.lang.String clientId, java.lang.String username, java.lang.String password)
          Create a connection to the JMS Server.
protected  java.util.Vector pack(java.lang.String method, java.lang.String id, java.lang.String username, java.lang.String password)
          Pack all the data that is required by the server in a vector.
 void setExceptionListener(javax.jms.ExceptionListener listener)
          Set the exception listener so that the client can be notified of client disconnection events.
protected  void setLabel(java.lang.String label)
          The the connection label
protected  void setURL(java.lang.String URL)
          Set the URL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpJmsServerStub

public HttpJmsServerStub()
Default constructor

HttpJmsServerStub

public HttpJmsServerStub(java.util.Hashtable env)
                  throws javax.jms.JMSException
The constructor has a collection of environment variables which it uses to construct a connection to the remote server
Parameters:
env - the connection properties
Throws:
javax.jms.JMSException - if required connection properties aren't specified

HttpJmsServerStub

public HttpJmsServerStub(java.lang.String url)
Instantiate an instance of this stub with the specified URL
Parameters:
url - url of the server hosting the servlet.
Method Detail

createConnection

public JmsConnectionStubIfc createConnection(java.lang.String clientId,
                                             java.lang.String username,
                                             java.lang.String password)
                                      throws javax.jms.JMSException
Create a connection to the JMS Server.
Specified by:
createConnection in interface JmsServerStubIfc
Parameters:
clientId - the identity of client
username - the client username
password - the client password
Throws:
javax.jms.JMSException - if the connection cannot be created

setExceptionListener

public void setExceptionListener(javax.jms.ExceptionListener listener)
Description copied from interface: JmsServerStubIfc
Set the exception listener so that the client can be notified of client disconnection events.
Specified by:
setExceptionListener in interface JmsServerStubIfc
Following copied from interface: org.exolab.jms.client.JmsServerStubIfc
Parameters:
listener - the exception listener

setURL

protected void setURL(java.lang.String URL)
Set the URL
Parameters:
URL - the webserver URL

setLabel

protected void setLabel(java.lang.String label)
The the connection label

checkReply

protected java.lang.Object checkReply(org.exolab.core.http.HttpClient connection,
                                      java.lang.String method)
                               throws javax.jms.JMSException
A convenience method to check the success of operations which return a true on sucess.
Parameters:
connection - the connection
method - The requested server function.
Returns:
the result of the call, or null if the call didn't return a result
Throws:
javax.jms.JMSException - for any failure.

pack

protected java.util.Vector pack(java.lang.String method,
                                java.lang.String id,
                                java.lang.String username,
                                java.lang.String password)
Pack all the data that is required by the server in a vector. Set the size of the vector to be exactly the right size for efficiency.
Parameters:
method - The function to activate on the server.
id - The unique client id.
username -  
password -  
Returns:
Vector The vector containing all the data.


Copyright © 1999-2004 The OpenJMS Group. All Rights Reserved.