* @param xid
* @return
*/
private XAResourceRecord createRecord(XAResource xaRes, Object[] params, Xid xid)
{
final XAResourceRecord record;
if ((xaRes instanceof LastResourceCommitOptimisation)
|| ((LAST_RESOURCE_OPTIMISATION_INTERFACE != null) && LAST_RESOURCE_OPTIMISATION_INTERFACE
.isInstance(xaRes)))
{
if (lastResourceCount == 1)
{
if (jtaLogger.loggerI18N.isWarnEnabled())
{
if (ALLOW_MULTIPLE_LAST_RESOURCES)
{
jtaLogger.loggerI18N
.warn(
"com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.multipleWarning",
new Object[]
{ xaRes });
}
else
{
jtaLogger.loggerI18N
.warn(
"com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow",
new Object[]
{ xaRes });
}
}
}
if ((lastResourceCount++ == 0) || ALLOW_MULTIPLE_LAST_RESOURCES)
{
record = new LastResourceRecord(this, xaRes, xid, params);
}
else
{
record = null;
}
}
else
{
record = new XAResourceRecord(this, xaRes, xid, params);
}
return record;
}