Example usage for java.lang Boolean getBoolean

List of usage examples for java.lang Boolean getBoolean

Introduction

In this page you can find the example usage for java.lang Boolean getBoolean.

Prototype

public static boolean getBoolean(String name) 

Source Link

Document

Returns true if and only if the system property named by the argument exists and is equal to, ignoring case, the string "true" .

Usage

From source file:org.apache.geode.distributed.internal.InternalLocator.java

/**
 * Start peer location in this locator. If you plan on starting a distributed system later, this
 * method should be called first so that the distributed system can use this locator.
 * <p>/*from  w  ww. j a v  a2s  .  co m*/
 * TODO: parameter withDS is never used
 *
 * @param withDS true if a distributed system has been or will be started
 *
 * @since GemFire 5.7
 */
void startPeerLocation(boolean withDS) throws IOException {
    if (isPeerLocator()) {
        throw new IllegalStateException(LocalizedStrings.InternalLocator_PEER_LOCATION_IS_ALREADY_RUNNING_FOR_0
                .toLocalizedString(this));
    }
    logger.info(LocalizedMessage.create(LocalizedStrings.InternalLocator_STARTING_PEER_LOCATION_FOR_0, this));

    String locatorsProp = this.config.getLocators();

    // check for settings that would require only locators to hold the
    // coordinator - e.g., security and network-partition detection
    boolean locatorsAreCoordinators = false;
    boolean networkPartitionDetectionEnabled = this.config.getEnableNetworkPartitionDetection();
    String securityUDPDHAlgo = this.config.getSecurityUDPDHAlgo();
    if (networkPartitionDetectionEnabled) {
        locatorsAreCoordinators = true;
    } else {
        // check if security is enabled
        String prop = this.config.getSecurityPeerAuthInit();
        locatorsAreCoordinators = prop != null && !prop.isEmpty();
        if (!locatorsAreCoordinators) {
            locatorsAreCoordinators = Boolean.getBoolean(LOCATORS_PREFERRED_AS_COORDINATORS);
        }
    }

    this.locatorImpl = MemberFactory.newLocatorHandler(this.bindAddress, this.stateFile, locatorsProp,
            locatorsAreCoordinators, networkPartitionDetectionEnabled, this.stats, securityUDPDHAlgo);
    this.handler.addHandler(PeerLocatorRequest.class, this.locatorImpl);
    this.peerLocator = true;
    if (!this.server.isAlive()) {
        startTcpServer();
    }
}

From source file:org.jactr.core.runtime.controller.OldController.java

/**
 * override to provide ProfilingModelRunner if you'd like to track performance
 * stats/*from w  w w.  j a va 2  s  .co  m*/
 * 
 * @param model
 * @param service
 * @return
 */
protected Runnable createModelRunner(IModel model, ExecutorService service) {
    if (Boolean.getBoolean("jactr.profiling"))
        return new ProfilingModelRunner(service, model, new DefaultCycleProcessor6());

    return new DefaultModelRunner(service, model, new DefaultCycleProcessor6());
}

From source file:org.wso2.carbon.registry.extensions.handlers.ServiceMediaTypeHandler.java

public void setDisableWADLValidation(String disableWADLValidation) {
    this.disableWADLValidation = Boolean.getBoolean(disableWADLValidation);
}

From source file:org.kie.workbench.common.services.backend.compiler.external339.AFMavenCli.java

protected void repository(AFCliRequest cliRequest) throws Exception {
    if (cliRequest.getCommandLine().hasOption(CLIManager.LEGACY_LOCAL_REPOSITORY)
            || Boolean.getBoolean("maven.legacyLocalRepo")) {
        cliRequest.getRequest().setUseLegacyLocalRepository(true);
    }/*from   www.  j av  a2s.  c o m*/
}

From source file:org.hyperic.hq.measurement.server.session.DataManagerImpl.java

private void sendDataToEventHandlers(Collection<DataPoint> data) {
    ArrayList<MeasurementEvent> events = new ArrayList<MeasurementEvent>();
    List<MeasurementZevent> zevents = new ArrayList<MeasurementZevent>();

    boolean allEventsInteresting = Boolean.getBoolean(ALL_EVENTS_INTERESTING_PROP);

    for (DataPoint dp : data) {

        Integer metricId = dp.getMeasurementId();
        MetricValue val = dp.getMetricValue();
        MeasurementEvent event = new MeasurementEvent(metricId, val);

        if (registeredTriggers.isTriggerInterested(event) || allEventsInteresting) {
            measurementManager.buildMeasurementEvent(event);
            events.add(event);//from   w w  w . j  ava 2s  . co m
        }

        zevents.add(new MeasurementZevent(metricId.intValue(), val));
    }

    if (!events.isEmpty()) {
        messagePublisher.publishMessage(EventConstants.EVENTS_TOPIC, events);
    }

    if (!zevents.isEmpty()) {
        try {
            // XXX: Shouldn't this be a transactional queueing?
            zeventManager.enqueueEvents(zevents);
        } catch (InterruptedException e) {
            log.warn("Interrupted while sending events.  Some data may " + "be lost");
        }
    }
}

From source file:org.apache.hadoop.security.KDiag.java

/**
 * Set the System property to true; return the old value for caching.
 *
 * @param sysprop property/*w w w  .ja va2  s .  c  om*/
 * @return the previous value
 */
private boolean getAndSet(String sysprop) {
    boolean old = Boolean.getBoolean(sysprop);
    System.setProperty(sysprop, "true");
    return old;
}

From source file:org.openconcerto.sql.PropsConfiguration.java

public void setupLogging(final String dirName) {
    this.setupLogging(dirName, Boolean.getBoolean(REDIRECT_TO_FILE));
}

From source file:org.apache.ranger.service.XResourceService.java

/**
 * check group permission on path/* w  ww  . j  ava  2 s.c o m*/
 *
 * @param vxPermMap
 * @param pathList
 * @return
 */
public boolean checkGroupAccess(VXPermMap vxPermMap, List<String> pathList, Long assetId, int isRecursive,
        int assetType, List<Integer> resourceTypeList) {
    boolean isAccess = false;
    boolean isRecursivlyAllowed;
    for (int i = 0; i < pathList.size(); i++) {
        isAccess = false;
        isRecursivlyAllowed = false;
        HashMap<String, Object> accessMap = fetchGroupAccessMap(vxPermMap.getGroupId(), vxPermMap.getPermType(),
                pathList.get(i), assetType, assetId, isRecursive, resourceTypeList);
        isAccess = Boolean.getBoolean("" + accessMap.get("isAccess"));
        isRecursivlyAllowed = Boolean.getBoolean("" + accessMap.get("isRecursive"));
        if (isAccess && isRecursivlyAllowed) {
            return true;
        }
        if (!isAccess) {
            break;
        }

    }
    return isAccess;
}

From source file:com.ocs.dynamo.ui.composite.table.CustomTreeTable.java

/**
 * Indicates whether to use the thousands separator in edit fields
 * //from   www.ja v  a  2 s  .com
 * @return
 */
private boolean useThousandsGrouping() {
    return Boolean.getBoolean(DynamoConstants.SP_THOUSAND_GROUPING);
}

From source file:org.apache.geode.admin.jmx.internal.AgentImpl.java

/**
 * Adds a ShutdownHook to the Agent for cleaning up any resources
 *//*w w  w . j a v  a2s  .c  o  m*/
private void addShutdownHook() {
    if (!Boolean.getBoolean(
            org.apache.geode.distributed.internal.InternalDistributedSystem.DISABLE_SHUTDOWN_HOOK_PROPERTY)) {
        Runtime.getRuntime().addShutdownHook(shutdownHook);
    }
}