*/
protected Topic createTopic(Object value)
{
if (value instanceof AMQShortString)
{
return new AMQTopic(AMQShortString.valueOf(ExchangeDefaults.TOPIC_EXCHANGE_NAME), (AMQShortString) value);
}
else if (value instanceof String)
{
String[] keys = ((String)value).split(",");
AMQShortString[] bindings = new AMQShortString[keys.length];
int i = 0;
for (String key:keys)
{
bindings[i] = new AMQShortString(key.trim());
i++;
}
// The Destination has a dual nature. If this was used for a producer the key is used
// for the routing key. If it was used for the consumer it becomes the bindingKey
return new AMQTopic(AMQShortString.valueOf(ExchangeDefaults.TOPIC_EXCHANGE_NAME),bindings[0],null,bindings);
}
else if (value instanceof BindingURL)
{
return new AMQTopic((BindingURL) value);
}
return null;
}