[jboss-cvs] JBossAS SVN: r109603 - in branches/JBoss-AS-6.0.x-ipv6/testsuite/src/resources: security-srp/service-inf and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Nov 30 18:31:55 EST 2010


Author: rachmatowicz at jboss.com
Date: 2010-11-30 18:31:55 -0500 (Tue, 30 Nov 2010)
New Revision: 109603

Modified:
   branches/JBoss-AS-6.0.x-ipv6/testsuite/src/resources/naming/services/jboss-service.xml
   branches/JBoss-AS-6.0.x-ipv6/testsuite/src/resources/security-srp/service-inf/jboss-service.xml
Log:
Update Invoker URLs in deployed testcase MBeans using SBM (JBAS-8540)

Modified: branches/JBoss-AS-6.0.x-ipv6/testsuite/src/resources/naming/services/jboss-service.xml
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/testsuite/src/resources/naming/services/jboss-service.xml	2010-11-30 23:29:45 UTC (rev 109602)
+++ branches/JBoss-AS-6.0.x-ipv6/testsuite/src/resources/naming/services/jboss-service.xml	2010-11-30 23:31:55 UTC (rev 109603)
@@ -34,9 +34,40 @@
    <mbean code="org.jboss.invocation.http.server.HttpProxyFactory"
       name="jboss:test=invoker,type=http,target=Naming,readonly=true">
       <attribute name="InvokerName">jboss.test:service=Naming,test=readonly</attribute>
-      <attribute name="InvokerURLPrefix">http://</attribute>
-      <attribute name="InvokerURLSuffix">:8080/invoker/readonly/JMXInvokerServlet</attribute>
-      <attribute name="UseHostName">true</attribute>
+
+      <!-- JBAS-8540
+       NOTE: In order to handle both IPv4 and IPv6 address literals in URLs (see rfc2732), the value of
+       the InvokerURL attribute is now constructed using the ServiceBindingManger, using the following format:
+         <value-factory bean="ServiceBindingManager" method="getStringBinding">
+           <parameter>servicename</parameter>
+           <parameter>bindingname</parameter>
+           <parameter>URL string</parameter>
+           <parameter>actual host</parameter>
+           <parameter>actual port</parameter>
+         </value-factory>
+       where 'URL string' is a string which may contain the substitution variables host, hostforurl and port.
+       The value-factory element will return a string with the variables ${host}, ${hostforurl} and ${port}
+       replaced with the values for host, hostforurl and port in the metadata for the ServiceBindingManager's
+       entry for that servicename/bindingname pair.
+       In order to ensure that the values 'actual host' and 'actual port' are used in the variable substitution,
+       you must ensure that servicename and bindingname are unique to your bean deployment on the AS
+       and do not match any existing ServiceBindingManager metadata entries. A safe approach is to use the
+       following practice:
+          servicename = the JMX ObjectName of your bean deployment
+          bindingname = any identifier unique among all beans deployed with the same servicename
+       If these values are not unique, you may instead pick up the host and port of an existing ServiceBindingManager
+       metadata entry which is probably not what you want.
+     -->          
+
+      <attribute name="InvokerURL">
+        <value-factory bean="ServiceBindingManager" method="getStringBinding">
+          <parameter>jboss:test=invoker,type=http,target=Naming,readonly=true</parameter>
+          <parameter>anynamehere</parameter>
+          <parameter>http://${hostforurl}:${port}/invoker/readonly/JMXInvokerServlet</parameter>
+          <parameter>${jboss.bind.address}</parameter>
+          <parameter>8080</parameter>
+        </value-factory>
+      </attribute>      
       <attribute name="ExportedInterface">org.jnp.interfaces.Naming</attribute>
       <attribute name="JndiName">naming/ReadOnlyNaming</attribute>
       <attribute name="ClientInterceptors">

Modified: branches/JBoss-AS-6.0.x-ipv6/testsuite/src/resources/security-srp/service-inf/jboss-service.xml
===================================================================
--- branches/JBoss-AS-6.0.x-ipv6/testsuite/src/resources/security-srp/service-inf/jboss-service.xml	2010-11-30 23:29:45 UTC (rev 109602)
+++ branches/JBoss-AS-6.0.x-ipv6/testsuite/src/resources/security-srp/service-inf/jboss-service.xml	2010-11-30 23:31:55 UTC (rev 109603)
@@ -30,7 +30,39 @@
    <!-- Expose the SRP service interface via HTTP -->
    <mbean code="org.jboss.invocation.http.server.HttpProxyFactory"
       name="jboss.security.tests:service=SRP/HTTP">
-      <attribute name="InvokerURL">http://${jboss.bind.address}:8080/invoker/JMXInvokerServlet</attribute>
+      
+     <!-- JBAS-8540
+       NOTE: In order to handle both IPv4 and IPv6 address literals in URLs (see rfc2732), the value of
+       the InvokerURL attribute is now constructed using the ServiceBindingManger, using the following format:
+         <value-factory bean="ServiceBindingManager" method="getStringBinding">
+           <parameter>servicename</parameter>
+           <parameter>bindingname</parameter>
+           <parameter>URL string</parameter>
+           <parameter>actual host</parameter>
+           <parameter>actual port</parameter>
+         </value-factory>
+       where 'URL string' is a string which may contain the substitution variables host, hostforurl and port.
+       The value-factory element will return a string with the variables ${host}, ${hostforurl} and ${port}
+       replaced with the values for host, hostforurl and port in the metadata for the ServiceBindingManager's
+       entry for that servicename/bindingname pair.
+       In order to ensure that the values 'actual host' and 'actual port' are used in the variable substitution,
+       you must ensure that servicename and bindingname are unique to your bean deployment on the AS
+       and do not match any existing ServiceBindingManager metadata entries. A safe approach is to use the
+       following practice:
+          servicename = the JMX ObjectName of your bean deployment
+          bindingname = any identifier unique among all beans deployed with the same servicename
+       If these values are not unique, you may instead pick up the host and port of an existing ServiceBindingManager
+       metadata entry which is probably not what you want.
+     -->          
+      <attribute name="InvokerURL">
+        <value-factory bean="ServiceBindingManager" method="getStringBinding">
+          <parameter>jboss.security.tests:service=SRP/HTTP</parameter>
+          <parameter>anynamehere</parameter>
+          <parameter>http://${hostforurl}:${port}/invoker/JMXInvokerServlet</parameter>
+          <parameter>${jboss.bind.address}</parameter>
+          <parameter>8080</parameter>
+        </value-factory>
+      </attribute>
       <attribute name="InvokerName">jboss.security.tests:service=SRPService</attribute>
       <attribute name="ExportedInterface">org.jboss.security.srp.SRPRemoteServerInterface</attribute>
       <attribute name="JndiName">srp-test-http/SRPServerInterface</attribute>
@@ -44,8 +76,16 @@
       <attribute name="ExportedInterface">org.jboss.security.srp.SRPRemoteServerInterface</attribute>
       <attribute name="JndiName">srp-test-http/SRPServerInterfaceHA</attribute>
       <attribute name="LoadBalancePolicy">org.jboss.ha.framework.interfaces.FirstAvailable</attribute>
-      <attribute name="InvokerURLPrefix">http://</attribute>
-      <attribute name="InvokerURLSuffix">:8080/invoker/JMXInvokerHAServlet</attribute>
+      <attribute name="InvokerURL">
+        <value-factory bean="ServiceBindingManager" method="getStringBinding">
+          <parameter>jboss.security.tests:service=SRP/HA-HTTP</parameter>
+          <parameter>anynamehere</parameter>
+          <parameter>http://${hostforurl}:${port}/invoker/JMXInvokerHAServlet</parameter>
+          <parameter>${jboss.bind.address}</parameter>
+          <parameter>8080</parameter>
+        </value-factory>
+      </attribute>
+
       <attribute name="ClientInterceptors">
          <interceptors>
             <interceptor>org.jboss.invocation.http.interfaces.ClientMethodInterceptorHA</interceptor>



More information about the jboss-cvs-commits mailing list