[jboss-cvs] JBossAS SVN: r79562 - in trunk: server/src/etc/conf/default/xmdesc and 9 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Oct 15 20:13:50 EDT 2008
Author: scott.stark at jboss.org
Date: 2008-10-15 20:13:50 -0400 (Wed, 15 Oct 2008)
New Revision: 79562
Added:
trunk/server/src/etc/conf/default/xmdesc/Main-xmbean.xml
trunk/server/src/etc/deploy/legacy-conf-service.xml
trunk/server/src/etc/deploy/naming-jboss-beans.xml
Modified:
trunk/server/src/etc/conf/default/jboss-service.xml
trunk/server/src/etc/conf/default/xmdesc/NamingService-xmbean.xml
trunk/server/src/main/org/jboss/deployment/dependency/JndiDependencyItem.java
trunk/server/src/main/org/jboss/deployment/dependency/JndiDependencyMetaData.java
trunk/server/src/main/org/jboss/naming/NamingService.java
trunk/server/src/main/org/jboss/naming/NamingServiceMBean.java
trunk/system-jmx/src/main/org/jboss/system/deployers/managed/ServiceMetaDataICF.java
trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceDependencyValueMetaData.java
trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceMetaDataParser.java
trunk/testsuite/src/main/org/jboss/test/jbossmessaging/JBossMessagingAdmin.java
trunk/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinder.java
trunk/testsuite/src/main/org/jboss/test/naming/restart/RestartNamingService.java
trunk/testsuite/src/resources/naming/restart/naming-restart-jboss-beans.xml
trunk/testsuite/src/resources/naming/services/pooled-service.xml
Log:
JBAS-4814, refactor all but the Log4jService out of conf/jboss-service.xml into deploy/{legacy-conf-service.xml,naming-jboss-beans.xml}
Modified: trunk/server/src/etc/conf/default/jboss-service.xml
===================================================================
--- trunk/server/src/etc/conf/default/jboss-service.xml 2008-10-16 00:01:29 UTC (rev 79561)
+++ trunk/server/src/etc/conf/default/jboss-service.xml 2008-10-16 00:13:50 UTC (rev 79562)
@@ -15,87 +15,6 @@
<classpath codebase="${jboss.server.lib.url:lib}" archives="*"/>
<!-- ==================================================================== -->
- <!-- Main Deployer -->
- <!-- ==================================================================== -->
- <mbean code="org.jboss.deployment.MainDeployer"
- name="jboss.system:service=MainDeployer">
- <!-- This is used to delegate the deployment handling -->
- <attribute name="KernelMainDeployer"><inject bean="MainDeployer" /></attribute>
- <!-- This is used to validate incomplete deployments -->
- <attribute name="Controller"><inject bean="jboss.kernel:service=Kernel" property="controller"/></attribute>
- </mbean>
-
- <!-- ==================================================================== -->
- <!-- SAR Deployer -->
- <!-- ==================================================================== -->
- <mbean code="org.jboss.deployment.SARDeployer"
- name="jboss.system:service=ServiceDeployer">
- <depends>jboss.system:service=MainDeployer</depends>
- </mbean>
-
- <!-- ==================================================================== -->
- <!-- JSR-77 Single JBoss Server Management Domain -->
- <!-- ==================================================================== -->
- <mbean code="org.jboss.management.j2ee.LocalJBossServerDomain"
- name="jboss.management.local:j2eeType=J2EEDomain,name=Manager">
- <attribute name="MainDeployer">jboss.system:service=MainDeployer</attribute>
- <attribute name="SARDeployer">jboss.system:service=ServiceDeployer</attribute>
- <attribute name="EARDeployer">jboss.j2ee:service=EARDeployer</attribute>
- <attribute name="EJBDeployer">jboss.ejb:service=EJBDeployer</attribute>
- <attribute name="RARDeployer">jboss.jca:service=RARDeployer</attribute>
- <attribute name="CMDeployer">jboss.jca:service=ConnectionFactoryDeployer</attribute>
- <attribute name="WARDeployer">jboss.web:service=WebServer</attribute>
- <attribute name="CARDeployer">jboss.j2ee:service=ClientDeployer</attribute>
- <attribute name="MailService">jboss:service=Mail</attribute>
- <attribute name="JMSService">jboss.mq:service=DestinationManager</attribute>
- <attribute name="JNDIService">jboss:service=Naming</attribute>
- <attribute name="JTAService">jboss:service=TransactionManager</attribute>
- <attribute name="UserTransactionService">jboss:service=DistributedTransactionManager</attribute>
- <attribute name="RMI_IIOPService">jboss:service=CorbaORB</attribute>
- <depends>jboss.system:service=MainDeployer</depends>
- </mbean>
-
- <!-- ==================================================================== -->
- <!-- XMBean Persistence -->
- <!-- ==================================================================== -->
- <mbean code="org.jboss.system.pm.AttributePersistenceService"
- name="jboss:service=AttributePersistenceService"
- xmbean-dd="resource:xmdesc/AttributePersistenceService-xmbean.xml">
- <!-- the AttributePersistenceService is persistent, itself -->
-
- <!--
- <attribute name="AttributePersistenceManagerClass">org.jboss.system.pm.XMLAttributePersistenceManager</attribute>
- <attribute name="AttributePersistenceManagerConfig">
- <data-directory>data/xmbean-attrs</data-directory>
- </attribute>
- <attribute name="ApmDestroyOnServiceStop">false</attribute>
- <attribute name="VersionTag"></attribute>
- -->
- </mbean>
-
- <!-- A Thread pool service -->
- <mbean code="org.jboss.util.threadpool.BasicThreadPool"
- name="jboss.system:service=ThreadPool">
- <attribute name="Name">JBoss System Threads</attribute>
- <attribute name="ThreadGroupName">System Threads</attribute>
- <!-- How long a thread will live without any tasks in MS -->
- <attribute name="KeepAliveTime">60000</attribute>
- <!-- The max number of threads in the pool -->
- <attribute name="MaximumPoolSize">10</attribute>
- <!-- The max number of tasks before the queue is full -->
- <attribute name="MaximumQueueSize">1000</attribute>
- <!-- The behavior of the pool when a task is added and the queue is full.
- abort - a RuntimeException is thrown
- run - the calling thread executes the task
- wait - the calling thread blocks until the queue has room
- discard - the task is silently discarded without being run
- discardOldest - check to see if a task is about to complete and enque
- the new task if possible, else run the task in the calling thread
- -->
- <attribute name="BlockingMode">run</attribute>
- </mbean>
-
- <!-- ==================================================================== -->
<!-- Log4j Initialization -->
<!-- ==================================================================== -->
@@ -112,207 +31,4 @@
<attribute name="RefreshPeriod">60</attribute>
</mbean>
- <!-- ==================================================================== -->
- <!-- Active Alarm Table -->
- <!-- ==================================================================== -->
-
- <!--
- | The ActiveAlarmTable service is a simple JMX notification listener
- | that maintains a table with the received notifications (alarms).
- | The alarms can be acknowledged through the jmx or the web console.
- | Modify the SubscriptionList below to subscribe for any notification
- | in the system and treat it as an alarm.
- | The JMXNotificationAppender is a log4j Appender that can be configured
- | in log4j.xml, that trasforms logging events to JMX notification so they
- | can be fed back into the table. By storing the WARN or higher level logging
- | events you can have a quick view of important system faults.
- |
- | The following attributes may be set:
- |
- | MaxTableSize (default 1000)
- | - set an upper limit to the number of stored alarms
- | LogLevel (default DEBUG)
- | - the log level to use for received notification, can be set to NONE
- | ServerId (default jboss)
- | - used to construct unique alarm ids
- | SubscriptionList
- | - subscribe for the notifications to be stored in the table
-
- <mbean code="org.jboss.monitor.services.ActiveAlarmTable"
- name="jboss.monitor:service=ActiveAlarmTable">
- <attribute name="SubscriptionList">
- <subscription-list>
- <mbean name="jboss.monitor:*">
- <notification type="jboss.alarm"/>
- <notification type="JBOSS_MONITOR_NOTIFICATION"/>
- </mbean>
- <mbean name="jboss.system:service=Logging,type=JMXNotificationAppender"/>
- </subscription-list>
- </attribute>
- </mbean>
- -->
-
- <!-- ==================================================================== -->
- <!-- JBoss RMI Classloader - only install when available -->
- <!-- ==================================================================== -->
- <mbean code="org.jboss.util.property.jmx.SystemPropertyClassValue"
- name="jboss.rmi:type=RMIClassLoader">
- <attribute name="Property">java.rmi.server.RMIClassLoaderSpi</attribute>
- <attribute name="ClassName">org.jboss.system.JBossRMIClassLoader</attribute>
- </mbean>
-
- <!-- ==================================================================== -->
- <!-- Class Loading -->
- <!-- ==================================================================== -->
-
- <!-- A mini webserver used for dynamic and class and resource loading -->
- <mbean code="org.jboss.web.WebService"
- name="jboss:service=WebService">
- <!-- The Bind address and Port -->
- <attribute name="BindAddress">${jboss.bind.address}</attribute>
- <attribute name="Port">
- <!-- Get the port to use from ServiceBindingManager. -->
- <value-factory bean="ServiceBindingManager" method="getIntBinding" parameter="jboss:service=WebService"/>
- </attribute>
- <!-- The address to use for the host portion of the RMI codebase URL -->
- <attribute name="Host">${java.rmi.server.hostname}</attribute>
- <!-- Should non-EJB .class files be downloadable -->
- <attribute name="DownloadServerClasses">true</attribute>
- <!-- Should resources other than .class files be downloadable. Both
- DownloadServerClasses and DownloadResources must be true for resources
- to be downloadable. This is false by default because its generally a
- bad idea as server configuration files that container security
- information can be accessed.
- -->
- <attribute name="DownloadResources">false</attribute>
-
- <!-- Use the default thread pool for dynamic class loading -->
- <depends optional-attribute-name="ThreadPool"
- proxy-type="attribute">jboss.system:service=ThreadPool</depends>
- </mbean>
-
- <!-- ==================================================================== -->
- <!-- JNDI -->
- <!-- ==================================================================== -->
-
- <!-- A simple mbean wrapper around the jndi Naming object. This
- only handles an in memory instance. The NamingService uses this
- as the JNDI store and exposes it remotely.
- -->
- <mbean code="org.jnp.server.NamingBeanImpl"
- name="jboss:service=NamingBeanImpl"
- xmbean-dd="resource:xmdesc/NamingBean-xmbean.xml">
- </mbean>
-
- <mbean code="org.jboss.naming.NamingService"
- name="jboss:service=Naming"
- xmbean-dd="resource:xmdesc/NamingService-xmbean.xml">
- <!-- 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.
- -->
- <attribute name="CallByValue">false</attribute>
-
- <!-- The listening port for the bootstrap JNP service. Set this to -1
- to run the NamingService without the JNP invoker listening port.
- -->
- <attribute name="Port">
- <value-factory bean="ServiceBindingManager" method="getIntBinding">
- <parameter>jboss:service=Naming</parameter>
- <parameter>Port</parameter>
- </value-factory>
- </attribute>
-
- <!-- The bootstrap JNP server bind address. This also sets the default
- RMI service bind address. Empty == all addresses
- -->
- <attribute name="BindAddress">${jboss.bind.address}</attribute>
- <!-- The port of the RMI naming service, 0 == anonymous -->
- <attribute name="RmiPort">
- <value-factory bean="ServiceBindingManager" method="getIntBinding">
- <parameter>jboss:service=Naming</parameter>
- <parameter>RmiPort</parameter>
- </value-factory>
- </attribute>
- <!-- The RMI service bind address. Empty == all addresses
- -->
- <attribute name="RmiBindAddress">${jboss.bind.address}</attribute>
- <!-- The thread pool service used to control the bootstrap lookups -->
- <depends optional-attribute-name="LookupPool"
- proxy-type="attribute">jboss.system:service=ThreadPool</depends>
- <!-- An example of using the unifed invoker as the transport.
- <depends optional-attribute-name="InvokerProxyFactory"
- proxy-type="attribute">jboss:service=proxyFactory,type=unified,target=Naming</depends>
- -->
- <depends optional-attribute-name="Naming"
- proxy-type="attribute">jboss:service=NamingBeanImpl</depends>
- </mbean>
-
- <mbean code="org.jboss.naming.JNDIView"
- name="jboss:service=JNDIView"
- xmbean-dd="resource:xmdesc/JNDIView-xmbean.xml">
- <!-- The HANamingService service name -->
- <attribute name="HANamingService">jboss:service=HAJNDI</attribute>
- </mbean>
-
- <!-- ==================================================================== -->
- <!-- Security -->
- <!-- ==================================================================== -->
-
- <!-- JAAS security manager and realm mapping -->
- <mbean code="org.jboss.security.plugins.JaasSecurityManagerService"
- name="jboss.security:service=JaasSecurityManager">
- <!-- A flag which indicates whether the SecurityAssociation server mode
- is set on service creation. This is true by default since the
- SecurityAssociation should be thread local for multi-threaded server
- operation.
- -->
- <attribute name="ServerMode">true</attribute>
- <attribute name="SecurityManagerClassName">org.jboss.security.plugins.JaasSecurityManager</attribute>
- <attribute name="DefaultUnauthenticatedPrincipal">anonymous</attribute>
- <!-- DefaultCacheTimeout: Specifies the default timed cache policy timeout
- in seconds.
- If you want to disable caching of security credentials, set this to 0 to
- force authentication to occur every time. This has no affect if the
- AuthenticationCacheJndiName has been changed from the default value.
- -->
- <attribute name="DefaultCacheTimeout">1800</attribute>
- <!-- DefaultCacheResolution: Specifies the default timed cache policy
- resolution in seconds. This controls the interval at which the cache
- current timestamp is updated and should be less than the DefaultCacheTimeout
- in order for the timeout to be meaningful. This has no affect if the
- AuthenticationCacheJndiName has been changed from the default value.
- -->
- <attribute name="DefaultCacheResolution">60</attribute>
- <!-- DeepCopySubjectMode: This set the copy mode of subjects done by the
- security managers to be deep copies that makes copies of the subject
- principals and credentials if they are cloneable. It should be set to
- true if subject include mutable content that can be corrupted when
- multiple threads have the same identity and cache flushes/logout clearing
- the subject in one thread results in subject references affecting other
- threads.
- -->
- <attribute name="DeepCopySubjectMode">false</attribute>
- </mbean>
-
- <!-- ==================================================================== -->
- <!-- Monitoring and Management -->
- <!-- ==================================================================== -->
-
- <!-- Uncomment to enable JMX monitoring of the bean cache
- <mbean code="org.jboss.monitor.BeanCacheMonitor"
- name="jboss.monitor:name=BeanCacheMonitor"/>
- -->
-
- <!-- Uncomment to enable JMX monitoring of the entity bean locking
- <mbean code="org.jboss.monitor.EntityLockMonitor"
- name="jboss.monitor:name=EntityLockMonitor"/>
- -->
-
- <!-- ==================================================================== -->
- <!-- An MBean that is a registry for JDBC type-mapping metadata -->
- <!-- ==================================================================== -->
-
- <mbean code="org.jboss.ejb.plugins.cmp.jdbc.metadata.MetaDataLibrary"
- name="jboss.jdbc:service=metadata"/>
-
</server>
Added: trunk/server/src/etc/conf/default/xmdesc/Main-xmbean.xml
===================================================================
--- trunk/server/src/etc/conf/default/xmdesc/Main-xmbean.xml (rev 0)
+++ trunk/server/src/etc/conf/default/xmdesc/Main-xmbean.xml 2008-10-16 00:13:50 UTC (rev 79562)
@@ -0,0 +1,146 @@
+<?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: NamingService-xmbean.xml 60241 2007-02-03 18:49:26Z scott.stark at jboss.org $
+-->
+<mbean>
+ <description>The standard JBoss JNDI naming server.
+ </description>
+
+ <descriptors>
+ <interceptors>
+ <interceptor code="org.jboss.mx.interceptor.PersistenceInterceptor2" />
+ <interceptor code="org.jboss.mx.interceptor.ModelMBeanInterceptor" />
+ <interceptor code="org.jboss.mx.interceptor.ObjectReferenceInterceptor" />
+ </interceptors>
+ </descriptors>
+
+ <class>org.jnp.server.Main</class>
+
+ <constructor>
+ <description>The default constructor</description>
+ <name>Main</name>
+ </constructor>
+
+ <attribute access="read-write" getMethod="getNamingInfo" setMethod="setNamingInfo">
+ <description>Underlying Naming bean instance</description>
+ <name>Naming</name>
+ <type>org.jnp.server.NamingBean</type>
+ </attribute>
+ <attribute access="read-only" getMethod="getNamingInstance">
+ <description>Underlying Naming bean instance</description>
+ <name>NamingInstance</name>
+ <type>org.jnp.interfaces.Naming</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 class name</description>
+ <name>JNPServerSocketFactory</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute access="read-write" getMethod="getJNPServerSocketFactoryBean"
+ setMethod="setJNPServerSocketFactoryBean">
+ <description>The bootstrap socket javax.net.ServerSocketFactory</description>
+ <name>JNPServerSocketFactoryBean</name>
+ <type>javax.net.ServerSocketFactory</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 class name</description>
+ <name>ClientSocketFactory</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute access="read-write" getMethod="getClientSocketFactoryBean" setMethod="setClientSocketFactoryBean">
+ <description>The RMI service java.rmi.server.RMIServerSocketFactory instance</description>
+ <name>ClientSocketFactoryBean</name>
+ <type>java.rmi.server.RMIClientSocketFactory</type>
+ </attribute>
+ <attribute access="read-write" getMethod="getServerSocketFactory" setMethod="setServerSocketFactory">
+ <description>The RMI service java.rmi.server.RMIServerSocketFactory class name</description>
+ <name>ServerSocketFactory</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute access="read-write" getMethod="getServerSocketFactoryBean" setMethod="setServerSocketFactoryBean">
+ <description>The RMI service java.rmi.server.RMIServerSocketFactory instance</description>
+ <name>ServerSocketFactory</name>
+ <type>java.rmi.server.RMIServerSocketFactory</type>
+ </attribute>
+
+ <attribute access="read-write" getMethod="getInstallGlobalService"
+ setMethod="setInstallGlobalService">
+ <description>Ghe InstallGlobalService which defines whether the MainMBean's
+ Naming server will be installed as the NamingContext.setLocal global
+ value.</description>
+ <name>InstallGlobalService</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute access="read-write" getMethod="getUseGlobalService"
+ setMethod="setUseGlobalService">
+ <description>The UseGlobalService which defines whether the MainMBean's
+ Naming server will initialized from the existing NamingContext.setLocal global
+ value.</description>
+ <name>UseGlobalService</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="setNamingProxy">
+ <description>The Naming proxy to use for the naming
+ service transport.</description>
+ <name>NamingProxy</name>
+ <type>java.lang.Object</type>
+ </attribute>
+
+ <operation>
+ <description>The start lifecycle operation</description>
+ <name>start</name>
+ </operation>
+ <operation>
+ <description>The stop lifecycle operation</description>
+ <name>stop</name>
+ </operation>
+
+</mbean>
+
\ No newline at end of file
Modified: trunk/server/src/etc/conf/default/xmdesc/NamingService-xmbean.xml
===================================================================
--- trunk/server/src/etc/conf/default/xmdesc/NamingService-xmbean.xml 2008-10-16 00:01:29 UTC (rev 79561)
+++ trunk/server/src/etc/conf/default/xmdesc/NamingService-xmbean.xml 2008-10-16 00:13:50 UTC (rev 79562)
@@ -34,111 +34,21 @@
<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="getNaming" setMethod="setNaming">
- <description>Underlying Naming bean instance</description>
- <name>Naming</name>
- <type>org.jnp.server.NamingBean</type>
+ <attribute access="read-write" getMethod="getNamingMain" setMethod="setNamingMain">
+ <description>Underlying MainMBean bean instance</description>
+ <name>NamingMain</name>
+ <type>org.jnp.server.MainMBean</type>
</attribute>
<attribute access="read-only" getMethod="getNamingInstance">
<description>Underlying Naming bean instance</description>
<name>NamingInstance</name>
<type>org.jnp.interfaces.Naming</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 class name</description>
- <name>JNPServerSocketFactory</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute access="read-write" getMethod="getJNPServerSocketFactoryBean"
- setMethod="setJNPServerSocketFactoryBean">
- <description>The bootstrap socket javax.net.ServerSocketFactory</description>
- <name>JNPServerSocketFactoryBean</name>
- <type>javax.net.ServerSocketFactory</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 class name</description>
- <name>ClientSocketFactory</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute access="read-write" getMethod="getClientSocketFactoryBean" setMethod="setClientSocketFactoryBean">
- <description>The RMI service java.rmi.server.RMIServerSocketFactory instance</description>
- <name>ClientSocketFactoryBean</name>
- <type>java.rmi.server.RMIClientSocketFactory</type>
- </attribute>
- <attribute access="read-write" getMethod="getServerSocketFactory" setMethod="setServerSocketFactory">
- <description>The RMI service java.rmi.server.RMIServerSocketFactory class name</description>
- <name>ServerSocketFactory</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute access="read-write" getMethod="getServerSocketFactoryBean" setMethod="setServerSocketFactoryBean">
- <description>The RMI service java.rmi.server.RMIServerSocketFactory instance</description>
- <name>ServerSocketFactory</name>
- <type>java.rmi.server.RMIServerSocketFactory</type>
- </attribute>
-
- <attribute access="read-write" getMethod="getInstallGlobalService"
- setMethod="setInstallGlobalService">
- <description>Ghe InstallGlobalService which defines whether the MainMBean's
- Naming server will be installed as the NamingContext.setLocal global
- value.</description>
- <name>InstallGlobalService</name>
- <type>boolean</type>
- </attribute>
- <attribute access="read-write" getMethod="getUseGlobalService"
- setMethod="setUseGlobalService">
- <description>The UseGlobalService which defines whether the MainMBean's
- Naming server will initialized from the existing NamingContext.setLocal global
- value.</description>
- <name>UseGlobalService</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>
@@ -191,7 +101,14 @@
<return-type>void</return-type>
</operation>
- &defaultOperations;
+ <operation>
+ <description>The start lifecycle operation</description>
+ <name>start</name>
+ </operation>
+ <operation>
+ <description>The stop lifecycle operation</description>
+ <name>stop</name>
+ </operation>
</mbean>
\ No newline at end of file
Added: trunk/server/src/etc/deploy/legacy-conf-service.xml
===================================================================
--- trunk/server/src/etc/deploy/legacy-conf-service.xml (rev 0)
+++ trunk/server/src/etc/deploy/legacy-conf-service.xml 2008-10-16 00:13:50 UTC (rev 79562)
@@ -0,0 +1,149 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id: jboss-service.xml 77499 2008-08-26 18:38:57Z dimitris at jboss.org $ -->
+
+<!-- ===================================================================== -->
+<!-- JBoss Server Configuration -->
+<!-- ===================================================================== -->
+
+<server>
+
+ <!-- Load all jars from the JBOSS_DIST/server/<config>/lib directory. This
+ can be restricted to specific jars by specifying them in the archives
+ attribute.
+ -->
+ <classpath codebase="${jboss.server.lib.url:lib}" archives="*"/>
+
+ <!-- ==================================================================== -->
+ <!-- Main Deployer -->
+ <!-- ==================================================================== -->
+ <mbean code="org.jboss.deployment.MainDeployer"
+ name="jboss.system:service=MainDeployer">
+ <!-- This is used to delegate the deployment handling -->
+ <attribute name="KernelMainDeployer"><inject bean="MainDeployer" /></attribute>
+ <!-- This is used to validate incomplete deployments -->
+ <attribute name="Controller"><inject bean="jboss.kernel:service=Kernel" property="controller"/></attribute>
+ </mbean>
+
+ <!-- ==================================================================== -->
+ <!-- SAR Deployer -->
+ <!-- ==================================================================== -->
+ <mbean code="org.jboss.deployment.SARDeployer"
+ name="jboss.system:service=ServiceDeployer">
+ <depends>jboss.system:service=MainDeployer</depends>
+ </mbean>
+
+ <!-- A Thread pool service -->
+ <mbean code="org.jboss.util.threadpool.BasicThreadPool"
+ name="jboss.system:service=ThreadPool">
+ <attribute name="Name">JBoss System Threads</attribute>
+ <attribute name="ThreadGroupName">System Threads</attribute>
+ <!-- How long a thread will live without any tasks in MS -->
+ <attribute name="KeepAliveTime">60000</attribute>
+ <!-- The max number of threads in the pool -->
+ <attribute name="MaximumPoolSize">10</attribute>
+ <!-- The max number of tasks before the queue is full -->
+ <attribute name="MaximumQueueSize">1000</attribute>
+ <!-- The behavior of the pool when a task is added and the queue is full.
+ abort - a RuntimeException is thrown
+ run - the calling thread executes the task
+ wait - the calling thread blocks until the queue has room
+ discard - the task is silently discarded without being run
+ discardOldest - check to see if a task is about to complete and enque
+ the new task if possible, else run the task in the calling thread
+ -->
+ <attribute name="BlockingMode">run</attribute>
+ </mbean>
+
+ <!-- ==================================================================== -->
+ <!-- XMBean Persistence -->
+ <!-- ==================================================================== -->
+ <mbean code="org.jboss.system.pm.AttributePersistenceService"
+ name="jboss:service=AttributePersistenceService"
+ xmbean-dd="resource:xmdesc/AttributePersistenceService-xmbean.xml">
+ <!-- the AttributePersistenceService is persistent, itself -->
+
+ <!--
+ <attribute name="AttributePersistenceManagerClass">org.jboss.system.pm.XMLAttributePersistenceManager</attribute>
+ <attribute name="AttributePersistenceManagerConfig">
+ <data-directory>data/xmbean-attrs</data-directory>
+ </attribute>
+ <attribute name="ApmDestroyOnServiceStop">false</attribute>
+ <attribute name="VersionTag"></attribute>
+ -->
+ </mbean>
+
+ <!-- ==================================================================== -->
+ <!-- JBoss RMI Classloader - only install when available -->
+ <!-- ==================================================================== -->
+ <mbean code="org.jboss.util.property.jmx.SystemPropertyClassValue"
+ name="jboss.rmi:type=RMIClassLoader">
+ <attribute name="Property">java.rmi.server.RMIClassLoaderSpi</attribute>
+ <attribute name="ClassName">org.jboss.system.JBossRMIClassLoader</attribute>
+ </mbean>
+
+ <!-- ==================================================================== -->
+ <!-- Class Loading -->
+ <!-- ==================================================================== -->
+
+ <mbean code="org.jboss.web.WebService"
+ name="jboss:service=WebService">
+ <attribute name="Port">
+ <value-factory bean="ServiceBindingManager"
+ method="getIntBinding"
+ parameter="jboss:service=WebService"/>
+ </attribute>
+ <!-- Should resources and non-EJB classes be downloadable -->
+ <attribute name="DownloadServerClasses">true</attribute>
+ <attribute name="Host">${jboss.bind.address}</attribute>
+ <attribute name="BindAddress">${jboss.bind.address}</attribute>
+ </mbean>
+
+ <!-- ==================================================================== -->
+ <!-- Security -->
+ <!-- ==================================================================== -->
+
+ <!-- JAAS security manager and realm mapping -->
+ <mbean code="org.jboss.security.plugins.JaasSecurityManagerService"
+ name="jboss.security:service=JaasSecurityManager">
+ <!-- A flag which indicates whether the SecurityAssociation server mode
+ is set on service creation. This is true by default since the
+ SecurityAssociation should be thread local for multi-threaded server
+ operation.
+ -->
+ <attribute name="ServerMode">true</attribute>
+ <attribute name="SecurityManagerClassName">org.jboss.security.plugins.JaasSecurityManager</attribute>
+ <attribute name="DefaultUnauthenticatedPrincipal">anonymous</attribute>
+ <!-- DefaultCacheTimeout: Specifies the default timed cache policy timeout
+ in seconds.
+ If you want to disable caching of security credentials, set this to 0 to
+ force authentication to occur every time. This has no affect if the
+ AuthenticationCacheJndiName has been changed from the default value.
+ -->
+ <attribute name="DefaultCacheTimeout">1800</attribute>
+ <!-- DefaultCacheResolution: Specifies the default timed cache policy
+ resolution in seconds. This controls the interval at which the cache
+ current timestamp is updated and should be less than the DefaultCacheTimeout
+ in order for the timeout to be meaningful. This has no affect if the
+ AuthenticationCacheJndiName has been changed from the default value.
+ -->
+ <attribute name="DefaultCacheResolution">60</attribute>
+ <!-- DeepCopySubjectMode: This set the copy mode of subjects done by the
+ security managers to be deep copies that makes copies of the subject
+ principals and credentials if they are cloneable. It should be set to
+ true if subject include mutable content that can be corrupted when
+ multiple threads have the same identity and cache flushes/logout clearing
+ the subject in one thread results in subject references affecting other
+ threads.
+ -->
+ <attribute name="DeepCopySubjectMode">false</attribute>
+ </mbean>
+
+ <!-- ==================================================================== -->
+ <!-- An MBean that is a registry for JDBC type-mapping metadata -->
+ <!-- ==================================================================== -->
+
+ <mbean code="org.jboss.ejb.plugins.cmp.jdbc.metadata.MetaDataLibrary"
+ name="jboss.jdbc:service=metadata"/>
+
+</server>
Added: trunk/server/src/etc/deploy/naming-jboss-beans.xml
===================================================================
--- trunk/server/src/etc/deploy/naming-jboss-beans.xml (rev 0)
+++ trunk/server/src/etc/deploy/naming-jboss-beans.xml 2008-10-16 00:13:50 UTC (rev 79562)
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <!-- ==================================================================== -->
+ <!-- JNDI -->
+ <!-- ==================================================================== -->
+
+ <!-- A simple mbean wrapper around the jndi Naming object. This
+ only handles an in memory instance. The NamingService uses this
+ as the JNDI store and exposes it remotely.
+ -->
+ <bean name="LookupPool">
+ <constructor factoryMethod="newFixedThreadPool"
+ factoryClass="java.util.concurrent.Executors">
+ <!-- At least 2 threads are required -->
+ <parameter>2</parameter>
+ </constructor>
+ </bean>
+ <bean name="LocalNamingBean" class="org.jnp.server.NamingBeanImpl">
+ <!-- Install this bean as the global JVM NamingServer -->
+ <property name="installGlobalService">true</property>
+
+ <property name="useGlobalService">false</property>
+ </bean>
+ <bean name="RemoteNamingBean" class="org.jnp.server.Main">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss:service=Naming", exposedInterface=org.jnp.server.MainMBean, registerDirectly=true)</annotation>
+ <property name="namingInfo"><inject bean="LocalNamingBean" /></property>
+ <!-- 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.
+ -->
+ <property name="callByValue">false</property>
+
+ <!-- The listening port for the bootstrap JNP service. Set this to -1
+ to run the NamingService without the JNP invoker listening port.
+ -->
+ <property name="port">1099</property>
+ <property name="port">
+ <value-factory bean="ServiceBindingManager"
+ method="getIntBinding">
+ <parameter>jboss:service=Naming</parameter>
+ <parameter>Port</parameter>
+ </value-factory>
+ </property>
+ <!-- The bootstrap JNP server bind address. This also sets the default
+ RMI service bind address. Empty == all addresses
+ -->
+ <property name="bindAddress">${jboss.bind.address:localhost}</property>
+ <!-- The port of the RMI naming service, 0 == anonymous -->
+ <property name="rmiPort">
+ <value-factory bean="ServiceBindingManager" method="getIntBinding">
+ <parameter>jboss:service=Naming</parameter>
+ <parameter>RmiPort</parameter>
+ </value-factory>
+ </property>
+ <!-- The RMI service bind address. Empty == all addresses
+ -->
+ <property name="rmiBindAddress">${jboss.bind.address:localhost}</property>
+ <!-- Set the java.rmi.server.hostname system property to rmiBindAddress -->
+ <property name="enableRmiServerHostname">true</property>
+ <!-- The thread pool service used to control the bootstrap lookups -->
+ <property name="lookupExector"><inject bean="LookupPool"/></property>
+ </bean>
+
+ <bean name="JndiViewBean" class="org.jboss.naming.JNDIView">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss:service=JNDIView", exposedInterface=org.jboss.naming.JNDIViewMBean, registerDirectly=true)</annotation>
+ <!-- The HANamingService service name -->
+ <property name="HANamingService">jboss:service=HAJNDI</property>
+ </bean>
+
+ <!-- An obsolete bean only needed if using legacy detached invoker access,
+ or the createAlias/removeAlias operations
+ -->
+ <bean class="org.jboss.naming.NamingService"
+ name="NamingService">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss:service=NamingService", exposedInterface=org.jboss.naming.NamingServiceMBean, registerDirectly=true)</annotation>
+ <!-- An example of using the unifed invoker as the transport.
+ <depends optional-attribute-name="InvokerProxyFactory"
+ proxy-type="attribute">jboss:service=proxyFactory,type=unified,target=Naming</depends>
+ -->
+ <property name="namingMain"><inject bean="RemoteNamingBean"/></property>
+ </bean>
+
+</deployment>
Modified: trunk/server/src/main/org/jboss/deployment/dependency/JndiDependencyItem.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/dependency/JndiDependencyItem.java 2008-10-16 00:01:29 UTC (rev 79561)
+++ trunk/server/src/main/org/jboss/deployment/dependency/JndiDependencyItem.java 2008-10-16 00:13:50 UTC (rev 79562)
@@ -74,7 +74,8 @@
ClassLoader tcl = Thread.currentThread().getContextClassLoader();
try
{
- Thread.currentThread().setContextClassLoader(loader);
+ if(loader != null)
+ Thread.currentThread().setContextClassLoader(loader);
InitialContext ctx = new InitialContext();
demand = ctx.lookup(jndiName);
setResolved(true);
Modified: trunk/server/src/main/org/jboss/deployment/dependency/JndiDependencyMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/dependency/JndiDependencyMetaData.java 2008-10-16 00:01:29 UTC (rev 79561)
+++ trunk/server/src/main/org/jboss/deployment/dependency/JndiDependencyMetaData.java 2008-10-16 00:13:50 UTC (rev 79562)
@@ -51,9 +51,17 @@
/** The container class loader to use during lookup */
private ClassLoader loader;
private ControllerState whenRequired = ControllerState.INSTALLED;
-
+
/**
* Create a demand for a jndi name lookup using the given class loader.
+ * @param jndiName - the name to lookup
+ */
+ public JndiDependencyMetaData(String jndiName)
+ {
+ this(jndiName, null);
+ }
+ /**
+ * Create a demand for a jndi name lookup using the given class loader.
*
* @param jndiName - the name to lookup
* @param loader - the ClassLoader to use as the TCL during lookup.
Modified: trunk/server/src/main/org/jboss/naming/NamingService.java
===================================================================
--- trunk/server/src/main/org/jboss/naming/NamingService.java 2008-10-16 00:01:29 UTC (rev 79561)
+++ trunk/server/src/main/org/jboss/naming/NamingService.java 2008-10-16 00:13:50 UTC (rev 79562)
@@ -25,48 +25,39 @@
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.UndeclaredThrowableException;
-import java.net.UnknownHostException;
-import java.rmi.server.RMIClientSocketFactory;
-import java.rmi.server.RMIServerSocketFactory;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
-import javax.net.ServerSocketFactory;
import org.jboss.invocation.Invocation;
import org.jboss.invocation.MarshalledInvocation;
import org.jboss.invocation.jrmp.server.JRMPProxyFactoryMBean;
-import org.jboss.system.ServiceMBeanSupport;
-import org.jboss.util.threadpool.ThreadPool;
-import org.jboss.util.threadpool.BasicThreadPoolMBean;
+import org.jboss.logging.Logger;
import org.jnp.interfaces.Naming;
import org.jnp.interfaces.MarshalledValuePair;
-import org.jnp.server.Main;
-import org.jnp.server.NamingBean;
+import org.jnp.server.MainMBean;
/**
- * A JBoss service that starts the jnp JNDI server.
+ * A JBoss service that wraps the jnp JNDI server.
*
* @author <a href="mailto:rickard.oberg at telkel.com">Rickard Oberg</a>
* @author <a href="mailto:Scott.Stark at jboss.org">Scott Stark</a>.
* @author <a href="mailto:andreas at jboss.org">Andreas Schaefer</a>.
* @version $Revision$
*
- * @jmx:mbean name="jboss:service=Naming"
- * extends="org.jboss.system.ServiceMBean, org.jnp.server.MainMBean"
+ * @deprecated the org.jnp.server.Main pojo provides all functionality except
+ * the deprecated detached invoker layer
*/
public class NamingService
- extends ServiceMBeanSupport
implements NamingServiceMBean
{
- /** The actual namingMain service impl bean */
- private NamingBean namingBean;
+ private static final Logger log = Logger.getLogger(NamingService.class);
/** */
- private Main namingMain = new Main();
+ private MainMBean namingMain;
/** The hash mappings of the Naming interface methods */
- private Map marshalledInvocationMapping = new HashMap();
+ private Map<Long, Method> marshalledInvocationMapping = new HashMap<Long, Method>();
/** An optional proxy factory for externalizing the Naming proxy transport */
private JRMPProxyFactoryMBean proxyFactory;
@@ -74,33 +65,20 @@
{
}
- public NamingBean getNaming()
+ public MainMBean getNamingMain()
{
- return namingBean;
+ return namingMain;
}
- public void setNaming(NamingBean bean)
+ public void setNamingMain(MainMBean namingMain)
{
- this.namingBean = bean;
- this.namingMain.setNamingInfo(bean);
+ this.namingMain = namingMain;
}
public Naming getNamingInstance()
{
- return namingBean.getNamingInstance();
+ return namingMain.getNamingInstance();
}
- /** Set the thread pool used for the bootstrap lookups
- *
- * @jmx:managed-attribute
- *
- * @param poolMBean
- */
- public void setLookupPool(BasicThreadPoolMBean poolMBean)
- {
- ThreadPool lookupPool = poolMBean.getInstance();
- namingMain.setLookupPool(lookupPool);
- }
-
/** Get the call by value flag for jndi lookups.
*
* @jmx:managed-attribute
@@ -123,133 +101,20 @@
MarshalledValuePair.setEnableCallByReference(callByValue);
}
- public void setPort(int port)
+ public void setInvokerProxyFactory(JRMPProxyFactoryMBean proxyFactory)
{
- namingMain.setPort(port);
+ this.proxyFactory = proxyFactory;
}
- public int getPort()
+ public Naming getNamingProxy()
{
- return namingMain.getPort();
+ Naming proxy = null;
+ if(proxyFactory != null)
+ proxy = (Naming) proxyFactory.getProxy();
+ return proxy;
}
- public void setRmiPort(int port)
- {
- namingMain.setRmiPort(port);
- }
-
- public int getRmiPort()
- {
- return namingMain.getRmiPort();
- }
-
- public String getBindAddress()
- {
- return namingMain.getBindAddress();
- }
-
- public void setBindAddress(String host) throws UnknownHostException
- {
- namingMain.setBindAddress(host);
- }
-
- public String getRmiBindAddress()
- {
- return namingMain.getRmiBindAddress();
- }
-
- public void setRmiBindAddress(String host) throws UnknownHostException
- {
- namingMain.setRmiBindAddress(host);
- }
-
- public int getBacklog()
- {
- return namingMain.getBacklog();
- }
-
- public void setBacklog(int backlog)
- {
- namingMain.setBacklog(backlog);
- }
-
- public boolean getInstallGlobalService()
- {
- return namingMain.getInstallGlobalService();
- }
- public void setInstallGlobalService(boolean flag)
- {
- namingMain.setInstallGlobalService(flag);
- }
- public boolean getUseGlobalService()
- {
- return namingMain.getUseGlobalService();
- }
- public void setUseGlobalService(boolean flag)
- {
- namingMain.setUseGlobalService(flag);
- }
- public String getClientSocketFactory()
- {
- return namingMain.getClientSocketFactory();
- }
- public void setClientSocketFactory(String factoryClassName)
- throws ClassNotFoundException, InstantiationException, IllegalAccessException
- {
- namingMain.setClientSocketFactory(factoryClassName);
- }
-
- public RMIClientSocketFactory getClientSocketFactoryBean()
- {
- return namingMain.getClientSocketFactoryBean();
- }
- public void setClientSocketFactoryBean(RMIClientSocketFactory factory)
- {
- namingMain.setClientSocketFactoryBean(factory);
- }
-
- public String getServerSocketFactory()
- {
- return namingMain.getServerSocketFactory();
- }
- public void setServerSocketFactory(String factoryClassName)
- throws ClassNotFoundException, InstantiationException, IllegalAccessException
- {
- namingMain.setServerSocketFactory(factoryClassName);
- }
- public RMIServerSocketFactory getServerSocketFactoryBean()
- {
- return namingMain.getServerSocketFactoryBean();
- }
- public void setServerSocketFactoryBean(RMIServerSocketFactory factory)
- {
- namingMain.setServerSocketFactoryBean(factory);
- }
-
- public String getJNPServerSocketFactory()
- {
- return namingMain.getJNPServerSocketFactory();
- }
- public void setJNPServerSocketFactory(String factoryClassName)
- throws ClassNotFoundException, InstantiationException, IllegalAccessException
- {
- namingMain.setJNPServerSocketFactory(factoryClassName);
- }
- public ServerSocketFactory getJNPServerSocketFactoryBean()
- {
- return namingMain.getJNPServerSocketFactoryBean();
- }
- public void setJNPServerSocketFactoryBean(ServerSocketFactory factory)
- {
- namingMain.setJNPServerSocketFactoryBean(factory);
- }
-
- public void setInvokerProxyFactory(JRMPProxyFactoryMBean proxyFactory)
- {
- this.proxyFactory = proxyFactory;
- }
-
- protected void startService()
+ public void start()
throws Exception
{
boolean debug = log.isDebugEnabled();
@@ -279,12 +144,9 @@
}
System.setProperty(key, value);
}
- if( proxyFactory != null )
- namingMain.setNamingProxy(proxyFactory.getProxy());
- namingMain.start();
// Build the Naming interface method map
- HashMap tmpMap = new HashMap(13);
+ HashMap<Long, Method> tmpMap = new HashMap<Long, Method>(13);
Method[] methods = Naming.class.getMethods();
for(int m = 0; m < methods.length; m ++)
{
@@ -295,10 +157,8 @@
marshalledInvocationMapping = Collections.unmodifiableMap(tmpMap);
}
- protected void stopService()
- throws Exception
+ public void stop()
{
- namingMain.stop();
log.debug("JNP server stopped");
}
@@ -311,7 +171,7 @@
*
* @return a <code>Main</code> value
*/
- protected Main getNamingServer()
+ protected MainMBean getNamingServer()
{
return namingMain;
} // end of main()
@@ -323,7 +183,7 @@
*
* @return A Map<Long hash, Method> of the Naming interface
*/
- public Map getMethodMap()
+ public Map<Long, Method> getMethodMap()
{
return marshalledInvocationMapping;
}
@@ -377,4 +237,13 @@
return value;
}
+
+ protected void startService() throws Exception
+ {
+ start();
+ }
+ protected void stopService() throws Exception
+ {
+ stop();
+ }
}
Modified: trunk/server/src/main/org/jboss/naming/NamingServiceMBean.java
===================================================================
--- trunk/server/src/main/org/jboss/naming/NamingServiceMBean.java 2008-10-16 00:01:29 UTC (rev 79561)
+++ trunk/server/src/main/org/jboss/naming/NamingServiceMBean.java 2008-10-16 00:13:50 UTC (rev 79562)
@@ -21,20 +21,23 @@
*/
package org.jboss.naming;
+import java.lang.reflect.Method;
+
+import org.jnp.interfaces.Naming;
+import org.jnp.server.MainMBean;
+
/**
* MBean interface.
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
*/
-public interface NamingServiceMBean extends org.jboss.system.ServiceMBean, org.jnp.server.MainMBean {
+public interface NamingServiceMBean
+{
//default object name
- public static final javax.management.ObjectName OBJECT_NAME = org.jboss.mx.util.ObjectNameFactory.create("jboss:service=Naming");
+ public static final javax.management.ObjectName OBJECT_NAME = org.jboss.mx.util.ObjectNameFactory.create("jboss:service=NamingService");
/**
- * Set the thread pool used for the bootstrap lookups
- * @param poolMBean */
- void setLookupPool(org.jboss.util.threadpool.BasicThreadPoolMBean poolMBean) ;
-
- /**
* Get the call by value flag for jndi lookups.
* @return true if all lookups are unmarshalled using the caller's TCL, false if in VM lookups return the value by reference. */
boolean getCallByValue() ;
@@ -44,10 +47,15 @@
* @param flag - true if all lookups are unmarshalled using the caller's TCL, false if in VM lookups return the value by reference. */
void setCallByValue(boolean flag) ;
+ MainMBean getNamingMain();
+ void setNamingMain(MainMBean main);
+
+ Naming getNamingInstance();
+
/**
* Expose the Naming service interface mapping as a read-only attribute
* @return A Map<Long hash, Method> of the Naming interface */
- java.util.Map getMethodMap() ;
+ java.util.Map<Long, Method> getMethodMap() ;
/**
* Expose the Naming service via JMX to invokers.
Modified: trunk/system-jmx/src/main/org/jboss/system/deployers/managed/ServiceMetaDataICF.java
===================================================================
--- trunk/system-jmx/src/main/org/jboss/system/deployers/managed/ServiceMetaDataICF.java 2008-10-16 00:01:29 UTC (rev 79561)
+++ trunk/system-jmx/src/main/org/jboss/system/deployers/managed/ServiceMetaDataICF.java 2008-10-16 00:13:50 UTC (rev 79562)
@@ -79,6 +79,8 @@
{
ClassLoader loader = getServiceMetaDataCL(md);
Class moClass = loader.loadClass(md.getCode());
+ if(moClass.getName().equals("org.jboss.system.server.ServerInfo"))
+ log.info("org.jboss.system.server.ServerInfo");
// Set the mbean class loader as the TCL
SecurityActions.setContextClassLoader(loader);
Modified: trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceDependencyValueMetaData.java
===================================================================
--- trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceDependencyValueMetaData.java 2008-10-16 00:01:29 UTC (rev 79561)
+++ trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceDependencyValueMetaData.java 2008-10-16 00:13:50 UTC (rev 79562)
@@ -60,6 +60,8 @@
/** The proxy type */
private String proxyType;
+ /** The attribute of the depends mbean to use */
+ private String dependsAttribute;
/**
* Create a new ServiceDependencyValueMetaData.
@@ -84,10 +86,11 @@
* @param dependency the dependents object name
* @param proxyType the proxy type
*/
- public ServiceDependencyValueMetaData(String dependency, String proxyType)
+ public ServiceDependencyValueMetaData(String dependency, String proxyType, String dependsAttribute)
{
setDependency(dependency);
setProxyType(proxyType);
+ setDependsAttribute(dependsAttribute);
}
/**
@@ -115,6 +118,17 @@
this.objectName = null;
}
+
+ public String getDependsAttribute()
+ {
+ return dependsAttribute;
+ }
+
+ public void setDependsAttribute(String dependsAttribute)
+ {
+ this.dependsAttribute = dependsAttribute;
+ }
+
/**
* Get the object name.
*
@@ -188,7 +202,12 @@
Class proxyClass = cl.loadClass(proxyType);
return MBeanProxyExt.create(proxyClass, objectName, server, true);
}
-
+ if (dependsAttribute != null)
+ {
+ Object value = server.getAttribute(objectName, dependsAttribute);
+ return value;
+ }
+
return objectName;
}
Modified: trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceMetaDataParser.java
===================================================================
--- trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceMetaDataParser.java 2008-10-16 00:01:29 UTC (rev 79561)
+++ trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceMetaDataParser.java 2008-10-16 00:13:50 UTC (rev 79562)
@@ -272,12 +272,18 @@
else
proxyType = StringPropertyReplacer.replaceProperties(proxyType);
+ String dependsAttribute = element.getAttribute("attribute");
+ if ("".equals(dependsAttribute))
+ dependsAttribute = null;
+ else
+ dependsAttribute = StringPropertyReplacer.replaceProperties(dependsAttribute);
+
// Get the mbeanRef value
String dependsObjectName = processDependency(mbeanName, mbeanRefName, element, services, replace);
if (mbeanRefName != null)
{
- ServiceValueMetaData value = new ServiceDependencyValueMetaData(dependsObjectName, proxyType);
+ ServiceValueMetaData value = new ServiceDependencyValueMetaData(dependsObjectName, proxyType, dependsAttribute);
ServiceAttributeMetaData attribute = new ServiceAttributeMetaData();
attribute.setName(mbeanRefName);
attribute.setValue(value);
Modified: trunk/testsuite/src/main/org/jboss/test/jbossmessaging/JBossMessagingAdmin.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossmessaging/JBossMessagingAdmin.java 2008-10-16 00:01:29 UTC (rev 79561)
+++ trunk/testsuite/src/main/org/jboss/test/jbossmessaging/JBossMessagingAdmin.java 2008-10-16 00:13:50 UTC (rev 79562)
@@ -55,7 +55,7 @@
{
name = JBossMessagingAdmin.class.getName() ;
serverPeer = new ObjectName("jboss.messaging:service=ServerPeer");
- namingService = new ObjectName("jboss:service=Naming");
+ namingService = new ObjectName("jboss:service=NamingService");
}
catch (Exception e)
{
Modified: trunk/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinder.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinder.java 2008-10-16 00:01:29 UTC (rev 79561)
+++ trunk/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinder.java 2008-10-16 00:13:50 UTC (rev 79562)
@@ -27,7 +27,6 @@
import javax.naming.NameNotFoundException;
import org.jboss.logging.Logger;
-import org.jboss.naming.NamingServiceMBean;
import org.jnp.interfaces.MarshalledValuePair;
import org.jnp.interfaces.Naming;
import org.jnp.interfaces.NamingParser;
@@ -48,12 +47,12 @@
public static final String SUBCONTEXT_NAME = "LocalSubcontext";
// private String providerURL;
private NamingParser parser = new NamingParser();
- private NamingServiceMBean naming;
+ private Naming naming;
/* (non-Javadoc)
* @see org.jboss.test.naming.restart.ObjectBinderMBean#setNamingService(org.jboss.naming.NamingServiceMBean)
*/
- public void setNamingService(NamingServiceMBean naming)
+ public void setNamingService(Naming naming)
{
// this.providerURL = (naming == null)
// ? null
@@ -86,22 +85,22 @@
// Context ctx = new InitialContext(env);
// ctx.bind(NAME, VALUE);
- Naming namingServer = naming.getNamingInstance();
- namingServer.bind(parser.parse(NAME),
+
+ naming.bind(parser.parse(NAME),
new MarshalledValuePair(VALUE),
VALUE.getClass().getName());
- log.info("Bound " + VALUE + " to " + namingServer + " under " + NAME);
- Context sub = namingServer.createSubcontext(parser.parse(SUBCONTEXT_NAME));
+ log.info("Bound " + VALUE + " to " + naming + " under " + NAME);
+ Context sub = naming.createSubcontext(parser.parse(SUBCONTEXT_NAME));
sub.bind(parser.parse(NAME), VALUE);
log.info("Bound " + VALUE + " to " + sub + " under " + NAME);
// NOTE: we must bind the NonDeserializable directly, or else the
// NamingContext will wrap it in a MarshalledValuePair, which will
// defeat the test by triggering deserialization too late
- namingServer.bind(parser.parse(BAD_BINDING), new NonDeserializable(),
+ naming.bind(parser.parse(BAD_BINDING), new NonDeserializable(),
NonDeserializable.class.getName());
- log.info("Bound a NonDeserializable to " + namingServer + " under " + BAD_BINDING);
+ log.info("Bound a NonDeserializable to " + naming + " under " + BAD_BINDING);
}
@@ -129,11 +128,10 @@
// Context ctx = new InitialContext(env);
// ctx.unbind(NAME);
- Naming namingServer = naming.getNamingInstance();
try
{
- namingServer.unbind(parser.parse(SUBCONTEXT_NAME + "/" + NAME));
- log.info("Unbound " + SUBCONTEXT_NAME + "/" + NAME + " from " + namingServer);
+ naming.unbind(parser.parse(SUBCONTEXT_NAME + "/" + NAME));
+ log.info("Unbound " + SUBCONTEXT_NAME + "/" + NAME + " from " + naming);
}
catch (NameNotFoundException ignored)
{
@@ -141,8 +139,8 @@
}
try
{
- namingServer.unbind(parser.parse(SUBCONTEXT_NAME));
- log.info("Unbound " + SUBCONTEXT_NAME + " from " + namingServer);
+ naming.unbind(parser.parse(SUBCONTEXT_NAME));
+ log.info("Unbound " + SUBCONTEXT_NAME + " from " + naming);
}
catch (NameNotFoundException ignored)
{
@@ -150,8 +148,8 @@
}
try
{
- namingServer.unbind(parser.parse(NAME));
- log.info("Unbound " + NAME + " from " + namingServer);
+ naming.unbind(parser.parse(NAME));
+ log.info("Unbound " + NAME + " from " + naming);
}
catch (NameNotFoundException ignored)
{
@@ -159,8 +157,8 @@
}
try
{
- namingServer.unbind(parser.parse(BAD_BINDING));
- log.info("Unbound " + BAD_BINDING + " from " + namingServer);
+ naming.unbind(parser.parse(BAD_BINDING));
+ log.info("Unbound " + BAD_BINDING + " from " + naming);
}
catch (NameNotFoundException ignored)
{
Modified: trunk/testsuite/src/main/org/jboss/test/naming/restart/RestartNamingService.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/naming/restart/RestartNamingService.java 2008-10-16 00:01:29 UTC (rev 79561)
+++ trunk/testsuite/src/main/org/jboss/test/naming/restart/RestartNamingService.java 2008-10-16 00:13:50 UTC (rev 79562)
@@ -26,6 +26,7 @@
import org.jboss.naming.NamingService;
import org.jnp.server.Main;
+import org.jnp.server.MainMBean;
/**
* Overrides NamingService in startService() to not use the AS's statically
@@ -34,25 +35,25 @@
* of the normal way a NamingService is restarted -- via a full server
* restart.
*
+ * Once JBNAME-18 is fixed this class is redundant.
+ *
* @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
+ * @author Scott.Stark at jboss.org
* @version $Revision$
*/
-public class RestartNamingService extends NamingService
+public class RestartNamingService extends Main
{
@Override
- protected void startService() throws Exception
+ public void stop()
{
- Main main = getNamingServer();
- main.setUseGlobalService(false);
- main.setInstallGlobalService(false);
-
- super.startService();
+ super.stop();
+ try
+ {
+ UnicastRemoteObject.unexportObject(getNamingInstance(), true);
+ }
+ catch(Exception e)
+ {
+ throw new RuntimeException(e);
+ }
}
-
- @Override
- protected void stopService() throws Exception
- {
- super.stopService();
- UnicastRemoteObject.unexportObject(getNamingInstance(), true);
- }
}
Modified: trunk/testsuite/src/resources/naming/restart/naming-restart-jboss-beans.xml
===================================================================
--- trunk/testsuite/src/resources/naming/restart/naming-restart-jboss-beans.xml 2008-10-16 00:01:29 UTC (rev 79561)
+++ trunk/testsuite/src/resources/naming/restart/naming-restart-jboss-beans.xml 2008-10-16 00:13:50 UTC (rev 79562)
@@ -39,7 +39,7 @@
<property name="rmiPort">0</property>
<property name="rmiBindAddress">${jboss.bind.address}</property>
<property name="lookupPool"><inject bean="RestartNamingThreadPool"/></property>
- <property name="naming"><inject bean="RestartNamingBean"/></property>
+ <property name="namingInfo"><inject bean="RestartNamingBean"/></property>
</bean>
<!-- Our own HA-JNDI that we can redeploy. Subclasses std HA-JNDI service
@@ -85,7 +85,7 @@
<!-- Binds an object in the above two naming services for remote lookup
by the test client -->
<bean name="RestartObjectBinder" class="org.jboss.test.naming.restart.ObjectBinder">
- <property name="namingService"><inject bean="RestartNamingService"/></property>
+ <property name="namingService"><inject bean="RestartNamingBean" property="namingInstance"/></property>
</bean>
Modified: trunk/testsuite/src/resources/naming/services/pooled-service.xml
===================================================================
--- trunk/testsuite/src/resources/naming/services/pooled-service.xml 2008-10-16 00:01:29 UTC (rev 79561)
+++ trunk/testsuite/src/resources/naming/services/pooled-service.xml 2008-10-16 00:13:50 UTC (rev 79562)
@@ -33,21 +33,23 @@
</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">
+ <mbean code="org.jnp.server.Main"
+ name="jboss.test:service=Naming,test=pooled-main"
+ xmbean-dd="resource:xmdesc/Main-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>
+ <attribute name="Naming"><inject bean="LocalNamingBean"/></attribute>
<!-- The detached pooled invoker proxy -->
- <depends optional-attribute-name="InvokerProxyFactory"
- proxy-type="attribute">jboss.test:service=proxyFactory,type=pooled,target=Naming</depends>
- <depends optional-attribute-name="Naming"
- proxy-type="attribute">jboss:service=NamingBeanImpl</depends>
+ <depends optional-attribute-name="NamingProxy"
+ attribute="Proxy">jboss.test:service=proxyFactory,type=pooled,target=Naming</depends>
</mbean>
+ <mbean code="org.jboss.naming.NamingService"
+ name="jboss.test:service=Naming,test=pooled"
+ xmbean-dd="resource:xmdesc/NamingService-xmbean.xml">
+ <depends optional-attribute-name="NamingMain"
+ proxy-type="attribute">jboss.test:service=Naming,test=pooled-main</depends>
+ </mbean>
</server>
More information about the jboss-cvs-commits
mailing list