throw new Exception("Resource Adapter selected doesn't support Inflow");
}
ActiveInboundResourceAdapter rar = (ActiveInboundResourceAdapter) activeRar;
//the resource adapter this MDB client is deployed to
ResourceAdapter ra = rar.getResourceAdapter();
ConnectorDescriptor desc = rar.getDescriptor();
String msgListenerType = getDescriptor().getMessageListenerType();
if (msgListenerType == null || "".equals(msgListenerType))
msgListenerType = "javax.jms.MessageListener";
Iterator i =
desc.getInboundResourceAdapter().getMessageListeners().iterator();
MessageListener msgListener = null;
while (i.hasNext()) {
msgListener = (MessageListener) i.next();
if (msgListenerType.equals(msgListener.getMessageListenerType()))
break;
}
String activationSpecClassName = null;
if (msgListener != null) {
activationSpecClassName = msgListener.getActivationSpecClass();
}
if (activationSpecClassName != null) {
if (logger.isLoggable(Level.FINEST)) {
String msg =
"ActivationSpecClassName = " + activationSpecClassName;
logger.log(Level.FINEST, msg);
}
try {
ClassLoader cl = rar.getClassLoader();
Class aClass = cl.loadClass(activationSpecClassName);
if (logger.isLoggable(Level.FINEST)) {
logger.log(Level.FINEST, "classloader = "
+ aClass.getClassLoader());
logger.log(Level.FINEST, "classloader parent = "
+ aClass.getClassLoader().getParent());
}
ActivationSpec activationSpec =
(ActivationSpec) aClass.newInstance();
Set props = RARUtils.getMergedActivationConfigProperties(getDescriptor());
AccessController.doPrivileged
(new SetMethodAction(activationSpec, props));
activationSpec.setResourceAdapter(ra);
//GF issue -3462 DIRECT mode MDB does not connect to remote broker when addresslist is overridden
//Need to set properties after the setResourceAdapter method is called
AccessController.doPrivileged
(new SetMethodAction(activationSpec, props));
/*
AccessController.doPrivileged(new PrivilegedAction() {
public java.lang.Object run() {
activationSpec.setResourceAdapter(ra);
return null;
}
});
*/
boolean validate =
"true".equals(System.getProperty("validate.jms.ra"));
if (validate) {
try {
activationSpec.validate();
} catch (Exception ex) {
logger.log(Level.SEVERE,
"endpointfactory.as_validate_Failed", ex);
}
}
myState=BLOCKED;
ra.endpointActivation(this, activationSpec);
rar.addEndpointFactoryInfo(beanID_,
new MessageEndpointFactoryInfo(this, activationSpec));