public RuntimeAPI getRuntimeAPI() { try { return AccessorUtil.lookup(AccessorUtil.RUNTIMEAPI_JNDINAME); } catch (NamingException e) { throw new BonitaRuntimeException(e); } }
public DefinitionAPI getDefinitionAPI() { try { return AccessorUtil.lookup(AccessorUtil.DEFINITIONAPI_JNDINAME); } catch (NamingException e) { throw new BonitaRuntimeException(e); } }
public ManagementAPI getManagementAPI() { try { return AccessorUtil.lookup(AccessorUtil.MANAGEMENT_JNDINAME); } catch (NamingException e) { throw new BonitaRuntimeException(e); } }
public QueryDefinitionAPI getQueryDefinitionAPI() { try { return AccessorUtil.lookup(AccessorUtil.QUERYDEFINITION_JNDINAME); } catch (NamingException e) { throw new BonitaRuntimeException(e); } }
public QueryRuntimeAPI getQueryRuntimeAPI() { try { return AccessorUtil.lookup(AccessorUtil.QUERYRUNTIME_JNDINAME); } catch (NamingException e) { throw new BonitaRuntimeException(e); } }
public static Context autoDetect() { if (Context.LOG.isLoggable(Level.INFO)) { Context.LOG.info("Can't get the api-type from the environment." + " I guess we are on the remote case. Launching auto detection algorithm."); } try { RuntimeAPI.class.cast(AccessorUtil.lookup(AccessorUtil.RUNTIMEAPI_JNDINAME)); if (Context.LOG.isLoggable(Level.INFO)) { Context.LOG.info(Context.EJB3 + " context found: EJB3 api-type will be used."); } return Context.EJB3; } catch (final NamingException ne) { if (Context.LOG.isLoggable(Level.INFO)) { Context.LOG.info("No context found: assuming J2SE. Standard api-type will be used." + " Note that this may not be what you want." + " In this case, either specify the api-type in the environment or via the property: " + AccessorUtil.API_TYPE_PROPERTY); } return Context.Standard; } catch (final ClassCastException cceEJB3) { return Context.EJB2; } }
public CommandAPI getCommandAPI() { CommandAPI ejbCommandAPI; try { ejbCommandAPI = AccessorUtil.lookup(AccessorUtil.COMMANDAPI_JNDINAME); } catch (NamingException e) { throw new BonitaRuntimeException(e); } return new EJBCommandAPIInterceptor(ejbCommandAPI); }
public ManagementAPI getManagementAPI() { if (managementAPI == null) { try { EJB2ManagementAPIHome managementAPIHome = (EJB2ManagementAPIHome) PortableRemoteObject.narrow( AccessorUtil.<Object>lookup(AccessorUtil.MANAGEMENT_JNDINAME), EJB2ManagementAPIHome.class); managementAPI = managementAPIHome.create(); } catch (RemoteException e) { throw new BonitaInternalException(e.getMessage(), e); } catch (CreateException e) { throw new BonitaInternalException(e.getMessage(), e); } catch (NamingException e) { throw new BonitaInternalException(e.getMessage(), e); } } Class<ManagementAPI> clazz = ManagementAPI.class; EJB2ClientAPIInterceptor apiInterceptor = new EJB2ClientAPIInterceptor(managementAPI); return (ManagementAPI) Proxy.newProxyInstance(APIAccessor.class.getClassLoader(), new Class[] {clazz}, apiInterceptor); }
public QueryRuntimeAPI getQueryRuntimeAPI() { if (queryRuntimeAPI == null) { try { EJB2QueryRuntimeAPIHome queryRuntimeAPIHome = (EJB2QueryRuntimeAPIHome) PortableRemoteObject.narrow( AccessorUtil.<Object>lookup(AccessorUtil.QUERYRUNTIME_JNDINAME), EJB2QueryRuntimeAPIHome.class); queryRuntimeAPI = queryRuntimeAPIHome.create(); } catch (RemoteException e) { throw new BonitaInternalException(e.getMessage(), e); } catch (CreateException e) { throw new BonitaInternalException(e.getMessage(), e); } catch (NamingException e) { throw new BonitaInternalException(e.getMessage(), e); } } Class<QueryRuntimeAPI> clazz = QueryRuntimeAPI.class; EJB2ClientAPIInterceptor apiInterceptor = new EJB2ClientAPIInterceptor(queryRuntimeAPI); return (QueryRuntimeAPI) Proxy.newProxyInstance(QueryAPIAccessor.class.getClassLoader(), new Class[] {clazz}, apiInterceptor); } }
public QueryDefinitionAPI getQueryDefinitionAPI() { if (queryDefinitionAPI == null) { try { EJB2QueryDefinitionAPIHome queryDefinitionHome = (EJB2QueryDefinitionAPIHome) PortableRemoteObject.narrow( AccessorUtil.<Object>lookup(AccessorUtil.QUERYDEFINITION_JNDINAME), EJB2QueryDefinitionAPIHome.class); queryDefinitionAPI = queryDefinitionHome.create(); } catch (RemoteException e) { throw new BonitaInternalException(e.getMessage(), e); } catch (CreateException e) { throw new BonitaInternalException(e.getMessage(), e); } catch (NamingException e) { throw new BonitaInternalException(e.getMessage(), e); } } Class<QueryDefinitionAPI> clazz = QueryDefinitionAPI.class; EJB2ClientAPIInterceptor apiInterceptor = new EJB2ClientAPIInterceptor(queryDefinitionAPI); return (QueryDefinitionAPI) Proxy.newProxyInstance(QueryAPIAccessor.class.getClassLoader(), new Class[] {clazz}, apiInterceptor); }
public DefinitionAPI getDefinitionAPI() { if (definitionAPI == null) { try { EJB2DefinitionAPIHome definitionAPIHome = (EJB2DefinitionAPIHome) PortableRemoteObject.narrow( AccessorUtil.<Object>lookup(AccessorUtil.DEFINITIONAPI_JNDINAME), EJB2DefinitionAPIHome.class); definitionAPI = definitionAPIHome.create(); } catch (RemoteException e) { throw new BonitaInternalException(e.getMessage(), e); } catch (CreateException e) { throw new BonitaInternalException(e.getMessage(), e); } catch (NamingException e) { throw new BonitaInternalException(e.getMessage(), e); } } Class<DefinitionAPI> clazz = DefinitionAPI.class; EJB2ClientAPIInterceptor apiInterceptor = new EJB2ClientAPIInterceptor(definitionAPI); return (DefinitionAPI) Proxy.newProxyInstance(APIAccessor.class.getClassLoader(), new Class[] {clazz}, apiInterceptor); }
public RuntimeAPI getRuntimeAPI() { if (runtimeAPI == null) { try { EJB2RuntimeAPIHome runtimeAPIHome = (EJB2RuntimeAPIHome) PortableRemoteObject.narrow( AccessorUtil.<Object>lookup(AccessorUtil.RUNTIMEAPI_JNDINAME), EJB2RuntimeAPIHome.class); runtimeAPI = runtimeAPIHome.create(); } catch (RemoteException e) { throw new BonitaInternalException(e.getMessage(), e); } catch (CreateException e) { throw new BonitaInternalException(e.getMessage(), e); } catch (NamingException e) { throw new BonitaInternalException(e.getMessage(), e); } } Class<RuntimeAPI> clazz = RuntimeAPI.class; EJB2ClientAPIInterceptor apiInterceptor = new EJB2ClientAPIInterceptor(runtimeAPI); return (RuntimeAPI) Proxy.newProxyInstance(APIAccessor.class.getClassLoader(), new Class[] {clazz}, apiInterceptor); }
public CommandAPI getCommandAPI() { if (commandAPI == null) { try { EJB2CommandAPIHome commandAPIHome = (EJB2CommandAPIHome) PortableRemoteObject.narrow( AccessorUtil.<Object>lookup(AccessorUtil.COMMANDAPI_JNDINAME), EJB2CommandAPIHome.class); commandAPI = commandAPIHome.create(); } catch (RemoteException e) { throw new BonitaInternalException(e.getMessage(), e); } catch (CreateException e) { throw new BonitaInternalException(e.getMessage(), e); } catch (NamingException e) { throw new BonitaInternalException(e.getMessage(), e); } } Class<CommandAPI> clazz = CommandAPI.class; EJB2ClientAPIInterceptor apiInterceptor = new EJB2ClientAPIInterceptor(commandAPI); CommandAPI ejbCommandAPI = (CommandAPI) Proxy.newProxyInstance(APIAccessor.class.getClassLoader(), new Class[] {clazz}, apiInterceptor); return new EJBCommandAPIInterceptor(ejbCommandAPI); }