Commit bcbcfa4f authored by Andre Freyssinet's avatar Andre Freyssinet

Minor changes.

parent 9aa719e8
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2004 - 2012 ScalAgent Distributed Technologies
* Copyright (C) 2004 - 2019 ScalAgent Distributed Technologies
* Copyright (C) 2004 - 2006 Bull SA
*
* This library is free software; you can redistribute it and/or
......@@ -210,8 +210,7 @@ public class ManagedConnectionFactoryImpl extends ManagedConnectionFactoryConfig
if (! (cxRequest instanceof ConnectionRequest)) {
if (out != null)
out.print("Provided ConnectionRequestInfo instance is not a JORAM object.");
throw new ResourceException("Provided ConnectionRequestInfo instance "
+ "is not a JORAM object.");
throw new ResourceException("Provided ConnectionRequestInfo instance is not a JORAM object.");
}
userName = ((ConnectionRequest) cxRequest).getUserName();
......@@ -260,8 +259,7 @@ public class ManagedConnectionFactoryImpl extends ManagedConnectionFactoryConfig
public final ManagedConnection
matchManagedConnections(Set connectionSet,
Subject subject,
ConnectionRequestInfo cxRequest)
throws ResourceException {
ConnectionRequestInfo cxRequest) throws ResourceException {
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG, this + " matchManagedConnections(" + connectionSet + ", " + subject + ", " + cxRequest + ")");
......@@ -275,8 +273,7 @@ public class ManagedConnectionFactoryImpl extends ManagedConnectionFactoryConfig
else {
if (! (cxRequest instanceof ConnectionRequest)) {
out.print("Provided ConnectionRequestInfo instance is not a JORAM object.");
throw new ResourceException("Provided ConnectionRequestInfo instance "
+ "is not a JORAM object.");
throw new ResourceException("Provided ConnectionRequestInfo instance is not a JORAM object.");
}
if (cxRequest instanceof QueueConnectionRequest)
......@@ -296,7 +293,8 @@ public class ManagedConnectionFactoryImpl extends ManagedConnectionFactoryConfig
int serverPort = getServerPort();
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG, this + " hostName = " + hostName + ", serverPort = " + serverPort);
logger.log(BasicLevel.DEBUG,
this + " hostName = " + hostName + ", serverPort = " + serverPort);
if (isCollocated()) {
hostName = "localhost";
serverPort = -1;
......@@ -306,14 +304,16 @@ public class ManagedConnectionFactoryImpl extends ManagedConnectionFactoryConfig
try {
managedCx = (ManagedConnectionImpl) it.next();
matching = managedCx.matches(hostName, serverPort, userName, mode);
}
catch (ClassCastException exc) {
} catch (ClassCastException exc) {
logger.log(BasicLevel.WARN,
this + " matchManagedConnections managedCx = " + managedCx, exc);
}
}
if (matching) {
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG, this + " matchManagedConnections managedCx = " + managedCx);
logger.log(BasicLevel.DEBUG,
this + " matchManagedConnections managedCx = " + managedCx);
managedCx.setLogWriter(out);
return managedCx;
}
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2004 - 2016 ScalAgent Distributed Technologies
* Copyright (C) 2004 - 2019 ScalAgent Distributed Technologies
* Copyright (C) 2004 Bull SA
*
* This library is free software; you can redistribute it and/or
......@@ -90,8 +90,7 @@ public class OutboundConnectionFactory implements javax.jms.ConnectionFactory,
* is not reachable.
* @exception JMSException Generic exception.
*/
public javax.jms.Connection createConnection()
throws JMSException {
public javax.jms.Connection createConnection() throws JMSException {
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG, this + " createConnection()");
......@@ -108,12 +107,10 @@ public class OutboundConnectionFactory implements javax.jms.ConnectionFactory,
* @exception JMSException Generic exception.
*/
public javax.jms.Connection
createConnection(String userName, String password)
throws JMSException {
createConnection(String userName, String password) throws JMSException {
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG, this + " createConnection(" + userName +
", " + password + ")");
logger.log(BasicLevel.DEBUG, this + " createConnection(" + userName + ", " + password + ")");
try {
ConnectionRequest cxRequest = null;
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2012 - 2013 ScalAgent Distributed Technologies
* Copyright (C) 2012 - 2019 ScalAgent Distributed Technologies
* Copyright (C) 2004 - Bull SA
*
* This library is free software; you can redistribute it and/or
......@@ -425,7 +425,7 @@ public class OutboundSession implements javax.jms.Session {
/*
* This session is shared by all the outbound sessions.
* This session will be closed on outboud connection close.
* This session will be closed on outbound connection close.
*/
sess = null;
}
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2001 - 2012 ScalAgent Distributed Technologies
* Copyright (C) 2001 - 2019 ScalAgent Distributed Technologies
* Copyright (C) 2004 Bull SA
* Copyright (C) 1996 - 2000 Dyade
*
......@@ -36,8 +36,7 @@ import javax.jms.JMSException;
* programs are strongly encouraged to use the transactional support available
* in their environment, rather than use these XA interfaces directly.
*/
public class XAConnection extends Connection
implements javax.jms.XAConnection {
public class XAConnection extends Connection implements javax.jms.XAConnection {
/** Resource manager instance. */
private XAResourceMngr rm;
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2001 - 2008 ScalAgent Distributed Technologies
* Copyright (C) 2001 - 2019 ScalAgent Distributed Technologies
* Copyright (C) 2004 Bull SA
* Copyright (C) 1996 - 2000 Dyade
*
......@@ -69,15 +69,13 @@ public class XAResource implements javax.transaction.xa.XAResource {
* transaction, or if the RM fails to enlist the
* resource.
*/
public void start(Xid xid, int flag)
throws XAException {
public void start(Xid xid, int flag) throws XAException {
if (enlisted)
throw new XAException("Resource already enlisted.");
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG,
this + ": start(" + xid +
", " + flag + ")");
this + ": start(" + xid + ", " + flag + ")");
rm.start(xid, flag, sess);
......@@ -92,16 +90,13 @@ public class XAResource implements javax.transaction.xa.XAResource {
* transaction, or if the RM fails to delist the
* resource.
*/
public void end(Xid xid, int flag)
throws XAException {
public void end(Xid xid, int flag) throws XAException {
if (! enlisted || ! xid.equals(currentXid))
throw new XAException("Resource is not enlisted in specified"
+ " transaction.");
throw new XAException("Resource is not enlisted in specified transaction.");
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG,
this + ": end(" + xid +
", " + flag + ")");
this + ": end(" + xid + ", " + flag + ")");
rm.end(xid, flag, sess);
......@@ -114,8 +109,7 @@ public class XAResource implements javax.transaction.xa.XAResource {
*
* @exception XAException If the RM fails to prepare the resource.
*/
public int prepare(Xid xid)
throws XAException {
public int prepare(Xid xid) throws XAException {
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG,
......@@ -148,9 +142,7 @@ public class XAResource implements javax.transaction.xa.XAResource {
*
* @exception XAException If the RM fails to roll the resource back.
*/
public void rollback(Xid xid)
throws XAException {
public void rollback(Xid xid) throws XAException {
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG,
this + ": rollback(" + xid + ")");
......@@ -178,40 +170,35 @@ public class XAResource implements javax.transaction.xa.XAResource {
*
* @exception XAException Always thrown.
*/
public void forget(Xid xid) throws XAException
{
public void forget(Xid xid) throws XAException {
throw new XAException("Non implemented method.");
}
/**
* Returns <code>false</code> as timeout feaure is not supported.
* Returns <code>false</code> as timeout feature is not supported.
*
* @exception XAException Never thrown.
*/
public boolean setTransactionTimeout(int seconds) throws XAException
{
public boolean setTransactionTimeout(int seconds) throws XAException {
return false;
}
/**
* Returns 0 as timeout feaure is not supported.
* Returns 0 as timeout feature is not supported.
*
* @exception XAException Never thrown.
*/
public int getTransactionTimeout() throws XAException
{
public int getTransactionTimeout() throws XAException {
return 0;
}
/**
* Checks wether this resource shares the same resource manager
* Checks if this resource shares the same resource manager
* (XAConnection) with an other resource.
*
* @exception XAException Never thrown.
*/
public boolean isSameRM(javax.transaction.xa.XAResource o)
throws XAException {
public boolean isSameRM(javax.transaction.xa.XAResource o) throws XAException {
if (! (o instanceof org.objectweb.joram.client.jms.XAResource))
return false;
......@@ -219,9 +206,7 @@ public class XAResource implements javax.transaction.xa.XAResource {
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG,
this + ": isSameRM other.rm = " + other.rm +
", this.rm = " + this.rm +
", equals = " + this.rm.equals(other.rm));
this + ": isSameRM other.rm = " + other.rm + ", this.rm = " + this.rm + ", equals = " + this.rm.equals(other.rm));
return this.rm.equals(other.rm);
}
......
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