Commit 4bf3fe04 authored by afreyssin's avatar afreyssin

Bug fixe: cnxPendingTimer is not stored in JNDI Reference.

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