{
String sQueueName = m_channel.getName();
if (!m_channel.isSendable())
{
throw new RPCException("err.rpc.notSender", new Object[]{m_channel.getName()});
}
if (s_logger.isDebugEnabled())
{
for (Iterator itr = col.iterator(); itr.hasNext();)
{
s_logger.debug("Sending a message on channel \"" + m_channel.getName() + "\"");
s_logger.dump(itr.next());
}
}
m_sentCounter.add(col.size());
UnitOfWork oldUOW = m_invocationContext.getUnitOfWork();
UnitOfWork uow = m_invocationContext.createUnitOfWork();
try
{
Metadata metadata = m_invocationContext.getMetadata();
Instance queue = (Instance)metadata.getMetaclass("SysQueue").invoke("getQueue", new Object[]{sQueueName});
queue.invoke("send", new Object[]{col});
uow.commit(true);
}
catch (Throwable t)
{
uow.rollback();
ObjUtil.rethrow(t);
}
finally
{
m_invocationContext.setUnitOfWork(oldUOW);
}
}
catch (IntegrationException e)
{
throw e;
}
catch (Exception e)
{
throw new RPCException("err.rpc.msg", e);
}
}