org.jnp.server
Class Main

java.lang.Object
  extended by org.jnp.server.Main
All Implemented Interfaces:
MainMBean

public class Main
extends Object
implements MainMBean

A main() entry point for running the jnp naming service implementation as a standalone process.

Version:
$Revision: 57222 $
Author:
Rickard Oberg, Scott.Stark@jboss.org

Field Summary
protected  int backlog
          The serverSocket listen queue depth
protected  InetAddress bindAddress
          The interface to bind to for the lookup socket.
protected  RMIClientSocketFactory clientSocketFactory
          An optional custom client socket factory
protected  String clientSocketFactoryName
          The class name of the optional custom client socket factory
protected  boolean InstallGlobalService
          A flag indicating if theServer will be set as the NamingContext.setLocal value
protected  boolean isStubExported
           
protected  ServerSocketFactory jnpServerSocketFactory
          An optional custom server socket factory
protected  String jnpServerSocketFactoryName
          The class name of the optional custom JNP server socket factory
protected  org.jboss.logging.Logger log
           
protected  org.jboss.util.threadpool.ThreadPool lookupPool
          The thread pool used to handle jnp stub lookup requests
protected  int port
          The jnp protocol listening port.
protected  InetAddress rmiBindAddress
          The interface to bind to for the Naming RMI server
protected  int rmiPort
          The RMI port on which the Naming implementation will be exported.
protected  ServerSocket serverSocket
          The jnp server socket through which the NamingServer stub is vended
protected  RMIServerSocketFactory serverSocketFactory
          An optional custom server socket factory
protected  String serverSocketFactoryName
          The class name of the optional custom server socket factory
protected  MarshalledObject serverStub
           
protected  Naming theServer
          The Naming interface server implementation
protected  boolean UseGlobalService
          A flag indicating if theServer will try to use the NamingContext.setLocal value
 
Constructor Summary
Main()
           
Main(String categoryName)
           
 
Method Summary
 int getBacklog()
           
 String getBindAddress()
           
 String getClientSocketFactory()
           
 boolean getInstallGlobalService()
           
 org.jboss.util.threadpool.ThreadPool getLookupPool()
           
 int getPort()
           
 String getRmiBindAddress()
           
 int getRmiPort()
           
 Naming getServer()
           
 String getServerSocketFactory()
           
 boolean getUseGlobalService()
          Get the UseGlobalService which defines whether the MainMBean's Naming server will initialized from the existing NamingContext.setLocal global value.
protected  void initBootstrapListener()
          Bring up the bootstrap lookup port for obtaining the naming service proxy
protected  void initCustomSocketFactories()
          Init the clientSocketFactory, serverSocketFactory using the bind address.
protected  void initJnpInvoker()
          This code should be moved to a seperate invoker in the org.jboss.naming package.
static void main(String[] args)
           
 void setBacklog(int backlog)
           
 void setBindAddress(String host)
           
 void setClientSocketFactory(String factoryClassName)
          The RMIClientSocketFactory implementation class
 void setInstallGlobalService(boolean flag)
          Whether the MainMBean's Naming server will be installed as the NamingContext.setLocal global value
 void setJNPServerSocketFactory(String factoryClassName)
          The JNPServerSocketFactory implementation class
 void setLookupPool(org.jboss.util.threadpool.ThreadPool lookupPool)
           
 void setNamingProxy(Object proxy)
           
 void setPort(int p)
           
 void setRmiBindAddress(String host)
           
 void setRmiPort(int p)
           
 void setServerSocketFactory(String factoryClassName)
          The RMIServerSocketFactory implementation class
 void setUseGlobalService(boolean flag)
          Set the UseGlobalService which defines whether the MainMBean's Naming server will initialized from the existing NamingContext.setLocal global value.
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

theServer

protected Naming theServer
The Naming interface server implementation


serverStub

protected MarshalledObject serverStub

isStubExported

protected boolean isStubExported

serverSocket

protected ServerSocket serverSocket
The jnp server socket through which the NamingServer stub is vended


clientSocketFactory

protected RMIClientSocketFactory clientSocketFactory
An optional custom client socket factory


serverSocketFactory

protected RMIServerSocketFactory serverSocketFactory
An optional custom server socket factory


jnpServerSocketFactory

protected ServerSocketFactory jnpServerSocketFactory
An optional custom server socket factory


clientSocketFactoryName

protected String clientSocketFactoryName
The class name of the optional custom client socket factory


serverSocketFactoryName

protected String serverSocketFactoryName
The class name of the optional custom server socket factory


jnpServerSocketFactoryName

protected String jnpServerSocketFactoryName
The class name of the optional custom JNP server socket factory


bindAddress

protected InetAddress bindAddress
The interface to bind to for the lookup socket. This is useful for multi-homed hosts that want control over which interfaces accept connections


rmiBindAddress

protected InetAddress rmiBindAddress
The interface to bind to for the Naming RMI server


backlog

protected int backlog
The serverSocket listen queue depth


port

protected int port
The jnp protocol listening port. The default is 1099, the same as the RMI registry default port.


rmiPort

protected int rmiPort
The RMI port on which the Naming implementation will be exported. The default is 0 which means use any available port.


InstallGlobalService

protected boolean InstallGlobalService
A flag indicating if theServer will be set as the NamingContext.setLocal value


UseGlobalService

protected boolean UseGlobalService
A flag indicating if theServer will try to use the NamingContext.setLocal value


log

protected org.jboss.logging.Logger log

lookupPool

protected org.jboss.util.threadpool.ThreadPool lookupPool
The thread pool used to handle jnp stub lookup requests

Constructor Detail

Main

public Main()

Main

public Main(String categoryName)
Method Detail

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception

getServer

public Naming getServer()

getLookupPool

public org.jboss.util.threadpool.ThreadPool getLookupPool()

setLookupPool

public void setLookupPool(org.jboss.util.threadpool.ThreadPool lookupPool)

setNamingProxy

public void setNamingProxy(Object proxy)
                    throws IOException
Throws:
IOException

setRmiPort

public void setRmiPort(int p)
Specified by:
setRmiPort in interface MainMBean

getRmiPort

public int getRmiPort()
Specified by:
getRmiPort in interface MainMBean

setPort

public void setPort(int p)
Specified by:
setPort in interface MainMBean

getPort

public int getPort()
Specified by:
getPort in interface MainMBean

getBindAddress

public String getBindAddress()
Specified by:
getBindAddress in interface MainMBean

setBindAddress

public void setBindAddress(String host)
                    throws UnknownHostException
Specified by:
setBindAddress in interface MainMBean
Throws:
UnknownHostException

getRmiBindAddress

public String getRmiBindAddress()
Specified by:
getRmiBindAddress in interface MainMBean

setRmiBindAddress

public void setRmiBindAddress(String host)
                       throws UnknownHostException
Specified by:
setRmiBindAddress in interface MainMBean
Throws:
UnknownHostException

getBacklog

public int getBacklog()
Specified by:
getBacklog in interface MainMBean

setBacklog

public void setBacklog(int backlog)
Specified by:
setBacklog in interface MainMBean

getInstallGlobalService

public boolean getInstallGlobalService()
Specified by:
getInstallGlobalService in interface MainMBean

setInstallGlobalService

public void setInstallGlobalService(boolean flag)
Description copied from interface: MainMBean
Whether the MainMBean's Naming server will be installed as the NamingContext.setLocal global value

Specified by:
setInstallGlobalService in interface MainMBean

getUseGlobalService

public boolean getUseGlobalService()
Description copied from interface: MainMBean
Get the UseGlobalService which defines whether the MainMBean's Naming server will initialized from the existing NamingContext.setLocal global value.

Specified by:
getUseGlobalService in interface MainMBean
Returns:
true if this should try to use VM global naming service, false otherwise

setUseGlobalService

public void setUseGlobalService(boolean flag)
Description copied from interface: MainMBean
Set the UseGlobalService which defines whether the MainMBean's Naming server will initialized from the existing NamingContext.setLocal global value. This allows one to export multiple servers via different transports and still share the same underlying naming service.

Specified by:
setUseGlobalService in interface MainMBean

getClientSocketFactory

public String getClientSocketFactory()
Specified by:
getClientSocketFactory in interface MainMBean

setClientSocketFactory

public void setClientSocketFactory(String factoryClassName)
                            throws ClassNotFoundException,
                                   InstantiationException,
                                   IllegalAccessException
Description copied from interface: MainMBean
The RMIClientSocketFactory implementation class

Specified by:
setClientSocketFactory in interface MainMBean
Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException

getServerSocketFactory

public String getServerSocketFactory()
Specified by:
getServerSocketFactory in interface MainMBean

setServerSocketFactory

public void setServerSocketFactory(String factoryClassName)
                            throws ClassNotFoundException,
                                   InstantiationException,
                                   IllegalAccessException
Description copied from interface: MainMBean
The RMIServerSocketFactory implementation class

Specified by:
setServerSocketFactory in interface MainMBean
Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException

setJNPServerSocketFactory

public void setJNPServerSocketFactory(String factoryClassName)
                               throws ClassNotFoundException,
                                      InstantiationException,
                                      IllegalAccessException
Description copied from interface: MainMBean
The JNPServerSocketFactory implementation class

Specified by:
setJNPServerSocketFactory in interface MainMBean
Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException

start

public void start()
           throws Exception
Specified by:
start in interface MainMBean
Throws:
Exception

stop

public void stop()
Specified by:
stop in interface MainMBean

initJnpInvoker

protected void initJnpInvoker()
                       throws IOException
This code should be moved to a seperate invoker in the org.jboss.naming package.

Throws:
IOException

initBootstrapListener

protected void initBootstrapListener()
Bring up the bootstrap lookup port for obtaining the naming service proxy


initCustomSocketFactories

protected void initCustomSocketFactories()
Init the clientSocketFactory, serverSocketFactory using the bind address.



Copyright © 2002 JBoss Group, LLC. All Rights Reserved.