static Context findContext() { String apiType = System.getProperty(AccessorUtil.API_TYPE_PROPERTY); if (apiType == null) { if (AccessorUtil.LOG.isLoggable(Level.INFO)) { AccessorUtil.LOG.info("Property: " + AccessorUtil.API_TYPE_PROPERTY + " has not been specified for api-type." + " Possible values are: " + Arrays.asList(Context.values()) + ". Using default value: " + Context.AutoDetect); } apiType = Context.AutoDetect.toString(); } final Context result = Misc.stringToEnum(Context.class, apiType); if (!result.equals(Context.AutoDetect)) { if (AccessorUtil.LOG.isLoggable(Level.INFO)) { AccessorUtil.LOG.info("API-Type: " + result + " has been specified through property: " + AccessorUtil.API_TYPE_PROPERTY); } return result; } return AccessorUtil.autoDetectContext(); }
private static Context autoDetectContext() { if (AccessorUtil.LOG.isLoggable(Level.INFO)) { AccessorUtil.LOG.info("Auto detecting api-type."); } try { if (AccessorUtil.LOG.isLoggable(Level.INFO)) { AccessorUtil.LOG.info("Looking into environment the specified api-type."); } final Context result = Context.getFromEnvironment(); if (AccessorUtil.LOG.isLoggable(Level.INFO)) { AccessorUtil.LOG.info("API-Type: " + result + " has been taken from the environment." + " (Note that the api-type can be set to: " + Context.AutoDetect + " in the environment. So this api-type may be the output of the autodetecting algorithm)." + " Increase " + Context.class.getName() + " logging level to " + Level.FINER + " for details."); } return result; } catch (final EnvironmentNotFoundException iee) { return Context.autoDetect(); } }
public void setAPIType(final Context context) { this.apiTypeXml = "<api " + " type='" + context.name() + "' />"; }
private boolean isREST() { final String apiType = System.getProperty(BonitaConstants.API_TYPE_PROPERTY); return apiType != null && apiType.equalsIgnoreCase(Context.REST.toString()); }
Context.LOG.fine("No api-type specified in the environment! Launching the Automatic Context Detection Algorithm."); context = Context.autoDetect(); } else { final String apiTypeString = apiConfig.getContextType(); Context.LOG.fine("API-Type: " + context + " specified in environment."); if (context.equals(Context.AutoDetect)) { if (Context.LOG.isLoggable(Level.FINE)) { Context.LOG.fine("Launching the Automatic Context Detection Algorithm."); context = Context.autoDetect(); + Arrays.asList(Context.values()));
private boolean isREST() { final String apiType = System.getProperty(BonitaConstants.API_TYPE_PROPERTY); return apiType != null && apiType.equalsIgnoreCase(Context.REST.toString()); }
Environment.Variable var = new Environment.Variable(); var.setKey(BonitaConstants.API_TYPE_PROPERTY); var.setValue(Misc.stringToEnum(Context.class, apitype).toString()); java.addSysproperty(var);
Environment.Variable var = new Environment.Variable(); var.setKey(BonitaConstants.API_TYPE_PROPERTY); var.setValue(Misc.stringToEnum(Context.class, apitype).toString()); java.addSysproperty(var);