Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.jnp.server
Class Main  view Main download Main.java

java.lang.Object
  extended byorg.jnp.server.Main
All Implemented Interfaces:
MainMBean, java.lang.Runnable

public class Main
extends java.lang.Object
implements java.lang.Runnable, MainMBean

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

Version:
$Revision: 1.12.2.6 $

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  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  org.apache.log4j.Category log
           
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 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.
 int getPort()
           
 java.lang.String getRmiBindAddress()
           
 int getRmiPort()
           
 org.jnp.interfaces.Naming getServer()
           
 java.lang.String getServerSocketFactory()
          Get the RMIServerSocketFactory implementation class
protected  void initJnpInvoker()
          This code should be moved to a seperate invoker in the org.jboss.naming package.
protected  void listen()
           
static void main(java.lang.String[] args)
           
 void run()
          This method will be called by whoever wishes to run your class implementing Runnable.
 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 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 theServer
The Naming interface server implementation


serverStub

protected java.rmi.MarshalledObject serverStub

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 org.apache.log4j.Category log
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

getServer

public org.jnp.interfaces.Naming getServer()

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 java.lang.String getBindAddress()
Specified by:
getBindAddress in interface MainMBean

setBindAddress

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

getRmiBindAddress

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

setRmiBindAddress

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

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()
Description copied from interface: MainMBean
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

setInstallGlobalService

public void setInstallGlobalService(boolean flag)
Description copied from interface: MainMBean
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

getClientSocketFactory

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

Specified by:
getClientSocketFactory in interface MainMBean

setClientSocketFactory

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

Specified by:
setClientSocketFactory in interface MainMBean

getServerSocketFactory

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

Specified by:
getServerSocketFactory in interface MainMBean

setServerSocketFactory

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

Specified by:
setServerSocketFactory in interface MainMBean

setJNPServerSocketFactory

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

Specified by:
setJNPServerSocketFactory in interface MainMBean

start

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

stop

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

run

public void run()
Description copied from interface: java.lang.Runnable
This method will be called by whoever wishes to run your class implementing Runnable. Note that there are no restrictions on what you are allowed to do in the run method, except that you cannot throw a checked exception.

Specified by:
run in interface java.lang.Runnable

listen

protected void listen()

initJnpInvoker

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