protected CommandAPI getAPI() { Authentication.setUserId(ctx.getCallerPrincipal().getName()); AccessorUtil.setContext(Context.Standard); if (commandAPI == null) { commandAPI = new StandardAPIAccessorImpl().getCommandAPI(); } return commandAPI; }
protected DefinitionAPI getAPI() { Authentication.setUserId(ctx.getCallerPrincipal().getName()); AccessorUtil.setContext(Context.Standard); if (definitionAPI == null) { definitionAPI = new StandardAPIAccessorImpl().getDefinitionAPI(); } return definitionAPI; } public void ejbCreate() {
protected QueryRuntimeAPI getAPI() { Authentication.setUserId(ctx.getCallerPrincipal().getName()); // IMPORTANT Note: see AccessorUtil.setContext() AccessorUtil.setContext(Context.Standard); if (queryRuntimeAPI == null) { queryRuntimeAPI = new StandardAPIAccessorImpl().getQueryRuntimeAPI(); } return queryRuntimeAPI; }
protected ManagementAPI getAPI() { Authentication.setUserId(ctx.getCallerPrincipal().getName()); AccessorUtil.setContext(Context.Standard); if (managementAPI == null) { managementAPI = new StandardAPIAccessorImpl().getManagementAPI(); } return managementAPI; }
protected RuntimeAPI getAPI() { Authentication.setUserId(ctx.getCallerPrincipal().getName()); AccessorUtil.setContext(Context.Standard); if (runtimeAPI == null) { runtimeAPI = new StandardAPIAccessorImpl().getRuntimeAPI(); } return runtimeAPI; }
protected QueryDefinitionAPI getAPI() { Authentication.setUserId(ctx.getCallerPrincipal().getName()); // We set the Context of the AccessorUtil to Standard // since we are in the engine core! // Therefore, hooks get executed properly when they call // AccessorUtil.getWhateverAccessor(); // Note that the Context in the APIInterceptor remains unchanged // (hence we have two contexts). The one in the APIInterceptor is used // to fetch the caller id. Note that in the case of EJB2 (this case), // the caller id has been set manually (see previous instruction). AccessorUtil.setContext(Context.Standard); if (queryDefinitionAPI == null) { queryDefinitionAPI = new StandardAPIAccessorImpl().getQueryDefinitionAPI(); } return queryDefinitionAPI; }