jrun.jms.core.client.mipc
Class IpcJmsServerStub

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

public class IpcJmsServerStub
extends java.lang.Object
implements JmsServerStubIfc, DisconnectionEventListener

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

This is a singleton class.

Version:
$Revision: 1.10 $ $Date: 2002/01/18 12:21:32 $
Author:
Jim Mourikis
See Also:
org.exolab.jms.client.mipc.IpcJmsConnectionStub, org.exolab.core.mipc.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
protected  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)
          Create a connection to the JMS Server.
 JmsConnectionStubIfc createConnection(java.lang.String clientId, java.lang.String userName, java.lang.String password)
          Create a connection to the JMS Server.
 void disconnected(MultiplexConnectionIfc connection)
          A multiplex connection has been terminated.
protected  Logger getLogger()
          Return a reference to the logger.
 java.lang.String getServerAddress()
          Return a refernece to the server host
 int getServerPort()
          Return a reference ot 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. If one cannot be established then throw JMSException exception
Specified by:
createConnection in interface JmsServerStubIfc
Parameters:
id - identity of client
userName -  
password -  
Throws:
JMSException -  

createConnection

public JmsConnectionStubIfc createConnection(java.lang.String clientId)
                                      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:
id - identity of client
Throws:
JMSException -  

setServerAddress

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

getServerAddress

public java.lang.String getServerAddress()
Return a refernece to the server host
Returns:
String

setServerPort

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

getServerPort

public int getServerPort()
Return a reference ot the server port.
Returns:
int

disconnected

public void disconnected(MultiplexConnectionIfc connection)
Description copied from interface: DisconnectionEventListener
A multiplex connection has been terminated.
Specified by:
disconnected in interface DisconnectionEventListener
Following copied from interface: jrun.jms.core.kernel.mipc.DisconnectionEventListener
Parameters:
connection - The terminated connection

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: jrun.jms.core.client.JmsServerStubIfc
Parameters:
listener - the exception listener

getLogger

protected Logger getLogger()
Return a reference to the logger.
Returns:
LoggerIfc

createClientConnection

protected MultiplexConnectionIfc createClientConnection(java.lang.String serverAddress,
                                                        java.lang.String internalServerAddress,
                                                        int port)
                                                 throws java.io.IOException,
                                                        java.lang.Exception
Create a multiplexed connection to the server
Parameters:
serverAddress - The address of the server.
internalServerAddress - Internal server address if used.
port - The port number to use.
Returns:
MultiplexConnectionIfc The created connection.
Throws:
IOException - If the server fails to initialise the ip service.


Copyright � 2002 Macromedia Corporation. All Rights Reserved.