< prev index next >

src/java.management/share/classes/sun/management/ManagementFactoryHelper.java

Print this page




 328         @Override
 329         public String getParentLoggerName(String loggerName) {
 330             return loggingAccess.invoke("getParentLoggerName", loggerName);
 331         }
 332 
 333         private static PlatformLoggingImpl getInstance() {
 334             return new PlatformLoggingImpl(new LoggingMXBeanAccess());
 335          }
 336 
 337         static final PlatformLoggingMXBean MBEAN = getInstance();
 338     }
 339 
 340     private static List<BufferPoolMXBean> bufferPools = null;
 341     public static synchronized List<BufferPoolMXBean> getBufferPoolMXBeans() {
 342         if (bufferPools == null) {
 343             bufferPools = new ArrayList<>(2);
 344             bufferPools.add(createBufferPoolMXBean(SharedSecrets.getJavaNioAccess()
 345                 .getDirectBufferPool()));
 346             bufferPools.add(createBufferPoolMXBean(sun.nio.ch.FileChannelImpl
 347                 .getMappedBufferPool()));


 348         }
 349         return bufferPools;
 350     }
 351 
 352     private final static String BUFFER_POOL_MXBEAN_NAME = "java.nio:type=BufferPool";
 353 
 354     /**
 355      * Creates management interface for the given buffer pool.
 356      */
 357     private static BufferPoolMXBean
 358         createBufferPoolMXBean(final JavaNioAccess.BufferPool pool)
 359     {
 360         return new BufferPoolMXBean() {
 361             private volatile ObjectName objname;  // created lazily
 362             @Override
 363             public ObjectName getObjectName() {
 364                 ObjectName result = objname;
 365                 if (result == null) {
 366                     synchronized (this) {
 367                         result = objname;




 328         @Override
 329         public String getParentLoggerName(String loggerName) {
 330             return loggingAccess.invoke("getParentLoggerName", loggerName);
 331         }
 332 
 333         private static PlatformLoggingImpl getInstance() {
 334             return new PlatformLoggingImpl(new LoggingMXBeanAccess());
 335          }
 336 
 337         static final PlatformLoggingMXBean MBEAN = getInstance();
 338     }
 339 
 340     private static List<BufferPoolMXBean> bufferPools = null;
 341     public static synchronized List<BufferPoolMXBean> getBufferPoolMXBeans() {
 342         if (bufferPools == null) {
 343             bufferPools = new ArrayList<>(2);
 344             bufferPools.add(createBufferPoolMXBean(SharedSecrets.getJavaNioAccess()
 345                 .getDirectBufferPool()));
 346             bufferPools.add(createBufferPoolMXBean(sun.nio.ch.FileChannelImpl
 347                 .getMappedBufferPool()));
 348             bufferPools.add(createBufferPoolMXBean(sun.nio.ch.FileChannelImpl
 349                 .getPersistentMappedBufferPool()));
 350         }
 351         return bufferPools;
 352     }
 353 
 354     private final static String BUFFER_POOL_MXBEAN_NAME = "java.nio:type=BufferPool";
 355 
 356     /**
 357      * Creates management interface for the given buffer pool.
 358      */
 359     private static BufferPoolMXBean
 360         createBufferPoolMXBean(final JavaNioAccess.BufferPool pool)
 361     {
 362         return new BufferPoolMXBean() {
 363             private volatile ObjectName objname;  // created lazily
 364             @Override
 365             public ObjectName getObjectName() {
 366                 ObjectName result = objname;
 367                 if (result == null) {
 368                     synchronized (this) {
 369                         result = objname;


< prev index next >