org.jboss.naming
Class NamingService

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended byorg.jboss.system.ServiceMBeanSupport
          extended byorg.jboss.naming.NamingService
All Implemented Interfaces:
org.jnp.server.MainMBean, javax.management.MBeanRegistration, NamingServiceMBean, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, org.jboss.system.Service, org.jboss.system.ServiceMBean

public class NamingService
extends org.jboss.system.ServiceMBeanSupport
implements NamingServiceMBean

A JBoss service that starts the jnp JNDI server.

Version:
$Revision: 1.34.2.13 $
Author:
Rickard ´┐Żberg, Scott Stark., Andreas Schaefer.

Field Summary
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.naming.NamingServiceMBean
OBJECT_NAME
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
NamingService()
           
 
Method Summary
 int getBacklog()
           
 String getBindAddress()
           
 boolean getCallByValue()
          Get the call by value flag for jndi lookups.
 String getClientSocketFactory()
           
 boolean getInstallGlobalService()
           
 Map getMethodMap()
          Expose the Naming service interface mapping as a read-only attribute
protected  org.jnp.server.Main getNamingServer()
          The getNamingServer method makes this class extensible, but it is a hack.
 int getPort()
           
 String getRmiBindAddress()
           
 int getRmiPort()
           
 String getServerSocketFactory()
           
 Object invoke(Invocation invocation)
          Expose the Naming service via JMX to invokers.
 void setBacklog(int backlog)
           
 void setBindAddress(String host)
           
 void setCallByValue(boolean flag)
          Set the call by value flag for jndi lookups.
 void setClientSocketFactory(String factoryClassName)
           
 void setInstallGlobalService(boolean flag)
           
 void setInvokerProxyFactory(JRMPProxyFactoryMBean proxyFactory)
           
 void setJNPServerSocketFactory(String factoryClassName)
           
 void setLookupPool(org.jboss.util.threadpool.BasicThreadPoolMBean poolMBean)
          Set the thread pool used for the bootstrap lookups
 void setPort(int port)
           
 void setRmiBindAddress(String host)
           
 void setRmiPort(int port)
           
 void setServerSocketFactory(String factoryClassName)
           
protected  void startService()
           
protected  void stopService()
           
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
create, createService, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.system.ServiceMBean
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 
Methods inherited from interface org.jnp.server.MainMBean
start, stop
 

Constructor Detail

NamingService

public NamingService()
Method Detail

setLookupPool

public void setLookupPool(org.jboss.util.threadpool.BasicThreadPoolMBean poolMBean)
Set the thread pool used for the bootstrap lookups

Specified by:
setLookupPool in interface NamingServiceMBean
Parameters:
poolMBean -

getCallByValue

public boolean getCallByValue()
Get the call by value flag for jndi lookups.

Specified by:
getCallByValue in interface NamingServiceMBean
Returns:
true if all lookups are unmarshalled using the caller's TCL, false if in VM lookups return the value by reference.

setCallByValue

public void setCallByValue(boolean flag)
Set the call by value flag for jndi lookups.

Specified by:
setCallByValue in interface NamingServiceMBean
Parameters:
flag - - true if all lookups are unmarshalled using the caller's TCL, false if in VM lookups return the value by reference.

setPort

public void setPort(int port)
Specified by:
setPort in interface org.jnp.server.MainMBean

getPort

public int getPort()
Specified by:
getPort in interface org.jnp.server.MainMBean

setRmiPort

public void setRmiPort(int port)
Specified by:
setRmiPort in interface org.jnp.server.MainMBean

getRmiPort

public int getRmiPort()
Specified by:
getRmiPort in interface org.jnp.server.MainMBean

getBindAddress

public String getBindAddress()
Specified by:
getBindAddress in interface org.jnp.server.MainMBean

setBindAddress

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

getRmiBindAddress

public String getRmiBindAddress()
Specified by:
getRmiBindAddress in interface org.jnp.server.MainMBean

setRmiBindAddress

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

getBacklog

public int getBacklog()
Specified by:
getBacklog in interface org.jnp.server.MainMBean

setBacklog

public void setBacklog(int backlog)
Specified by:
setBacklog in interface org.jnp.server.MainMBean

getInstallGlobalService

public boolean getInstallGlobalService()
Specified by:
getInstallGlobalService in interface org.jnp.server.MainMBean

setInstallGlobalService

public void setInstallGlobalService(boolean flag)
Specified by:
setInstallGlobalService in interface org.jnp.server.MainMBean

getClientSocketFactory

public String getClientSocketFactory()
Specified by:
getClientSocketFactory in interface org.jnp.server.MainMBean

setClientSocketFactory

public void setClientSocketFactory(String factoryClassName)
                            throws ClassNotFoundException,
                                   InstantiationException,
                                   IllegalAccessException
Specified by:
setClientSocketFactory in interface org.jnp.server.MainMBean
Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException

getServerSocketFactory

public String getServerSocketFactory()
Specified by:
getServerSocketFactory in interface org.jnp.server.MainMBean

setServerSocketFactory

public void setServerSocketFactory(String factoryClassName)
                            throws ClassNotFoundException,
                                   InstantiationException,
                                   IllegalAccessException
Specified by:
setServerSocketFactory in interface org.jnp.server.MainMBean
Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException

setJNPServerSocketFactory

public void setJNPServerSocketFactory(String factoryClassName)
                               throws ClassNotFoundException,
                                      InstantiationException,
                                      IllegalAccessException
Specified by:
setJNPServerSocketFactory in interface org.jnp.server.MainMBean
Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException

setInvokerProxyFactory

public void setInvokerProxyFactory(JRMPProxyFactoryMBean proxyFactory)

startService

protected void startService()
                     throws Exception
Throws:
Exception

stopService

protected void stopService()
                    throws Exception
Throws:
Exception

getNamingServer

protected org.jnp.server.Main getNamingServer()
The getNamingServer method makes this class extensible, but it is a hack. The NamingServer should be exposed directly as an xmbean, and the startup logic put in either an interceptor, the main class itself, or an auxilliary mbean (for the enc).

Returns:
a Main value

getMethodMap

public Map getMethodMap()
Expose the Naming service interface mapping as a read-only attribute

Specified by:
getMethodMap in interface NamingServiceMBean
Returns:
A Map of the Naming interface

invoke

public Object invoke(Invocation invocation)
              throws Exception
Expose the Naming service via JMX to invokers.

Specified by:
invoke in interface NamingServiceMBean
Parameters:
invocation - A pointer to the invocation object
Returns:
Return value of method invocation.
Throws:
Exception - Failed to invoke method.


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