List of usage examples for java.lang Boolean getBoolean
public static boolean getBoolean(String name)
From source file:org.jboss.tools.project.examples.tests.ProjectTest.java
@BeforeClass public static void initRuntimes() throws Exception { hideCentral = Boolean.getBoolean(CENTRAL_PROP); System.setProperty(CENTRAL_PROP, "true"); ProjectExamplesTestUtil.initRuntimes(); }
From source file:org.mule.util.queue.DelegateQueueManager.java
public static boolean isOldModeEnabled() { return Boolean.getBoolean(MULE_QUEUE_OLD_MODE_KEY); }
From source file:org.apache.lucene.replicator.ReplicatorTestCase.java
/** * Returns a new {@link Server HTTP Server} instance. To obtain its port, use * {@link #serverPort(Server)}./* www . ja v a2 s .c om*/ */ public static synchronized Server newHttpServer(Handler handler) throws Exception { // if this property is true, then jetty will be configured to use SSL // leveraging the same system properties as java to specify // the keystore/truststore if they are set // // This means we will use the same truststore, keystore (and keys) for // the server as well as any client actions taken by this JVM in // talking to that server, but for the purposes of testing that should // be good enough final boolean useSsl = Boolean.getBoolean("tests.jettySsl"); final SslContextFactory sslcontext = new SslContextFactory(false); if (useSsl) { if (null != System.getProperty("javax.net.ssl.keyStore")) { sslcontext.setKeyStorePath(System.getProperty("javax.net.ssl.keyStore")); } if (null != System.getProperty("javax.net.ssl.keyStorePassword")) { sslcontext.setKeyStorePassword(System.getProperty("javax.net.ssl.keyStorePassword")); } if (null != System.getProperty("javax.net.ssl.trustStore")) { sslcontext.setKeyStorePath(System.getProperty("javax.net.ssl.trustStore")); } if (null != System.getProperty("javax.net.ssl.trustStorePassword")) { sslcontext.setTrustStorePassword(System.getProperty("javax.net.ssl.trustStorePassword")); } sslcontext.setNeedClientAuth(Boolean.getBoolean("tests.jettySsl.clientAuth")); } final QueuedThreadPool threadPool = new QueuedThreadPool(); threadPool.setDaemon(true); threadPool.setMaxThreads(10000); threadPool.setIdleTimeout(5000); threadPool.setStopTimeout(30000); Server server = new Server(threadPool); server.setStopAtShutdown(true); server.manage(threadPool); final ServerConnector connector; if (useSsl) { HttpConfiguration configuration = new HttpConfiguration(); configuration.setSecureScheme("https"); configuration.addCustomizer(new SecureRequestCustomizer()); ServerConnector c = new ServerConnector(server, new SslConnectionFactory(sslcontext, "http/1.1"), new HttpConnectionFactory(configuration)); connector = c; } else { ServerConnector c = new ServerConnector(server, new HttpConnectionFactory()); connector = c; } connector.setPort(0); connector.setHost("127.0.0.1"); server.setConnectors(new Connector[] { connector }); server.setSessionIdManager(new HashSessionIdManager(new Random(random().nextLong()))); server.setHandler(handler); server.start(); return server; }
From source file:org.apache.archiva.web.runtime.ArchivaRuntimeInfo.java
@Inject public ArchivaRuntimeInfo(@Named(value = "archivaRuntimeProperties") Properties archivaRuntimeProperties) { this.version = (String) archivaRuntimeProperties.get("archiva.version"); this.buildNumber = (String) archivaRuntimeProperties.get("archiva.buildNumber"); String archivaTimeStamp = (String) archivaRuntimeProperties.get("archiva.timestamp"); if (NumberUtils.isNumber(archivaTimeStamp)) { this.timestamp = NumberUtils.createLong(archivaTimeStamp); } else {//from w ww. java2s .c om this.timestamp = new Date().getTime(); } this.devMode = Boolean.getBoolean("archiva.devMode"); }
From source file:org.codehaus.groovy.grails.exceptions.DefaultStackTraceFilterer.java
public DefaultStackTraceFilterer() { this(!Boolean.getBoolean(SYS_PROP_DISPLAY_FULL_STACKTRACE)); }
From source file:com.ericsson.eiffel.remrem.publish.helper.PublishUtils.java
/** * Method returns the routing key from the messaging service based on the json event type. * @param msgService the Messaging service. * @param json the eiffel event//from www . ja v a 2 s .co m * @param userDomainSuffix is optional parameter, If user provide this it will add to the domainId. * @param tag is optional parameter, If user provide this it will add to the tag if routingKey is not specified by the user. * @param routingKey is optional parameter, If user provide this it will add to the routingKey otherwise generate routingKey based on message type. * @return routing key or returns "" if host, exchange and domainId not available. */ public static String getRoutingKey(MsgService msgService, JsonObject json, RMQHelper rmqHelper, String userDomainSuffix, String tag, String routingKey) { String protocol = msgService.getServiceName(); Boolean cliMode = Boolean.getBoolean(PropertiesConfig.CLI_MODE); RabbitMqProperties rabbitMqProperties = rmqHelper.rabbitMqPropertiesMap.get(protocol); String domainId = rabbitMqProperties.getDomainId(); if (rabbitMqProperties != null && rabbitMqProperties.getExchangeName() != null && rabbitMqProperties.getHost() != null && (cliMode || (!cliMode && StringUtils.isNotBlank(domainId)))) { return StringUtils.defaultIfBlank(routingKey, msgService.generateRoutingKey(json, tag, domainId, userDomainSuffix)); } return ""; }
From source file:com.adeptj.runtime.common.Environment.java
public static boolean useProvidedKeyStore() { return Boolean.getBoolean("use.provided.keyStore"); }
From source file:org.ejbca.extra.util.ExtraConfiguration.java
public static Configuration instance() { if (config == null) { try {//from w ww . j a v a 2 s.c o m // Default values build into war file, this is last prio used if no of the other sources override this boolean allowexternal = Boolean.getBoolean( new PropertiesConfiguration(ExtraConfiguration.class.getResource("/" + PROPERTY_FILENAME)) .getString(CONFIGALLOWEXTERNAL, "false")); config = new CompositeConfiguration(); PropertiesConfiguration pc; // Only add these config sources if we allow external configuration if (allowexternal) { // Override with system properties, this is prio 1 if it exists (java -Dscep.test=foo) config.addConfiguration(new SystemConfiguration()); log.info("Added system properties to configuration source (java -Dfoo.prop=bar)."); // Override with file in "application server home directory"/conf, this is prio 2 File f1 = new File("conf/" + PROPERTY_FILENAME); pc = new PropertiesConfiguration(f1); pc.setReloadingStrategy(new FileChangedReloadingStrategy()); config.addConfiguration(pc); log.info("Added file to configuration source: " + f1.getAbsolutePath()); // Override with file in "/etc/ejbca/conf/extra, this is prio 3 File f2 = new File("/etc/ejbca/conf/extra/" + PROPERTY_FILENAME); pc = new PropertiesConfiguration(f2); pc.setReloadingStrategy(new FileChangedReloadingStrategy()); config.addConfiguration(pc); log.info("Added file to configuration source: " + f2.getAbsolutePath()); } // Default values build into war file, this is last prio used if no of the other sources override this URL url = ExtraConfiguration.class.getResource("/" + PROPERTY_FILENAME); pc = new PropertiesConfiguration(url); config.addConfiguration(pc); log.info("Added url to configuration source: " + url); log.info("Allow external re-configuration: " + allowexternal); // Test log.debug("Using keystore path (1): " + config.getString(SCEPKEYSTOREPATH + ".1")); //log.debug("Using keystore pwd (1): "+config.getString(SCEPKEYSTOREPWD+".1")); //log.debug("Using authPwd: "+config.getString(SCEPAUTHPWD)); log.debug("Using certificate profile: " + config.getString(SCEPCERTPROFILEKEY)); log.debug("Using entity profile: " + config.getString(SCEPENTITYPROFILEKEY)); log.debug("Using default CA: " + config.getString(SCEPDEFAULTCA)); log.debug("Create or edit user: " + config.getBoolean(SCEPEDITUSER)); log.debug("Mapping for CN=Scep CA,O=EJBCA Sample,C=SE: " + config.getString("CN=Scep CA,O=EJBCA Sample,C=SE")); } catch (ConfigurationException e) { log.error("Error intializing ExtRA Configuration: ", e); } } return config; }
From source file:com.seajas.search.profiler.task.ArchiveInjectionTask.java
/** * {@inheritDoc}/*from ww w .j a va 2s .com*/ */ @Override public void inject(final String triggerName, final Long intervalTotal, final InjectionJobInterrupted interrupted) { // XXX: There is currently no such thing as an archive-queue based on the triggerName List<Archive> enabledArchives = profilerService.getEnabledArchives(); if (logger.isInfoEnabled()) logger.info("Starting archive injection under trigger '" + triggerName + "' (" + enabledArchives.size() + " archive" + (enabledArchives.size() != 1 ? "s" : "") + ")"); // We report on the number of feeds first, and then move on to potentially canceling the operation if (Boolean.getBoolean("profiler.indexing.disabled")) { if (logger.isInfoEnabled()) logger.info( "Indexing has been explicitly disabled using 'profiler.indexing.disabled=true'. Skipping injection."); return; } for (Archive archive : enabledArchives) { if (interrupted.isInterrupted()) { logger.warn("This job was interrupted - not continuing with archive injection"); break; } logger.warn( "TODO: Injecting archives is not yet supported within the new distributed architecture - skipping '" + archive.getName() + "'"); } logger.info("Finished archive injection for trigger '" + triggerName + "'"); }
From source file:org.copperengine.core.test.persistent.MySqlSpringTxnPersistentWorkflowTest.java
@Override protected boolean skipTests() { return Boolean.getBoolean(Constants.SKIP_EXTERNAL_DB_TESTS_KEY) || !dbmsAvailable; }