public void bindResource(Object key, Object resource) throws TransactionException
{
if (!(key instanceof Connection) || !(resource instanceof Session))
{
throw new IllegalTransactionStateException(
CoreMessages.transactionCanOnlyBindToResources("javax.jms.Connection/javax.jms.Session"));
}
Session session = (Session)resource;
try
{
if (!session.getTransacted())
{
throw new IllegalTransactionStateException(JmsMessages.sessionShouldBeTransacted());
}
}
catch (JMSException e)
{
throw new IllegalTransactionStateException(CoreMessages.transactionCannotReadState(), e);
}
super.bindResource(key, resource);
}