Commit 4bf3fe04 authored by afreyssin's avatar afreyssin
Browse files

Bug fixe: cnxPendingTimer is not stored in JNDI Reference.

parent a701672e
...@@ -41,7 +41,6 @@ public abstract class ConnectionFactory ...@@ -41,7 +41,6 @@ public abstract class ConnectionFactory
/** Object containing the factory's parameters. */ /** Object containing the factory's parameters. */
protected FactoryParameters params; protected FactoryParameters params;
/** /**
* Constructs a <code>ConnectionFactory</code> dedicated to a given server. * Constructs a <code>ConnectionFactory</code> dedicated to a given server.
* *
...@@ -60,17 +59,14 @@ public abstract class ConnectionFactory ...@@ -60,17 +59,14 @@ public abstract class ConnectionFactory
/** /**
* Constructs an empty <code>ConnectionFactory</code>. * Constructs an empty <code>ConnectionFactory</code>.
*/ */
public ConnectionFactory() public ConnectionFactory() {}
{}
/** Returns a string view of the connection factory. */ /** Returns a string view of the connection factory. */
public String toString() public String toString() {
{
return "CF:" + params.getHost() + "-" + params.getPort(); return "CF:" + params.getHost() + "-" + params.getPort();
} }
/** /**
* API method, implemented according to the communication protocol. * API method, implemented according to the communication protocol.
* *
...@@ -93,27 +89,24 @@ public abstract class ConnectionFactory ...@@ -93,27 +89,24 @@ public abstract class ConnectionFactory
return createConnection("anonymous", "anonymous"); return createConnection("anonymous", "anonymous");
} }
/** Returns the factory's configuration parameters. */ /** Returns the factory's configuration parameters. */
public FactoryParameters getParameters() public FactoryParameters getParameters() {
{
return params; return params;
} }
/** Sets the naming reference of a connection factory. */ /** Sets the naming reference of a connection factory. */
public Reference getReference() throws NamingException public Reference getReference() throws NamingException
{ {
Reference ref = super.getReference(); Reference ref = super.getReference();
ref.add(new StringRefAddr("cFactory.host", params.getHost())); ref.add(new StringRefAddr("cFactory.host", params.getHost()));
ref.add(new StringRefAddr("cFactory.port", ref.add(new StringRefAddr("cFactory.port",
(new Integer(params.getPort())).toString())); new Integer(params.getPort()).toString()));
ref.add( ref.add(new StringRefAddr("cFactory.cnxT",
new StringRefAddr("cFactory.cnxT", new Integer(params.connectingTimer).toString()));
(new Integer(params.connectingTimer)).toString())); ref.add(new StringRefAddr("cFactory.txT",
ref.add( new Integer(params.txPendingTimer).toString()));
new StringRefAddr("cFactory.txT", ref.add(new StringRefAddr("cFactory.cnxPT",
(new Integer(params.txPendingTimer)).toString())); new Integer(params.cnxPendingTimer).toString()));
return ref; return ref;
} }
......
...@@ -58,12 +58,10 @@ public abstract class XAConnectionFactory ...@@ -58,12 +58,10 @@ public abstract class XAConnectionFactory
} }
/** Returns a string view of the connection factory. */ /** Returns a string view of the connection factory. */
public String toString() public String toString() {
{
return "XACF:" + params.getHost() + "-" + params.getPort(); return "XACF:" + params.getHost() + "-" + params.getPort();
} }
/** /**
* API method, implemented according to the communication protocol. * API method, implemented according to the communication protocol.
* *
...@@ -86,11 +84,8 @@ public abstract class XAConnectionFactory ...@@ -86,11 +84,8 @@ public abstract class XAConnectionFactory
return createXAConnection("anonymous", "anonymous"); return createXAConnection("anonymous", "anonymous");
} }
/** /** Returns the factory's configuration parameters. */
* Returns the factory's configuration parameters. public FactoryParameters getParameters() {
*/
public FactoryParameters getParameters()
{
return params; return params;
} }
...@@ -100,10 +95,13 @@ public abstract class XAConnectionFactory ...@@ -100,10 +95,13 @@ public abstract class XAConnectionFactory
Reference ref = super.getReference(); Reference ref = super.getReference();
ref.add(new StringRefAddr("cFactory.host", params.getHost())); ref.add(new StringRefAddr("cFactory.host", params.getHost()));
ref.add(new StringRefAddr("cFactory.port", ref.add(new StringRefAddr("cFactory.port",
(new Integer(params.getPort())).toString())); new Integer(params.getPort()).toString()));
ref.add( ref.add(new StringRefAddr("cFactory.cnxT",
new StringRefAddr("cFactory.cnxT", new Integer(params.connectingTimer).toString()));
(new Integer(params.connectingTimer)).toString())); ref.add(new StringRefAddr("cFactory.txT",
new Integer(params.txPendingTimer).toString()));
ref.add(new StringRefAddr("cFactory.cnxPT",
new Integer(params.cnxPendingTimer).toString()));
return ref; return ref;
} }
...@@ -116,6 +114,8 @@ public abstract class XAConnectionFactory ...@@ -116,6 +114,8 @@ public abstract class XAConnectionFactory
h.put("host",params.getHost()); h.put("host",params.getHost());
h.put("port",new Integer(params.getPort())); h.put("port",new Integer(params.getPort()));
h.put("connectingTimer",new Integer(params.connectingTimer)); h.put("connectingTimer",new Integer(params.connectingTimer));
h.put("txPendingTimer",new Integer(params.txPendingTimer));
h.put("cnxPendingTimer",new Integer(params.cnxPendingTimer));
return h; return h;
} }
......
...@@ -131,11 +131,13 @@ public class ObjectFactory implements javax.naming.spi.ObjectFactory ...@@ -131,11 +131,13 @@ public class ObjectFactory implements javax.naming.spi.ObjectFactory
String port = (String) ref.get("cFactory.port").getContent(); String port = (String) ref.get("cFactory.port").getContent();
String cnxTimer = (String) ref.get("cFactory.cnxT").getContent(); String cnxTimer = (String) ref.get("cFactory.cnxT").getContent();
String txTimer = (String) ref.get("cFactory.txT").getContent(); String txTimer = (String) ref.get("cFactory.txT").getContent();
String cnxPendingTimer = (String) ref.get("cFactory.cnxPT").getContent();
ConnectionFactory cnxFact = ConnectionFactory cnxFact =
new TcpConnectionFactory(host, (new Integer(port)).intValue()); new TcpConnectionFactory(host, (new Integer(port)).intValue());
FactoryParameters params = cnxFact.getParameters(); FactoryParameters params = cnxFact.getParameters();
params.connectingTimer = (new Integer(cnxTimer)).intValue(); params.connectingTimer = (new Integer(cnxTimer)).intValue();
params.txPendingTimer = (new Integer(txTimer)).intValue(); params.txPendingTimer = (new Integer(txTimer)).intValue();
params.cnxPendingTimer = (new Integer(cnxPendingTimer)).intValue();
return cnxFact; return cnxFact;
} }
else if (ref.getClassName().equals(tcpQCF)) { else if (ref.getClassName().equals(tcpQCF)) {
...@@ -143,11 +145,13 @@ public class ObjectFactory implements javax.naming.spi.ObjectFactory ...@@ -143,11 +145,13 @@ public class ObjectFactory implements javax.naming.spi.ObjectFactory
String port = (String) ref.get("cFactory.port").getContent(); String port = (String) ref.get("cFactory.port").getContent();
String cnxTimer = (String) ref.get("cFactory.cnxT").getContent(); String cnxTimer = (String) ref.get("cFactory.cnxT").getContent();
String txTimer = (String) ref.get("cFactory.txT").getContent(); String txTimer = (String) ref.get("cFactory.txT").getContent();
String cnxPendingTimer = (String) ref.get("cFactory.cnxPT").getContent();
QueueConnectionFactory cnxFact = QueueConnectionFactory cnxFact =
new QueueTcpConnectionFactory(host, (new Integer(port)).intValue()); new QueueTcpConnectionFactory(host, (new Integer(port)).intValue());
FactoryParameters params = cnxFact.getParameters(); FactoryParameters params = cnxFact.getParameters();
params.connectingTimer = (new Integer(cnxTimer)).intValue(); params.connectingTimer = (new Integer(cnxTimer)).intValue();
params.txPendingTimer = (new Integer(txTimer)).intValue(); params.txPendingTimer = (new Integer(txTimer)).intValue();
params.cnxPendingTimer = (new Integer(cnxPendingTimer)).intValue();
return cnxFact; return cnxFact;
} }
else if (ref.getClassName().equals(tcpTCF)) { else if (ref.getClassName().equals(tcpTCF)) {
...@@ -155,41 +159,55 @@ public class ObjectFactory implements javax.naming.spi.ObjectFactory ...@@ -155,41 +159,55 @@ public class ObjectFactory implements javax.naming.spi.ObjectFactory
String port = (String) ref.get("cFactory.port").getContent(); String port = (String) ref.get("cFactory.port").getContent();
String cnxTimer = (String) ref.get("cFactory.cnxT").getContent(); String cnxTimer = (String) ref.get("cFactory.cnxT").getContent();
String txTimer = (String) ref.get("cFactory.txT").getContent(); String txTimer = (String) ref.get("cFactory.txT").getContent();
String cnxPendingTimer = (String) ref.get("cFactory.cnxPT").getContent();
TopicConnectionFactory cnxFact = TopicConnectionFactory cnxFact =
new TopicTcpConnectionFactory(host, (new Integer(port)).intValue()); new TopicTcpConnectionFactory(host, (new Integer(port)).intValue());
FactoryParameters params = cnxFact.getParameters(); FactoryParameters params = cnxFact.getParameters();
params.connectingTimer = (new Integer(cnxTimer)).intValue(); params.connectingTimer = (new Integer(cnxTimer)).intValue();
params.txPendingTimer = (new Integer(txTimer)).intValue(); params.txPendingTimer = (new Integer(txTimer)).intValue();
params.cnxPendingTimer = (new Integer(cnxPendingTimer)).intValue();
return cnxFact; return cnxFact;
} }
else if (ref.getClassName().equals(tcpXACF)) { else if (ref.getClassName().equals(tcpXACF)) {
String host = (String) ref.get("cFactory.host").getContent(); String host = (String) ref.get("cFactory.host").getContent();
String port = (String) ref.get("cFactory.port").getContent(); String port = (String) ref.get("cFactory.port").getContent();
String cnxTimer = (String) ref.get("cFactory.cnxT").getContent(); String cnxTimer = (String) ref.get("cFactory.cnxT").getContent();
String txTimer = (String) ref.get("cFactory.txT").getContent();
String cnxPendingTimer = (String) ref.get("cFactory.cnxPT").getContent();
XAConnectionFactory cnxFact = XAConnectionFactory cnxFact =
new XATcpConnectionFactory(host, (new Integer(port)).intValue()); new XATcpConnectionFactory(host, (new Integer(port)).intValue());
FactoryParameters params = cnxFact.getParameters(); FactoryParameters params = cnxFact.getParameters();
params.connectingTimer = (new Integer(cnxTimer)).intValue(); params.connectingTimer = (new Integer(cnxTimer)).intValue();
params.txPendingTimer = (new Integer(txTimer)).intValue();
params.cnxPendingTimer = (new Integer(cnxPendingTimer)).intValue();
return cnxFact; return cnxFact;
} }
else if (ref.getClassName().equals(tcpXAQCF)) { else if (ref.getClassName().equals(tcpXAQCF)) {
String host = (String) ref.get("cFactory.host").getContent(); String host = (String) ref.get("cFactory.host").getContent();
String port = (String) ref.get("cFactory.port").getContent(); String port = (String) ref.get("cFactory.port").getContent();
String cnxTimer = (String) ref.get("cFactory.cnxT").getContent(); String cnxTimer = (String) ref.get("cFactory.cnxT").getContent();
String txTimer = (String) ref.get("cFactory.txT").getContent();
String cnxPendingTimer = (String) ref.get("cFactory.cnxPT").getContent();
XAQueueConnectionFactory cnxFact = XAQueueConnectionFactory cnxFact =
new XAQueueTcpConnectionFactory(host, (new Integer(port)).intValue()); new XAQueueTcpConnectionFactory(host, (new Integer(port)).intValue());
FactoryParameters params = cnxFact.getParameters(); FactoryParameters params = cnxFact.getParameters();
params.connectingTimer = (new Integer(cnxTimer)).intValue(); params.connectingTimer = (new Integer(cnxTimer)).intValue();
params.txPendingTimer = (new Integer(txTimer)).intValue();
params.cnxPendingTimer = (new Integer(cnxPendingTimer)).intValue();
return cnxFact; return cnxFact;
} }
else if (ref.getClassName().equals(tcpXATCF)) { else if (ref.getClassName().equals(tcpXATCF)) {
String host = (String) ref.get("cFactory.host").getContent(); String host = (String) ref.get("cFactory.host").getContent();
String port = (String) ref.get("cFactory.port").getContent(); String port = (String) ref.get("cFactory.port").getContent();
String cnxTimer = (String) ref.get("cFactory.cnxT").getContent(); String cnxTimer = (String) ref.get("cFactory.cnxT").getContent();
String txTimer = (String) ref.get("cFactory.txT").getContent();
String cnxPendingTimer = (String) ref.get("cFactory.cnxPT").getContent();
XATopicConnectionFactory cnxFact = XATopicConnectionFactory cnxFact =
new XATopicTcpConnectionFactory(host, (new Integer(port)).intValue()); new XATopicTcpConnectionFactory(host, (new Integer(port)).intValue());
FactoryParameters params = cnxFact.getParameters(); FactoryParameters params = cnxFact.getParameters();
params.connectingTimer = (new Integer(cnxTimer)).intValue(); params.connectingTimer = (new Integer(cnxTimer)).intValue();
params.txPendingTimer = (new Integer(txTimer)).intValue();
params.cnxPendingTimer = (new Integer(cnxPendingTimer)).intValue();
return cnxFact; return cnxFact;
} }
else if (ref.getClassName().equals(localCF)) { else if (ref.getClassName().equals(localCF)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment