jrun.jms.core.server.mipc
Class IpcJmsServer

java.lang.Object
  |
  +--jrun.jms.core.server.mipc.IpcJmsServer
All Implemented Interfaces:
ConnectionNotifierIfc, JmsServerIfc
Direct Known Subclasses:
SslIpcJmsServer

public class IpcJmsServer
extends java.lang.Object
implements JmsServerIfc, ConnectionNotifierIfc

This class implements the JmsServerIfc and provides an IPC-based JMS Server.

Version:
$Revision: 1.9 $ $Date: 2001/11/30 04:29:10 $
Author:
Jim Mourikis
See Also:
org.exolab.jms.server.JmsServer, org.exolab.jms.server.mipc.IpcJmsReceiver

Fields inherited from interface jrun.jms.core.server.JmsServerIfc
Name
 
Constructor Summary
IpcJmsServer()
          Retrieve the server paramaters from the config file and initialise the server, with an appropriate port number and callback handle.
 
Method Summary
 void addConnection(JmsServerSession session, MultiplexConnectionIfc connection)
          Add a new connection for this client.
 void bindConnectionFactories(javax.naming.Context context)
          Bind any factory object specified in the configuration file to the specified JNDI context.
 void connected(MultiplexConnectionIfc newConnection)
          ConnectionNotifierIfc method implementation.
protected  MultiplexConnectionServerIfc createServer(int port)
          Create an normal connection.
protected  java.lang.String getClientClassName()
          Get the client side mipc implementation.
protected  Logger getLogger()
          Return a reference to the logger
protected  java.lang.String getScheme()
          Returns the connector scheme for this server.
 void init()
          This method is called to initialise the JMS service.Control returns when the server has exited.
static IpcJmsServer instance()
          Return the one and only instance of this object if it exists otherwise, create it, then return the instance.
 void removeAllConnections()
          Remove all managed client connections
 void removeConnection(JmsServerSession session)
          Remove this sessions connection
 void start()
          Start the Ipc service in its own thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IpcJmsServer

public IpcJmsServer()
             throws java.io.IOException
Retrieve the server paramaters from the config file and initialise the server, with an appropriate port number and callback handle.
Throws:
java.io.IOException - if the connection server cannot be created
Method Detail

init

public void init()
Description copied from interface: JmsServerIfc
This method is called to initialise the JMS service.Control returns when the server has exited. It throws FailedToInitialiseServerException if, for any reason, it cannot start the service.
Specified by:
init in interface JmsServerIfc
Following copied from interface: jrun.jms.core.server.JmsServerIfc
Throws:
FailedToInitialiseServerException -  

start

public void start()
Start the Ipc service in its own thread. This will then listen for new connections, establish connections as they arrive, and call the callback with new data when received.

connected

public void connected(MultiplexConnectionIfc newConnection)
ConnectionNotifierIfc method implementation. The MultipleConnectionServer calls this method whenever a new MultiplexConnection is established. It gives the user of MCS an opportunity to setup channel handlers.
Specified by:
connected in interface ConnectionNotifierIfc
Following copied from interface: jrun.jms.core.kernel.mipc.ConnectionNotifierIfc
Parameters:
newConnection - The new connection that was established.

addConnection

public void addConnection(JmsServerSession session,
                          MultiplexConnectionIfc connection)
                   throws java.io.IOException
Add a new connection for this client.
Parameters:
session - the session
connection - the connection to the client
Throws:
java.io.IOException - if a connection error occurs

removeConnection

public void removeConnection(JmsServerSession session)
Remove this sessions connection
Parameters:
session - the session

removeAllConnections

public void removeAllConnections()
Remove all managed client connections

bindConnectionFactories

public void bindConnectionFactories(javax.naming.Context context)
                             throws FailedToBindFactoriesException
Description copied from interface: JmsServerIfc
Bind any factory object specified in the configuration file to the specified JNDI context. If there is any error during the process then simply log the error and continue. A failure to bind will not terminate the server.

If it cannot bind the connection factories then an exception is thrown.

Specified by:
bindConnectionFactories in interface JmsServerIfc
Following copied from interface: jrun.jms.core.server.JmsServerIfc
Parameters:
context - context to bind factory objects
Throws:
FailedToBindFactoriesException -  

instance

public static IpcJmsServer instance()
Return the one and only instance of this object if it exists otherwise, create it, then return the instance.
Returns:
IpcJmsServer The one and only instance.

createServer

protected MultiplexConnectionServerIfc createServer(int port)
                                             throws java.io.IOException
Create an normal connection.
Parameters:
port - The port number to use.
Returns:
the created connection
Throws:
java.io.IOException - if the server fails to initialise the ip service

getScheme

protected java.lang.String getScheme()
Returns the connector scheme for this server. Defaults to tcp

getLogger

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

getClientClassName

protected java.lang.String getClientClassName()
Get the client side mipc implementation.
Returns:
a String value


Copyright � 2002 Macromedia Corporation. All Rights Reserved.