List of usage examples for java.lang Boolean getBoolean
public static boolean getBoolean(String name)
From source file:io.cloudslang.worker.management.services.WorkerRecoveryManagerImpl.java
public void doRecovery() { try {/* w w w . j av a 2 s . c om*/ boolean toRestart = Boolean.getBoolean("cloudslang.worker.restart.on.recovery"); //If we are configured to restart on recovery - do shutdown if (toRestart) { logger.warn( "Worker is configured to restart on recovery and since internal recovery is needed the process is exiting..."); System.exit(EXIT_STATUS); } synchronized (this) { //If already in recovery - then return and do nothing if (inRecovery) { return; } inRecovery = true; } syncManager.startRecovery(); logger.warn("Worker internal recovery started"); for (WorkerRecoveryListener listener : listeners) { try { listener.doRecovery(); } catch (Exception ex) { logger.error("Failed on worker internal recovery", ex); } } if (logger.isDebugEnabled()) logger.debug("Listeners recovery is done"); retryTemplate.retry(RetryTemplate.INFINITELY, 30 * 1000L, new RetryTemplate.RetryCallback() { @Override public void tryOnce() { if (logger.isDebugEnabled()) logger.debug("sending worker UP"); String newWrv = workerNodeService.up(System.getProperty("worker.uuid"), workerVersionService.getWorkerVersion(), workerVersionService.getWorkerVersionId()); setWRV(newWrv); if (logger.isDebugEnabled()) logger.debug("the worker is UP"); } }); inRecovery = false; logger.warn("Worker recovery is done"); } finally { syncManager.finishRecovery(); } }
From source file:org.apache.geode.internal.process.ProcessControllerFactory.java
public ProcessControllerFactory() { this.disableAttachApi = Boolean.getBoolean(PROPERTY_DISABLE_ATTACH_API); }
From source file:com.twinsoft.convertigo.engine.util.CookiesUtils.java
public static void addCookie(HttpState httpState, String cook) { String name = ""; String domain = ""; String path = ""; String value = ""; boolean secure = false; Date expires = new Date(Long.MAX_VALUE); String[] fields = cook.split(";"); for (int i = 0; i < fields.length; i++) { String[] half = fields[i].trim().split("="); if (half.length == 2) { if (fields[i].startsWith("$")) { if (half[0].equals("$Domain")) domain = half[1];//from www. ja v a2 s . com else if (half[0].equals("$Path")) path = half[1]; else if (half[0].equals("$Secure")) secure = Boolean.getBoolean(half[1]); else if (half[0].equals("$Date")) try { expires = DateFormat.getDateTimeInstance().parse(half[1]); } catch (ParseException e) { } } else { name = half[0]; value = half[1]; } } } Cookie cookie = null; try { cookie = new Cookie(domain, name, value, path, expires, secure); if (cookie != null) httpState.addCookie(cookie); } catch (Exception e) { Engine.logBeans.debug("(CookiesUtils) failed to parse cookie: " + cook); } }
From source file:com.servoy.j2db.util.Debug.java
@SuppressWarnings("nls") public static void init() { try {//from ww w . j av a2 s .c om System.setProperty("org.apache.commons.logging.simplelog.showdatetime", "true"); System.setProperty("org.apache.commons.logging.simplelog.dateTimeFormat", "yyyy-MM-dd HH:mm"); System.setProperty("org.apache.commons.logging.simplelog.defaultlog", "warn"); boolean st = false; try { st = Boolean.getBoolean("STACKTRACE"); //$NON-NLS-1$ } catch (Exception ex) { //ignore } boolean STACKTRACE = st; if (STACKTRACE) System.setProperty("org.apache.commons.logging.simplelog.defaultlog", "info"); boolean t = false; try { if (STACKTRACE) { t = true; } else { t = Boolean.getBoolean("TRACE"); //$NON-NLS-1$ } } catch (Exception ex) { //ignore } boolean TRACE = t; if (TRACE) System.setProperty("org.apache.commons.logging.simplelog.defaultlog", "trace"); log = LoggerFactory.getLogger(Debug.class); trace = log.isTraceEnabled(); } catch (Throwable t) { System.err.println("Error initializing Debug log class"); t.printStackTrace(); } }
From source file:com.netflix.conductor.server.ConductorConfig.java
@Override public boolean disableAsyncWorkers() { String disable = getProperty("conductor.disable.async.workers", "false"); return Boolean.getBoolean(disable); }
From source file:gov.vha.isaac.ochre.api.LookupService.java
/** * @return the {@link ServiceLocator} that is managing this ISAAC instance */// w ww. ja v a 2 s . c om public static ServiceLocator get() { if (looker == null) { synchronized (lock) { if (looker == null) { if (GraphicsEnvironment.isHeadless()) { log.info("Installing headless toolkit"); HeadlessToolkit.installToolkit(); } PlatformImpl.startup(() -> { // No need to do anything here }); ArrayList<String> packagesToSearch = new ArrayList<>( Arrays.asList("gov.va", "gov.vha", "org.ihtsdo", "org.glassfish")); boolean readInhabitantFiles = Boolean .getBoolean(System.getProperty(Constants.READ_INHABITANT_FILES, "false")); if (System.getProperty(Constants.EXTRA_PACKAGES_TO_SEARCH) != null) { String[] extraPackagesToSearch = System.getProperty(Constants.EXTRA_PACKAGES_TO_SEARCH) .split(";"); packagesToSearch.addAll(Arrays.asList(extraPackagesToSearch)); } try { String[] packages = packagesToSearch.toArray(new String[] {}); log.info("Looking for HK2 annotations " + (readInhabitantFiles ? "from inhabitant files" : "skipping inhabitant files") + "; and scanning in the packages: " + Arrays.toString(packages)); looker = HK2RuntimeInitializer.init("ISAAC", readInhabitantFiles, packages); log.info("HK2 initialized. Identifed " + looker.getAllServiceHandles((criteria) -> { return true; }).size() + " services"); } catch (Exception e) { throw new RuntimeException(e); } } } } return looker; }
From source file:com.assignmentone.Asta4DSampleServlet.java
@Override protected WebApplicationConfiguration createConfiguration() { WebApplicationConfiguration conf = super.createConfiguration(); conf.getPageInterceptorList().add(new SamplePageInterceptor()); DefaultSnippetInvoker snippetInvoker = ((DefaultSnippetInvoker) conf.getSnippetInvoker()); snippetInvoker.getSnippetInterceptorList().add(new SampleSnippetInterceptor()); boolean debug = Boolean.getBoolean("asta4d.sample.debug"); if (debug) {// www .ja v a 2s. c o m conf.setCacheEnable(false); conf.setSaveCallstackInfoOnRendererCreation(true); } return conf; }
From source file:org.apache.stratos.aws.extension.AWSExtensionContext.java
private AWSExtensionContext() { this.cepStatsPublisherEnabled = Boolean.getBoolean(Constants.CEP_STATS_PUBLISHER_ENABLED); this.thriftReceiverIp = System.getProperty(Constants.THRIFT_RECEIVER_IP); this.thriftReceiverPort = System.getProperty(Constants.THRIFT_RECEIVER_PORT); this.networkPartitionId = System.getProperty(Constants.NETWORK_PARTITION_ID); this.clusterId = System.getProperty(Constants.CLUSTER_ID); this.serviceName = System.getProperty(Constants.SERVICE_NAME); this.terminateLBsOnExtensionStop = Boolean.getBoolean(Constants.TERMINATE_LBS_ON_EXTENSION_STOP); this.terminateLBOnClusterRemoval = Boolean.getBoolean(Constants.TERMINATE_LB_ON_CLUSTER_REMOVAL); this.operatingInVPC = Boolean.getBoolean(Constants.OPERATIMG_IN_VPC); this.enableCrossZoneLoadBalancing = Boolean.getBoolean(Constants.ENABLE_CROSS_ZONE_LOADBALANCING); if (log.isDebugEnabled()) { log.debug(Constants.CEP_STATS_PUBLISHER_ENABLED + " = " + cepStatsPublisherEnabled); log.debug(Constants.THRIFT_RECEIVER_IP + " = " + thriftReceiverIp); log.debug(Constants.THRIFT_RECEIVER_PORT + " = " + thriftReceiverPort); log.debug(Constants.NETWORK_PARTITION_ID + " = " + networkPartitionId); log.debug(Constants.CLUSTER_ID + " = " + clusterId); log.debug(Constants.TERMINATE_LBS_ON_EXTENSION_STOP + "=" + terminateLBsOnExtensionStop); log.debug(Constants.TERMINATE_LB_ON_CLUSTER_REMOVAL + "=" + terminateLBOnClusterRemoval); log.debug(Constants.OPERATIMG_IN_VPC + "=" + operatingInVPC); log.debug(Constants.ENABLE_CROSS_ZONE_LOADBALANCING + "=" + enableCrossZoneLoadBalancing); }// www . j av a 2 s . c om }
From source file:org.apache.jackrabbit.webdav.simple.LitmusTest.java
public void testLitmus() throws Exception { File dir = new File("target", "litmus"); String litmus = System.getProperty("litmus", "litmus"); if (Boolean.getBoolean("jackrabbit.test.integration") && isLitmusAvailable(litmus)) { final Repository repository = JcrUtils .getRepository("jcr-jackrabbit://" + Text.escapePath(dir.getCanonicalPath())); Session session = repository.login(); // for the TransientRepository try {//www .ja va 2 s .c o m SocketConnector connector = new SocketConnector(); connector.setHost("localhost"); connector.setPort(Integer.getInteger("litmus.port", 0)); Server server = new Server(); server.addConnector(connector); ServletHolder holder = new ServletHolder(new SimpleWebdavServlet() { @Override public Repository getRepository() { return repository; } }); holder.setInitParameter("resource-config", "/config.xml"); Context context = new Context(server, "/"); context.setResourceBase("src/test/resources"); context.addServlet(holder, "/*"); server.addHandler(context); server.start(); try { int port = connector.getLocalPort(); String url = "http://localhost:" + port + "/default"; ProcessBuilder builder = new ProcessBuilder(litmus, url, "admin", "admin"); builder.directory(dir); builder.redirectErrorStream(); assertLitmus(builder, "basic", 0); assertLitmus(builder, "http", 0); assertLitmus(builder, "props", 0); // FIXME: JCR-2637: WebDAV shallow copy test failure assertLitmus(builder, "copymove", 1); // FIXME: JCR-2638: Litmus locks test failures assertLitmus(builder, "locks", 1); } finally { server.stop(); } } finally { session.logout(); } } }
From source file:com.redapesolutions.syncnow.SyncNow.java
@Override public void initialize(CordovaInterface cordova, CordovaWebView webView) { int resId = cordova.getActivity().getResources().getIdentifier(mLicenseKey, "string", cordova.getActivity().getPackageName()); int mNumIdentifierBitsId = cordova.getActivity().getResources().getIdentifier(mNumIdentifierBitsKey, "string", cordova.getActivity().getPackageName()); int mNumTimeStampBitsId = cordova.getActivity().getResources().getIdentifier(mNumTimeStampBitsKey, "string", cordova.getActivity().getPackageName()); int mTimeStampLoopId = cordova.getActivity().getResources().getIdentifier(mTimeStampLoopKey, "string", cordova.getActivity().getPackageName()); String license = cordova.getActivity().getString(resId); int mNumIdentifierBits = Integer.getInteger(cordova.getActivity().getString(mNumIdentifierBitsId), 4); int mNumTimeStampBits = Integer.getInteger(cordova.getActivity().getString(mNumTimeStampBitsId), 4); boolean mTimeStampLoop = Boolean.getBoolean(cordova.getActivity().getString(mTimeStampLoopId)); syncNow = new SyncNowPlugin(license, mNumIdentifierBits, mNumTimeStampBits, mTimeStampLoop); super.initialize(cordova, webView); }