/* (non-Javadoc)
* @see hermes.ext.HermesAdminFactory#createSession(hermes.Hermes, javax.jms.ConnectionFactory)
*/
public HermesAdmin createSession(Hermes hermes, ConnectionFactory connectionFactory) throws JMSException, NamingException
{
QueueConnectionFactoryAdmin cfAdmin = null;
if (connectionFactory instanceof JNDIQueueConnectionFactory)
{
JNDIQueueConnectionFactory jndiCF = (JNDIQueueConnectionFactory) connectionFactory;
return createSession(hermes, jndiCF._getConnectionFactory());
}
if (connectionFactory instanceof QueueConnectionFactoryAdmin)
{
try
{
cfAdmin = (QueueConnectionFactoryAdmin) connectionFactory;
final BrokerConnectionDescriptor bcd = new BrokerConnectionDescriptor();
bcd.setConnectionShare(true);
try
{
bcd.setConnectionShareLimit(100); // some arbitary number to handle concurrent connection.
}
catch (NoSuchMethodError ex)
{
// Old version of WebMethods
}
final BrokerAdminClient adminClient = BrokerAdminClient.newOrReconnectAdmin(cfAdmin.getBrokerHost(), cfAdmin.getBrokerName(), "admin"
+ System.currentTimeMillis(), "admin", WMEAdminFactory.class.getName(), bcd);
return new WMEAdmin(hermes, adminClient);
}
catch (BrokerException e)