org.exolab.jms.client.mipc
Class IpcJmsServerStub

java.lang.Object
  |
  +--org.exolab.jms.client.mipc.IpcJmsServerStub
All Implemented Interfaces:
org.exolab.core.mipc.DisconnectionEventListener, JmsServerStubIfc
Direct Known Subclasses:
SslJmsServerStub

public class IpcJmsServerStub
extends java.lang.Object
implements JmsServerStubIfc, org.exolab.core.mipc.DisconnectionEventListener

This class is repsonsible for opening an ipc connection to the server and creating IpcJmsConnections.

Version:
$Revision: 1.19 $ $Date: 2004/01/20 14:11:36 $
Author:
Jim Mourikis
See Also:
IpcJmsConnectionStub, DisconnectionEventListener

Constructor Summary
IpcJmsServerStub()
          Default constructor for serialization
IpcJmsServerStub(java.util.Hashtable env)
          The constructor has a collection of environment variables which it uses to construct a connection to the remote server
IpcJmsServerStub(java.lang.String host, int port)
          Instantiate an instance of this stub with the specified host and port numbers
 
Method Summary
 void close()
           
 void closed(IpcJmsConnectionStub connection)
           
protected  org.exolab.core.mipc.MultiplexConnectionIfc createClientConnection(java.lang.String serverAddress, java.lang.String internalServerAddress, int port)
          Create a multiplexed connection to the server
 JmsConnectionStubIfc createConnection(java.lang.String clientId, java.lang.String username, java.lang.String password)
          Create a connection to the JMS Server.
 void disconnected(org.exolab.core.mipc.MultiplexConnectionIfc connection)
           
 java.lang.String getServerAddress()
          Returns the server host
 int getServerPort()
          Returns the server port
 void setExceptionListener(javax.jms.ExceptionListener listener)
          Set the exception listener so that the client can be notified of client disconnection events.
 void setServerAddress(java.lang.String host)
          Set the server host.
 void setServerPort(int port)
          Set the server port.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IpcJmsServerStub

public IpcJmsServerStub()
Default constructor for serialization

IpcJmsServerStub

public IpcJmsServerStub(java.util.Hashtable env)
The constructor has a collection of environment variables which it uses to construct a connection to the remote server
Parameters:
env -  

IpcJmsServerStub

public IpcJmsServerStub(java.lang.String host,
                        int port)
Instantiate an instance of this stub with the specified host and port numbers
Parameters:
host - server host address
port - server port number
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. A new connectionId will be returned if the connection is successful. Create a new IpcJmsConnection object with the given id's.
Specified by:
createConnection in interface JmsServerStubIfc
Parameters:
clientId - the identity of client
username - the client username
password - the client password
Throws:
javax.jms.JMSException -  

setServerAddress

public void setServerAddress(java.lang.String host)
Set the server host. This is the host that the server runs on
Parameters:
host - the name of the host

getServerAddress

public java.lang.String getServerAddress()
Returns the server host
Returns:
the server host

setServerPort

public void setServerPort(int port)
Set the server port. This is the port that the server runs on
Parameters:
port - the server port number

getServerPort

public int getServerPort()
Returns the server port
Returns:
the server port

disconnected

public void disconnected(org.exolab.core.mipc.MultiplexConnectionIfc connection)
Specified by:
disconnected in interface org.exolab.core.mipc.DisconnectionEventListener

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

close

public void close()

closed

public void closed(IpcJmsConnectionStub connection)

createClientConnection

protected org.exolab.core.mipc.MultiplexConnectionIfc createClientConnection(java.lang.String serverAddress,
                                                                             java.lang.String internalServerAddress,
                                                                             int port)
                                                                      throws java.lang.Exception
Create a multiplexed connection to the server
Parameters:
serverAddress - the address of the server
internalServerAddress - internal server address. May be null.
port - the port number to use
Returns:
the connection to the server
Throws:
java.io.IOException - if the connection cannot be established


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