org.jnp.server
Class Main

java.lang.Object
  extended byorg.jnp.server.Main
All Implemented Interfaces:
MainMBean (src)

public class Main
extends java.lang.Object
implements MainMBean (src)

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


Field Summary
protected  int backlog
          The serverSocket listen queue depth
protected  java.net.InetAddress bindAddress
          The interface to bind to for the lookup socket.
protected  java.rmi.server.RMIClientSocketFactory clientSocketFactory
          An optional custom client socket factory
protected  java.lang.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  javax.net.ServerSocketFactory jnpServerSocketFactory
          An optional custom server socket factory
protected  java.lang.String jnpServerSocketFactoryName
          The class name of the optional custom JNP server socket factory
protected  Logger (src) log
           
protected  ThreadPool (src) lookupPool
          The thread pool used to handle jnp stub lookup requests
protected  int port
          The jnp protocol listening port.
protected  java.net.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  java.net.ServerSocket serverSocket
          The jnp server socket through which the NamingServer stub is vended
protected  java.rmi.server.RMIServerSocketFactory serverSocketFactory
          An optional custom server socket factory
protected  java.lang.String serverSocketFactoryName
          The class name of the optional custom server socket factory
protected  java.rmi.MarshalledObject serverStub
           
protected  NamingServer (src) theServer
          The Naming interface server implementation
 
Constructor Summary
Main()
           
Main(java.lang.String categoryName)
           
 
Method Summary
 int getBacklog()
           
 java.lang.String getBindAddress()
           
 java.lang.String getClientSocketFactory()
          Get the RMIClientSocketFactory implementation class
 boolean getInstallGlobalService()
          Get the InstallGlobalService which defines whether the MainMBean's Naming server will be installed as the NamingContext.setLocal global value.
 ThreadPool (src) getLookupPool()
           
 int getPort()
           
 java.lang.String getRmiBindAddress()
           
 int getRmiPort()
           
 Naming (src) getServer()
           
 java.lang.String getServerSocketFactory()
          Get the RMIServerSocketFactory implementation class
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(java.lang.String[] args)
           
 void setBacklog(int backlog)
           
 void setBindAddress(java.lang.String host)
           
 void setClientSocketFactory(java.lang.String factoryClassName)
          Set the RMIClientSocketFactory implementation class
 void setInstallGlobalService(boolean flag)
          Set the InstallGlobalService which defines whether the MainMBean's Naming server will be installed as the NamingContext.setLocal global value.
 void setJNPServerSocketFactory(java.lang.String factoryClassName)
          Set the ServerSocketFactory implementation class
 void setLookupPool(ThreadPool (src)  lookupPool)
           
 void setNamingProxy(java.lang.Object proxy)
           
 void setPort(int p)
           
 void setRmiBindAddress(java.lang.String host)
           
 void setRmiPort(int p)
           
 void setServerSocketFactory(java.lang.String factoryClassName)
          Set the RMIServerSocketFactory implementation class
 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 NamingServer (src)  theServer
The Naming interface server implementation


serverStub

protected java.rmi.MarshalledObject serverStub

isStubExported

protected boolean isStubExported

serverSocket

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


clientSocketFactory

protected java.rmi.server.RMIClientSocketFactory clientSocketFactory
An optional custom client socket factory


serverSocketFactory

protected java.rmi.server.RMIServerSocketFactory serverSocketFactory
An optional custom server socket factory


jnpServerSocketFactory

protected javax.net.ServerSocketFactory jnpServerSocketFactory
An optional custom server socket factory


clientSocketFactoryName

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


serverSocketFactoryName

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


jnpServerSocketFactoryName

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


bindAddress

protected java.net.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 java.net.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


log

protected Logger (src)  log

lookupPool

protected ThreadPool (src)  lookupPool
The thread pool used to handle jnp stub lookup requests

Constructor Detail

Main

public Main()

Main

public Main(java.lang.String categoryName)
Method Detail

main

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

getServer

public Naming (src)  getServer()

getLookupPool

public ThreadPool (src)  getLookupPool()

setLookupPool

public void setLookupPool(ThreadPool (src)  lookupPool)

setNamingProxy

public void setNamingProxy(java.lang.Object proxy)
                    throws java.io.IOException
Throws:
java.io.IOException

setRmiPort

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

getRmiPort

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

setPort

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

getPort

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

getBindAddress

public java.lang.String getBindAddress()
Specified by:
getBindAddress in interface MainMBean (src)

setBindAddress

public void setBindAddress(java.lang.String host)
                    throws java.net.UnknownHostException
Specified by:
setBindAddress in interface MainMBean (src)
Throws:
java.net.UnknownHostException

getRmiBindAddress

public java.lang.String getRmiBindAddress()
Specified by:
getRmiBindAddress in interface MainMBean (src)

setRmiBindAddress

public void setRmiBindAddress(java.lang.String host)
                       throws java.net.UnknownHostException
Specified by:
setRmiBindAddress in interface MainMBean (src)
Throws:
java.net.UnknownHostException

getBacklog

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

setBacklog

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

getInstallGlobalService

public boolean getInstallGlobalService()
Description copied from interface: MainMBean (src)
Get the InstallGlobalService which defines whether the MainMBean's Naming server will be installed as the NamingContext.setLocal global value.

Specified by:
getInstallGlobalService in interface MainMBean (src)
Returns:
true if this is the VM global naming service, false otherwise

setInstallGlobalService

public void setInstallGlobalService(boolean flag)
Description copied from interface: MainMBean (src)
Set the InstallGlobalService which defines whether the MainMBean's Naming server will be installed as the NamingContext.setLocal global value.

Specified by:
setInstallGlobalService in interface MainMBean (src)
Returns:
true if this is the VM global naming service, false otherwise

getClientSocketFactory

public java.lang.String getClientSocketFactory()
Description copied from interface: MainMBean (src)
Get the RMIClientSocketFactory implementation class

Specified by:
getClientSocketFactory in interface MainMBean (src)

setClientSocketFactory

public void setClientSocketFactory(java.lang.String factoryClassName)
                            throws java.lang.ClassNotFoundException,
                                   java.lang.InstantiationException,
                                   java.lang.IllegalAccessException
Description copied from interface: MainMBean (src)
Set the RMIClientSocketFactory implementation class

Specified by:
setClientSocketFactory in interface MainMBean (src)
Throws:
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException

getServerSocketFactory

public java.lang.String getServerSocketFactory()
Description copied from interface: MainMBean (src)
Get the RMIServerSocketFactory implementation class

Specified by:
getServerSocketFactory in interface MainMBean (src)

setServerSocketFactory

public void setServerSocketFactory(java.lang.String factoryClassName)
                            throws java.lang.ClassNotFoundException,
                                   java.lang.InstantiationException,
                                   java.lang.IllegalAccessException
Description copied from interface: MainMBean (src)
Set the RMIServerSocketFactory implementation class

Specified by:
setServerSocketFactory in interface MainMBean (src)
Throws:
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException

setJNPServerSocketFactory

public void setJNPServerSocketFactory(java.lang.String factoryClassName)
                               throws java.lang.ClassNotFoundException,
                                      java.lang.InstantiationException,
                                      java.lang.IllegalAccessException
Description copied from interface: MainMBean (src)
Set the ServerSocketFactory implementation class

Specified by:
setJNPServerSocketFactory in interface MainMBean (src)
Throws:
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException

start

public void start()
           throws java.lang.Exception
Specified by:
start in interface MainMBean (src)
Throws:
java.lang.Exception

stop

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

initJnpInvoker

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

Throws:
java.io.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.