[jboss-cvs] JBossAS SVN: r108275 - in trunk: iiop/src/etc and 8 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Sep 21 23:13:36 EDT 2010


Author: sguilhen at redhat.com
Date: 2010-09-21 23:13:35 -0400 (Tue, 21 Sep 2010)
New Revision: 108275

Added:
   trunk/iiop/src/etc/iiop-jboss-beans.xml
Removed:
   trunk/iiop/src/etc/iiop-service.xml
Modified:
   trunk/build/build.xml
   trunk/iiop/src/main/java/org/jboss/iiop/CorbaNamingService.java
   trunk/iiop/src/main/java/org/jboss/iiop/CorbaNamingServiceMBean.java
   trunk/iiop/src/main/java/org/jboss/iiop/CorbaORBService.java
   trunk/iiop/src/main/java/org/jboss/iiop/CorbaORBServiceMBean.java
   trunk/iiop/src/main/java/org/jboss/iiop/csiv2/CSIv2IORInterceptor.java
   trunk/iiop/src/main/java/org/jboss/invocation/iiop/IIOPInvoker.java
   trunk/iiop/src/main/java/org/jboss/invocation/iiop/IIOPInvokerMBean.java
   trunk/iiop/src/main/java/org/jboss/proxy/ejb/IORFactory.java
   trunk/jbossas-transactions/build.xml
   trunk/server/src/etc/conf/all/bindingservice.beans/META-INF/bindings-jboss-beans.xml
   trunk/testsuite/src/resources/jbossts/resources/sample-bindings.xml
   trunk/testsuite/src/resources/profileservice/persistence/testbindings-jboss-beans.xml
Log:
JBAS-8169: default IOR security settings can now be specified in CorbaORBService. These settings are applied to all IORs created by JBAS and can be overridden by the ior-security-config settings in jboss.xml

Modified: trunk/build/build.xml
===================================================================
--- trunk/build/build.xml	2010-09-22 03:11:52 UTC (rev 108274)
+++ trunk/build/build.xml	2010-09-22 03:13:35 UTC (rev 108275)
@@ -236,7 +236,7 @@
         <exclude name="deploy/cluster/**"/>
         <exclude name="deploy/deploy.last/**"/>
         <exclude name="deploy/httpha-invoker.sar/**"/>
-        <exclude name="deploy/iiop-service.xml"/>
+        <exclude name="deploy/iiop-jboss-beans.xml"/>
         <exclude name="deploy/juddi-service.sar/**"/>
         <exclude name="deploy/hornetq/**"/>
         <exclude name="deploy/osgi/**"/>
@@ -470,7 +470,7 @@
       <fileset dir="${install.all}">
         <include name="conf/jacorb.properties"/>
         <include name="deploy/juddi-service.sar/**"/>
-        <include name="deploy/iiop-service.xml"/>
+        <include name="deploy/iiop-jboss-beans.xml"/>
         <include name="lib/jacorb.jar"/>
       </fileset>
     </copy>
@@ -1508,7 +1508,7 @@
     <copy todir="${install.server}/all/deploy" filtering="no">
       <!-- Deployable service -->
       <fileset dir="${iiop.module.output}/etc">
-        <include name="iiop-service.xml"/>
+        <include name="iiop-jboss-beans.xml"/>
       </fileset>
     </copy>
 

Added: trunk/iiop/src/etc/iiop-jboss-beans.xml
===================================================================
--- trunk/iiop/src/etc/iiop-jboss-beans.xml	                        (rev 0)
+++ trunk/iiop/src/etc/iiop-jboss-beans.xml	2010-09-22 03:13:35 UTC (rev 108275)
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <!-- ======================================================================= -->
+   <!-- CORBA ORB service                                                       -->
+   <!-- The ORB is pluggable. This configuration uses JacORB.                   -->
+   <!-- ======================================================================= -->
+
+   <bean name="CorbaORBService" class="org.jboss.iiop.CorbaORBService">
+      <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss:service=CorbaORB", exposedInterface=org.jboss.iiop.CorbaORBServiceMBean)</annotation>
+      <property name="ORBClass">org.jacorb.orb.ORB</property>
+      <property name="ORBSingletonClass">org.jboss.system.ORBSingleton</property>
+      <property name="ORBSingletonDelegate">org.jacorb.orb.ORBSingleton</property>
+      <property name="ORBPropertiesFileName">jacorb.properties</property>
+      <property name="OTSContextPropagationEnabled">true</property>
+      <property name="port">
+         <!-- Get the port from the ServiceBindingManager -->
+         <value-factory bean="ServiceBindingManager" method="getIntBinding" parameter="jboss:service=CorbaORB"/>
+      </property>
+      <!-- uncomment the attribute below to interoperate with IONA's ASP 6.0
+      <property name="sendSASAcceptWithExceptionEnabled">false</property>
+      -->
+      <property name="portableInterceptorInitializers">
+         <list>
+            <!-- the two initializers below are required - do not remove them -->
+            <value>org.jboss.iiop.codebase.CodebaseInterceptorInitializer</value>
+            <value>org.jboss.iiop.csiv2.CSIv2Initializer</value>
+            <!-- comment out to generate IORs with no transaction policy info -->
+            <value>org.jboss.tm.iiop.TxIORInterceptorInitializer</value>
+            <!-- comment out to disable null transaction propagation over IIOP -->
+            <value>org.jboss.tm.iiop.TxServerClientInterceptorInitializer</value>
+            <!-- comment out to disable transaction demarcation over IIOP
+                    Note: for TX over IIOP support in 5.0, use JBossTS JTS instead.
+            -->
+            <value>org.jboss.tm.iiop.TxServerInterceptorInitializer</value>
+            <!-- comment out to disable the Security Attribute Service -->
+            <value>org.jboss.iiop.csiv2.SASInitializer</value>
+         </list>
+      </property>
+      <!-- uncomment to use IIOP over SSL
+      <property name="securityDomain"><inject bean="IIOPSecurityDomain"/></property>
+      -->
+      <!-- uncomment to inject default IOR security settings
+      <property name="defaultIORSecurityConfig"><inject bean="DefaultIORSecurityConfig"/></property>
+      -->
+   </bean>
+
+
+   <!-- ======================================================================= -->
+   <!-- CORBA naming service                                                    -->
+   <!-- ======================================================================= -->
+
+   <bean name="CorbaNamingService" class="org.jboss.iiop.CorbaNamingService">
+      <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss:service=CorbaNaming", exposedInterface=org.jboss.iiop.CorbaNamingServiceMBean)</annotation>
+      <depends>jboss:service=CorbaORB</depends>
+      <depends>jboss:service=Naming</depends>
+   </bean>
+
+   <!-- ======================================================================= -->
+   <!-- IIOP invoker                                                            -->
+   <!-- ======================================================================= -->
+
+   <bean name="IIOPInvoker" class="org.jboss.invocation.iiop.IIOPInvoker">
+      <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss:service=invoker,type=iiop", exposedInterface=org.jboss.invocation.iiop.IIOPInvokerMBean)</annotation>
+      <property name="server"><inject bean="JMXKernel" property="mbeanServer"/></property>
+      <property name="serviceName">jboss:service=invoker,type=iiop</property>
+      <depends>jboss:service=CorbaORB</depends>
+      <depends>jboss:service=Naming</depends>
+   </bean>
+
+   <!-- ======================================================================= -->
+   <!-- Default IOR security settings. This can be used to specify the security -->
+   <!-- settings that must inserted in the IORs of all beans and services that  -->
+   <!-- expose an IIOP view. To use this feature, uncomment this bean, set the  -->
+   <!-- appropriate values, and uncomment the defaultIORSecurityConfig property -->
+   <!-- in CorbaORBService.                                                     -->
+   <!-- NOTE: beans that specify IOR settings in jboss.xml will override the    -->
+   <!-- default security values defined here.                                   -->
+   <!-- ======================================================================= -->
+   <!--
+   <bean name="DefaultIORSecurityConfig" class="org.jboss.metadata.IorSecurityConfigMetaData">
+      <property name="transportConfig">
+         <bean name="DefaultTransportConfig" 
+               class="org.jboss.metadata.IorSecurityConfigMetaData$TransportConfig">
+            <constructor>
+               <parameter><null/></parameter>
+               <parameter name="integrity">supported</parameter>
+               <parameter name="confidentiality">supported</parameter>
+               <parameter name="establishTrustInTarget">none</parameter>
+               <parameter name="establishTrustInClient">none</parameter>
+               <parameter name="detectMisordering">none</parameter>
+               <parameter name="detectReplay">none</parameter>
+            </constructor>
+         </bean>
+      </property>
+      <property name="asContext">
+         <bean name="DefaultAsContextConfig" 
+               class="org.jboss.metadata.IorSecurityConfigMetaData$AsContext">
+            <constructor>
+               <parameter><null/></parameter>
+               <parameter name="authMethod">username_password</parameter>
+               <parameter name="realm">default</parameter>
+               <parameter name="required">true</parameter>
+            </constructor>
+         </bean>
+      </property>
+      <property name="sasContext">
+         <bean name="DefaultSasContextConfig" 
+               class="org.jboss.metadata.IorSecurityConfigMetaData$SasContext">
+            <constructor>
+               <parameter><null/></parameter>
+               <parameter name="callerPropagation" class="java.lang.String">none</parameter>
+            </constructor>
+         </bean>
+      </property>
+   </bean>
+   -->
+ </deployment>
+

Deleted: trunk/iiop/src/etc/iiop-service.xml
===================================================================
--- trunk/iiop/src/etc/iiop-service.xml	2010-09-22 03:11:52 UTC (rev 108274)
+++ trunk/iiop/src/etc/iiop-service.xml	2010-09-22 03:13:35 UTC (rev 108275)
@@ -1,122 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- $Id$ -->
-
-<!-- ===================================================================== -->
-<!--                                                                       -->
-<!--  JBoss RMI/IIOP Configuration                                         -->
-<!--                                                                       -->
-<!--  IIOP over SSL is disabled by default. To enable it, uncomment        -->
-<!--  the JaasSecurityDomain MBean, as well as the SecurityDomain          -->
-<!--  attribute and the depends element of the CorbaORBService MBean.      -->
-<!--  You will also need to edit the jacorb.properties file in the conf    -->
-<!--  dir and set to "on" the property jacorb.security.support_ssl.        -->
-<!--                                                                       -->
-<!--  Transaction demarcation over IIOP is enabled by defaut. To disable   -->
-<!--  it, comment out the TxServerInterceptorInitializer in the            -->
-<!--  CorbaORBService MBean, as well as the CorbaTransactionService        -->
-<!--  MBean. You will also need to comment out (or set to false) the       -->
-<!--  attibute GlobalIdsEnabled of the TransactionManagerService MBean     -->
-<!--  (in file conf/jboss-service.xml).                                    --> 
-<!--                                                                       -->
-<!-- ===================================================================== -->
-
-<server>
-
-  <classpath codebase="lib" archives="jboss-iiop.jar, jacorb.jar"/>
-
-  <!-- ==================================================================== -->
-  <!-- IIOP+SSL domain setup                                                -->
-  <!-- ==================================================================== -->
-
-  <!-- uncomment to use IIOP over SSL
-  <mbean code="org.jboss.security.plugins.JaasSecurityDomain"
-         name="jboss.security:service=JaasSecurityDomain,domain=IIOP+SSL">
-    <constructor>
-      <arg type="java.lang.String" value="IIOP+SSL"/>
-    </constructor> 
-    <attribute name="KeyStoreURL">iiop-over-ssl.keystore</attribute>
-    <attribute name="KeyStorePass">iiop-over-ssl</attribute>
-  </mbean>
-  -->
-
-  <!-- ==================================================================== -->
-  <!-- CORBA ORB service                                                    -->
-  <!-- The ORB is pluggable. This configuration uses JacORB.                -->
-  <!-- ==================================================================== -->
-
-  <mbean code="org.jboss.iiop.CorbaORBService"
-         name="jboss:service=CorbaORB">
-    <attribute name="ORBClass">org.jacorb.orb.ORB</attribute>
-    <attribute name="ORBSingletonClass">org.jboss.system.ORBSingleton</attribute>
-    <attribute name="ORBSingletonDelegate">org.jacorb.orb.ORBSingleton</attribute>
-    <attribute name="ORBPropertiesFileName">jacorb.properties</attribute>
-    <attribute name="OTSContextPropagationEnabled">true</attribute>
-    <attribute name="Port">
-       <!-- Get the port from the ServiceBindingManager -->
-      <value-factory bean="ServiceBindingManager" method="getIntBinding" 
-         parameter="jboss:service=CorbaORB"/>
-    </attribute>
-    <!-- uncomment the attribute below to interoperate with IONA's ASP 6.0
-    <attribute name="SendSASAcceptWithExceptionEnabled">false</attribute>
-    -->
-    <attribute name="PortableInterceptorInitializers">
-      <interceptor-initializers>
-        <!-- the two initializers below are required - do not remove them -->
-        <initializer>org.jboss.iiop.codebase.CodebaseInterceptorInitializer</initializer>
-        <initializer>org.jboss.iiop.csiv2.CSIv2Initializer</initializer>
-        <!-- comment out to generate IORs with no transaction policy info -->
-        <initializer>org.jboss.tm.iiop.TxIORInterceptorInitializer</initializer>
-        <!-- comment out to disable null transaction propagation over IIOP -->
-        <initializer>org.jboss.tm.iiop.TxServerClientInterceptorInitializer</initializer>
-        <!-- comment out to disable transaction demarcation over IIOP
-        	Note: for TX over IIOP support in 5.0, use JBossTS JTS instead.
-        -->
-        <initializer>org.jboss.tm.iiop.TxServerInterceptorInitializer</initializer>
-        <!-- comment out to disable the Security Attribute Service -->
-        <initializer>org.jboss.iiop.csiv2.SASInitializer</initializer>
-      </interceptor-initializers>
-    </attribute>
-    <!-- uncomment to use IIOP over SSL
-    <attribute name="SecurityDomain">java:/jaas/IIOP+SSL</attribute>
-    <depends>JBossSecurityJNDIContextEstablishment</depends>
-    <depends>jboss.security:service=JaasSecurityDomain,domain=IIOP+SSL</depends>
-    -->
-  </mbean>
-
-  <!-- ==================================================================== -->
-  <!-- IIOP invoker                                                         -->
-  <!-- ==================================================================== -->
-
-  <mbean code="org.jboss.invocation.iiop.IIOPInvoker" 
-         name="jboss:service=invoker,type=iiop">
-    <depends>jboss:service=CorbaORB</depends>
-    <depends>jboss:service=Naming</depends>
-  </mbean>
-  
-  <!-- ==================================================================== -->
-  <!-- CORBA naming service                                                 -->
-  <!-- ==================================================================== -->
-
-  <mbean code="org.jboss.iiop.CorbaNamingService" 
-         name="jboss:service=CorbaNaming">
-    <depends>jboss:service=CorbaORB</depends>
-    <depends>jboss:service=Naming</depends>
-  </mbean>
-
-  <!-- ==================================================================== -->
-  <!-- CORBA transaction service                                            -->
-  <!-- ==================================================================== -->
-
-  <!-- comment out to disable transaction demarcation over IIOP
-  	Note: for TX over IIOP support in 5.0, use JBossTS JTS instead.
-  	(http://labs.jboss.com/portal/jbosstm)
-  <mbean code="org.jboss.tm.iiop.CorbaTransactionService" 
-         name="jboss:service=CorbaTransaction">
-    <depends>jboss:service=TransactionManager</depends>
-    <depends>jboss:service=CorbaORB</depends>
-    <depends>jboss:service=CorbaNaming</depends>
-  </mbean>
-  -->
-
-</server>

Modified: trunk/iiop/src/main/java/org/jboss/iiop/CorbaNamingService.java
===================================================================
--- trunk/iiop/src/main/java/org/jboss/iiop/CorbaNamingService.java	2010-09-22 03:11:52 UTC (rev 108274)
+++ trunk/iiop/src/main/java/org/jboss/iiop/CorbaNamingService.java	2010-09-22 03:13:35 UTC (rev 108275)
@@ -32,7 +32,6 @@
 
 import org.jacorb.config.Configuration;
 import org.jboss.logging.Logger;
-import org.jboss.system.ServiceMBeanSupport;
 import org.omg.CORBA.ORB;
 import org.omg.CORBA.Policy;
 import org.omg.CosNaming.Binding;
@@ -50,19 +49,16 @@
 import org.omg.PortableServer.POA;
 
 /**
- * This is a JMX service that provides the default CORBA naming service
- * for JBoss to use.
+ * This is a service that provides the default CORBA naming service for JBoss to use.
  *      
  * @author  <a href="mailto:reverbel at ime.usp.br">Francisco Reverbel</a>
  * @version $Revision$
  */
-public class CorbaNamingService
-   extends ServiceMBeanSupport
-   implements CorbaNamingServiceMBean, ObjectFactory
+public class CorbaNamingService implements CorbaNamingServiceMBean, ObjectFactory
 {
    // Constants -----------------------------------------------------
    public static String NAMING_NAME = "JBossCorbaNaming";
-    
+
    // Attributes ----------------------------------------------------
 
    /** The POA used by the CORBA naming service. */
@@ -73,6 +69,8 @@
    /** Root naming context (returned by <code>getObjectInstance()</code>). */
    private static NamingContextExt namingService;
 
+   private static Logger log = Logger.getLogger(CorbaNamingService.class);
+   
    /** List the CORBA naming service contents.
     * 
     * @return
@@ -84,10 +82,9 @@
       return buf.toString();
    }
 
-   // ServiceMBeanSupport overrides ---------------------------------
-
-   protected void startService()
-      throws Exception
+   //=========================== Microcontainer lifecycle methods ========================//
+   
+   public void start() throws Exception
    {
       Context ctx;
       ORB orb;
@@ -134,11 +131,11 @@
                   namingPOA.create_reference_with_id(rootContextId, 
                                 "IDL:omg.org/CosNaming/NamingContextExt:1.0"));
       bind(NAMING_NAME, "org.omg.CosNaming.NamingContextExt");
-      getLog().info("CORBA Naming Started");
-      getLog().debug("Naming: ["+orb.object_to_string(namingService)+"]");
+      log.info("CORBA Naming Started");
+      log.debug("Naming: ["+orb.object_to_string(namingService)+"]");
    }
     
-   protected void stopService()
+   public void stop()
    {
       // Unbind from JNDI
       try {
@@ -158,12 +155,12 @@
    // ObjectFactory implementation ----------------------------------
 
    public Object getObjectInstance(Object obj, Name name,
-                                   Context nameCtx, Hashtable environment)
+                                   Context nameCtx, Hashtable<?,?> environment)
       throws Exception
    {
       String s = name.toString();
-      if (getLog().isTraceEnabled())
-         getLog().trace("getObjectInstance: obj.getClass().getName=\"" +
+      if (log.isTraceEnabled())
+         log.trace("getObjectInstance: obj.getClass().getName=\"" +
                         obj.getClass().getName() +
                         "\n                   name=" + s);
       if (NAMING_NAME.equals(s))

Modified: trunk/iiop/src/main/java/org/jboss/iiop/CorbaNamingServiceMBean.java
===================================================================
--- trunk/iiop/src/main/java/org/jboss/iiop/CorbaNamingServiceMBean.java	2010-09-22 03:11:52 UTC (rev 108274)
+++ trunk/iiop/src/main/java/org/jboss/iiop/CorbaNamingServiceMBean.java	2010-09-22 03:13:35 UTC (rev 108275)
@@ -28,7 +28,6 @@
  * @version $Revision$
  */
 public interface CorbaNamingServiceMBean
-   extends org.jboss.system.ServiceMBean
 {
    public String list();
 }

Modified: trunk/iiop/src/main/java/org/jboss/iiop/CorbaORBService.java
===================================================================
--- trunk/iiop/src/main/java/org/jboss/iiop/CorbaORBService.java	2010-09-22 03:11:52 UTC (rev 108274)
+++ trunk/iiop/src/main/java/org/jboss/iiop/CorbaORBService.java	2010-09-22 03:13:35 UTC (rev 108275)
@@ -23,7 +23,7 @@
 
 import java.io.InputStream;
 import java.util.Hashtable;
-import java.util.Iterator;
+import java.util.List;
 import java.util.Properties;
 
 import javax.ejb.spi.HandleDelegate;
@@ -33,13 +33,13 @@
 import javax.naming.Reference;
 import javax.naming.spi.ObjectFactory;
 
+import org.apache.log4j.Logger;
+import org.jboss.config.ServerConfigUtil;
 import org.jboss.iiop.naming.ORBInitialContextFactory;
-import org.jboss.metadata.MetaData;
+import org.jboss.metadata.IorSecurityConfigMetaData;
 import org.jboss.proxy.ejb.handle.HandleDelegateImpl;
 import org.jboss.security.SecurityDomain;
 import org.jboss.system.Registry;
-import org.jboss.system.ServiceMBeanSupport;
-import org.jboss.config.ServerConfigUtil;
 import org.omg.CORBA.ORB;
 import org.omg.CORBA.Policy;
 import org.omg.PortableServer.IdAssignmentPolicy;
@@ -51,7 +51,6 @@
 import org.omg.PortableServer.POAHelper;
 import org.omg.PortableServer.RequestProcessingPolicyValue;
 import org.omg.PortableServer.ServantRetentionPolicyValue;
-import org.w3c.dom.Element;
 
 /**
  *  This is a JMX service that provides the default CORBA ORB
@@ -61,9 +60,7 @@
  *  @author <a href="mailto:reverbel at ime.usp.br">Francisco Reverbel</a>
  *  @version $Revision$
  */
-public class CorbaORBService
-      extends ServiceMBeanSupport
-      implements CorbaORBServiceMBean, ObjectFactory
+public class CorbaORBService implements CorbaORBServiceMBean, ObjectFactory
 {
    // Constants -----------------------------------------------------
 
@@ -71,17 +68,19 @@
    public static String POA_NAME = "JBossCorbaPOA";
    public static String IR_POA_NAME = "JBossCorbaInterfaceRepositoryPOA";
    public static String SSL_DOMAIN = "JBossCorbaSSLDomain";
-    
+   public static String IOR_SECURITY_CONFIG = "IORSecurityConfig";
+   
    // Attributes ----------------------------------------------------
 
    private String orbClass = null;
    private String orbSingletonClass = null;
    private String orbSingletonDelegate = null;
    private String orbPropertiesFileName = "orb-properties-file-not-defined";
-   private Element portableInterceptorInitializers = null;
+   private List<String> portableInterceptorInitializers = null;
    private int port = 0;
    private int sslPort = 0;
-   private String sslDomain = null;
+   private SecurityDomain sslDomain = null;
+   private IorSecurityConfigMetaData defaultIORSecurityConfig = null;
 
    // Static --------------------------------------------------------
 
@@ -93,6 +92,8 @@
    private static HandleDelegate hd;
    private static int oaSslPort;
 
+   private static Logger log = Logger.getLogger(CorbaORBService.class);
+   
    /** 
     * Addition of SSL components to IORs is disabled by default.
     * This must remain off for interoperation with IONA's ASP 6.0,
@@ -175,10 +176,9 @@
       return otsResourcePoa;
    }
 
-   // ServiceMBeanSupport overrides ---------------------------------
+   //============================ Microcontainer lifecycle methods ==========================//
 
-   protected void startService() 
-      throws Exception 
+   public void start() throws Exception 
    {
 
       Properties props = new Properties();
@@ -220,23 +220,21 @@
 
       System.setProperties(systemProps);
       
+      // Make the default IOR security configuration available in the registry.
+      if (this.defaultIORSecurityConfig == null)
+    	  this.defaultIORSecurityConfig = new IorSecurityConfigMetaData();
+      Registry.bind(IOR_SECURITY_CONFIG, this.defaultIORSecurityConfig);
+      
       // Add portable interceptor initializers
-      Iterator initializerElements = 
-            MetaData.getChildrenByTagName(portableInterceptorInitializers, 
-                                          "initializer");
-      if (initializerElements != null)
+      if (this.portableInterceptorInitializers != null)
       {
-         while (initializerElements.hasNext())
+         for (String initializer : portableInterceptorInitializers)
          {
-            Element initializerElement = (Element) initializerElements.next();
-            String portableInterceptorInitializerClassName = 
-                  MetaData.getElementContent(initializerElement);
-                  log.debug("Adding portable interceptor initializer: " +
-                           portableInterceptorInitializerClassName);
-            if (portableInterceptorInitializerClassName != null 
-                  && !portableInterceptorInitializerClassName.equals(""))
-               props.put("org.omg.PortableInterceptor.ORBInitializerClass."
-                         + portableInterceptorInitializerClassName, "");
+            if (initializer != null && !initializer.equals(""))
+            {
+               log.debug("Adding portable interceptor initializer: " + initializer);
+               props.put("org.omg.PortableInterceptor.ORBInitializerClass." + initializer, "");
+            }
          }
       }
 
@@ -253,23 +251,11 @@
       if (oaSslPortString != null)
          oaSslPort = Integer.parseInt(oaSslPortString);
 
-      // Allow SSL domain to be specified through MBean config
-      if (sslDomain != null) 
+      // Allow SSL domain to be specified through bean config
+      if (this.sslDomain != null) 
       {
-         InitialContext ctx = new InitialContext();
-         log.debug("sslDomain: " + sslDomain);
-         try 
-         {
-            SecurityDomain domain = (SecurityDomain) ctx.lookup(sslDomain);
-
-            // Make SSL domain available to socket factories
-            Registry.bind(SSL_DOMAIN, domain);
-         }
-         catch (Exception e)
-         {
-            log.warn("Security domain " + sslDomain + " not found");
-            log.debug("Exception looking up " + sslDomain + ": ", e);
-         }
+         // Make SSL domain available to socket factories
+         Registry.bind(SSL_DOMAIN, this.sslDomain);
       }
 
       // Initialize the ORB
@@ -351,14 +337,14 @@
          irPoa.the_POAManager().activate();
          
       } catch (Exception ex) {
-         getLog().error("Error in IR POA initialization", ex);
+         log.error("Error in IR POA initialization", ex);
       }
       
       // Keep a HandleDelegate
       hd = new HandleDelegateImpl();
    }
 
-   protected void stopService() throws Exception
+   public void stop() throws Exception
    {
       /*
       if( mJSR77 != null )
@@ -438,17 +424,27 @@
       return orbPropertiesFileName;
    }
 
-   public Element getPortableInterceptorInitializers()
+   public List<String> getPortableInterceptorInitializers()
    {
       return portableInterceptorInitializers;
    }
 
    public void setPortableInterceptorInitializers(
-                                       Element portableInterceptorInitializers)
+                                       List<String> portableInterceptorInitializers)
    {
       this.portableInterceptorInitializers = portableInterceptorInitializers;
    }
 
+   public IorSecurityConfigMetaData getDefaultIORSecurityConfig()
+   {
+      return this.defaultIORSecurityConfig;
+   }
+   
+   public void setDefaultIORSecurityConfig(IorSecurityConfigMetaData config)
+   {
+	   this.defaultIORSecurityConfig = config;
+   }
+   
    public void setPort(int port)
    {
       this.port = port;
@@ -469,12 +465,12 @@
       return this.sslPort;
    }
 
-   public void setSecurityDomain(String sslDomain)
+   public void setSecurityDomain(SecurityDomain sslDomain)
    {
       this.sslDomain = sslDomain;
    }
 
-   public String getSecurityDomain()
+   public SecurityDomain getSecurityDomain()
    {
       return this.sslDomain;
    }
@@ -516,18 +512,18 @@
 
    public void setSunJDK14IsLocalBugFix(boolean sunJDK14IsLocalBugFix)
    {
-      getLog().warn("Not setting SunJDK14IsLocalBugFix since JDK1.4 is no longer supported.");
+      log.warn("Not setting SunJDK14IsLocalBugFix since JDK1.4 is no longer supported.");
    }
 
    // ObjectFactory implementation ----------------------------------
 
    public Object getObjectInstance(Object obj, Name name,
-                                   Context nameCtx, Hashtable environment)
+                                   Context nameCtx, Hashtable<?,?> environment)
       throws Exception
    {
       String s = name.toString();
-      if (getLog().isTraceEnabled())
-         getLog().trace("getObjectInstance: obj.getClass().getName=\"" +
+      if (log.isTraceEnabled())
+         log.trace("getObjectInstance: obj.getClass().getName=\"" +
                         obj.getClass().getName() +
                         "\n                   name=" + s);
       if (ORB_NAME.equals(s))

Modified: trunk/iiop/src/main/java/org/jboss/iiop/CorbaORBServiceMBean.java
===================================================================
--- trunk/iiop/src/main/java/org/jboss/iiop/CorbaORBServiceMBean.java	2010-09-22 03:11:52 UTC (rev 108274)
+++ trunk/iiop/src/main/java/org/jboss/iiop/CorbaORBServiceMBean.java	2010-09-22 03:13:35 UTC (rev 108275)
@@ -21,10 +21,14 @@
  */
 package org.jboss.iiop;
 
-import org.omg.CORBA.ORB;
-import org.w3c.dom.Element;
+import java.util.List;
+
 import javax.ejb.spi.HandleDelegate;
 
+import org.jboss.metadata.IorSecurityConfigMetaData;
+import org.jboss.security.SecurityDomain;
+import org.omg.CORBA.ORB;
+
 /**
  *   Mbean interface for the JBoss CORBA ORB service.
  *      
@@ -33,7 +37,6 @@
  *   @version $Revision$
  */
 public interface CorbaORBServiceMBean
-   extends org.jboss.system.ServiceMBean
 {
    public ORB getORB();
 
@@ -51,18 +54,21 @@
    public void setORBPropertiesFileName(String orbPropertiesFileName);
    public String getORBPropertiesFileName();
 
-   public Element getPortableInterceptorInitializers();
+   public List<String> getPortableInterceptorInitializers();
    public void setPortableInterceptorInitializers(
-                                      Element portableInterceptorInitializers);
+                                      List<String> portableInterceptorInitializers);
 
+   public IorSecurityConfigMetaData getDefaultIORSecurityConfig();
+   public void setDefaultIORSecurityConfig(IorSecurityConfigMetaData config);
+   
    public void setPort(int port);
    public int getPort();
 
    public void setSSLPort(int sslPort);
    public int getSSLPort();
 
-   public void setSecurityDomain(String sslDomain);
-   public String getSecurityDomain();
+   public void setSecurityDomain(SecurityDomain sslDomain);
+   public SecurityDomain getSecurityDomain();
 
    boolean getSSLComponentsEnabled();
    void setSSLComponentsEnabled(boolean sslComponentsEnabled);

Modified: trunk/iiop/src/main/java/org/jboss/iiop/csiv2/CSIv2IORInterceptor.java
===================================================================
--- trunk/iiop/src/main/java/org/jboss/iiop/csiv2/CSIv2IORInterceptor.java	2010-09-22 03:11:52 UTC (rev 108274)
+++ trunk/iiop/src/main/java/org/jboss/iiop/csiv2/CSIv2IORInterceptor.java	2010-09-22 03:13:35 UTC (rev 108275)
@@ -43,6 +43,7 @@
 import org.jboss.iiop.CorbaORBService;
 import org.jboss.logging.Logger;
 import org.jboss.metadata.IorSecurityConfigMetaData;
+import org.jboss.system.Registry;
 
 /**
  * Implements an <code>org.omg.PortableInterceptor.IORInterceptor</code>
@@ -82,8 +83,9 @@
          byte[] componentData = codec.encode_value(any);
          defaultSSLComponent = new TaggedComponent(TAG_SSL_SEC_TRANS.value,
             componentData);
-
-         IorSecurityConfigMetaData metadata = new IorSecurityConfigMetaData();
+         // Get the default IOR security metadata from the system registry.
+         IorSecurityConfigMetaData metadata = (IorSecurityConfigMetaData) Registry.lookup(
+        		 CorbaORBService.IOR_SECURITY_CONFIG);
          defaultCSIComponent = CSIv2Util.createSecurityTaggedComponent(metadata,
             codec, sslPort, orb);
       }

Modified: trunk/iiop/src/main/java/org/jboss/invocation/iiop/IIOPInvoker.java
===================================================================
--- trunk/iiop/src/main/java/org/jboss/invocation/iiop/IIOPInvoker.java	2010-09-22 03:11:52 UTC (rev 108274)
+++ trunk/iiop/src/main/java/org/jboss/invocation/iiop/IIOPInvoker.java	2010-09-22 03:13:35 UTC (rev 108275)
@@ -23,9 +23,12 @@
 
 import java.net.InetAddress;
 import java.util.Collections;
-import java.util.Map;
 import java.util.HashMap;
 import java.util.Hashtable;
+import java.util.Map;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.Name;
@@ -33,6 +36,10 @@
 import javax.naming.Reference;
 import javax.naming.spi.ObjectFactory;
 
+import org.jboss.iiop.CorbaORBService;
+import org.jboss.logging.Logger;
+import org.jboss.naming.Util;
+import org.jboss.system.Registry;
 import org.omg.CORBA.LocalObject;
 import org.omg.CORBA.Policy;
 import org.omg.CORBA.SetOverrideType;
@@ -41,18 +48,13 @@
 import org.omg.PortableServer.IdUniquenessPolicyValue;
 import org.omg.PortableServer.LifespanPolicyValue;
 import org.omg.PortableServer.POA;
-import org.omg.PortableServer.POAManagerPackage.AdapterInactive;
 import org.omg.PortableServer.RequestProcessingPolicyValue;
 import org.omg.PortableServer.Servant;
 import org.omg.PortableServer.ServantLocator;
+import org.omg.PortableServer.ServantRetentionPolicyValue;
+import org.omg.PortableServer.POAManagerPackage.AdapterInactive;
 import org.omg.PortableServer.ServantLocatorPackage.CookieHolder;
-import org.omg.PortableServer.ServantRetentionPolicyValue;
 
-import org.jboss.iiop.CorbaORBService;
-import org.jboss.naming.Util;
-import org.jboss.system.ServiceMBeanSupport;
-import org.jboss.system.Registry;
-
 /**
  * IIOP invoker that routs IIOP requests to CORBA servants.
  * It implements the interface <code>ServantRegistries</code>, which
@@ -74,13 +76,13 @@
  * @author  <a href="mailto:reverbel at ime.usp.br">Francisco Reverbel</a>
  * @version $Revision$
  */
-public class IIOPInvoker
-      extends ServiceMBeanSupport
-   implements IIOPInvokerMBean, ServantRegistries, ObjectFactory
+public class IIOPInvoker implements IIOPInvokerMBean, ServantRegistries, ObjectFactory
 {
 
    // Attributes -------------------------------------------------------------
 
+   private static Logger log = Logger.getLogger(IIOPInvoker.class);
+	
    /** A reference to the singleton IIOPInvoker. */
    private static IIOPInvoker theIIOPInvoker;
 
@@ -94,7 +96,7 @@
    private POA transientPOA;
 
    /** The transient servant map used by the ServantRegistry above. */
-   private Map transientServantMap;
+   private Map<String, Servant> transientServantMap;
 
    /** A ServantRegistry with a persistent POA shared by all servants. */
    private ServantRegistry registryWithSharedPersistentPOA;
@@ -103,13 +105,13 @@
    private POA persistentPOA;
 
    /** The persistent servant map used by the ServantRegistry above. */
-   private Map persistentServantMap;
+   private Map<String, Servant> persistentServantMap;
 
    /** A ServantRegistry with a transient POA per servant. */
    private ServantRegistry registryWithTransientPOAPerServant;
 
    /** The transient POA map used by the ServantRegistry above. */
-   private Map transientPoaMap;
+   private Map<String, POA> transientPoaMap;
 
    /** POA policies used by the ServantRegistry above. */
    private Policy[] transientPoaPolicies;
@@ -118,26 +120,29 @@
    private ServantRegistry registryWithPersistentPOAPerServant;
 
    /** The persistent POA map used by the ServantRegistry above. */
-   private Map persistentPoaMap;
+   private Map<String, POA> persistentPoaMap;
 
    /** POA policies used by the ServantRegistry above. */
    private Policy[] persistentPoaPolicies;
 
+   /** The name used as a key to the IIOP invoker in the system registry. */
+   private String serviceName;
+   
+   /** The MBean server that will be used by the servants to route the invocations to the EJB container. */
+   private MBeanServer server;
 
-   // ServiceMBeanSupport overrides ---------------------------------
+   //======================= Microcontainer lifecycle methods =========================//
 
-   public void createService()
-         throws Exception 
+   public void create() throws Exception 
    {
       theIIOPInvoker = this;
-      transientServantMap = Collections.synchronizedMap(new HashMap());
-      persistentServantMap = Collections.synchronizedMap(new HashMap());
-      transientPoaMap = Collections.synchronizedMap(new HashMap());
-      persistentPoaMap = Collections.synchronizedMap(new HashMap());     
+      transientServantMap = Collections.synchronizedMap(new HashMap<String, Servant>());
+      persistentServantMap = Collections.synchronizedMap(new HashMap<String, Servant>());
+      transientPoaMap = Collections.synchronizedMap(new HashMap<String, POA>());
+      persistentPoaMap = Collections.synchronizedMap(new HashMap<String, POA>());     
    }
 
-   public void startService() 
-         throws Exception 
+   public void start() throws Exception 
    {
       // Get a reference for the root POA
       try {
@@ -216,7 +221,7 @@
          new ServantRegistryWithPersistentPOAPerServant();
 
       // Export this invoker
-      Registry.bind(getServiceName(), this);
+      Registry.bind(new ObjectName(this.serviceName), this);
       
       // Activate my shared POAs
       transientPOA.the_POAManager().activate();
@@ -235,11 +240,10 @@
                           getClass().getName(), 
                           null));
 
-      getLog().debug("Bound IIOP invoker for JMX node");
+      log.debug("Bound IIOP invoker for JMX node");
    }
 
-   public void stopService() 
-         throws Exception
+   public void stop() throws Exception
    {
       // Destroy my shared POAs
       try {
@@ -255,10 +259,61 @@
                                false  /* wait_for_completion */ );
       }
       catch (AdapterInactive adapterInactive) {
-          getLog().error("Cannot deactivate home POA", adapterInactive);
+          log.error("Cannot deactivate home POA", adapterInactive);
       }
    }
 
+   //======================= Bean properties getters/setters =========================//
+
+   /**
+    * <p>
+    * Gets the name under which this {@code IIOPInvoker} will be registered.
+    * </p>
+    * 
+    * @return a {@code String} representing the service name.
+    */
+   public String getServiceName() 
+   {
+      return this.serviceName;
+   }
+
+   /**
+    * <p>
+    * Sets the name under which this {@code IIOPInvoker} is to be registered.
+    * </p>
+    * 
+    * @param serviceName a {@code String} representing the service name.
+    */
+   public void setServiceName(String serviceName) 
+   {
+      this.serviceName = serviceName;
+   }
+   
+   /**
+    * <p>
+    * Gets a reference to the {@code MBeanServer}.
+    * </p>
+    * 
+    * @return a reference to the {@code MBeanServer}.
+    */
+   public MBeanServer getServer() 
+   {
+      return server;
+   }
+   
+   /**
+    * <p>
+    * Sets the {@code MBeanServer} that will be used by the servants to dispatch the invocations to
+    * the EJB container.
+    * </p>
+    * 
+    * @param server a reference to the {@code MBeanServer}.
+    */
+   public void setServer(MBeanServer server) 
+   {
+      this.server = server;
+   }
+   
    // Auxiliary static methods -----------------------------------------------
 
    private static Policy[] concatPolicies(Policy[] policies1, 
@@ -300,12 +355,12 @@
    // Implementation of the interface ObjectFactory ---------------------------
 
    public Object getObjectInstance(Object obj, Name name,
-                                   Context nameCtx, Hashtable environment)
+                                   Context nameCtx, Hashtable<?,?> environment)
          throws Exception
    {
       String s = name.toString();
-      if (getLog().isTraceEnabled())
-         getLog().trace("getObjectInstance: obj.getClass().getName=\"" +
+      if (log.isTraceEnabled())
+         log.trace("getObjectInstance: obj.getClass().getName=\"" +
                         obj.getClass().getName() +
                         "\n                   name=" + s);
       if (s.equals("iiop"))
@@ -596,7 +651,7 @@
             return (Servant)transientServantMap.get(id);
          }
          catch (Exception e) {
-            getLog().trace("Unexpected exception in preinvoke:", e);
+            log.trace("Unexpected exception in preinvoke:", e);
             throw new UNKNOWN(e.toString());
          }
       }
@@ -628,7 +683,7 @@
             return (Servant)persistentServantMap.get(id);
          }
          catch (Exception e) {
-            getLog().trace("Unexpected exception in preinvoke:", e);
+            log.trace("Unexpected exception in preinvoke:", e);
             throw new UNKNOWN(e.toString());
          }
       }

Modified: trunk/iiop/src/main/java/org/jboss/invocation/iiop/IIOPInvokerMBean.java
===================================================================
--- trunk/iiop/src/main/java/org/jboss/invocation/iiop/IIOPInvokerMBean.java	2010-09-22 03:11:52 UTC (rev 108274)
+++ trunk/iiop/src/main/java/org/jboss/invocation/iiop/IIOPInvokerMBean.java	2010-09-22 03:13:35 UTC (rev 108275)
@@ -28,6 +28,6 @@
  * @version $Revision$
  */
 public interface IIOPInvokerMBean
-      extends org.jboss.system.ServiceMBean
 {
+	public String getServiceName();
 }

Modified: trunk/iiop/src/main/java/org/jboss/proxy/ejb/IORFactory.java
===================================================================
--- trunk/iiop/src/main/java/org/jboss/proxy/ejb/IORFactory.java	2010-09-22 03:11:52 UTC (rev 108274)
+++ trunk/iiop/src/main/java/org/jboss/proxy/ejb/IORFactory.java	2010-09-22 03:13:35 UTC (rev 108275)
@@ -386,21 +386,23 @@
          logger.debug("Not setting codebase policy, codebase is null");
       }
 
-      // Create csiv2Policy for both home and remote containing
-      // IorSecurityConfigMetadata
+      // Create csiv2Policy for both home and remote containing IorSecurityConfigMetadata
       Any secPolicy = orb.create_any();
-      IorSecurityConfigMetaData iorSecurityConfigMetaData =
+      IorSecurityConfigMetaData securityConfig =
          container.getBeanMetaData().getIorSecurityConfigMetaData();
-      secPolicy.insert_Value(iorSecurityConfigMetaData);
+      // if no security metadata was found, get the default metadata from the registry.
+      if (securityConfig == null)
+    	  securityConfig = (IorSecurityConfigMetaData) Registry.lookup(CorbaORBService.IOR_SECURITY_CONFIG);
+      secPolicy.insert_Value(securityConfig);
       csiv2Policy = orb.create_policy(CSIv2Policy.TYPE, secPolicy);
 
       // Create SSLPolicy
       //    (SSL_REQUIRED ensures home and remote IORs
       //     will have port 0 in the primary address)
       boolean sslRequired = false;
-      if (iorSecurityConfigMetaData != null) {
+      if (securityConfig != null) {
          IorSecurityConfigMetaData.TransportConfig tc = 
-            iorSecurityConfigMetaData.getTransportConfig();
+            securityConfig.getTransportConfig();
          sslRequired = 
             tc.getIntegrity() == 
                IorSecurityConfigMetaData.TransportConfig.INTEGRITY_REQUIRED

Modified: trunk/jbossas-transactions/build.xml
===================================================================
--- trunk/jbossas-transactions/build.xml	2010-09-22 03:11:52 UTC (rev 108274)
+++ trunk/jbossas-transactions/build.xml	2010-09-22 03:13:35 UTC (rev 108275)
@@ -85,7 +85,7 @@
             replace="jacorb.poa.thread_pool_max=32"  />
 
 	<!--
-	     Edit the deploy/iiop-service.xml and modify the PortableInterceptorInitializers attribute as follows.
+	     Edit the deploy/iiop-jboss-beans.xml and modify the PortableInterceptorInitializers attribute as follows.
              remove the following lines
                  <!- - comment out to disable null transaction propagation over IIOP - ->
                  <initializer>org.jboss.tm.iiop.TxServerClientInterceptorInitializer</initializer>
@@ -98,13 +98,13 @@
                  <initializer>com.arjuna.ats.jbossatx.jts.InboundTransactionCurrentInitializer</initializer>
 	-->
         <replaceregexp
-            file="${server.dir}/deploy/iiop-service.xml"
+            file="${server.dir}/deploy/iiop-jboss-beans.xml"
             match="org.jboss.tm.iiop.TxServerClientInterceptorInitializer"
             replace="com.arjuna.ats.jts.orbspecific.jacorb.interceptors.interposition.InterpositionORBInitializerImpl"  />
         <replaceregexp
-            file="${server.dir}/deploy/iiop-service.xml"
+            file="${server.dir}/deploy/iiop-jboss-beans.xml"
             match="org.jboss.tm.iiop.TxServerInterceptorInitializer"
             replace="com.arjuna.ats.jbossatx.jts.InboundTransactionCurrentInitializer"  />
 
     </target>
-</project>
\ No newline at end of file
+</project>

Modified: trunk/server/src/etc/conf/all/bindingservice.beans/META-INF/bindings-jboss-beans.xml
===================================================================
--- trunk/server/src/etc/conf/all/bindingservice.beans/META-INF/bindings-jboss-beans.xml	2010-09-22 03:11:52 UTC (rev 108274)
+++ trunk/server/src/etc/conf/all/bindingservice.beans/META-INF/bindings-jboss-beans.xml	2010-09-22 03:13:35 UTC (rev 108275)
@@ -213,7 +213,7 @@
                <property name="description">Socket for high availability version of the legacy Pooled invoker</property>
             </bean>
 
-            <!-- ********************* deploy/iiop-service.xml ****************** -->
+            <!-- ********************* deploy/iiop-jboss-beans.xml ****************** -->
 
             <bean class="org.jboss.services.binding.ServiceBindingMetadata">
                <property name="serviceName">jboss:service=CorbaORB</property>

Modified: trunk/testsuite/src/resources/jbossts/resources/sample-bindings.xml
===================================================================
--- trunk/testsuite/src/resources/jbossts/resources/sample-bindings.xml	2010-09-22 03:11:52 UTC (rev 108274)
+++ trunk/testsuite/src/resources/jbossts/resources/sample-bindings.xml	2010-09-22 03:13:35 UTC (rev 108275)
@@ -95,7 +95,7 @@
          <binding port="4448"/>
       </service-config>   
       
-      <!-- ********************* iiop-service.xml ****************** -->
+      <!-- ********************* iiop-jboss-beans.xml ****************** -->
 
       <service-config name="jboss:service=CorbaORB"
          delegateClass="org.jboss.services.binding.AttributeMappingDelegate"
@@ -537,7 +537,7 @@
          <binding port="4548"/>
       </service-config>
       
-      <!-- ********************* iiop-service.xml ****************** -->
+      <!-- ********************* iiop-jboss-beans.xml ****************** -->
 
       <service-config name="jboss:service=CorbaORB"
          delegateClass="org.jboss.services.binding.AttributeMappingDelegate"
@@ -984,7 +984,7 @@
          <binding port="4648"/>
       </service-config>
       
-      <!-- ********************* iiop-service.xml ****************** -->
+      <!-- ********************* iiop-jboss-beans.xml ****************** -->
 
       <service-config name="jboss:service=CorbaORB"
          delegateClass="org.jboss.services.binding.AttributeMappingDelegate"

Modified: trunk/testsuite/src/resources/profileservice/persistence/testbindings-jboss-beans.xml
===================================================================
--- trunk/testsuite/src/resources/profileservice/persistence/testbindings-jboss-beans.xml	2010-09-22 03:11:52 UTC (rev 108274)
+++ trunk/testsuite/src/resources/profileservice/persistence/testbindings-jboss-beans.xml	2010-09-22 03:13:35 UTC (rev 108275)
@@ -220,7 +220,7 @@
                <property name="description">Socket for high availability version of the legacy Pooled invoker</property>
             </bean>
 
-            <!-- ********************* deploy/iiop-service.xml ****************** -->
+            <!-- ********************* deploy/iiop-jboss-beans.xml ****************** -->
 
             <bean class="org.jboss.services.binding.ServiceBindingMetadata">
                <property name="serviceName">jboss:service=CorbaORB</property>



More information about the jboss-cvs-commits mailing list