List of usage examples for java.util.logging Level FINEST
Level FINEST
To view the source code for java.util.logging Level FINEST.
Click Source Link
From source file:com.willwinder.universalgcodesender.model.GUIBackend.java
@Override public long getNumSentRows() { logger.log(Level.FINEST, "Getting number of sent rows."); return controller == null ? 0 : controller.rowsSent(); }
From source file:com.sun.grizzly.http.jk.common.ChannelSocket.java
/** * Read N bytes from the InputStream, and ensure we got them all * Under heavy load we could experience many fragmented packets * just read Unix Network Programming to recall that a call to * read didn't ensure you got all the data you want * * from read() Linux manual/*from w w w . j a va 2 s . c om*/ * * On success, the number of bytes read is returned (zero indicates end * of file),and the file position is advanced by this number. * It is not an error if this number is smaller than the number of bytes * requested; this may happen for example because fewer bytes * are actually available right now (maybe because we were close to * end-of-file, or because we are reading from a pipe, or from a * terminal), or because read() was interrupted by a signal. * On error, -1 is returned, and errno is set appropriately. In this * case it is left unspecified whether the file position (if any) changes. * **/ public int read(MsgContext ep, byte[] b, int offset, int len) throws IOException { InputStream is = (InputStream) ep.getNote(isNote); int pos = 0; int got; while (pos < len) { try { got = is.read(b, pos + offset, len - pos); } catch (SocketException sex) { if (pos > 0) { LoggerUtils.getLogger().log(Level.SEVERE, "Error reading data after " + pos + "bytes", sex); } else { LoggerUtils.getLogger().log(Level.FINEST, "Error reading data", sex); } got = -1; } // connection just closed by remote. if (got <= 0) { // This happens periodically, as apache restarts // periodically. // It should be more gracefull ! - another feature for Ajp14 // LoggerUtils.getLogger().log(Level.WARNING, "server has closed the current connection (-1)" ); return -3; } pos += got; } return pos; }
From source file:com.willwinder.universalgcodesender.model.GUIBackend.java
@Override public long getNumCompletedRows() { logger.log(Level.FINEST, "Getting number of completed rows."); return controller == null ? 0 : controller.rowsCompleted(); }
From source file:be.appfoundry.custom.google.android.gcm.server.Sender.java
private static void close(Closeable closeable) { if (closeable != null) { try {/*from w ww.j a v a 2 s. co m*/ closeable.close(); } catch (IOException e) { // ignore error logger.log(Level.FINEST, "IOException closing stream", e); } } }
From source file:com.granule.json.utils.internal.JSONObject.java
/** * Method to write aa standard attribute/subtag containing object * @param writer The writer object to render the XML to. * @param indentDepth How far to indent. * @param contentOnly Whether or not to write the object name as part of the output * @param compact Flag to denote whether or not to write the object in compact form. * @throws IOException Trhown if an error occurs on write. *///w ww .j ava 2 s.co m private void writeComplexObject(Writer writer, int indentDepth, boolean contentOnly, boolean compact) throws IOException { if (logger.isLoggable(Level.FINER)) logger.entering(className, "writeComplexObject(Writer, int, boolean, boolean)"); boolean wroteTagText = false; if (!contentOnly) { if (logger.isLoggable(Level.FINEST)) logger.logp(Level.FINEST, className, "writeComplexObject(Writer, int, boolean, boolean)", "Writing object: [" + this.objectName + "]"); if (!compact) { writeIndention(writer, indentDepth); } writer.write("\"" + this.objectName + "\""); if (!compact) { writer.write(" : {\n"); } else { writer.write(":{"); } } else { if (logger.isLoggable(Level.FINEST)) logger.logp(Level.FINEST, className, "writeObject(Writer, int, boolean, boolean)", "Writing object contents as an anonymous object (usually an array entry)"); if (!compact) { writeIndention(writer, indentDepth); writer.write("{\n"); } else { writer.write("{"); } } if (this.tagText != null && !this.tagText.equals("") && !this.tagText.trim().equals("")) { writeAttribute(writer, "content", this.tagText.trim(), indentDepth + 1, compact); wroteTagText = true; } if (this.attrs != null && !this.attrs.isEmpty() && wroteTagText) { if (!compact) { writer.write(",\n"); } else { writer.write(","); } } writeAttributes(writer, this.attrs, indentDepth, compact); if (!this.jsonObjects.isEmpty()) { if (this.attrs != null && (!this.attrs.isEmpty() || wroteTagText)) { if (!compact) { writer.write(",\n"); } else { writer.write(","); } } else { if (!compact) { writer.write("\n"); } } writeChildren(writer, indentDepth, compact); } else { if (!compact) { writer.write("\n"); } } if (!compact) { writeIndention(writer, indentDepth); writer.write("}\n"); //writer.write("\n"); } else { writer.write("}"); } if (logger.isLoggable(Level.FINER)) logger.exiting(className, "writeComplexObject(Writer, int, boolean, boolean)"); }
From source file:com.sun.grizzly.http.jk.common.ChannelSocket.java
/** Accept incoming connections, dispatch to the thread pool *///from w w w.ja v a 2 s . com void acceptConnections() { if (LoggerUtils.getLogger().isLoggable(Level.FINEST)) { LoggerUtils.getLogger().log(Level.FINEST, "Accepting ajp connections on " + port); } while (running) { try { MsgContext ep = createMsgContext(packetSize); ep.setSource(this); ep.setWorkerEnv(wEnv); this.accept(ep); if (!running) { break; } // Since this is a long-running connection, we don't care // about the small GC SocketConnection ajpConn = new SocketConnection(this, ep); tp.runIt(ajpConn); } catch (Exception ex) { if (running) { LoggerUtils.getLogger().log(Level.WARNING, "Exception executing accept", ex); } } } }
From source file:com.sun.grizzly.http.jk.server.JkMain.java
private void processModules() { Enumeration keys = props.keys(); int plen = 6; while (keys.hasMoreElements()) { String k = (String) keys.nextElement(); if (!k.startsWith("class.")) { continue; }/*from www. j a v a2s . co m*/ String name = k.substring(plen); String propValue = props.getProperty(k); if (LoggerUtils.getLogger().isLoggable(Level.FINEST)) { LoggerUtils.getLogger().log(Level.FINEST, "Register " + name + " " + propValue); } modules.put(name, propValue); } }
From source file:com.sun.grizzly.http.jk.common.ChannelNioSocket.java
/** * Read N bytes from the InputStream, and ensure we got them all * Under heavy load we could experience many fragmented packets * just read Unix Network Programming to recall that a call to * read didn't ensure you got all the data you want * * from read() Linux manual//from w w w . j ava 2 s. c o m * * On success, the number of bytes read is returned (zero indicates end * of file),and the file position is advanced by this number. * It is not an error if this number is smaller than the number of bytes * requested; this may happen for example because fewer bytes * are actually available right now (maybe because we were close to * end-of-file, or because we are reading from a pipe, or from a * terminal), or because read() was interrupted by a signal. * On error, -1 is returned, and errno is set appropriately. In this * case it is left unspecified whether the file position (if any) changes. * **/ public int read(MsgContext ep, byte[] b, int offset, int len) throws IOException { InputStream is = (InputStream) ep.getNote(isNote); int pos = 0; int got; while (pos < len) { try { got = is.read(b, pos + offset, len - pos); } catch (ClosedChannelException sex) { if (pos > 0) { LoggerUtils.getLogger().log(Level.WARNING, "Error reading data after " + pos + "bytes", sex); } else { LoggerUtils.getLogger().log(Level.FINEST, "Error reading data", sex); } got = -1; } if (LoggerUtils.getLogger().isLoggable(Level.FINE)) { LoggerUtils.getLogger().log(Level.FINE, "read() " + b + " " + (b == null ? 0 : b.length) + " " + offset + " " + len + " = " + got); } // connection just closed by remote. if (got <= 0) { // This happens periodically, as apache restarts // periodically. // It should be more gracefull ! - another feature for Ajp14 // LoggerUtils.getLogger().log(Level.WARNING, "server has closed the current connection (-1)" ); return -3; } pos += got; } return pos; }
From source file:org.apache.myfaces.ov2021.application.jsp.JspStateManagerImpl.java
@Override public void writeState(FacesContext facesContext, SerializedView serializedView) throws IOException { if (log.isLoggable(Level.FINEST)) log.finest("Entering writeState"); UIViewRoot uiViewRoot = facesContext.getViewRoot(); //save state in response (client) RenderKit renderKit = getRenderKitFactory().getRenderKit(facesContext, uiViewRoot.getRenderKitId()); ResponseStateManager responseStateManager = renderKit.getResponseStateManager(); if (isLegacyResponseStateManager(responseStateManager)) { responseStateManager.writeState(facesContext, serializedView); } else if (!isSavingStateInClient(facesContext)) { Object[] state = new Object[2]; state[JSF_SEQUENCE_INDEX] = Integer.toString(getNextViewSequence(facesContext), Character.MAX_RADIX); responseStateManager.writeState(facesContext, state); } else {/*from w w w.j a va2s. co m*/ Object[] state = new Object[2]; state[0] = serializedView.getStructure(); state[1] = serializedView.getState(); responseStateManager.writeState(facesContext, state); } if (log.isLoggable(Level.FINEST)) log.finest("Exiting writeState"); }
From source file:com.sun.grizzly.http.jk.common.ChannelSocket.java
/** Process a single ajp connection. *///w ww . j a v a2s. co m void processConnection(MsgContext ep) { try { MsgAjp recv = new MsgAjp(packetSize); while (running) { if (paused) { // Drop the connection on pause break; } int status = this.receive(recv, ep); if (status <= 0) { if (status == -3) { LoggerUtils.getLogger().log(Level.FINEST, "server has been restarted or reset this connection"); } else { LoggerUtils.getLogger().log(Level.WARNING, "Closing ajp connection " + status); } break; } ep.setLong(MsgContext.TIMER_RECEIVED, System.currentTimeMillis()); ep.setType(0); // Will call next status = this.invoke(recv, ep); if (status != JkHandler.OK) { LoggerUtils.getLogger().log(Level.WARNING, "processCallbacks status " + status); ep.action(ActionCode.ACTION_CLOSE, ep.getRequest().getResponse()); break; } } } catch (Exception ex) { String msg = ex.getMessage(); if (msg != null && msg.indexOf("Connection reset") >= 0) { LoggerUtils.getLogger().log(Level.FINEST, "Server has been restarted or reset this connection"); } else if (msg != null && msg.indexOf("Read timed out") >= 0) { LoggerUtils.getLogger().log(Level.FINEST, "connection timeout reached"); } else { LoggerUtils.getLogger().log(Level.SEVERE, "Error, processing connection", ex); } } finally { /* * Whatever happened to this connection (remote closed it, timeout, read error) * the socket SHOULD be closed, or we may be in situation where the webserver * will continue to think the socket is still open and will forward request * to tomcat without receiving ever a reply */ try { this.close(ep); } catch (Exception e) { LoggerUtils.getLogger().log(Level.SEVERE, "Error, closing connection", e); } try { Request req = (Request) ep.getRequest(); if (req != null) { ObjectName roname = (ObjectName) ep.getNote(JMXRequestNote); if (roname != null) { Registry.getRegistry(null, null).unregisterComponent(roname); } req.getRequestProcessor().setGlobalProcessor(null); } } catch (Exception ee) { LoggerUtils.getLogger().log(Level.SEVERE, "Error, releasing connection", ee); } } }