Version 4

    Using alternate transports with JNDI

    As of the 3.2.7RC1 release, the JNDI NamingService supports delegation of the transport layer to the detached invoker framework via the InvokerProxyFactory attribute.

     

    The following jboss-service.xml descriptor shows a deployment of the JNDI naming service that uses the PooledInvoker as the transport layer:

     

    <?xml version="1.0" encoding="UTF-8"?>
    
    <!--DOCTYPE server
        PUBLIC "-//JBoss//DTD MBean Service 3.2//EN"
        "http://www.jboss.org/j2ee/dtd/jboss-service_3_2.dtd"
    
    This instance goes beyond the jboss-service_3_2.dtd model
    due to its use of the embedded <interceptors> element in the
    ClientInterceptors attribute of the proxy factory configs.
    $Id: pooled-service.xml,v 1.2 2004/10/17 20:17:32 starksm Exp $
    -->
    
    <server>
    
       <!-- Expose the Naming service interface via the PooledInvoker
       -->
       <mbean code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
          name="jboss.test:service=proxyFactory,type=pooled,target=Naming">
          <!-- Use the standard PooledInvoker from conf/jboss-service.xxml -->
          <attribute name="InvokerName">jboss:service=invoker,type=pooled</attribute>
          <attribute name="TargetName">jboss.test:service=Naming,test=pooled</attribute>
          <attribute name="JndiName"></attribute>
          <attribute name="ExportedInterface">org.jnp.interfaces.Naming</attribute>
          <attribute name="ClientInterceptors">
              <interceptors>
                 <interceptor>org.jboss.proxy.ClientMethodInterceptor</interceptor>
                 <interceptor>org.jboss.proxy.SecurityInterceptor</interceptor>
                 <interceptor>org.jboss.naming.interceptors.ExceptionInterceptor</interceptor>
                 <interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
              </interceptors>
          </attribute>
          <depends>jboss:service=invoker,type=pooled</depends>
       </mbean>
    
       <!-- A custom deployment of the JBoss JNDI naming service -->
       <mbean code="org.jboss.naming.NamingService"
          name="jboss.test:service=Naming,test=pooled"
          xmbean-dd="naming-xmbean.xml">
          <!-- The bootstrap port used to lookup the Naming proxy -->
          <attribute name="Port">10999</attribute>
          <!-- Don't override the default naming service -->
          <attribute name="InstallGlobalService">false</attribute>
          <!-- The thread pool service used to control the bootstrap lookups -->
          <depends optional-attribute-name="LookupPool"
             proxy-type="attribute">jboss.system:service=ThreadPool</depends>
          <!-- The detached pooled invoker proxy -->
          <depends optional-attribute-name="InvokerProxyFactory"
             proxy-type="attribute">jboss.test:service=proxyFactory,type=pooled,target=Naming</depends>
       </mbean>
    
    </server>
    
    

     

    The associated naming-xmbean.xml descriptor is:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE mbean PUBLIC
       "-//JBoss//DTD JBOSS XMBEAN 1.1//EN"
       "http://www.jboss.org/j2ee/dtd/jboss_xmbean_1_1.dtd"
    [
       <!ATTLIST interceptor proxyName CDATA #IMPLIED>
    ]>
    
    <!-- The JNDI Naming service XMBean
    $Id: naming-xmbean.xml,v 1.2.6.1 2004/10/17 20:12:37 starksm Exp $
    -->
    <mbean>
       <description>The standard JBoss JNDI naming server with a ProxyFactoryInterceptor
          to replace NamingContext objects with the correct transport proxy.
       </description>
    
       <descriptors>
          <interceptors>
             <interceptor code="org.jboss.naming.interceptors.ProxyFactoryInterceptor"
                proxyName="jboss.test:service=proxyFactory,type=pooled,target=Naming"></interceptor>
             <interceptor code="org.jboss.mx.interceptor.PersistenceInterceptor2" ></interceptor>
             <interceptor code="org.jboss.mx.interceptor.ModelMBeanInterceptor" ></interceptor>
             <interceptor code="org.jboss.mx.interceptor.ObjectReferenceInterceptor" ></interceptor>
          </interceptors>
       </descriptors>
    
       <class>org.jboss.naming.NamingService</class>
    
       <constructor>
          <description>The default constructor</description>
          <name>NamingService</name>
       </constructor>
       
       &defaultAttributes;
    
       <attribute access="read-only" getMethod="getMethodMap">
          <name>MethodMap</name>
          <type>java.util.Map</type>
       </attribute>
       <attribute access="read-write" getMethod="getCallByValue" setMethod="setCallByValue">
          <description>The call by value mode. true if all lookups are unmarshalled using
          the caller's TCL, false if in VM lookups return the value by reference.</description>
          <name>CallByValue</name>
          <type>boolean</type>
       </attribute>
       <attribute access="read-write" getMethod="getBindAddress" setMethod="setBindAddress">
          <description>The bind address of the bootstrap lookup socket.</description>
          <name>BindAddress</name>
          <type>java.lang.String</type>
       </attribute>
       <attribute access="read-write" getMethod="getPort" setMethod="setPort">
          <description>The listening port for the bootstrap JNP service. Set this to -1
            to run the NamingService without the JNP invoker listening port.</description>
          <name>Port</name>
          <type>int</type>
       </attribute>
       <attribute access="read-write" getMethod="getBacklog" setMethod="setBacklog">
          <description>The bootstrap socket backlog count.</description>
          <name>Backlog</name>
          <type>int</type>
       </attribute>
       <attribute access="read-write" getMethod="getJNPServerSocketFactory"
          setMethod="setJNPServerSocketFactory">
          <description>The bootstrap socket javax.net.ServerSocketFactory</description>
          <name>JNPServerSocketFactory</name>
          <type>java.lang.String</type>
       </attribute>
    
       <attribute access="read-write" getMethod="getRmiPort" setMethod="setRmiPort">
          <description>The port of the RMI naming service, 0 == anonymous. This
          is only used if an explicit InvokerProxyFactory has not been set.</description>
          <name>RmiPort</name>
          <type>int</type>
       </attribute>
       <attribute access="read-write" getMethod="getRmiBindAddress" setMethod="setRmiBindAddress">
          <description>The RMI service bind address. Empty == all addresses</description>
          <name>RmiBindAddress</name>
          <type>java.lang.String</type>
       </attribute>
       <attribute access="read-write" getMethod="getClientSocketFactory" setMethod="setClientSocketFactory">
          <description>The RMI service java.rmi.server.RMIClientSocketFactory</description>
          <name>ClientSocketFactory</name>
          <type>java.lang.String</type>
       </attribute>
       <attribute access="read-write" getMethod="getServerSocketFactory" setMethod="setServerSocketFactory">
          <description>The RMI service java.rmi.server.RMIServerSocketFactory</description>
          <name>ServerSocketFactory</name>
          <type>java.lang.String</type>
       </attribute>
    
       <attribute access="read-write" getMethod="getInstallGlobalService"
          setMethod="setInstallGlobalService">
          <name>InstallGlobalService</name>
          <type>boolean</type>
       </attribute>
       <attribute access="write-only" setMethod="setLookupPool">
          <description>The thread pool service used to control the bootstrap lookups</description>
          <name>LookupPool</name>
          <type>org.jboss.util.threadpool.BasicThreadPoolMBean</type>
       </attribute>
       <attribute access="write-only" setMethod="setInvokerProxyFactory">
          <description>The detached invoker proxy factory to use for the naming
          service transport.</description>
          <name>InvokerProxyFactory</name>
          <type>org.jboss.invocation.jrmp.server.JRMPProxyFactoryMBean</type>
       </attribute>
    
       <!-- Operations -->
       <operation>
          <description>The generic invocation operation used by detached invokers
             to route requests to the service
          </description>
          <name>invoke</name>
          <parameter>
             <description>The Naming interface method invocation encapsulation
             </description>
             <name>invocation</name>
             <type>org.jboss.invocation.Invocation</type>
          </parameter>
          <return-type>java.lang.Object</return-type>
       </operation>
    
       &defaultOperations;                  
    
    </mbean>
    

     

    Referenced by: