private RemoteRuntimeEngineFactory buildRemoteRuntimeEngineFactory() {
RemoteRuntimeEngineFactory factory = null;
ClassLoader loader = getLoader();
RemoteModel remoteModel = getModel().getManifest().getRemote();
if (remoteModel instanceof RemoteJmsModel) {
RemoteJmsRuntimeEngineFactoryBuilder builder = RemoteJmsRuntimeEngineFactory.newBuilder();
InitialContext ctx = configRemoteJms(builder, (RemoteJmsModel)remoteModel, loader);
try {
factory = builder.build();
} finally {
if (ctx != null) {
try {
ctx.close();
} catch (Exception e) {
e.getMessage(); // ignore but keep checkstyle happy
}
}
}
} else if (remoteModel instanceof RemoteRestModel) {
RemoteRestRuntimeEngineFactoryBuilder builder = RemoteRestRuntimeEngineFactory.newBuilder();
configRemoteRest(builder, (RemoteRestModel)remoteModel, loader);
factory = builder.build();
}
return factory;
}