org.exolab.jms.server
Class JmsServer

java.lang.Object
  |
  +--org.exolab.jms.server.JmsServer
Direct Known Subclasses:
EmbeddedJmsServer

public class JmsServer
extends java.lang.Object

This class contains the main line for instantiating the JMS Server. It dynamically detemrines, from the configuration information which of the servers to implement and then calls the init method on them.

Version:
$Revision: 1.48.2.1 $ $Date: 2004/05/06 11:35:09 $
Author:
Jim Alateras, Tim Anderson
See Also:
ConfigurationManager

Field Summary
protected  org.exolab.core.service.ServiceManager _services
          The service manager
 
Constructor Summary
JmsServer(org.exolab.jms.config.Configuration config)
          Construct a new JmsServer
JmsServer(java.lang.String file)
          Construct a new JmsServer, configured from the specified configuration file.
 
Method Summary
protected  void createRegistry()
           
 void init()
          Initialise the server
protected  JmsServerIfc initConnector(org.exolab.jms.config.Connector connector, javax.naming.Context context)
          Create an interface to the server for the specified connector
protected  void initConnectors(javax.naming.Context context)
          Creates an interface to the server for each configured connector
protected  JndiServerIfc initJNDIConnector(org.exolab.jms.config.ConnectorResource connector, javax.naming.Context context)
          Creates a JNDI provider interface for the specified connector
protected  void initJNDIConnectors(javax.naming.Context context)
          Creates a JNDI provider interface for each connector that supports it
static void main(java.lang.String[] args)
          This is the main line for the JMS Server.
protected  void registerServices()
          Initialise the services
protected static void usage()
          Print out information on running this sevice
static void version()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_services

protected org.exolab.core.service.ServiceManager _services
The service manager
Constructor Detail

JmsServer

public JmsServer(org.exolab.jms.config.Configuration config)
          throws ServerException
Construct a new JmsServer
Parameters:
config - the server configuration
Throws:
ServerException - if the server cannot be created

JmsServer

public JmsServer(java.lang.String file)
          throws ServerException
Construct a new JmsServer, configured from the specified configuration file.
Parameters:
file - configuration file name
Throws:
ServerException - if the server cannot be created
Method Detail

init

public void init()
          throws javax.naming.NamingException,
                 ServerException
Initialise the server
Throws:
javax.naming.NamingException - if administered objects cannot be bound in JNDI
ServerException - if the server cannot be initialised

main

public static void main(java.lang.String[] args)
This is the main line for the JMS Server. It processes the command line argument, instantiates an instance of the server class and calls the init routine on it.

version

public static void version()

usage

protected static void usage()
Print out information on running this sevice

registerServices

protected void registerServices()
                         throws org.exolab.core.service.ServiceException
Initialise the services

initConnectors

protected void initConnectors(javax.naming.Context context)
                       throws javax.naming.NamingException,
                              ServerException
Creates an interface to the server for each configured connector
Parameters:
context - the initial context
Throws:
javax.naming.NamingException - if administered objects cannot be bound in JNDI
ServerException - if an interface can't be created

initConnector

protected JmsServerIfc initConnector(org.exolab.jms.config.Connector connector,
                                     javax.naming.Context context)
                              throws javax.naming.NamingException,
                                     ServerException
Create an interface to the server for the specified connector
Parameters:
connector - the connector
context - the initial context
Returns:
the interface corresponding to connector
Throws:
javax.naming.NamingException - if administered objects cannot be bound in JNDI
ServerException - if the interface can't be created

createRegistry

protected void createRegistry()
                       throws ServerException

initJNDIConnectors

protected void initJNDIConnectors(javax.naming.Context context)
                           throws javax.naming.NamingException,
                                  ServerException
Creates a JNDI provider interface for each connector that supports it
Parameters:
context - the initial context
Throws:
javax.naming.NamingException - if a provider can't be initialised
ServerException - if a provider can't be created

initJNDIConnector

protected JndiServerIfc initJNDIConnector(org.exolab.jms.config.ConnectorResource connector,
                                          javax.naming.Context context)
                                   throws javax.naming.NamingException,
                                          ServerException
Creates a JNDI provider interface for the specified connector
Parameters:
connector - the connector
context - the initial context
Returns:
the JNDI provider interface
Throws:
javax.naming.NamingException - if the provider can't be initialised
ServerException - if the provider can't be created


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