[jboss-cvs] JBoss Messaging SVN: r5891 - in trunk: examples/jms/src/org/jboss/jms/example and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Feb 18 06:51:59 EST 2009
Author: ataylor
Date: 2009-02-18 06:51:59 -0500 (Wed, 18 Feb 2009)
New Revision: 5891
Added:
trunk/examples/jms/src/org/jboss/jms/example/EJB3MDBExample.java
Modified:
trunk/examples/jms/build.xml
trunk/src/config/ra.xml
trunk/src/main/org/jboss/messaging/ra/JBMRAProperties.java
trunk/src/main/org/jboss/messaging/ra/JBMResourceAdapter.java
trunk/src/main/org/jboss/messaging/ra/inflow/JBMActivationSpec.java
Log:
fixed jbm-ra config
Modified: trunk/examples/jms/build.xml
===================================================================
--- trunk/examples/jms/build.xml 2009-02-18 10:44:32 UTC (rev 5890)
+++ trunk/examples/jms/build.xml 2009-02-18 11:51:59 UTC (rev 5891)
@@ -55,6 +55,7 @@
<property name="cf.lookup" value="ConnectionFactory"/>
<property name="throttle.rate" value="-1"/>
<property name="throughput.queue" value="NONE"/>
+ <property name="example.queue.name" value="testQueue"/>
<path id="other.system.client.classpath">
<fileset dir="${other.system.client.dir}">
@@ -248,4 +249,19 @@
<param name="sess.trans" value="true"/>
</antcall>
</target>
+
+ <target name="jar" depends="compile">
+ <jar destfile="${build.dir}/mdb-example.jar"
+ basedir="${build.dir}"
+ includes="**/*MDBExample.class">
+ </jar>
+ </target>
+
+ <target name="ear" depends="jar">
+ <jar destfile="${build.dir}/mdb-example.ear">
+ <zipfileset dir="${build.dir}" includes="mdb-example.jar"/>
+ <zipfileset dir="./config/META-INF"/>
+ </jar>
+ </target>
+
</project>
Added: trunk/examples/jms/src/org/jboss/jms/example/EJB3MDBExample.java
===================================================================
--- trunk/examples/jms/src/org/jboss/jms/example/EJB3MDBExample.java (rev 0)
+++ trunk/examples/jms/src/org/jboss/jms/example/EJB3MDBExample.java 2009-02-18 11:51:59 UTC (rev 5891)
@@ -0,0 +1,117 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jms.example;
+
+import javax.jms.TextMessage;
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.Session;
+import javax.jms.Message;
+import javax.jms.MessageProducer;
+import javax.jms.MessageListener;
+import javax.naming.InitialContext;
+import javax.ejb.MessageDriven;
+import javax.ejb.ActivationConfigProperty;
+
+/**
+ * A MDB3 EJB example.
+ *
+ * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @version <tt>$Revision: 2868 $</tt>
+
+ * $Id: EJB3MDBExample.java 2868 2007-07-10 20:22:16Z timfox $
+ */
+ at MessageDriven(activationConfig =
+{
+ @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
+ @ActivationConfigProperty(propertyName="destination", propertyValue="queue/testQueue")
+})
+public class EJB3MDBExample implements MessageListener
+{
+ public void onMessage(Message m)
+ {
+ businessLogic(m);
+ }
+
+ private void businessLogic(Message m)
+ {
+ Connection conn = null;
+ Session session = null;
+
+ try
+ {
+ TextMessage tm = (TextMessage)m;
+
+ String text = tm.getText();
+ System.out.println("message " + text + " received");
+
+ // flip the string
+ String result = "";
+ for(int i = 0; i < text.length(); i++)
+ {
+ result = text.charAt(i) + result;
+ }
+
+ System.out.println("message processed, result: " + result);
+
+
+ InitialContext ic = new InitialContext();
+ ConnectionFactory cf = (ConnectionFactory)ic.lookup("java:/JmsXA");
+ ic.close();
+
+ conn = cf.createConnection();
+ conn.start();
+ session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+ Destination replyTo = m.getJMSReplyTo();
+ MessageProducer producer = session.createProducer(replyTo);
+ TextMessage reply = session.createTextMessage(result);
+
+ producer.send(reply);
+ producer.close();
+
+ }
+ catch(Exception e)
+ {
+ e.printStackTrace();
+ System.out.println("The Message Driven Bean failed!");
+ }
+ finally
+ {
+ if (conn != null)
+ {
+ try
+ {
+ conn.close();
+ }
+ catch(Exception e)
+ {
+ System.out.println("Could not close the connection!" +e);
+ }
+ }
+ }
+ }
+}
+
+
+
Modified: trunk/src/config/ra.xml
===================================================================
--- trunk/src/config/ra.xml 2009-02-18 10:44:32 UTC (rev 5890)
+++ trunk/src/config/ra.xml 2009-02-18 11:51:59 UTC (rev 5891)
@@ -42,20 +42,60 @@
<resourceadapter>
<resourceadapter-class>org.jboss.messaging.ra.JBMResourceAdapter</resourceadapter-class>
-
<config-property>
- <description>The discovery group name</description>
- <config-property-name>DiscoveryGroupName</config-property-name>
+ <description>The transport type</description>
+ <config-property-name>TransportType</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value>org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory</config-property-value>
+ </config-property>
+ <config-property>
+ <description>The transport configuration. These values must be in the form of key:val:type;key:val:type; where type is Integer, String, Long or boolean</description>
+ <config-property-name>TransportConfiguration</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value>jbm.remoting.invm.serverid=0</config-property-value>
+ </config-property>
+ <config-property>
+ <description>Use XA methods to obtain connections</description>
+ <config-property-name>UseXA</config-property-name>
+ <config-property-type>java.lang.Boolean</config-property-type>
+ <config-property-value>true</config-property-value>
+ </config-property>
+ <config-property>
+ <description>The user name used to login to the JMS server</description>
+ <config-property-name>UserName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
- <config-property-value>default</config-property-value>
+ <config-property-value></config-property-value>
</config-property>
<config-property>
+ <description>The password used to login to the JMS server</description>
+ <config-property-name>Password</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <!--<config-property>
+ <description>The Backup transport type</description>
+ <config-property-name>BackUpTransportType</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <description>The Backup transport configuration. These values must be in the form of key=val;key=val;</description>
+ <config-property-name>TransportConfiguration</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <description>The discovery group address</description>
+ <config-property-name>DiscoveryGroupAddress</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
<description>The discovery group port</description>
<config-property-name>DiscoveryGroupPort</config-property-name>
<config-property-type>java.lang.Integer</config-property-type>
- <config-property-value>0</config-property-value>
+ <config-property-value></config-property-value>
</config-property>
-<!--
<config-property>
<description>The discovery refresh timeout</description>
<config-property-name>DiscoveryRefreshTimeout</config-property-name>
@@ -194,31 +234,12 @@
<config-property-type>java.lang.Integer</config-property-type>
<config-property-value></config-property-value>
</config-property>
--->
<config-property>
- <description>Use XA methods to obtain connections</description>
- <config-property-name>UseXA</config-property-name>
- <config-property-type>java.lang.Boolean</config-property-type>
- <config-property-value>true</config-property-value>
- </config-property>
- <config-property>
- <description>The user name used to login to the JMS server</description>
- <config-property-name>UserName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <description>The password used to login to the JMS server</description>
- <config-property-name>Password</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
<description>The client id</description>
<config-property-name>ClientID</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
- </config-property>
+ </config-property>-->
<outbound-resourceadapter>
<connection-definition>
@@ -231,7 +252,7 @@
<config-property-value>javax.jms.Queue</config-property-value>
</config-property>
<config-property>
- <description>Try to obtain a lock within specified number of seconds; <= 0 disable this functionality</description>
+ <description>Try to obtain a lock within specified number of seconds; less than 0 disable this functionality</description>
<config-property-name>UseTryLock</config-property-name>
<config-property-type>java.lang.Integer</config-property-type>
<config-property-value>0</config-property-value>
Modified: trunk/src/main/org/jboss/messaging/ra/JBMRAProperties.java
===================================================================
--- trunk/src/main/org/jboss/messaging/ra/JBMRAProperties.java 2009-02-18 10:44:32 UTC (rev 5890)
+++ trunk/src/main/org/jboss/messaging/ra/JBMRAProperties.java 2009-02-18 11:51:59 UTC (rev 5891)
@@ -22,6 +22,8 @@
package org.jboss.messaging.ra;
import java.io.Serializable;
+import java.util.Map;
+import java.util.HashMap;
import org.jboss.messaging.core.logging.Logger;
@@ -30,6 +32,7 @@
*
* @author <a href="mailto:adrian at jboss.com">Adrian Brock</a>
* @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ * @author <a href="mailto:andy.taylor at jboss.org">Andy Taylor</a>
* @version $Revision: $
*/
public class JBMRAProperties implements Serializable
@@ -44,7 +47,7 @@
private static boolean trace = log.isTraceEnabled();
/** The discovery group name */
- private String discoveryGroupName;
+ private String discoveryGroupAddress;
/** The discovery group port */
private Integer discoveryGroupPort;
@@ -130,6 +133,15 @@
/** Use XA */
private Boolean useXA;
+ /* the transport type*/
+ private String transportType;
+
+ private Map<String, Object> transportConfiguration = new HashMap<String, Object>();
+
+ private Map<String, Object> backupTransportConfiguration = new HashMap<String, Object>();
+
+ private String backUpTransportType;
+
/**
* Constructor
*/
@@ -138,7 +150,7 @@
if (trace)
log.trace("constructor()");
- discoveryGroupName = null;
+ discoveryGroupAddress = null;
discoveryGroupPort = null;
discoveryRefreshTimeout = null;
discoveryInitialWaitTimeout = null;
@@ -173,24 +185,24 @@
* Get the discovery group name
* @return The value
*/
- public String getDiscoveryGroupName()
+ public String getDiscoveryGroupAddress()
{
if (trace)
- log.trace("getDiscoveryGroupName()");
+ log.trace("getDiscoveryGroupAddress()");
- return discoveryGroupName;
+ return discoveryGroupAddress;
}
/**
* Set the discovery group name
* @param dgn The value
*/
- public void setDiscoveryGroupName(String dgn)
+ public void setDiscoveryGroupAddress(String dgn)
{
if (trace)
- log.trace("setDiscoveryGroupName(" + dgn + ")");
+ log.trace("setDiscoveryGroupAddress(" + dgn + ")");
- discoveryGroupName = dgn;
+ discoveryGroupAddress = dgn;
}
/**
@@ -896,7 +908,7 @@
if (obj instanceof JBMRAProperties)
{
JBMRAProperties you = (JBMRAProperties) obj;
- return (Util.compare(discoveryGroupName, you.getDiscoveryGroupName()) &&
+ return (Util.compare(discoveryGroupAddress, you.getDiscoveryGroupAddress()) &&
Util.compare(discoveryGroupPort, you.getDiscoveryGroupPort()) &&
Util.compare(discoveryRefreshTimeout, you.getDiscoveryRefreshTimeout()) &&
Util.compare(discoveryInitialWaitTimeout, you.getDiscoveryInitialWaitTimeout()) &&
@@ -941,7 +953,7 @@
int hash = 7;
- hash += 31 * hash + (discoveryGroupName != null ? discoveryGroupName.hashCode() : 0);
+ hash += 31 * hash + (discoveryGroupAddress != null ? discoveryGroupAddress.hashCode() : 0);
hash += 31 * hash + (discoveryGroupPort != null ? discoveryGroupPort.hashCode() : 0);
hash += 31 * hash + (discoveryRefreshTimeout != null ? discoveryRefreshTimeout.hashCode() : 0);
hash += 31 * hash + (discoveryInitialWaitTimeout != null ? discoveryInitialWaitTimeout.hashCode() : 0);
@@ -970,7 +982,37 @@
hash += 31 * hash + (password != null ? password.hashCode() : 0);
hash += 31 * hash + (clientID != null ? clientID.hashCode() : 0);
hash += 31 * hash + (useXA != null ? useXA.hashCode() : 0);
-
+ hash += 31 * hash + (transportType != null ? transportType.hashCode() : 0);
return hash;
}
+
+ public void setTransportType(String transportType)
+ {
+ this.transportType = transportType;
+ }
+
+ public String getTransportType()
+ {
+ return transportType;
+ }
+
+ public Map<String, Object> getTransportConfiguration()
+ {
+ return transportConfiguration;
+ }
+
+ public Map<String, Object> getBackupTransportConfiguration()
+ {
+ return backupTransportConfiguration;
+ }
+
+ public String getBackUpTransportType()
+ {
+ return backUpTransportType;
+ }
+
+ public void setBackupTransportType(String backUpTransportType)
+ {
+ this.backUpTransportType = backUpTransportType;
+ }
}
Modified: trunk/src/main/org/jboss/messaging/ra/JBMResourceAdapter.java
===================================================================
--- trunk/src/main/org/jboss/messaging/ra/JBMResourceAdapter.java 2009-02-18 10:44:32 UTC (rev 5890)
+++ trunk/src/main/org/jboss/messaging/ra/JBMResourceAdapter.java 2009-02-18 11:51:59 UTC (rev 5891)
@@ -21,17 +21,14 @@
*/
package org.jboss.messaging.ra;
+import org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl;
+import org.jboss.messaging.core.config.TransportConfiguration;
+import org.jboss.messaging.core.config.impl.ConfigurationImpl;
import org.jboss.messaging.core.logging.Logger;
import org.jboss.messaging.jms.client.JBossConnectionFactory;
import org.jboss.messaging.ra.inflow.JBMActivation;
import org.jboss.messaging.ra.inflow.JBMActivationSpec;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import javax.resource.NotSupportedException;
import javax.resource.ResourceException;
import javax.resource.spi.ActivationSpec;
import javax.resource.spi.BootstrapContext;
@@ -40,35 +37,54 @@
import javax.resource.spi.endpoint.MessageEndpointFactory;
import javax.resource.spi.work.WorkManager;
import javax.transaction.xa.XAResource;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicBoolean;
/**
* The resource adapter for JBoss Messaging
- *
+ *
* @author <a href="adrian at jboss.com">Adrian Brock</a>
* @author <a href="jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ * @author <a href="mailto:andy.taylor at jboss.org">Andy Taylor</a>
* @version $Revision: $
*/
public class JBMResourceAdapter implements ResourceAdapter
{
- /** The logger */
+ /**
+ * The logger
+ */
private static final Logger log = Logger.getLogger(JBMResourceAdapter.class);
- /** Trace enabled */
+ /**
+ * Trace enabled
+ */
private static boolean trace = log.isTraceEnabled();
- /** The bootstrap context */
+ /**
+ * The bootstrap context
+ */
private BootstrapContext ctx;
- /** The resource adapter properties */
+ /**
+ * The resource adapter properties
+ */
private JBMRAProperties raProperties;
- /** The JBoss connection factory */
+ /**
+ * The JBoss connection factory
+ */
private JBossConnectionFactory factory;
-
- /** Have the factory been configured */
+
+ /**
+ * Have the factory been configured
+ */
private AtomicBoolean configured;
- /** The activations by activation spec */
+ /**
+ * The activations by activation spec
+ */
private Map activations;
/**
@@ -77,7 +93,9 @@
public JBMResourceAdapter()
{
if (trace)
+ {
log.trace("constructor()");
+ }
raProperties = new JBMRAProperties();
factory = null;
@@ -87,14 +105,17 @@
/**
* Endpoint activation
+ *
* @param endpointFactory The endpoint factory
- * @param spec The activation spec
- * @exception ResourceException Thrown if an error occurs
+ * @param spec The activation spec
+ * @throws ResourceException Thrown if an error occurs
*/
public void endpointActivation(MessageEndpointFactory endpointFactory, ActivationSpec spec) throws ResourceException
{
if (trace)
+ {
log.trace("endpointActivation(" + endpointFactory + ", " + spec + ")");
+ }
JBMActivation activation = new JBMActivation(this, endpointFactory, (JBMActivationSpec) spec);
activations.put(spec, activation);
@@ -103,42 +124,54 @@
/**
* Endpoint deactivation
+ *
* @param endpointFactory The endpoint factory
- * @param spec The activation spec
+ * @param spec The activation spec
*/
public void endpointDeactivation(MessageEndpointFactory endpointFactory, ActivationSpec spec)
{
if (trace)
+ {
log.trace("endpointDeactivation(" + endpointFactory + ", " + spec + ")");
+ }
JBMActivation activation = (JBMActivation) activations.remove(spec);
if (activation != null)
+ {
activation.stop();
+ }
}
-
+
/**
* Get XA resources
+ *
* @param specs The activation specs
* @return The XA resources
- * @exception ResourceException Thrown if an error occurs or unsupported
+ * @throws ResourceException Thrown if an error occurs or unsupported
*/
public XAResource[] getXAResources(ActivationSpec[] specs) throws ResourceException
{
if (trace)
+ {
log.trace("getXAResources(" + specs + ")");
+ }
throw new ResourceException("Unsupported");
}
-
+
/**
* Start
+ *
* @param ctx The bootstrap context
- * @exception ResourceAdapterInternalException Thrown if an error occurs
+ * @throws ResourceAdapterInternalException
+ * Thrown if an error occurs
*/
public void start(BootstrapContext ctx) throws ResourceAdapterInternalException
{
if (trace)
+ {
log.trace("start(" + ctx + ")");
+ }
this.ctx = ctx;
@@ -151,7 +184,9 @@
public void stop()
{
if (trace)
+ {
log.trace("stop()");
+ }
for (Iterator i = activations.entrySet().iterator(); i.hasNext();)
{
@@ -160,7 +195,9 @@
{
JBMActivation activation = (JBMActivation) entry.getValue();
if (activation != null)
+ {
activation.stop();
+ }
}
catch (Exception ignored)
{
@@ -172,718 +209,993 @@
log.info("JBoss Messaging resource adapter stopped");
}
+ public void setTransportType(String transportType)
+ {
+ if (trace)
+ {
+ log.trace("setTransportType(" + transportType + ")");
+ }
+
+ raProperties.setTransportType(transportType);
+ }
+
+ public String getTransportType()
+ {
+ return raProperties.getTransportType();
+ }
+
+ public Map<String, Object> getTransportConfiguration()
+ {
+ return raProperties.getTransportConfiguration();
+ }
+
+ public void setTransportConfiguration(String config)
+ {
+ if (config != null)
+ {
+ String[] split = config.split(";");
+ for (String s : split)
+ {
+ String[] conf = s.split(":");
+ if (conf.length == 3)
+ {
+ Object val = getTransportParam(conf);
+ if (val != null)
+ {
+ raProperties.getTransportConfiguration().put(conf[0], val);
+ }
+ else
+ {
+ log.warn("Invalid JBMResourceAdapter type: " + val + " for type " + conf[2]);
+ }
+ }
+ else
+ {
+ log.warn("ignoring JBMResourceAdapter TransportConfiguration Element " + s + " : wrong format");
+ }
+ }
+ }
+ }
+
+
+ public String getBackUpTransportType()
+ {
+ return raProperties.getBackUpTransportType();
+ }
+
+ public void setBackUpTransportType(String backUpTransportType)
+ {
+ if (trace)
+ {
+ log.trace("setBackUpTransportType(" + backUpTransportType + ")");
+ }
+ raProperties.setBackupTransportType(backUpTransportType);
+ }
+
+ public Map<String, Object> getBackupTransportConfiguration()
+ {
+ return raProperties.getBackupTransportConfiguration();
+ }
+
+ public void setBackupTransportConfiguration(String config)
+ {
+ if (config != null)
+ {
+ String[] split = config.split(";");
+ for (String s : split)
+ {
+ String[] conf = s.split(":");
+ if (conf.length == 3)
+ {
+ Object val = getTransportParam(conf);
+ if (val != null)
+ {
+ raProperties.getBackupTransportConfiguration().put(conf[0], val);
+ }
+ else
+ {
+ log.warn("Invalid JBMResourceAdapter type: " + val + " for type " + conf[2]);
+ }
+ }
+ else
+ {
+ log.warn("ignoring JBMResourceAdapter BackupTransportConfiguration Element " + s + " : wrong format");
+ }
+ }
+ }
+ }
+
/**
* Get the discovery group name
+ *
* @return The value
*/
- public String getDiscoveryGroupName()
+ public String getDiscoveryGroupAddress()
{
if (trace)
- log.trace("getDiscoveryGroupName()");
+ {
+ log.trace("getDiscoveryGroupAddress()");
+ }
- return raProperties.getDiscoveryGroupName();
+ return raProperties.getDiscoveryGroupAddress();
}
/**
* Set the discovery group name
+ *
* @param dgn The value
*/
- public void setDiscoveryGroupName(String dgn)
+ public void setDiscoveryGroupAddress(String dgn)
{
if (trace)
- log.trace("setDiscoveryGroupName(" + dgn + ")");
+ {
+ log.trace("setDiscoveryGroupAddress(" + dgn + ")");
+ }
- raProperties.setDiscoveryGroupName(dgn);
+ raProperties.setDiscoveryGroupAddress(dgn);
}
/**
* Get the discovery group port
+ *
* @return The value
*/
public Integer getDiscoveryGroupPort()
{
if (trace)
+ {
log.trace("getDiscoveryGroupPort()");
+ }
return raProperties.getDiscoveryGroupPort();
}
/**
* Set the discovery group port
+ *
* @param dgp The value
*/
public void setDiscoveryGroupPort(Integer dgp)
{
if (trace)
+ {
log.trace("setDiscoveryGroupPort(" + dgp + ")");
+ }
raProperties.setDiscoveryGroupPort(dgp);
}
/**
* Get discovery refresh timeout
+ *
* @return The value
*/
public Long getDiscoveryRefreshTimeout()
{
if (trace)
+ {
log.trace("getDiscoveryRefreshTimeout()");
+ }
return raProperties.getDiscoveryRefreshTimeout();
}
/**
* Set discovery refresh timeout
+ *
* @param discoveryRefreshTimeout The value
*/
public void setDiscoveryRefreshTimeout(Long discoveryRefreshTimeout)
{
if (trace)
+ {
log.trace("setDiscoveryRefreshTimeout(" + discoveryRefreshTimeout + ")");
+ }
raProperties.setDiscoveryRefreshTimeout(discoveryRefreshTimeout);
}
/**
* Get discovery initial wait timeout
+ *
* @return The value
*/
public Long getDiscoveryInitialWaitTimeout()
{
if (trace)
+ {
log.trace("getDiscoveryInitialWaitTimeout()");
+ }
return raProperties.getDiscoveryInitialWaitTimeout();
}
/**
* Set discovery initial wait timeout
+ *
* @param discoveryInitialWaitTimeout The value
*/
public void setDiscoveryInitialWaitTimeout(Long discoveryInitialWaitTimeout)
{
if (trace)
+ {
log.trace("setDiscoveryInitialWaitTimeout(" + discoveryInitialWaitTimeout + ")");
+ }
raProperties.setDiscoveryInitialWaitTimeout(discoveryInitialWaitTimeout);
}
/**
* Get load balancing policy class name
+ *
* @return The value
*/
public String getLoadBalancingPolicyClassName()
{
if (trace)
+ {
log.trace("getLoadBalancingPolicyClassName()");
+ }
return raProperties.getLoadBalancingPolicyClassName();
}
/**
* Set load balancing policy class name
+ *
* @param loadBalancingPolicyClassName The value
*/
public void setLoadBalancingPolicyClassName(String loadBalancingPolicyClassName)
{
if (trace)
+ {
log.trace("setLoadBalancingPolicyClassName(" + loadBalancingPolicyClassName + ")");
+ }
raProperties.setLoadBalancingPolicyClassName(loadBalancingPolicyClassName);
}
/**
* Get ping period
+ *
* @return The value
*/
public Long getPingPeriod()
{
if (trace)
+ {
log.trace("getPingPeriod()");
+ }
return raProperties.getPingPeriod();
}
/**
* Set ping period
+ *
* @param pingPeriod The value
*/
public void setPingPeriod(Long pingPeriod)
{
if (trace)
+ {
log.trace("setPingPeriod(" + pingPeriod + ")");
+ }
raProperties.setPingPeriod(pingPeriod);
}
/**
* Get connection TTL
+ *
* @return The value
*/
public Long getConnectionTTL()
{
if (trace)
+ {
log.trace("getConnectionTTL()");
+ }
return raProperties.getConnectionTTL();
}
/**
* Set connection TTL
+ *
* @param connectionTTL The value
*/
public void setConnectionTTL(Long connectionTTL)
{
if (trace)
+ {
log.trace("setConnectionTTL(" + connectionTTL + ")");
+ }
raProperties.setConnectionTTL(connectionTTL);
}
/**
* Get call timeout
+ *
* @return The value
*/
public Long getCallTimeout()
{
if (trace)
+ {
log.trace("getCallTimeout()");
+ }
return raProperties.getCallTimeout();
}
/**
* Set call timeout
+ *
* @param callTimeout The value
*/
public void setCallTimeout(Long callTimeout)
{
if (trace)
+ {
log.trace("setCallTimeout(" + callTimeout + ")");
+ }
raProperties.setCallTimeout(callTimeout);
}
/**
* Get dups ok batch size
+ *
* @return The value
*/
public Integer getDupsOKBatchSize()
{
if (trace)
+ {
log.trace("getDupsOKBatchSize()");
+ }
return raProperties.getDupsOKBatchSize();
}
/**
* Set dups ok batch size
+ *
* @param dupsOKBatchSize The value
*/
public void setDupsOKBatchSize(Integer dupsOKBatchSize)
{
if (trace)
+ {
log.trace("setDupsOKBatchSize(" + dupsOKBatchSize + ")");
+ }
raProperties.setDupsOKBatchSize(dupsOKBatchSize);
}
/**
* Get transaction batch size
+ *
* @return The value
*/
public Integer getTransactionBatchSize()
{
if (trace)
+ {
log.trace("getTransactionBatchSize()");
+ }
return raProperties.getTransactionBatchSize();
}
/**
* Set transaction batch size
+ *
* @param transactionBatchSize The value
*/
public void setTransactionBatchSize(Integer transactionBatchSize)
{
if (trace)
+ {
log.trace("setTransactionBatchSize(" + transactionBatchSize + ")");
+ }
raProperties.setTransactionBatchSize(transactionBatchSize);
}
/**
* Get consumer window size
+ *
* @return The value
*/
public Integer getConsumerWindowSize()
{
if (trace)
+ {
log.trace("getConsumerWindowSize()");
+ }
return raProperties.getConsumerWindowSize();
}
/**
* Set consumer window size
+ *
* @param consumerWindowSize The value
*/
public void setConsumerWindowSize(Integer consumerWindowSize)
{
if (trace)
+ {
log.trace("setConsumerWindowSize(" + consumerWindowSize + ")");
+ }
raProperties.setConsumerWindowSize(consumerWindowSize);
}
/**
* Get consumer max rate
+ *
* @return The value
*/
public Integer getConsumerMaxRate()
{
if (trace)
+ {
log.trace("getConsumerMaxRate()");
+ }
return raProperties.getConsumerMaxRate();
}
/**
* Set consumer max rate
+ *
* @param consumerMaxRate The value
*/
public void setConsumerMaxRate(Integer consumerMaxRate)
{
if (trace)
+ {
log.trace("setConsumerMaxRate(" + consumerMaxRate + ")");
+ }
raProperties.setConsumerMaxRate(consumerMaxRate);
}
/**
* Get send window size
+ *
* @return The value
*/
public Integer getSendWindowSize()
{
if (trace)
+ {
log.trace("getSendWindowSize()");
+ }
return raProperties.getSendWindowSize();
}
/**
* Set send window size
+ *
* @param sendWindowSize The value
*/
public void setSendWindowSize(Integer sendWindowSize)
{
if (trace)
+ {
log.trace("setSendWindowSize(" + sendWindowSize + ")");
+ }
raProperties.setSendWindowSize(sendWindowSize);
}
/**
* Get producer max rate
+ *
* @return The value
*/
public Integer getProducerMaxRate()
{
if (trace)
+ {
log.trace("getProducerMaxRate()");
+ }
return raProperties.getProducerMaxRate();
}
/**
* Set producer max rate
+ *
* @param producerMaxRate The value
*/
public void setProducerMaxRate(Integer producerMaxRate)
{
if (trace)
+ {
log.trace("setProducerMaxRate(" + producerMaxRate + ")");
+ }
raProperties.setProducerMaxRate(producerMaxRate);
}
/**
* Get min large message size
+ *
* @return The value
*/
public Integer getMinLargeMessageSize()
{
if (trace)
+ {
log.trace("getMinLargeMessageSize()");
+ }
return raProperties.getMinLargeMessageSize();
}
/**
* Set min large message size
+ *
* @param minLargeMessageSize The value
*/
public void setMinLargeMessageSize(Integer minLargeMessageSize)
{
if (trace)
+ {
log.trace("setMinLargeMessageSize(" + minLargeMessageSize + ")");
+ }
raProperties.setMinLargeMessageSize(minLargeMessageSize);
}
/**
* Get block on acknowledge
+ *
* @return The value
*/
public Boolean getBlockOnAcknowledge()
{
if (trace)
+ {
log.trace("getBlockOnAcknowledge()");
+ }
return raProperties.getBlockOnAcknowledge();
}
/**
* Set block on acknowledge
+ *
* @param blockOnAcknowledge The value
*/
public void setBlockOnAcknowledge(Boolean blockOnAcknowledge)
{
if (trace)
+ {
log.trace("setBlockOnAcknowledge(" + blockOnAcknowledge + ")");
+ }
raProperties.setBlockOnAcknowledge(blockOnAcknowledge);
}
/**
* Get block on non persistent send
+ *
* @return The value
*/
public Boolean getBlockOnNonPersistentSend()
{
if (trace)
+ {
log.trace("getBlockOnNonPersistentSend()");
+ }
return raProperties.getBlockOnNonPersistentSend();
}
/**
* Set block on non persistent send
+ *
* @param blockOnNonPersistentSend The value
*/
public void setBlockOnNonPersistentSend(Boolean blockOnNonPersistentSend)
{
if (trace)
+ {
log.trace("setBlockOnNonPersistentSend(" + blockOnNonPersistentSend + ")");
+ }
raProperties.setBlockOnNonPersistentSend(blockOnNonPersistentSend);
}
/**
* Get block on persistent send
+ *
* @return The value
*/
public Boolean getBlockOnPersistentSend()
{
if (trace)
+ {
log.trace("getBlockOnPersistentSend()");
+ }
return raProperties.getBlockOnPersistentSend();
}
/**
* Set block on persistent send
+ *
* @param blockOnPersistentSend The value
*/
public void setBlockOnPersistentSend(Boolean blockOnPersistentSend)
{
if (trace)
+ {
log.trace("setBlockOnPersistentSend(" + blockOnPersistentSend + ")");
+ }
raProperties.setBlockOnPersistentSend(blockOnPersistentSend);
}
/**
* Get auto group
+ *
* @return The value
*/
public Boolean getAutoGroup()
{
if (trace)
+ {
log.trace("getAutoGroup()");
+ }
return raProperties.getAutoGroup();
}
/**
* Set auto group
+ *
* @param autoGroup The value
*/
public void setAutoGroup(Boolean autoGroup)
{
if (trace)
+ {
log.trace("setAutoGroup(" + autoGroup + ")");
+ }
raProperties.setAutoGroup(autoGroup);
}
/**
* Get max connections
+ *
* @return The value
*/
public Integer getMaxConnections()
{
if (trace)
+ {
log.trace("getMaxConnections()");
+ }
return raProperties.getMaxConnections();
}
/**
* Set max connections
+ *
* @param maxConnections The value
*/
public void setMaxConnections(Integer maxConnections)
{
if (trace)
+ {
log.trace("setMaxConnections(" + maxConnections + ")");
+ }
raProperties.setMaxConnections(maxConnections);
}
/**
* Get pre acknowledge
+ *
* @return The value
*/
public Boolean getPreAcknowledge()
{
if (trace)
+ {
log.trace("getPreAcknowledge()");
+ }
return raProperties.getPreAcknowledge();
}
/**
* Set pre acknowledge
+ *
* @param preAcknowledge The value
*/
public void setPreAcknowledge(Boolean preAcknowledge)
{
if (trace)
+ {
log.trace("setPreAcknowledge(" + preAcknowledge + ")");
+ }
raProperties.setPreAcknowledge(preAcknowledge);
}
/**
* Get retry interval
+ *
* @return The value
*/
public Long getRetryInterval()
{
if (trace)
+ {
log.trace("getRetryInterval()");
+ }
return raProperties.getRetryInterval();
}
/**
* Set retry interval
+ *
* @param retryInterval The value
*/
public void setRetryInterval(Long retryInterval)
{
if (trace)
+ {
log.trace("setRetryInterval(" + retryInterval + ")");
+ }
raProperties.setRetryInterval(retryInterval);
}
/**
* Get retry interval multiplier
+ *
* @return The value
*/
public Double getRetryIntervalMultiplier()
{
if (trace)
+ {
log.trace("getRetryIntervalMultiplier()");
+ }
return raProperties.getRetryIntervalMultiplier();
}
/**
* Set retry interval multiplier
+ *
* @param retryIntervalMultiplier The value
*/
public void setRetryIntervalMultiplier(Double retryIntervalMultiplier)
{
if (trace)
+ {
log.trace("setRetryIntervalMultiplier(" + retryIntervalMultiplier + ")");
+ }
raProperties.setRetryIntervalMultiplier(retryIntervalMultiplier);
}
/**
* Get max retries before failover
+ *
* @return The value
*/
public Integer getMaxRetriesBeforeFailover()
{
if (trace)
+ {
log.trace("getMaxRetriesBeforeFailover()");
+ }
return raProperties.getMaxRetriesBeforeFailover();
}
/**
* Set max retries before failover
+ *
* @param maxRetriesBeforeFailover The value
*/
public void setMaxRetriesBeforeFailover(Integer maxRetriesBeforeFailover)
{
if (trace)
+ {
log.trace("setMaxRetriesBeforeFailover(" + maxRetriesBeforeFailover + ")");
+ }
raProperties.setMaxRetriesBeforeFailover(maxRetriesBeforeFailover);
}
/**
* Get max retries after failover
+ *
* @return The value
*/
public Integer getMaxRetriesAfterFailover()
{
if (trace)
+ {
log.trace("getMaxRetriesAfterFailover()");
+ }
return raProperties.getMaxRetriesAfterFailover();
}
/**
* Set max retries after failover
+ *
* @param maxRetriesAfterFailover The value
*/
public void setMaxRetriesAfterFailover(Integer maxRetriesAfterFailover)
{
if (trace)
+ {
log.trace("setMaxRetriesAfterFailover(" + maxRetriesAfterFailover + ")");
+ }
raProperties.setMaxRetriesAfterFailover(maxRetriesAfterFailover);
}
/**
* Get the user name
+ *
* @return The value
*/
public String getUserName()
{
if (trace)
+ {
log.trace("getUserName()");
+ }
return raProperties.getUserName();
}
/**
* Set the user name
+ *
* @param userName The value
*/
public void setUserName(String userName)
{
if (trace)
+ {
log.trace("setUserName(" + userName + ")");
+ }
raProperties.setUserName(userName);
}
/**
* Get the password
+ *
* @return The value
*/
public String getPassword()
{
if (trace)
+ {
log.trace("getPassword()");
+ }
return raProperties.getPassword();
}
/**
* Set the password
+ *
* @param password The value
*/
public void setPassword(String password)
{
if (trace)
+ {
log.trace("setPassword(****)");
+ }
raProperties.setPassword(password);
}
-
+
/**
* Get the client ID
+ *
* @return The value
*/
public String getClientID()
{
if (trace)
+ {
log.trace("getClientID()");
+ }
return raProperties.getClientID();
}
/**
* Set the client ID
- * @param clientId The client id
+ *
+ * @param clientID The client id
*/
public void setClientID(String clientID)
{
if (trace)
+ {
log.trace("setClientID(" + clientID + ")");
+ }
raProperties.setClientID(clientID);
}
-
+
/**
* Get the use XA flag
+ *
* @return The value
*/
public Boolean getUseXA()
{
if (trace)
+ {
log.trace("getUseXA()");
+ }
return raProperties.getUseXA();
}
/**
* Set the use XA flag
+ *
* @param xa The value
*/
public void setUseXA(Boolean xa)
{
if (trace)
+ {
log.trace("setUseXA(" + xa + ")");
+ }
raProperties.setUseXA(xa);
}
/**
* Indicates whether some other object is "equal to" this one.
+ *
* @param obj Object with which to compare
* @return True if this object is the same as the obj argument; false otherwise.
*/
public boolean equals(Object obj)
{
if (trace)
+ {
log.trace("equals(" + obj + ")");
+ }
if (obj == null)
+ {
return false;
+ }
if (obj instanceof JBMResourceAdapter)
{
- return raProperties.equals(((JBMResourceAdapter)obj).getProperties());
+ return raProperties.equals(((JBMResourceAdapter) obj).getProperties());
}
else
{
@@ -893,38 +1205,48 @@
/**
* Return the hash code for the object
+ *
* @return The hash code
*/
public int hashCode()
{
if (trace)
+ {
log.trace("hashCode()");
+ }
return raProperties.hashCode();
}
/**
* Get the work manager
+ *
* @return The manager
*/
public WorkManager getWorkManager()
{
if (trace)
+ {
log.trace("getWorkManager()");
+ }
if (ctx == null)
+ {
return null;
+ }
return ctx.getWorkManager();
}
/**
* Get the JBoss connection factory
+ *
* @return The factory
*/
public JBossConnectionFactory getJBossConnectionFactory()
{
- if (!configured.get()) {
+ if (!configured.get())
+ {
setup();
}
@@ -933,12 +1255,15 @@
/**
* Get the resource adapter properties
+ *
* @return The properties
*/
protected JBMRAProperties getProperties()
{
if (trace)
+ {
log.trace("getProperties()");
+ }
return raProperties;
}
@@ -948,89 +1273,112 @@
*/
protected void setup()
{
- if (getDiscoveryGroupName() != null &&
- !getDiscoveryGroupName().trim().equals("") &&
- getDiscoveryGroupPort() != null &&
- getDiscoveryRefreshTimeout() != null &&
- getDiscoveryInitialWaitTimeout() != null &&
- getLoadBalancingPolicyClassName() != null &&
- getPingPeriod() != null &&
- getConnectionTTL() != null &&
- getCallTimeout() != null &&
- getClientID() != null &&
- getDupsOKBatchSize() != null &&
- getTransactionBatchSize() != null &&
- getConsumerWindowSize() != null &&
- getConsumerMaxRate() != null &&
- getSendWindowSize() != null &&
- getProducerMaxRate() != null &&
- getMinLargeMessageSize() != null &&
- getBlockOnAcknowledge() != null &&
- getBlockOnNonPersistentSend() != null &&
- getBlockOnPersistentSend() != null &&
- getAutoGroup() != null &&
- getMaxConnections() != null &&
- getPreAcknowledge() != null &&
- getRetryInterval() != null &&
- getRetryIntervalMultiplier() != null &&
- getMaxRetriesBeforeFailover() != null &&
- getMaxRetriesAfterFailover() != null)
+ if (getTransportType() != null)
{
- factory = new JBossConnectionFactory(getDiscoveryGroupName(),
- getDiscoveryGroupPort().intValue(),
- getDiscoveryRefreshTimeout().longValue(),
- getDiscoveryInitialWaitTimeout().longValue(),
- getLoadBalancingPolicyClassName(),
- getPingPeriod().longValue(),
- getConnectionTTL().longValue(),
- getCallTimeout().longValue(),
+ TransportConfiguration transportConf = new TransportConfiguration(getTransportType(), getTransportConfiguration());
+ TransportConfiguration backup = getBackUpTransportType() == null ? null : new TransportConfiguration(getBackUpTransportType(), getBackupTransportConfiguration());
+ factory = new JBossConnectionFactory(transportConf,
+ backup,
+ getLoadBalancingPolicyClassName() == null ? ClientSessionFactoryImpl.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME : getLoadBalancingPolicyClassName(),
+ getPingPeriod() == null ? ClientSessionFactoryImpl.DEFAULT_PING_PERIOD : getPingPeriod(),
+ getConnectionTTL() == null ? ClientSessionFactoryImpl.DEFAULT_CONNECTION_TTL : getConnectionTTL(),
+ getCallTimeout() == null ? ClientSessionFactoryImpl.DEFAULT_CALL_TIMEOUT : getCallTimeout(),
getClientID(),
- getDupsOKBatchSize().intValue(),
- getTransactionBatchSize().intValue(),
- getConsumerWindowSize().intValue(),
- getConsumerMaxRate().intValue(),
- getSendWindowSize().intValue(),
- getProducerMaxRate().intValue(),
- getMinLargeMessageSize().intValue(),
- getBlockOnAcknowledge().booleanValue(),
- getBlockOnNonPersistentSend().booleanValue(),
- getBlockOnPersistentSend().booleanValue(),
- getAutoGroup().booleanValue(),
- getMaxConnections().intValue(),
- getPreAcknowledge().booleanValue(),
- getRetryInterval().longValue(),
- getRetryIntervalMultiplier().doubleValue(),
- getMaxRetriesBeforeFailover().intValue(),
- getMaxRetriesAfterFailover().intValue());
-
+ getDupsOKBatchSize() == null ? ClientSessionFactoryImpl.DEFAULT_ACK_BATCH_SIZE : getDupsOKBatchSize(),
+ getTransactionBatchSize() == null ? ClientSessionFactoryImpl.DEFAULT_ACK_BATCH_SIZE : getTransactionBatchSize(),
+ getConsumerWindowSize() == null ? ClientSessionFactoryImpl.DEFAULT_CONSUMER_WINDOW_SIZE : getConsumerWindowSize(),
+ getConsumerMaxRate() == null ? ClientSessionFactoryImpl.DEFAULT_CONSUMER_MAX_RATE : getConsumerMaxRate(),
+ getSendWindowSize() == null ? ClientSessionFactoryImpl.DEFAULT_SEND_WINDOW_SIZE : getSendWindowSize(),
+ getProducerMaxRate() == null ? ClientSessionFactoryImpl.DEFAULT_PRODUCER_MAX_RATE : getProducerMaxRate(),
+ getMinLargeMessageSize() == null ? ClientSessionFactoryImpl.DEFAULT_MIN_LARGE_MESSAGE_SIZE : getMinLargeMessageSize(),
+ getBlockOnAcknowledge() == null ? ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_ACKNOWLEDGE : getBlockOnAcknowledge(),
+ getBlockOnNonPersistentSend() == null ? ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_NON_PERSISTENT_SEND : getBlockOnNonPersistentSend(),
+ getBlockOnPersistentSend() == null ? ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_PERSISTENT_SEND : getBlockOnPersistentSend(),
+ getAutoGroup() == null ? ClientSessionFactoryImpl.DEFAULT_AUTO_GROUP : getAutoGroup(),
+ getMaxConnections() == null ? ClientSessionFactoryImpl.DEFAULT_MAX_CONNECTIONS : getMaxConnections(),
+ getPreAcknowledge() == null ? ClientSessionFactoryImpl.DEFAULT_PRE_ACKNOWLEDGE : getPreAcknowledge(),
+ getRetryInterval() == null ? ClientSessionFactoryImpl.DEFAULT_RETRY_INTERVAL : getRetryInterval(),
+ getRetryIntervalMultiplier() == null ? ClientSessionFactoryImpl.DEFAULT_RETRY_INTERVAL_MULTIPLIER : getRetryIntervalMultiplier(),
+ getMaxRetriesBeforeFailover() == null ? ClientSessionFactoryImpl.DEFAULT_MAX_RETRIES_BEFORE_FAILOVER : getMaxRetriesBeforeFailover(),
+ getMaxRetriesAfterFailover() == null ? ClientSessionFactoryImpl.DEFAULT_MAX_RETRIES_AFTER_FAILOVER : getMaxRetriesAfterFailover()
+ );
configured.set(true);
-
- } else if (getDiscoveryGroupName() != null &&
- !getDiscoveryGroupName().trim().equals("") &&
- getDiscoveryGroupPort() != null &&
- getDiscoveryRefreshTimeout() != null &&
- getDiscoveryInitialWaitTimeout() != null)
+ }
+ else if (getDiscoveryGroupAddress() != null && getDiscoveryGroupPort() != null)
{
- factory = new JBossConnectionFactory(getDiscoveryGroupName(),
- getDiscoveryGroupPort().intValue(),
- getDiscoveryRefreshTimeout().longValue(),
- getDiscoveryInitialWaitTimeout().longValue());
-
+ factory = new JBossConnectionFactory(getDiscoveryGroupAddress(),
+ getDiscoveryGroupPort(),
+ getDiscoveryRefreshTimeout() == null ? ConfigurationImpl.DEFAULT_BROADCAST_REFRESH_TIMEOUT : getDiscoveryRefreshTimeout(),
+ getDiscoveryInitialWaitTimeout() == null ? ClientSessionFactoryImpl.DEFAULT_DISCOVERY_INITIAL_WAIT : getDiscoveryInitialWaitTimeout(),
+ getLoadBalancingPolicyClassName() == null ? ClientSessionFactoryImpl.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME : getLoadBalancingPolicyClassName(),
+ getPingPeriod() == null ? ClientSessionFactoryImpl.DEFAULT_PING_PERIOD : getPingPeriod(),
+ getConnectionTTL() == null ? ClientSessionFactoryImpl.DEFAULT_CONNECTION_TTL : getConnectionTTL(),
+ getCallTimeout() == null ? ClientSessionFactoryImpl.DEFAULT_CALL_TIMEOUT : getCallTimeout(),
+ getClientID(),
+ getDupsOKBatchSize() == null ? ClientSessionFactoryImpl.DEFAULT_ACK_BATCH_SIZE : getDupsOKBatchSize(),
+ getTransactionBatchSize() == null ? ClientSessionFactoryImpl.DEFAULT_ACK_BATCH_SIZE : getTransactionBatchSize(),
+ getConsumerWindowSize() == null ? ClientSessionFactoryImpl.DEFAULT_CONSUMER_WINDOW_SIZE : getConsumerWindowSize(),
+ getConsumerMaxRate() == null ? ClientSessionFactoryImpl.DEFAULT_CONSUMER_MAX_RATE : getConsumerMaxRate(),
+ getSendWindowSize() == null ? ClientSessionFactoryImpl.DEFAULT_SEND_WINDOW_SIZE : getSendWindowSize(),
+ getProducerMaxRate() == null ? ClientSessionFactoryImpl.DEFAULT_PRODUCER_MAX_RATE : getProducerMaxRate(),
+ getMinLargeMessageSize() == null ? ClientSessionFactoryImpl.DEFAULT_MIN_LARGE_MESSAGE_SIZE : getMinLargeMessageSize(),
+ getBlockOnAcknowledge() == null ? ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_ACKNOWLEDGE : getBlockOnAcknowledge(),
+ getBlockOnNonPersistentSend() == null ? ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_NON_PERSISTENT_SEND : getBlockOnNonPersistentSend(),
+ getBlockOnPersistentSend() == null ? ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_PERSISTENT_SEND : getBlockOnPersistentSend(),
+ getAutoGroup() == null ? ClientSessionFactoryImpl.DEFAULT_AUTO_GROUP : getAutoGroup(),
+ getMaxConnections() == null ? ClientSessionFactoryImpl.DEFAULT_MAX_CONNECTIONS : getMaxConnections(),
+ getPreAcknowledge() == null ? ClientSessionFactoryImpl.DEFAULT_PRE_ACKNOWLEDGE : getPreAcknowledge(),
+ getRetryInterval() == null ? ClientSessionFactoryImpl.DEFAULT_RETRY_INTERVAL : getRetryInterval(),
+ getRetryIntervalMultiplier() == null ? ClientSessionFactoryImpl.DEFAULT_RETRY_INTERVAL_MULTIPLIER : getRetryIntervalMultiplier(),
+ getMaxRetriesBeforeFailover() == null ? ClientSessionFactoryImpl.DEFAULT_MAX_RETRIES_BEFORE_FAILOVER : getMaxRetriesBeforeFailover(),
+ getMaxRetriesAfterFailover() == null ? ClientSessionFactoryImpl.DEFAULT_MAX_RETRIES_AFTER_FAILOVER : getMaxRetriesAfterFailover()
+ );
configured.set(true);
+ }
+ else
+ {
+ log.fatal("must provide either TransportTyoe or DiscoveryGroupAddress and DiscoveryGroupPort for JBM ResourceAdapter");
+ }
+ }
- }
- else if (getDiscoveryGroupName() != null &&
- !getDiscoveryGroupName().trim().equals("") &&
- getDiscoveryGroupPort() != null)
+
+ private Object getTransportParam(String[] conf)
+ {
+ Object val = null;
+ if ("Integer".equals(conf[2]))
{
- factory = new JBossConnectionFactory(getDiscoveryGroupName(),
- getDiscoveryGroupPort().intValue());
-
- configured.set(true);
+ try
+ {
+ val = Integer.parseInt(conf[1]);
+ }
+ catch (NumberFormatException e)
+ {//ok warning at end wll pick up
+ }
}
- else
+ else if ("Long".equals(conf[2]))
{
- log.fatal("Unable to configure phsyical connection factory");
+ try
+ {
+ val = Long.parseLong(conf[1]);
+ }
+ catch (NumberFormatException e)
+ {//ok warning at end wll pick up
+ }
}
+ else if ("Boolean".equals(conf[2]))
+ {
+ try
+ {
+ val = Boolean.parseBoolean(conf[1]);
+ }
+ catch (NumberFormatException e)
+ {//ok warning at end wll pick up
+ }
+ }
+ else if ("String".equals(conf[2]))
+ {
+ val = conf[2];
+ }
+ return val;
}
}
Modified: trunk/src/main/org/jboss/messaging/ra/inflow/JBMActivationSpec.java
===================================================================
--- trunk/src/main/org/jboss/messaging/ra/inflow/JBMActivationSpec.java 2009-02-18 10:44:32 UTC (rev 5890)
+++ trunk/src/main/org/jboss/messaging/ra/inflow/JBMActivationSpec.java 2009-02-18 11:51:59 UTC (rev 5891)
@@ -36,6 +36,7 @@
*
* @author <a href="adrian at jboss.com">Adrian Brock</a>
* @author <a href="jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ * @author <a href="mailto:andy.taylor at jboss.org">Andy Taylor</a>
* @version $Revision: $
*/
public class JBMActivationSpec implements ActivationSpec
@@ -101,7 +102,7 @@
private Boolean redeliverUnspecified;
/** Transaction timeout */
- private Integer transactionTimeout;
+ private Integer transactionTimeout = 100000;
/** Is same RM override */
private Boolean isSameRMOverrideValue;
@@ -136,12 +137,12 @@
password = null;
maxMessages = Integer.valueOf(1);
minSession = Integer.valueOf(1);
- maxSession = Integer.valueOf(15);
+ maxSession = Integer.valueOf(1);
keepAlive = Long.valueOf(60000);
sessionTransacted = Boolean.TRUE;
reconnectAttempts = Integer.valueOf(5);
redeliverUnspecified = Boolean.TRUE;
- transactionTimeout = null;
+ transactionTimeout = 100000;
isSameRMOverrideValue = null;
forceClearOnShutdown = Boolean.FALSE;
forceClearOnShutdownInterval = Long.valueOf(1000);
@@ -222,7 +223,7 @@
if (trace)
log.trace("setDestinationType(" + value + ")");
- this.destinationType = destinationType;
+ this.destinationType = value;
}
/**
More information about the jboss-cvs-commits
mailing list