Example usage for java.util.logging Level FINEST

List of usage examples for java.util.logging Level FINEST

Introduction

In this page you can find the example usage for java.util.logging Level FINEST.

Prototype

Level FINEST

To view the source code for java.util.logging Level FINEST.

Click Source Link

Document

FINEST indicates a highly detailed tracing message.

Usage

From source file:com.willwinder.universalgcodesender.model.GUIBackend.java

@Override
public boolean isConnected() {
    boolean isConnected = this.controller != null && this.controller.isCommOpen();
    logger.log(Level.FINEST, "Is connected: {0}", isConnected);
    return isConnected;
}

From source file:com.sun.grizzly.http.jk.common.ChannelUn.java

/** Accept incoming connections, dispatch to the thread pool
 *///from w w  w  . ja  v a  2s  .  c om
void acceptConnections() {
    if (apr == null) {
        return;
    }

    if (LoggerUtils.getLogger().isLoggable(Level.FINEST)) {
        LoggerUtils.getLogger().log(Level.FINEST, "Accepting ajp connections on " + file);
    }

    while (running) {
        try {
            MsgContext ep = this.createMsgContext();

            // blocking - opening a server connection.
            int status = this.open(ep);
            if (status != 0 && status != 2) {
                LoggerUtils.getLogger().log(Level.SEVERE, "Error acceptin connection on " + file);
                break;
            }

            //    if( LoggerUtils.getLogger().isLoggable(Level.FINEST) )
            //     LoggerUtils.getLogger().log(Level.FINEST,"Accepted ajp connections ");

            AprConnection ajpConn = new AprConnection(this, ep);
            tp.runIt(ajpConn);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
}

From source file:com.ibm.team.build.internal.hjplugin.util.Helper.java

private static String getValueFromParametersAction(Run<?, ?> build, String key) {
    LOGGER.finest("Helper.getValueFromParametersAction : Begin"); //$NON-NLS-1$
    String value = null;//from   w w  w.  j a va  2  s .c om
    for (ParametersAction paction : build.getActions(ParametersAction.class)) {
        List<ParameterValue> pValues = paction.getParameters();
        if (pValues == null) {
            continue;
        }
        for (ParameterValue pv : pValues) {
            if (pv instanceof StringParameterValue && pv.getName().equals(key)) {
                value = Util.fixEmptyAndTrim((String) pv.getValue());
                if (value != null) {
                    break;
                }
            }
        }
        if (value != null) {
            break;
        }
    }
    if (LOGGER.isLoggable(Level.FINEST)) {
        if (value == null) {
            LOGGER.finest("Helper.getValueFromParametersAction : Unable to find a value for key : " + key); //$NON-NLS-1$
        } else {
            LOGGER.finest("Helper.getValueFromParametersAction : Found value : " + value + " for key : " + key); //$NON-NLS-1$//$NON-NLS-2$
        }
    }
    return value;
}

From source file:com.sun.grizzly.http.jk.common.ChannelNioSocket.java

public void setMaxThreads(int i) {
    if (LoggerUtils.getLogger().isLoggable(Level.FINEST)) {
        LoggerUtils.getLogger().log(Level.FINEST, "Setting maxThreads " + i);
    }//from ww w . j  a  v a2  s.  c  om
    tp.setMaxThreads(i);
}

From source file:Peer.java

/**
 * Construct a peers finger table using getSuccessor.
 *//*  ww  w. j  av a  2s .co m*/
public void constructFingerTable(int mbits) {
    lg.log(Level.FINEST, "constructFingerTable entry");
    // clear the current finger table

    ft.clear();
    try {
        // For each mbit ...
        for (int i = 1; i <= mbits; i++) {
            // make a new finger entry 
            FingerEntry fe = new FingerEntry();

            // Calculate (nodeid+2^(i-1))%max_key
            Key fingerid = new Key().add(nodeid).add(new Key(BigInteger.valueOf((int) Math.pow(2, i - 1))))
                    .mod(new Key(BigInteger.valueOf((int) Math.pow(2, mbits))));
            // Adding a new finger entry
            fe.setId(fingerid);
            lg.log(Level.FINER, "Peer " + nodeid + " Initiating getSuccessor on key " + fingerid);
            fe.setNodeId(getSuccessor(fingerid));
            ft.addFingerEntry(fe);
        }

    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    lg.log(Level.FINEST, "constructFingerTable exit");

}

From source file:LineageSimulator.java

public static void main(String[] args) {
    Options options = new Options();
    // commands/*from   w w  w. j ava2 s .c  o m*/
    //options.addOption("simulate", false, "Simulate lineage trees");
    //options.addOption("sample", false, "Sample from the simulated trees");
    //options.addOption("evaluate", false, "Evaluate trees");

    // tree simulation
    options.addOption("t", "nTrees", true, "Number of trees to simulate (default: 100)");
    options.addOption("i", "nIter", true, "Number of tree growth iterations (default: 50)");
    options.addOption("snv", "probSNV", true,
            "Per node probablity of generating a descendant cell population with an acquired SNV during a tree growth iteration (default: 0.15)");
    options.addOption("cnv", "probCNV", true,
            "Per node probablity of generating a descendant cell population with an acquired CNV during a tree growth iteration (default: 0.02)");
    options.addOption("probDeath", true,
            "Probablity of a cell population death in each tree growth iteration (default: 0.06)");
    options.addOption("maxPopulationSize", true, "Max size of a cell population (default: 1000000)");
    options.addOption("minNodes", true,
            "Minimum number of undead cell population nodes in a valid tree, tree growth will continue beyond the defined number of iterations until this value is reached (default: 10)");
    options.addOption("maxNodes", true,
            "Maximum number of undead cell population nodes in a tree, tree growth will stop after the iteration in which this value is reached/first surpassed (default: 1000)");

    // sampling
    Option samplesOption = new Option("s", "nSamples", true,
            "Number of samples to collect, accepts multiple values, e.g. 5 10 15 (default: 5)");
    samplesOption.setArgs(Option.UNLIMITED_VALUES);
    options.addOption(samplesOption);
    Option covOption = new Option("c", "coverage", true,
            "Simulated coverage to generate the VAFs, accepts multiple values, e.g. 500 1000 (default: 1000)");
    covOption.setArgs(Option.UNLIMITED_VALUES);
    options.addOption(covOption);
    options.addOption("maxSubclones", true, "Max number of subclones per sample (default: 5)");
    options.addOption("sampleSize", true, "Number of cells per sample (default: 100000)");
    options.addOption("e", true, "Sequencing error (default: 0.001)");
    options.addOption("minNC", true,
            "Minimum percentage of normal contamination per sample; the percentage will be randomly generated from the range [minNC maxNC] for each sample (default: 0)");
    options.addOption("maxNC", true,
            "Maximum percentage of normal contamination per sample; if maxNC < minNC, maxNC will be automatically set to minNC; the percentage will be randomly generated from the range [minNC maxNC] for each sample (default: 20)");
    //options.addOption("localized", false, "Enable localized sampling (default: random sampling)");
    //options.addOption("mixSubclone", false, "With localized sampling, add an additional subclone from a different subtree to each sample; by default, the sample is localized to a single disjoint subtree");

    // input/output/display
    options.addOption("dir", "outputDir", true,
            "Directory where the output files should be created [required]");
    options.addOption("dot", false, "Produce DOT files for the simulated trees");
    options.addOption("sdot", "sampledDot", false,
            "Produce DOT files for the simulated trees with indicated samples");
    options.addOption("sampleProfile", false,
            "Output VAF file includes an additional column with the binary sample profile for each SNV");

    // other
    options.addOption("v", "verbose", false, "Verbose mode");
    options.addOption("h", "help", false, "Print usage");

    // display order
    ArrayList<Option> optionsList = new ArrayList<Option>();
    optionsList.add(options.getOption("dir"));
    optionsList.add(options.getOption("t"));
    optionsList.add(options.getOption("i"));
    optionsList.add(options.getOption("snv"));
    optionsList.add(options.getOption("cnv"));
    optionsList.add(options.getOption("probDeath"));
    optionsList.add(options.getOption("maxPopulationSize"));
    optionsList.add(options.getOption("minNodes"));
    optionsList.add(options.getOption("maxNodes"));
    optionsList.add(options.getOption("s"));
    optionsList.add(options.getOption("c"));
    optionsList.add(options.getOption("maxSubclones"));
    optionsList.add(options.getOption("sampleSize"));
    optionsList.add(options.getOption("e"));
    optionsList.add(options.getOption("minNC"));
    optionsList.add(options.getOption("maxNC"));
    optionsList.add(options.getOption("dot"));
    optionsList.add(options.getOption("sdot"));
    optionsList.add(options.getOption("sampleProfile"));
    optionsList.add(options.getOption("v"));
    optionsList.add(options.getOption("h"));

    CommandLineParser parser = new BasicParser();
    CommandLine cmdLine = null;
    HelpFormatter hf = new HelpFormatter();
    hf.setOptionComparator(new OptionComarator<Option>(optionsList));
    try {
        cmdLine = parser.parse(options, args);
    } catch (ParseException e) {
        System.err.println(e.getMessage());
        hf.printHelp(PROG_NAME, options);
        System.exit(-1);
    }
    Args params = new Args();
    if (cmdLine.hasOption("dir")) {
        params.simPath = cmdLine.getOptionValue("dir") + "/" + SIMULATION_DATA_DIR;
    } else {
        System.err.println("Required parameter: output directory path [-dir]");
        hf.printHelp(PROG_NAME, options);
        System.exit(-1);
    }
    if (cmdLine.hasOption("t")) {
        Parameters.NUM_TREES = Integer.parseInt(cmdLine.getOptionValue("t"));
    }
    if (cmdLine.hasOption("i")) {
        Parameters.NUM_ITERATIONS = Integer.parseInt(cmdLine.getOptionValue("i"));
    }
    if (cmdLine.hasOption("snv")) {
        Parameters.PROB_SNV = Double.parseDouble(cmdLine.getOptionValue("snv"));
    }
    if (cmdLine.hasOption("cnv")) {
        Parameters.PROB_CNV = Double.parseDouble(cmdLine.getOptionValue("cnv"));
    }
    if (cmdLine.hasOption("probDeath")) {
        Parameters.PROB_DEATH = Double.parseDouble(cmdLine.getOptionValue("probDeath"));
    }
    if (cmdLine.hasOption("maxPopulationSize")) {
        Parameters.MAX_POPULATION_SIZE = Integer.parseInt(cmdLine.getOptionValue("maxPopulationSize"));
    }
    if (cmdLine.hasOption("minNodes")) {
        Parameters.MIN_NUM_NODES = Integer.parseInt(cmdLine.getOptionValue("minNodes"));
        if (Parameters.MIN_NUM_NODES < 1) {
            System.err.println("Minimum number of nodes [-minNodes] must be at least 1");
            System.exit(-1);
        }
    }
    if (cmdLine.hasOption("maxNodes")) {
        Parameters.MAX_NUM_NODES = Integer.parseInt(cmdLine.getOptionValue("maxNodes"));
        if (Parameters.MAX_NUM_NODES < 1 || Parameters.MAX_NUM_NODES < Parameters.MIN_NUM_NODES) {
            System.err.println(
                    "Maximum number of nodes [-maxNodes] must be at least 1 and not less than [-minNodes]");
            System.exit(-1);
        }
    }
    if (cmdLine.hasOption("s")) {
        String[] samples = cmdLine.getOptionValues("s");
        Parameters.NUM_SAMPLES_ARRAY = new int[samples.length];
        for (int i = 0; i < samples.length; i++) {
            Parameters.NUM_SAMPLES_ARRAY[i] = Integer.parseInt(samples[i]);
        }
    }
    if (cmdLine.hasOption("c")) {
        String[] cov = cmdLine.getOptionValues("c");
        Parameters.COVERAGE_ARRAY = new int[cov.length];
        for (int i = 0; i < cov.length; i++) {
            Parameters.COVERAGE_ARRAY[i] = Integer.parseInt(cov[i]);
        }
    }
    if (cmdLine.hasOption("maxSubclones")) {
        Parameters.MAX_NUM_SUBCLONES = Integer.parseInt(cmdLine.getOptionValue("maxSubclones"));
    }
    if (cmdLine.hasOption("sampleSize")) {
        Parameters.NUM_CELLS_PER_SAMPLE = Integer.parseInt(cmdLine.getOptionValue("sampleSize"));
    }
    if (cmdLine.hasOption("e")) {
        Parameters.SEQUENCING_ERROR = Double.parseDouble(cmdLine.getOptionValue("e"));
    }
    if (cmdLine.hasOption("minNC")) {
        Parameters.MIN_PERCENT_NORMAL_CONTAMINATION = Double.parseDouble(cmdLine.getOptionValue("minNC"));
    }
    if (cmdLine.hasOption("maxNC")) {
        Parameters.MAX_PERCENT_NORMAL_CONTAMINATION = Double.parseDouble(cmdLine.getOptionValue("maxNC"));
    }
    if (Parameters.MAX_PERCENT_NORMAL_CONTAMINATION < Parameters.MIN_PERCENT_NORMAL_CONTAMINATION) {
        Parameters.MAX_PERCENT_NORMAL_CONTAMINATION = Parameters.MIN_PERCENT_NORMAL_CONTAMINATION;
    }

    /*if(cmdLine.hasOption("localized")) {
       Parameters.LOCALIZED_SAMPLING = true;
    }
    if(cmdLine.hasOption("mixSubclone")) {
       Parameters.MIX_NBR_SUBTREE_SUBCLONE = true;
    }*/

    if (cmdLine.hasOption("dot")) {
        params.generateDOT = true;
    }
    if (cmdLine.hasOption("sampledDot")) {
        params.generateSampledDOT = true;
    }
    if (cmdLine.hasOption("sampleProfile")) {
        params.outputSampleProfile = true;
    }
    if (cmdLine.hasOption("h")) {
        new HelpFormatter().printHelp(" ", options);
    }
    // logger
    ConsoleHandler h = new ConsoleHandler();
    h.setFormatter(new LogFormatter());
    h.setLevel(Level.INFO);
    logger.setLevel(Level.INFO);
    if (cmdLine.hasOption("v")) {
        h.setLevel(Level.FINEST);
        logger.setLevel(Level.FINEST);
    }
    logger.addHandler(h);
    logger.setUseParentHandlers(false);

    // validate settings
    if (Parameters.PROB_SNV + Parameters.PROB_CNV + Parameters.PROB_DEATH > 1) {
        System.err.println("The sum of SSNV, CNV, and cell death probabilities cannot exceed 1");
        hf.printHelp(PROG_NAME, options);
        System.exit(-1);
    }
    simulateLineageTrees(params);
}

From source file:com.funambol.tools.test.PostWBXMLSyncML.java

private void compare(String msgFile) throws IOException, Sync4jException, TestFailedException {
    File responseFile = new File(responseDir, msgFile);
    File referenceFile = new File(referenceDir, msgFile);

    //build reference/response from XML strings, NOT from the files (which contain WBXML)
    String responseXml = WBXMLConverter.readWbxmlAsXml(responseFile);
    String referenceXml = WBXMLConverter.readWbxmlAsXml(referenceFile);

    StringReader responseReader = new StringReader(responseXml);
    StringReader referenceReader = new StringReader(referenceXml);

    SAXBuilder sb = new SAXBuilder();
    sb.setFactory(new DomFactory());

    try {/*from ww w  . j  a  v  a  2 s.  c o m*/
        Document response = sb.build(responseReader);
        Document reference = sb.build(referenceReader);

        OtaUpdate update = new OtaUpdate(false);

        UniqueId id = new UniqueId("SyncMLTest", msgFile);
        Element diffs = update.generateDiffs(response.getRootElement(), reference.getRootElement(), id);

        if (log.isLoggable(Level.FINEST)) {
            saveDiffs(diffs, new File(errorDir, msgFile + ".dbg"));
        }

        if (checkDiffs(diffs)) {
            saveDiffs(diffs, new File(errorDir, msgFile));

            throw new TestFailedException(
                    "Test failed on " + msgFile + ". Diff file saved in " + new File(errorDir, msgFile));
        }
    } catch (JDOMException e) {
        IOTools.writeFile(e.getMessage(), new File(errorDir, msgFile));
        throw new TestFailedException("Test failed on " + msgFile + ": " + e.getMessage()
                + ". Error message saved in " + new File(errorDir, msgFile));
    }
}

From source file:fedroot.dacs.swingdemo.DacsSwingDemo.java

/**
 * Loads contents of the input stream in a separate thread.
 * @param is input stream to be rendered as HTML
 *///from   w  w  w .ja v  a2  s .  c  o m
private void loadPage(final String contenttype, final String url) {
    // create a new thread to load the URL from
    final StringBuffer stringBuffer = new StringBuffer();
    new Thread() {

        @Override
        public void run() {
            {
                InputStream inputStream = null;
                try {
                    inputStream = sessionManager.getInputStream(url);
                    Reader reader = new InputStreamReader(new BufferedInputStream(inputStream));
                    int character;
                    while ((character = reader.read()) != -1) {
                        stringBuffer.append((char) character);
                    }
                    inputStream.close();
                    if (inputStream != null) {
                        SwingUtilities.invokeLater(new Runnable() {

                            @Override
                            public void run() {
                                setDocumentContent(contenttype, stringBuffer.toString());
                            }
                        });
                    }
                } catch (DacsException ex) { // note: we EXPECT DacsExceptions
                    logger.log(Level.FINEST, ex.getMessage());
                } catch (IOException ex) {
                    logger.log(Level.SEVERE, ex.getMessage());
                } finally {
                    setDocumentContent(contenttype, stringBuffer.toString());
                    try {
                        if (inputStream != null) {
                            inputStream.close();
                        }
                    } catch (IOException ex) {
                        Logger.getLogger(DacsSwingDemo.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }
        }
    }.start();
}

From source file:com.socrata.Dataset.java

/**
 * Update an existing column name, description or rdfProperties.
 * Pass in null for properties you would like to leave untouched.
 * @param columnId//  w  w  w.j a va 2 s  .  com
 * @param name
 * @param description
 * @param rdfProperties
 * @return updated column properties or null if error
 */
public JSONObject updateColumn(int columnId, String name, String description, String rdfProperties) {
    if (!attached()) {
        return null;
    }

    log(Level.FINEST, "Updating column " + Integer.toString(columnId));

    JSONObject columnJson = new JSONObject();
    try {
        if (name != null) {
            columnJson.put("name", name);
        }

        if (description != null) {
            columnJson.put("description", description);
        }

        if (rdfProperties != null) {
            columnJson.put("rdfProperties", rdfProperties);
        }
    } catch (JSONException ex) {
        log(Level.SEVERE, "Could not create column JSON data for updateColumn()", ex);
    }

    HttpPut request = new HttpPut(
            httpBase() + "/views/" + id() + "/columns/" + Integer.toString(columnId) + ".json");

    try {
        request.setEntity(new StringEntity(columnJson.toString()));
    } catch (UnsupportedEncodingException ex) {
        log(Level.SEVERE, "Could not encode column data in Dataset.addColumn().", ex);
        return null;
    }

    JsonPayload response = performRequest(request);
    if (isErroneous(response)) {
        log(Level.SEVERE, "Error in column update, see logs", null);
        return null;
    }

    if (response.getObject() == null) {
        log(Level.SEVERE, "Received empty response from server on Dataset.updateColumn().", null);
        return null;
    }

    return response.getObject();
}

From source file:com.globallogic.push_service_poc.demo.sender.Sender.java

/**
 * Sends a message to many devices, retrying in case of unavailability.
 *
 * <p>//from w  ww  .  j av  a2  s. com
 * <strong>Note: </strong> this method uses exponential back-off to retry in
 * case of service unavailability and hence could block the calling thread
 * for many seconds.
 *
 * @param message
 *            message to be sent.
 * @param regIds
 *            registration id of the devices that will receive the message.
 * @param retries
 *            number of retries in case of service unavailability errors.
 *
 * @return combined result of all requests made.
 *
 * @throws IllegalArgumentException
 *             if registrationIds is {@literal null} or empty.
 * @throws InvalidRequestException
 *             if GCM didn't returned a 200 or 503 status.
 * @throws java.io.IOException
 *             if message could not be sent.
 */
public MulticastResult send(Message message, List<String> regIds, int retries) throws IOException {
    int attempt = 0;
    MulticastResult multicastResult;
    int backoff = BACKOFF_INITIAL_DELAY;
    // Map of results by registration id, it will be updated after each
    // attempt
    // to send the messages
    Map<String, Result> results = new HashMap<String, Result>();
    List<String> unsentRegIds = new ArrayList<String>(regIds);
    boolean tryAgain;
    List<Long> multicastIds = new ArrayList<Long>();
    do {
        multicastResult = null;
        attempt++;
        if (logger.isLoggable(Level.FINE)) {
            logger.fine("Attempt #" + attempt + " to send message " + message + " to regIds " + unsentRegIds);
        }
        try {
            multicastResult = sendNoRetry(message, unsentRegIds);
        } catch (IOException e) {
            // no need for WARNING since exception might be already logged
            logger.log(Level.FINEST, "IOException on attempt " + attempt, e);
        }
        if (multicastResult != null) {
            long multicastId = multicastResult.getMulticastId();
            logger.fine("multicast_id on attempt # " + attempt + ": " + multicastId);
            multicastIds.add(multicastId);
            unsentRegIds = updateStatus(unsentRegIds, results, multicastResult);
            tryAgain = !unsentRegIds.isEmpty() && attempt <= retries;
        } else {
            tryAgain = attempt <= retries;
        }
        if (tryAgain) {
            int sleepTime = backoff / 2 + random.nextInt(backoff);
            sleep(sleepTime);
            if (2 * backoff < MAX_BACKOFF_DELAY) {
                backoff *= 2;
            }
        }
    } while (tryAgain);
    if (multicastIds.isEmpty()) {
        // all JSON posts failed due to GCM unavailability
        throw new IOException("Could not post JSON requests to GCM after " + attempt + " attempts");
    }
    // calculate summary
    int success = 0, failure = 0, canonicalIds = 0;
    for (Result result : results.values()) {
        if (result.getMessageId() != null) {
            success++;
            if (result.getCanonicalRegistrationId() != null) {
                canonicalIds++;
            }
        } else {
            failure++;
        }
    }
    // build a new object with the overall result
    long multicastId = multicastIds.remove(0);
    MulticastResult.Builder builder = new MulticastResult.Builder(success, failure, canonicalIds, multicastId)
            .retryMulticastIds(multicastIds);
    // add results, in the same order as the input
    for (String regId : regIds) {
        Result result = results.get(regId);
        builder.addResult(result);
    }
    return builder.build();
}