[jboss-cvs] JBoss Messaging SVN: r2433 - trunk/util.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Sun Feb 25 22:41:38 EST 2007
Author: ovidiu.feodorov at jboss.com
Date: 2007-02-25 22:41:38 -0500 (Sun, 25 Feb 2007)
New Revision: 2433
Modified:
trunk/util/release-admin.xml
Log:
fixed installation script to correctly provide service binding manager configuration for the Remoting Connector for clustered installations; http://jira.jboss.org/jira/browse/JBMESSAGING-895
Modified: trunk/util/release-admin.xml
===================================================================
--- trunk/util/release-admin.xml 2007-02-26 00:07:38 UTC (rev 2432)
+++ trunk/util/release-admin.xml 2007-02-26 03:41:38 UTC (rev 2433)
@@ -70,12 +70,10 @@
<!-- ======================================================================================== -->
<target name="validate-ant">
- <!--
<condition property="ant.ok">
<antversion atleast="1.7.0"/>
</condition>
- <fail unless="ant.ok" message="The ant you're using (${ant.version}) is too old!"/>
- -->
+ <fail unless="ant.ok" message="The ant you're using (${ant.version}) is too old, you need at least 1.7.0!"/>
</target>
<target name="validate-database">
@@ -608,51 +606,11 @@
<!--
Add remoting binding manager overrides in ${config.name}/conf/binding-manager.xml
-->
+ <replace-messaging-connector-override server-name="ports-default" port="4457" binding-manager-file="${jboss.home}/server/${config.name}/conf/binding-manager.xml"/>
+ <replace-messaging-connector-override server-name="ports-01" port="4557" binding-manager-file="${jboss.home}/server/${config.name}/conf/binding-manager.xml"/>
+ <replace-messaging-connector-override server-name="ports-02" port="4657" binding-manager-file="${jboss.home}/server/${config.name}/conf/binding-manager.xml"/>
+ <replace-messaging-connector-override server-name="ports-03" port="4757" binding-manager-file="${jboss.home}/server/${config.name}/conf/binding-manager.xml"/>
- <replaceregexp file="${jboss.home}/server/${config.name}/conf/binding-manager.xml" flags="s">
- <regexp pattern="(\x3cserver[ \t]*name=\x22ports-default\x22\x3e)(.*?)(\x3c/server\x3e)"/>
- <substitution expression="\1\2
 <service-config name="jboss.messaging:service=Connector,transport=socket"

- delegateClass="org.jboss.services.binding.AttributeMappingDelegate">

- <delegate-config>

- <attribute name="InvokerLocator">socket://${jboss.bind.address}:4457/?dataType=jms&amp;serializationtype=jms&amp;timeout=0&amp;leasePeriod=20000&amp;socket.check_connection=false&amp;marshaller=org.jboss.jms.server.remoting.JMSWireFormat&amp;unmarshaller=org.jboss.jms.server.remoting.JMSWireFormat</attribute>

- </delegate-config>

- <binding port="4457"/>

- </service-config>\3"/>
- </replaceregexp>
-
- <replaceregexp file="${jboss.home}/server/${config.name}/conf/binding-manager.xml" flags="s">
- <regexp pattern="(\x3cserver[ \t]*name=\x22ports-01\x22\x3e)(.*?)(\x3c/server\x3e)"/>
- <substitution expression="\1\2
 <service-config name="jboss.messaging:service=Connector,transport=socket"

- delegateClass="org.jboss.services.binding.AttributeMappingDelegate">

- <delegate-config>

- <attribute name="InvokerLocator">socket://${jboss.bind.address}:4557/?dataType=jms&amp;serializationtype=jms&amp;timeout=0&amp;leasePeriod=20000&amp;socket.check_connection=false&amp;marshaller=org.jboss.jms.server.remoting.JMSWireFormat&amp;unmarshaller=org.jboss.jms.server.remoting.JMSWireFormat</attribute>

- </delegate-config>

- <binding port="4557"/>

- </service-config>\3"/>
- </replaceregexp>
-
- <replaceregexp file="${jboss.home}/server/${config.name}/conf/binding-manager.xml" flags="s">
- <regexp pattern="(\x3cserver[ \t]*name=\x22ports-02\x22\x3e)(.*?)(\x3c/server\x3e)"/>
- <substitution expression="\1\2
 <service-config name="jboss.messaging:service=Connector,transport=socket"

- delegateClass="org.jboss.services.binding.AttributeMappingDelegate">

- <delegate-config>

- <attribute name="InvokerLocator">socket://${jboss.bind.address}:4657/?dataType=jms&amp;serializationtype=jms&amp;timeout=0&amp;leasePeriod=20000&amp;socket.check_connection=false&amp;marshaller=org.jboss.jms.server.remoting.JMSWireFormat&amp;unmarshaller=org.jboss.jms.server.remoting.JMSWireFormat</attribute>

- </delegate-config>

- <binding port="4657"/>

- </service-config>\3"/>
- </replaceregexp>
-
- <replaceregexp file="${jboss.home}/server/${config.name}/conf/binding-manager.xml" flags="s">
- <regexp pattern="(\x3cserver[ \t]*name=\x22ports-03\x22\x3e)(.*?)(\x3c/server\x3e)"/>
- <substitution expression="\1\2
 <service-config name="jboss.messaging:service=Connector,transport=socket"

- delegateClass="org.jboss.services.binding.AttributeMappingDelegate">

- <delegate-config>

- <attribute name="InvokerLocator">socket://${jboss.bind.address}:4757/?dataType=jms&amp;serializationtype=jms&amp;timeout=0&amp;leasePeriod=20000&amp;socket.check_connection=false&amp;marshaller=org.jboss.jms.server.remoting.JMSWireFormat&amp;unmarshaller=org.jboss.jms.server.remoting.JMSWireFormat</attribute>

- </delegate-config>

- <binding port="4757"/>

- </service-config>\3"/>
- </replaceregexp>
-
</target>
<target name="insert-service-binding-manager-configuration" unless="binding.manager.declared">
@@ -673,6 +631,76 @@
</target>
+ <macrodef name="replace-messaging-connector-override">
+ <attribute name="server-name"/>
+ <attribute name="port"/>
+ <attribute name="binding-manager-file"/>
+ <sequential>
+ <!--
+ If configuration override already exists, replace it with the correct one.
+ -->
+ <replaceregexp file="@{binding-manager-file}" flags="s">
+ <regexp pattern="(\x3cserver[ \t]*name=\x22@{server-name}\x22\x3e)(.*?)(\x3cservice-config[ \t]*name=\x22jboss.messaging:service=Connector,transport=)(.*?)(\x3c/service-config\x3e)(.*?)(\x3c/server\x3e)"/>
+ <substitution expression="\1\2
 <service-config name="jboss.messaging:service=Connector,transport=bisocket"

+ delegateClass="org.jboss.services.binding.AttributeMappingDelegate">

+ <delegate-config>

+ <attribute name="InvokerLocator">bisocket://${jboss.bind.address}:@{port}/?NumberOfCallRetries=2&amp;clientMaxPoolSize=50&amp;clientSocketClass=org.jboss.jms.client.remoting.ClientSocketWrapper&amp;dataType=jms&amp;marshaller=org.jboss.jms.server.remoting.JMSWireFormat&amp;numberOfRetries=1&amp;serializationtype=jms&amp;socket.check_connection=false&amp;unmarshaller=org.jboss.jms.server.remoting.JMSWireFormat</attribute>

+ </delegate-config>

+ <binding port="@{port}"/>

+ </service-config>\6\7"/>
+ </replaceregexp>
+
+ <!--
+ If we don't find any configuration after replacement, then it means it didn't exist
+ in the first place, so add a new one
+ -->
+
+ <loadfile property="binding.manager.xml.content"
+ srcFile="@{binding-manager-file}"/>
+
+ <condition property="messaging.connector.override.exists">
+ <matches string="${binding.manager.xml.content}" singleline="true">
+ <regexp pattern="(\x3cserver[ \t]*name=\x22@{server-name}\x22\x3e)(.*?)(\x3cservice-config[ \t]*name=\x22jboss.messaging:service=Connector,transport=)(.*?)@{port}(.*?)(\x3c/service-config\x3e)(.*?)(\x3c/server\x3e)"/>
+ </matches>
+ </condition>
+ <echo message="override exists: ${messaging.connector.override.exists}"/>
+
+ <antcall target="add-messaging-connector-override-if-not-already-there">
+ <param name="local.server.name" value="@{server-name}"/>
+ <param name="local.port" value="@{port}"/>
+ <param name="local.binding.manager.file" value="@{binding-manager-file}"/>
+ </antcall>
+
+ </sequential>
+ </macrodef>
+
+ <macrodef name="add-messaging-connector-override">
+ <attribute name="server-name"/>
+ <attribute name="port"/>
+ <attribute name="binding-manager-file"/>
+ <sequential>
+ <replaceregexp file="@{binding-manager-file}" flags="s">
+ <regexp pattern="(\x3cserver[ \t]*name=\x22@{server-name}\x22\x3e)(.*?)(\x3c/server\x3e)"/>
+ <!--
+ note: substitution expression mst be identical with the one in
+ replace-messaging-connector-override, with 
 \3 at the end instead of
+ \6\7
+ -->
+ <substitution expression="\1\2
 <service-config name="jboss.messaging:service=Connector,transport=bisocket"

+ delegateClass="org.jboss.services.binding.AttributeMappingDelegate">

+ <delegate-config>

+ <attribute name="InvokerLocator">bisocket://${jboss.bind.address}:@{port}/?NumberOfCallRetries=2&amp;clientMaxPoolSize=50&amp;clientSocketClass=org.jboss.jms.client.remoting.ClientSocketWrapper&amp;dataType=jms&amp;marshaller=org.jboss.jms.server.remoting.JMSWireFormat&amp;numberOfRetries=1&amp;serializationtype=jms&amp;socket.check_connection=false&amp;unmarshaller=org.jboss.jms.server.remoting.JMSWireFormat</attribute>

+ </delegate-config>

+ <binding port="@{port}"/>

+ </service-config>
 \3"/>
+ </replaceregexp>
+ </sequential>
+ </macrodef>
+
+ <target name="add-messaging-connector-override-if-not-already-there" unless="messaging.connector.override.exists">
+ <add-messaging-connector-override server-name="${local.server.name}" port="${local.port}" binding-manager-file="${local.binding.manager.file}"/>
+ </target>
+
<macrodef name="set-config-name">
<attribute name="base"/>
<attribute name="suffix"/>
@@ -689,7 +717,7 @@
<echo message="main.artifact.location=${main.artifact.location}"/>
</target>
- <target name="test">
+ <target name="test" depends="validate-ant">
</target>
</project>
More information about the jboss-cvs-commits
mailing list