{
public Message onOutput (Message msg, Map<String, Object> params) throws CourierException
{
final Environment.Transports type;
final String name;
EPR destination = msg.getHeader().getCall().getTo();
if (destination != null)
{
if (destination instanceof FTPEpr)
{
try
{
type = Environment.Transports.FTP;
String dir = FtpUtils.getLocalDir();
name = dir
+ File.separator
+ msg.getHeader().getCall().getMessageID()
.toString()
+ ((FTPEpr) destination).getPostDirectory();
}
catch (Exception ex)
{
throw new CourierException(ex);
}
}
else if (destination instanceof FileEpr)
{
try
{
type = Environment.Transports.File;
name = destination.getURI()
+ File.separator
+ msg.getHeader().getCall().getMessageID()
.toString()
+ ((FileEpr) destination).getInputSuffix();
}
catch (Exception ex)
{
throw new CourierException(ex);
}
}
else if (destination instanceof JMSEpr)
{
type = Environment.Transports.JMS;
name = destination.getAddr().toString();
}
else if (destination instanceof JDBCEpr)
{
type = Environment.Transports.SQL;
name = destination.getAddr().toString();
}
else if (destination instanceof HibernateEpr)
{
type = Environment.Transports.Hibernate;
name = destination.getAddr().toString();
}
else
{
type = null;
name = null;