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:
MBeanRegistration, NotificationBroadcaster, NotificationEmitter, org.jboss.kernel.spi.dependency.KernelControllerContextAware, NamingServiceMBean, Service, ServiceMBean, org.jnp.server.MainMBean, org.jnp.server.NamingBean

public class NamingService
extends ServiceMBeanSupport
implements NamingServiceMBean

A JBoss service that starts the jnp JNDI server.

Version:
$Revision: 88695 $
Author:
Rickard Oberg, 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()
           
 String getBootstrapURL()
           
 boolean getCallByValue()
          Get the call by value flag for jndi lookups.
 String getClientSocketFactory()
           
 RMIClientSocketFactory getClientSocketFactoryBean()
           
 boolean getInstallGlobalService()
           
 String getJNPServerSocketFactory()
           
 ServerSocketFactory getJNPServerSocketFactoryBean()
           
 Exception getLookupListenerException()
           
 Map getMethodMap()
          Expose the Naming service interface mapping as a read-only attribute
 org.jnp.server.NamingBean getNaming()
           
 org.jnp.server.NamingBean getNamingInfo()
           
 org.jnp.interfaces.Naming getNamingInstance()
           
 Object getNamingProxy()
           
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()
           
 RMIServerSocketFactory getServerSocketFactoryBean()
           
 boolean getUseGlobalService()
           
 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 setClientSocketFactoryBean(RMIClientSocketFactory factory)
           
 void setInstallGlobalService(boolean flag)
           
 void setInvokerProxyFactory(JRMPProxyFactoryMBean proxyFactory)
           
 void setJNPServerSocketFactory(String factoryClassName)
           
 void setJNPServerSocketFactoryBean(ServerSocketFactory factory)
           
 void setLookupPool(org.jboss.util.threadpool.BasicThreadPoolMBean poolMBean)
          Set the thread pool used for the bootstrap lookups
 void setNaming(org.jnp.server.NamingBean bean)
           
 void setNamingInfo(org.jnp.server.NamingBean bean)
           
 void setNamingProxy(Object proxy)
           
 void setPort(int port)
           
 void setRmiBindAddress(String host)
           
 void setRmiPort(int port)
           
 void setServerSocketFactory(String factoryClassName)
           
 void setServerSocketFactoryBean(RMIServerSocketFactory factory)
           
 void setUseGlobalService(boolean flag)
           
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, pojoChange, pojoCreate, pojoDestroy, pojoStart, pojoStop, postDeregister, postRegister, preDeregister, preRegister, setKernelControllerContext, start, stop, unsetKernelControllerContext
 
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

getNaming

public org.jnp.server.NamingBean getNaming()

setNaming

public void setNaming(org.jnp.server.NamingBean bean)

getNamingInfo

public org.jnp.server.NamingBean getNamingInfo()
Specified by:
getNamingInfo in interface org.jnp.server.MainMBean

setNamingInfo

public void setNamingInfo(org.jnp.server.NamingBean bean)
Specified by:
setNamingInfo in interface org.jnp.server.MainMBean

getNamingProxy

public Object getNamingProxy()
                      throws Exception
Specified by:
getNamingProxy in interface org.jnp.server.MainMBean
Throws:
Exception

setNamingProxy

public void setNamingProxy(Object proxy)
                    throws IOException
Specified by:
setNamingProxy in interface org.jnp.server.MainMBean
Throws:
IOException

getNamingInstance

public org.jnp.interfaces.Naming getNamingInstance()
Specified by:
getNamingInstance in interface org.jnp.server.NamingBean

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
Specified by:
getCallByValue in interface org.jnp.server.MainMBean
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
Specified by:
setCallByValue in interface org.jnp.server.MainMBean
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

getUseGlobalService

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

setUseGlobalService

public void setUseGlobalService(boolean flag)
Specified by:
setUseGlobalService 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

getClientSocketFactoryBean

public RMIClientSocketFactory getClientSocketFactoryBean()
Specified by:
getClientSocketFactoryBean in interface org.jnp.server.MainMBean

setClientSocketFactoryBean

public void setClientSocketFactoryBean(RMIClientSocketFactory factory)
Specified by:
setClientSocketFactoryBean in interface org.jnp.server.MainMBean

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

getServerSocketFactoryBean

public RMIServerSocketFactory getServerSocketFactoryBean()
Specified by:
getServerSocketFactoryBean in interface org.jnp.server.MainMBean

setServerSocketFactoryBean

public void setServerSocketFactoryBean(RMIServerSocketFactory factory)
Specified by:
setServerSocketFactoryBean in interface org.jnp.server.MainMBean

getJNPServerSocketFactory

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

setJNPServerSocketFactory

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

getJNPServerSocketFactoryBean

public ServerSocketFactory getJNPServerSocketFactoryBean()
Specified by:
getJNPServerSocketFactoryBean in interface org.jnp.server.MainMBean

setJNPServerSocketFactoryBean

public void setJNPServerSocketFactoryBean(ServerSocketFactory factory)
Specified by:
setJNPServerSocketFactoryBean in interface org.jnp.server.MainMBean

setInvokerProxyFactory

public void setInvokerProxyFactory(JRMPProxyFactoryMBean proxyFactory)

getBootstrapURL

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

getLookupListenerException

public Exception getLookupListenerException()
Specified by:
getLookupListenerException in interface org.jnp.server.MainMBean

startService

protected void startService()
                     throws Exception
Overrides:
startService in class ServiceMBeanSupport
Throws:
Exception

stopService

protected void stopService()
                    throws Exception
Overrides:
stopService in class 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 © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.