Categories:
Audio (13)
Biotech (29)
Bytecode (35)
Database (77)
Framework (7)
Game (7)
General (512)
Graphics (53)
I/O (32)
IDE (2)
JAR Tools (86)
JavaBeans (16)
JDBC (89)
JDK (337)
JSP (20)
Logging (103)
Mail (54)
Messaging (8)
Network (71)
PDF (94)
Report (7)
Scripting (83)
Security (32)
Server (119)
Servlet (17)
SOAP (24)
Testing (50)
Web (19)
XML (301)
Other Resources:
Jackson Core Source Code
Jackson is "the Java JSON library" or "the best JSON parser for Java". Or simply as "JSON for Java".
Jackson Core Source Code files are provided in the source packge (jackson-core-2.12.4-sources.jar). You can download it at Jackson Maven Website.
You can also browse Jackson Core Source Code below:
✍: FYIcenter.com
⏎ com/fasterxml/jackson/core/util/BufferRecyclers.java
package com.fasterxml.jackson.core.util; import java.lang.ref.SoftReference; /** * Helper entity used to control access to simple buffer recyling scheme used for * some encoding, decoding tasks. * * @see BufferRecycler * * @since 2.9.2 */ public class BufferRecyclers { /** * System property that is checked to see if recycled buffers (see {@link BufferRecycler}) * should be tracked, for purpose of forcing release of all such buffers, typically * during major classloading. * * @since 2.9.6 */ public final static String SYSTEM_PROPERTY_TRACK_REUSABLE_BUFFERS = "com.fasterxml.jackson.core.util.BufferRecyclers.trackReusableBuffers"; /* /********************************************************** /* Life-cycle /********************************************************** */ /** * Flag that indicates whether {@link BufferRecycler} instances should be tracked. */ private final static ThreadLocalBufferManager _bufferRecyclerTracker; static { boolean trackReusableBuffers = false; try { trackReusableBuffers = "true".equals(System.getProperty(SYSTEM_PROPERTY_TRACK_REUSABLE_BUFFERS)); } catch (SecurityException e) { } _bufferRecyclerTracker = trackReusableBuffers ? ThreadLocalBufferManager.instance() : null; } /* /********************************************************** /* BufferRecyclers for parsers, generators /********************************************************** */ /** * This <code>ThreadLocal</code> contains a {@link java.lang.ref.SoftReference} * to a {@link BufferRecycler} used to provide a low-cost * buffer recycling between reader and writer instances. */ final protected static ThreadLocal<SoftReference<BufferRecycler>> _recyclerRef = new ThreadLocal<SoftReference<BufferRecycler>>(); /** * Main accessor to call for accessing possibly recycled {@link BufferRecycler} instance. * * @return {@link BufferRecycler} to use */ public static BufferRecycler getBufferRecycler() { SoftReference<BufferRecycler> ref = _recyclerRef.get(); BufferRecycler br = (ref == null) ? null : ref.get(); if (br == null) { br = new BufferRecycler(); if (_bufferRecyclerTracker != null) { ref = _bufferRecyclerTracker.wrapAndTrack(br); } else { ref = new SoftReference<BufferRecycler>(br); } _recyclerRef.set(ref); } return br; } /** * Specialized method that will release all recycled {@link BufferRecycler} if * (and only if) recycler tracking has been enabled * (see {@link #SYSTEM_PROPERTY_TRACK_REUSABLE_BUFFERS}). * This method is usually called on shutdown of the container like Application Server * to ensure that no references are reachable via {@link ThreadLocal}s as this may cause * unintentional retention of sizable amounts of memory. It may also be called regularly * if GC for some reason does not clear up {@link SoftReference}s aggressively enough. * * @return Number of buffers released, if tracking enabled (zero or more); -1 if tracking not enabled. * * @since 2.9.6 */ public static int releaseBuffers() { if (_bufferRecyclerTracker != null) { return _bufferRecyclerTracker.releaseBuffers(); } return -1; } }
⏎ com/fasterxml/jackson/core/util/BufferRecyclers.java
Â
⇒ Download and Install Jackson Binary Package
⇠What Is Jackson
⇑ Downloading and Reviewing jackson-*.jar
⇑⇑ Jackson - Java JSON library
2016-02-03, 29617👍, 1💬
Popular Posts:
JDK 11 java.xml.jmod is the JMOD file for JDK 11 XML (eXtensible Markup Language) module. JDK 11 XML...
JDK 11 java.security.jgss.jmod is the JMOD file for JDK 11 Security JGSS (Java Generic Security Serv...
What Is js.jar in Rhino JavaScript 1.7R5? js.jar in Rhino JavaScript 1.7R5 is the JAR file for Rhino...
What Is log4j-1.2.15.jar? I got the JAR file from apache-log4j-1.2.15.zip. log4j-1.2.15.jar is the v...
Woodstox, Release 3.2.8 is a high-performance validating namespace-aware StAX-compliant (JSR-173) Op...