} catch (final Throwable t1) {
try {
tmp = Class.forName("org.apache.openejb.resource.activemq.ActiveMQ4Factory");
brokerPrefix = "amq4factory:";
} catch (final Throwable t2) {
throw new OpenEJBRuntimeException("Unable to load ActiveMQFactory: Check ActiveMQ jar files are on classpath", t1);
}
}
final Class clazz = tmp;
try {
instance = clazz.newInstance();
} catch (final InstantiationException e) {
throw new OpenEJBRuntimeException("Unable to create ActiveMQFactory instance", e);
} catch (final IllegalAccessException e) {
throw new OpenEJBRuntimeException("Unable to access ActiveMQFactory instance", e);
}
try {
setThreadProperties = clazz.getDeclaredMethod("setThreadProperties", new Class[]{Properties.class});
} catch (final NoSuchMethodException e) {
throw new OpenEJBRuntimeException("Unable to create ActiveMQFactory setThreadProperties method", e);
}
try {
createBroker = clazz.getDeclaredMethod("createBroker", new Class[]{URI.class});
} catch (final NoSuchMethodException e) {
throw new OpenEJBRuntimeException("Unable to create ActiveMQFactory createBroker method", e);
}
try {
getBrokers = clazz.getDeclaredMethod("getBrokers", (Class[]) null);
} catch (final NoSuchMethodException e) {
throw new OpenEJBRuntimeException("Unable to create ActiveMQFactory createBroker method", e);
}
}
}
}