ByteArrayWriter msg = new ByteArrayWriter();
msg.writeString(message.getSubject());
msg.writeInt(0);
msg.writeString(message.getContent());
DefaultAgentManager agentManager = DefaultAgentManager.getInstance();
if (agentManager.hasActiveAgent(info) && info.getUser().getPrincipalName().equals(recipient.getRecipientAlias())) {
try {
Request request = new Request("agentMessage", msg.toByteArray());
AgentTunnel tunnel = agentManager.getAgentBySession(info);
if (tunnel != null) {
tunnel.sendRequest(request, false, 0);
return true;
}
} catch (IOException e) {