org.jboss.naming
Class NamingService

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

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

A JBoss service that starts the jnp JNDI server.

Version:
$Revision: 1.45.2.4 $
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
 void createAlias(String fromName, String toName)
          Create an alias
 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 removeAlias(String name)
          Remove an alias
 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, getDeploymentInfo, 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, nextNotificationSequenceNumber, 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
Overrides:
startService in class org.jboss.system.ServiceMBeanSupport
Throws:
Exception

stopService

protected void stopService()
                    throws Exception
Overrides:
stopService in class org.jboss.system.ServiceMBeanSupport
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

createAlias

public void createAlias(String fromName,
                        String toName)
                 throws Exception
Description copied from interface: NamingServiceMBean
Create an alias

Specified by:
createAlias in interface NamingServiceMBean
Parameters:
fromName - the from name
toName - the to name
Throws:
Exception - for any error

removeAlias

public void removeAlias(String name)
                 throws Exception
Description copied from interface: NamingServiceMBean
Remove an alias

Specified by:
removeAlias in interface NamingServiceMBean
Parameters:
name - the name
Throws:
Exception - for any error

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.