com.sun.corba.se.spi.monitoring.MonitoringFactories Java Examples

The following examples show how to use com.sun.corba.se.spi.monitoring.MonitoringFactories. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WorkQueueImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private void initializeMonitoring() {
    workqueueMonitoredObject = MonitoringFactories.
                        getMonitoredObjectFactory().
                        createMonitoredObject(name,
                        MonitoringConstants.WORKQUEUE_MONITORING_DESCRIPTION);

    LongMonitoredAttributeBase b1 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_TOTAL_WORK_ITEMS_ADDED,
                MonitoringConstants.WORKQUEUE_TOTAL_WORK_ITEMS_ADDED_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.totalWorkItemsAdded());
            }
        };
    workqueueMonitoredObject.addAttribute(b1);
    LongMonitoredAttributeBase b2 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_WORK_ITEMS_IN_QUEUE,
                MonitoringConstants.WORKQUEUE_WORK_ITEMS_IN_QUEUE_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.workItemsInQueue());
            }
        };
    workqueueMonitoredObject.addAttribute(b2);
    LongMonitoredAttributeBase b3 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_AVERAGE_TIME_IN_QUEUE,
                MonitoringConstants.WORKQUEUE_AVERAGE_TIME_IN_QUEUE_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.averageTimeInQueue());
            }
        };
    workqueueMonitoredObject.addAttribute(b3);
}
 
Example #2
Source File: WorkQueueImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
private void initializeMonitoring() {
    workqueueMonitoredObject = MonitoringFactories.
                        getMonitoredObjectFactory().
                        createMonitoredObject(name,
                        MonitoringConstants.WORKQUEUE_MONITORING_DESCRIPTION);

    LongMonitoredAttributeBase b1 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_TOTAL_WORK_ITEMS_ADDED,
                MonitoringConstants.WORKQUEUE_TOTAL_WORK_ITEMS_ADDED_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.totalWorkItemsAdded());
            }
        };
    workqueueMonitoredObject.addAttribute(b1);
    LongMonitoredAttributeBase b2 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_WORK_ITEMS_IN_QUEUE,
                MonitoringConstants.WORKQUEUE_WORK_ITEMS_IN_QUEUE_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.workItemsInQueue());
            }
        };
    workqueueMonitoredObject.addAttribute(b2);
    LongMonitoredAttributeBase b3 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_AVERAGE_TIME_IN_QUEUE,
                MonitoringConstants.WORKQUEUE_AVERAGE_TIME_IN_QUEUE_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.averageTimeInQueue());
            }
        };
    workqueueMonitoredObject.addAttribute(b3);
}
 
Example #3
Source File: WorkQueueImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private void initializeMonitoring() {
    workqueueMonitoredObject = MonitoringFactories.
                        getMonitoredObjectFactory().
                        createMonitoredObject(name,
                        MonitoringConstants.WORKQUEUE_MONITORING_DESCRIPTION);

    LongMonitoredAttributeBase b1 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_TOTAL_WORK_ITEMS_ADDED,
                MonitoringConstants.WORKQUEUE_TOTAL_WORK_ITEMS_ADDED_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.totalWorkItemsAdded());
            }
        };
    workqueueMonitoredObject.addAttribute(b1);
    LongMonitoredAttributeBase b2 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_WORK_ITEMS_IN_QUEUE,
                MonitoringConstants.WORKQUEUE_WORK_ITEMS_IN_QUEUE_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.workItemsInQueue());
            }
        };
    workqueueMonitoredObject.addAttribute(b2);
    LongMonitoredAttributeBase b3 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_AVERAGE_TIME_IN_QUEUE,
                MonitoringConstants.WORKQUEUE_AVERAGE_TIME_IN_QUEUE_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.averageTimeInQueue());
            }
        };
    workqueueMonitoredObject.addAttribute(b3);
}
 
Example #4
Source File: WorkQueueImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private void initializeMonitoring() {
    workqueueMonitoredObject = MonitoringFactories.
                        getMonitoredObjectFactory().
                        createMonitoredObject(name,
                        MonitoringConstants.WORKQUEUE_MONITORING_DESCRIPTION);

    LongMonitoredAttributeBase b1 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_TOTAL_WORK_ITEMS_ADDED,
                MonitoringConstants.WORKQUEUE_TOTAL_WORK_ITEMS_ADDED_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.totalWorkItemsAdded());
            }
        };
    workqueueMonitoredObject.addAttribute(b1);
    LongMonitoredAttributeBase b2 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_WORK_ITEMS_IN_QUEUE,
                MonitoringConstants.WORKQUEUE_WORK_ITEMS_IN_QUEUE_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.workItemsInQueue());
            }
        };
    workqueueMonitoredObject.addAttribute(b2);
    LongMonitoredAttributeBase b3 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_AVERAGE_TIME_IN_QUEUE,
                MonitoringConstants.WORKQUEUE_AVERAGE_TIME_IN_QUEUE_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.averageTimeInQueue());
            }
        };
    workqueueMonitoredObject.addAttribute(b3);
}
 
Example #5
Source File: WorkQueueImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private void initializeMonitoring() {
    workqueueMonitoredObject = MonitoringFactories.
                        getMonitoredObjectFactory().
                        createMonitoredObject(name,
                        MonitoringConstants.WORKQUEUE_MONITORING_DESCRIPTION);

    LongMonitoredAttributeBase b1 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_TOTAL_WORK_ITEMS_ADDED,
                MonitoringConstants.WORKQUEUE_TOTAL_WORK_ITEMS_ADDED_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.totalWorkItemsAdded());
            }
        };
    workqueueMonitoredObject.addAttribute(b1);
    LongMonitoredAttributeBase b2 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_WORK_ITEMS_IN_QUEUE,
                MonitoringConstants.WORKQUEUE_WORK_ITEMS_IN_QUEUE_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.workItemsInQueue());
            }
        };
    workqueueMonitoredObject.addAttribute(b2);
    LongMonitoredAttributeBase b3 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_AVERAGE_TIME_IN_QUEUE,
                MonitoringConstants.WORKQUEUE_AVERAGE_TIME_IN_QUEUE_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.averageTimeInQueue());
            }
        };
    workqueueMonitoredObject.addAttribute(b3);
}
 
Example #6
Source File: WorkQueueImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private void initializeMonitoring() {
    workqueueMonitoredObject = MonitoringFactories.
                        getMonitoredObjectFactory().
                        createMonitoredObject(name,
                        MonitoringConstants.WORKQUEUE_MONITORING_DESCRIPTION);

    LongMonitoredAttributeBase b1 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_TOTAL_WORK_ITEMS_ADDED,
                MonitoringConstants.WORKQUEUE_TOTAL_WORK_ITEMS_ADDED_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.totalWorkItemsAdded());
            }
        };
    workqueueMonitoredObject.addAttribute(b1);
    LongMonitoredAttributeBase b2 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_WORK_ITEMS_IN_QUEUE,
                MonitoringConstants.WORKQUEUE_WORK_ITEMS_IN_QUEUE_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.workItemsInQueue());
            }
        };
    workqueueMonitoredObject.addAttribute(b2);
    LongMonitoredAttributeBase b3 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_AVERAGE_TIME_IN_QUEUE,
                MonitoringConstants.WORKQUEUE_AVERAGE_TIME_IN_QUEUE_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.averageTimeInQueue());
            }
        };
    workqueueMonitoredObject.addAttribute(b3);
}
 
Example #7
Source File: WorkQueueImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private void initializeMonitoring() {
    workqueueMonitoredObject = MonitoringFactories.
                        getMonitoredObjectFactory().
                        createMonitoredObject(name,
                        MonitoringConstants.WORKQUEUE_MONITORING_DESCRIPTION);

    LongMonitoredAttributeBase b1 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_TOTAL_WORK_ITEMS_ADDED,
                MonitoringConstants.WORKQUEUE_TOTAL_WORK_ITEMS_ADDED_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.totalWorkItemsAdded());
            }
        };
    workqueueMonitoredObject.addAttribute(b1);
    LongMonitoredAttributeBase b2 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_WORK_ITEMS_IN_QUEUE,
                MonitoringConstants.WORKQUEUE_WORK_ITEMS_IN_QUEUE_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.workItemsInQueue());
            }
        };
    workqueueMonitoredObject.addAttribute(b2);
    LongMonitoredAttributeBase b3 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_AVERAGE_TIME_IN_QUEUE,
                MonitoringConstants.WORKQUEUE_AVERAGE_TIME_IN_QUEUE_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.averageTimeInQueue());
            }
        };
    workqueueMonitoredObject.addAttribute(b3);
}
 
Example #8
Source File: WorkQueueImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
private void initializeMonitoring() {
    workqueueMonitoredObject = MonitoringFactories.
                        getMonitoredObjectFactory().
                        createMonitoredObject(name,
                        MonitoringConstants.WORKQUEUE_MONITORING_DESCRIPTION);

    LongMonitoredAttributeBase b1 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_TOTAL_WORK_ITEMS_ADDED,
                MonitoringConstants.WORKQUEUE_TOTAL_WORK_ITEMS_ADDED_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.totalWorkItemsAdded());
            }
        };
    workqueueMonitoredObject.addAttribute(b1);
    LongMonitoredAttributeBase b2 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_WORK_ITEMS_IN_QUEUE,
                MonitoringConstants.WORKQUEUE_WORK_ITEMS_IN_QUEUE_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.workItemsInQueue());
            }
        };
    workqueueMonitoredObject.addAttribute(b2);
    LongMonitoredAttributeBase b3 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_AVERAGE_TIME_IN_QUEUE,
                MonitoringConstants.WORKQUEUE_AVERAGE_TIME_IN_QUEUE_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.averageTimeInQueue());
            }
        };
    workqueueMonitoredObject.addAttribute(b3);
}
 
Example #9
Source File: WorkQueueImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private void initializeMonitoring() {
    workqueueMonitoredObject = MonitoringFactories.
                        getMonitoredObjectFactory().
                        createMonitoredObject(name,
                        MonitoringConstants.WORKQUEUE_MONITORING_DESCRIPTION);

    LongMonitoredAttributeBase b1 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_TOTAL_WORK_ITEMS_ADDED,
                MonitoringConstants.WORKQUEUE_TOTAL_WORK_ITEMS_ADDED_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.totalWorkItemsAdded());
            }
        };
    workqueueMonitoredObject.addAttribute(b1);
    LongMonitoredAttributeBase b2 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_WORK_ITEMS_IN_QUEUE,
                MonitoringConstants.WORKQUEUE_WORK_ITEMS_IN_QUEUE_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.workItemsInQueue());
            }
        };
    workqueueMonitoredObject.addAttribute(b2);
    LongMonitoredAttributeBase b3 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_AVERAGE_TIME_IN_QUEUE,
                MonitoringConstants.WORKQUEUE_AVERAGE_TIME_IN_QUEUE_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.averageTimeInQueue());
            }
        };
    workqueueMonitoredObject.addAttribute(b3);
}
 
Example #10
Source File: WorkQueueImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private void initializeMonitoring() {
    workqueueMonitoredObject = MonitoringFactories.
                        getMonitoredObjectFactory().
                        createMonitoredObject(name,
                        MonitoringConstants.WORKQUEUE_MONITORING_DESCRIPTION);

    LongMonitoredAttributeBase b1 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_TOTAL_WORK_ITEMS_ADDED,
                MonitoringConstants.WORKQUEUE_TOTAL_WORK_ITEMS_ADDED_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.totalWorkItemsAdded());
            }
        };
    workqueueMonitoredObject.addAttribute(b1);
    LongMonitoredAttributeBase b2 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_WORK_ITEMS_IN_QUEUE,
                MonitoringConstants.WORKQUEUE_WORK_ITEMS_IN_QUEUE_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.workItemsInQueue());
            }
        };
    workqueueMonitoredObject.addAttribute(b2);
    LongMonitoredAttributeBase b3 = new
        LongMonitoredAttributeBase(MonitoringConstants.WORKQUEUE_AVERAGE_TIME_IN_QUEUE,
                MonitoringConstants.WORKQUEUE_AVERAGE_TIME_IN_QUEUE_DESCRIPTION) {
            public Object getValue() {
                return new Long(WorkQueueImpl.this.averageTimeInQueue());
            }
        };
    workqueueMonitoredObject.addAttribute(b3);
}
 
Example #11
Source File: MonitoringManagerImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
MonitoringManagerImpl(String nameOfTheRoot, String description) {
    MonitoredObjectFactory f =
        MonitoringFactories.getMonitoredObjectFactory();
    rootMonitoredObject =
        f.createMonitoredObject(nameOfTheRoot, description);
}
 
Example #12
Source File: ThreadPoolImpl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
private void initializeMonitoring() {
    // Get root monitored object
    MonitoredObject root = MonitoringFactories.getMonitoringManagerFactory().
            createMonitoringManager(MonitoringConstants.DEFAULT_MONITORING_ROOT, null).
            getRootMonitoredObject();

    // Create the threadpool monitoring root
    MonitoredObject threadPoolMonitoringObjectRoot = root.getChild(
                MonitoringConstants.THREADPOOL_MONITORING_ROOT);
    if (threadPoolMonitoringObjectRoot == null) {
        threadPoolMonitoringObjectRoot =  MonitoringFactories.
                getMonitoredObjectFactory().createMonitoredObject(
                MonitoringConstants.THREADPOOL_MONITORING_ROOT,
                MonitoringConstants.THREADPOOL_MONITORING_ROOT_DESCRIPTION);
        root.addChild(threadPoolMonitoringObjectRoot);
    }
    threadpoolMonitoredObject = MonitoringFactories.
                getMonitoredObjectFactory().
                createMonitoredObject(name,
                MonitoringConstants.THREADPOOL_MONITORING_DESCRIPTION);

    threadPoolMonitoringObjectRoot.addChild(threadpoolMonitoredObject);

    LongMonitoredAttributeBase b1 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_CURRENT_NUMBER_OF_THREADS,
                MonitoringConstants.THREADPOOL_CURRENT_NUMBER_OF_THREADS_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.currentNumberOfThreads());
            }
        };
    threadpoolMonitoredObject.addAttribute(b1);
    LongMonitoredAttributeBase b2 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_NUMBER_OF_AVAILABLE_THREADS,
                MonitoringConstants.THREADPOOL_CURRENT_NUMBER_OF_THREADS_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.numberOfAvailableThreads());
            }
        };
    threadpoolMonitoredObject.addAttribute(b2);
    LongMonitoredAttributeBase b3 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_NUMBER_OF_BUSY_THREADS,
                MonitoringConstants.THREADPOOL_NUMBER_OF_BUSY_THREADS_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.numberOfBusyThreads());
            }
        };
    threadpoolMonitoredObject.addAttribute(b3);
    LongMonitoredAttributeBase b4 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_AVERAGE_WORK_COMPLETION_TIME,
                MonitoringConstants.THREADPOOL_AVERAGE_WORK_COMPLETION_TIME_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.averageWorkCompletionTime());
            }
        };
    threadpoolMonitoredObject.addAttribute(b4);
    LongMonitoredAttributeBase b5 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_CURRENT_PROCESSED_COUNT,
                MonitoringConstants.THREADPOOL_CURRENT_PROCESSED_COUNT_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.currentProcessedCount());
            }
        };
    threadpoolMonitoredObject.addAttribute(b5);

    // Add the monitored object for the WorkQueue

    threadpoolMonitoredObject.addChild(
            ((WorkQueueImpl)workQueue).getMonitoredObject());
}
 
Example #13
Source File: ORB.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
protected ORB()
{
    // Initialize logging first, since it is needed nearly
    // everywhere (for example, in TypeCodeImpl).
    wrapperMap = new ConcurrentHashMap<>();
    wrapper = ORBUtilSystemException.get( this,
        CORBALogDomains.RPC_PRESENTATION ) ;
    omgWrapper = OMGSystemException.get( this,
        CORBALogDomains.RPC_PRESENTATION ) ;

    typeCodeMap = new HashMap<>();

    primitiveTypeCodeConstants = new TypeCodeImpl[] {
        new TypeCodeImpl(this, TCKind._tk_null),
        new TypeCodeImpl(this, TCKind._tk_void),
        new TypeCodeImpl(this, TCKind._tk_short),
        new TypeCodeImpl(this, TCKind._tk_long),
        new TypeCodeImpl(this, TCKind._tk_ushort),
        new TypeCodeImpl(this, TCKind._tk_ulong),
        new TypeCodeImpl(this, TCKind._tk_float),
        new TypeCodeImpl(this, TCKind._tk_double),
        new TypeCodeImpl(this, TCKind._tk_boolean),
        new TypeCodeImpl(this, TCKind._tk_char),
        new TypeCodeImpl(this, TCKind._tk_octet),
        new TypeCodeImpl(this, TCKind._tk_any),
        new TypeCodeImpl(this, TCKind._tk_TypeCode),
        new TypeCodeImpl(this, TCKind._tk_Principal),
        new TypeCodeImpl(this, TCKind._tk_objref),
        null,       // tk_struct
        null,       // tk_union
        null,       // tk_enum
        new TypeCodeImpl(this, TCKind._tk_string),
        null,       // tk_sequence
        null,       // tk_array
        null,       // tk_alias
        null,       // tk_except
        new TypeCodeImpl(this, TCKind._tk_longlong),
        new TypeCodeImpl(this, TCKind._tk_ulonglong),
        new TypeCodeImpl(this, TCKind._tk_longdouble),
        new TypeCodeImpl(this, TCKind._tk_wchar),
        new TypeCodeImpl(this, TCKind._tk_wstring),
        new TypeCodeImpl(this, TCKind._tk_fixed),
        new TypeCodeImpl(this, TCKind._tk_value),
        new TypeCodeImpl(this, TCKind._tk_value_box),
        new TypeCodeImpl(this, TCKind._tk_native),
        new TypeCodeImpl(this, TCKind._tk_abstract_interface)
    } ;

    monitoringManager =
        MonitoringFactories.getMonitoringManagerFactory( ).
            createMonitoringManager(
            MonitoringConstants.DEFAULT_MONITORING_ROOT,
            MonitoringConstants.DEFAULT_MONITORING_ROOT_DESCRIPTION);
}
 
Example #14
Source File: MonitoringManagerImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public void close() {
    MonitoringManagerFactory f =
        MonitoringFactories.getMonitoringManagerFactory();
    f.remove(rootMonitoredObject.getName());
}
 
Example #15
Source File: ThreadPoolImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
private void initializeMonitoring() {
    // Get root monitored object
    MonitoredObject root = MonitoringFactories.getMonitoringManagerFactory().
            createMonitoringManager(MonitoringConstants.DEFAULT_MONITORING_ROOT, null).
            getRootMonitoredObject();

    // Create the threadpool monitoring root
    MonitoredObject threadPoolMonitoringObjectRoot = root.getChild(
                MonitoringConstants.THREADPOOL_MONITORING_ROOT);
    if (threadPoolMonitoringObjectRoot == null) {
        threadPoolMonitoringObjectRoot =  MonitoringFactories.
                getMonitoredObjectFactory().createMonitoredObject(
                MonitoringConstants.THREADPOOL_MONITORING_ROOT,
                MonitoringConstants.THREADPOOL_MONITORING_ROOT_DESCRIPTION);
        root.addChild(threadPoolMonitoringObjectRoot);
    }
    threadpoolMonitoredObject = MonitoringFactories.
                getMonitoredObjectFactory().
                createMonitoredObject(name,
                MonitoringConstants.THREADPOOL_MONITORING_DESCRIPTION);

    threadPoolMonitoringObjectRoot.addChild(threadpoolMonitoredObject);

    LongMonitoredAttributeBase b1 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_CURRENT_NUMBER_OF_THREADS,
                MonitoringConstants.THREADPOOL_CURRENT_NUMBER_OF_THREADS_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.currentNumberOfThreads());
            }
        };
    threadpoolMonitoredObject.addAttribute(b1);
    LongMonitoredAttributeBase b2 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_NUMBER_OF_AVAILABLE_THREADS,
                MonitoringConstants.THREADPOOL_CURRENT_NUMBER_OF_THREADS_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.numberOfAvailableThreads());
            }
        };
    threadpoolMonitoredObject.addAttribute(b2);
    LongMonitoredAttributeBase b3 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_NUMBER_OF_BUSY_THREADS,
                MonitoringConstants.THREADPOOL_NUMBER_OF_BUSY_THREADS_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.numberOfBusyThreads());
            }
        };
    threadpoolMonitoredObject.addAttribute(b3);
    LongMonitoredAttributeBase b4 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_AVERAGE_WORK_COMPLETION_TIME,
                MonitoringConstants.THREADPOOL_AVERAGE_WORK_COMPLETION_TIME_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.averageWorkCompletionTime());
            }
        };
    threadpoolMonitoredObject.addAttribute(b4);
    LongMonitoredAttributeBase b5 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_CURRENT_PROCESSED_COUNT,
                MonitoringConstants.THREADPOOL_CURRENT_PROCESSED_COUNT_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.currentProcessedCount());
            }
        };
    threadpoolMonitoredObject.addAttribute(b5);

    // Add the monitored object for the WorkQueue

    threadpoolMonitoredObject.addChild(
            ((WorkQueueImpl)workQueue).getMonitoredObject());
}
 
Example #16
Source File: ThreadPoolImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
private void initializeMonitoring() {
    // Get root monitored object
    MonitoredObject root = MonitoringFactories.getMonitoringManagerFactory().
            createMonitoringManager(MonitoringConstants.DEFAULT_MONITORING_ROOT, null).
            getRootMonitoredObject();

    // Create the threadpool monitoring root
    MonitoredObject threadPoolMonitoringObjectRoot = root.getChild(
                MonitoringConstants.THREADPOOL_MONITORING_ROOT);
    if (threadPoolMonitoringObjectRoot == null) {
        threadPoolMonitoringObjectRoot =  MonitoringFactories.
                getMonitoredObjectFactory().createMonitoredObject(
                MonitoringConstants.THREADPOOL_MONITORING_ROOT,
                MonitoringConstants.THREADPOOL_MONITORING_ROOT_DESCRIPTION);
        root.addChild(threadPoolMonitoringObjectRoot);
    }
    threadpoolMonitoredObject = MonitoringFactories.
                getMonitoredObjectFactory().
                createMonitoredObject(name,
                MonitoringConstants.THREADPOOL_MONITORING_DESCRIPTION);

    threadPoolMonitoringObjectRoot.addChild(threadpoolMonitoredObject);

    LongMonitoredAttributeBase b1 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_CURRENT_NUMBER_OF_THREADS,
                MonitoringConstants.THREADPOOL_CURRENT_NUMBER_OF_THREADS_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.currentNumberOfThreads());
            }
        };
    threadpoolMonitoredObject.addAttribute(b1);
    LongMonitoredAttributeBase b2 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_NUMBER_OF_AVAILABLE_THREADS,
                MonitoringConstants.THREADPOOL_CURRENT_NUMBER_OF_THREADS_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.numberOfAvailableThreads());
            }
        };
    threadpoolMonitoredObject.addAttribute(b2);
    LongMonitoredAttributeBase b3 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_NUMBER_OF_BUSY_THREADS,
                MonitoringConstants.THREADPOOL_NUMBER_OF_BUSY_THREADS_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.numberOfBusyThreads());
            }
        };
    threadpoolMonitoredObject.addAttribute(b3);
    LongMonitoredAttributeBase b4 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_AVERAGE_WORK_COMPLETION_TIME,
                MonitoringConstants.THREADPOOL_AVERAGE_WORK_COMPLETION_TIME_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.averageWorkCompletionTime());
            }
        };
    threadpoolMonitoredObject.addAttribute(b4);
    LongMonitoredAttributeBase b5 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_CURRENT_PROCESSED_COUNT,
                MonitoringConstants.THREADPOOL_CURRENT_PROCESSED_COUNT_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.currentProcessedCount());
            }
        };
    threadpoolMonitoredObject.addAttribute(b5);

    // Add the monitored object for the WorkQueue

    threadpoolMonitoredObject.addChild(
            ((WorkQueueImpl)workQueue).getMonitoredObject());
}
 
Example #17
Source File: ORB.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
protected ORB()
{
    // Initialize logging first, since it is needed nearly
    // everywhere (for example, in TypeCodeImpl).
    wrapperMap = new ConcurrentHashMap();
    wrapper = ORBUtilSystemException.get( this,
        CORBALogDomains.RPC_PRESENTATION ) ;
    omgWrapper = OMGSystemException.get( this,
        CORBALogDomains.RPC_PRESENTATION ) ;

    typeCodeMap = new HashMap();

    primitiveTypeCodeConstants = new TypeCodeImpl[] {
        new TypeCodeImpl(this, TCKind._tk_null),
        new TypeCodeImpl(this, TCKind._tk_void),
        new TypeCodeImpl(this, TCKind._tk_short),
        new TypeCodeImpl(this, TCKind._tk_long),
        new TypeCodeImpl(this, TCKind._tk_ushort),
        new TypeCodeImpl(this, TCKind._tk_ulong),
        new TypeCodeImpl(this, TCKind._tk_float),
        new TypeCodeImpl(this, TCKind._tk_double),
        new TypeCodeImpl(this, TCKind._tk_boolean),
        new TypeCodeImpl(this, TCKind._tk_char),
        new TypeCodeImpl(this, TCKind._tk_octet),
        new TypeCodeImpl(this, TCKind._tk_any),
        new TypeCodeImpl(this, TCKind._tk_TypeCode),
        new TypeCodeImpl(this, TCKind._tk_Principal),
        new TypeCodeImpl(this, TCKind._tk_objref),
        null,       // tk_struct
        null,       // tk_union
        null,       // tk_enum
        new TypeCodeImpl(this, TCKind._tk_string),
        null,       // tk_sequence
        null,       // tk_array
        null,       // tk_alias
        null,       // tk_except
        new TypeCodeImpl(this, TCKind._tk_longlong),
        new TypeCodeImpl(this, TCKind._tk_ulonglong),
        new TypeCodeImpl(this, TCKind._tk_longdouble),
        new TypeCodeImpl(this, TCKind._tk_wchar),
        new TypeCodeImpl(this, TCKind._tk_wstring),
        new TypeCodeImpl(this, TCKind._tk_fixed),
        new TypeCodeImpl(this, TCKind._tk_value),
        new TypeCodeImpl(this, TCKind._tk_value_box),
        new TypeCodeImpl(this, TCKind._tk_native),
        new TypeCodeImpl(this, TCKind._tk_abstract_interface)
    } ;

    monitoringManager =
        MonitoringFactories.getMonitoringManagerFactory( ).
            createMonitoringManager(
            MonitoringConstants.DEFAULT_MONITORING_ROOT,
            MonitoringConstants.DEFAULT_MONITORING_ROOT_DESCRIPTION);
}
 
Example #18
Source File: MonitoringManagerImpl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
MonitoringManagerImpl(String nameOfTheRoot, String description) {
    MonitoredObjectFactory f =
        MonitoringFactories.getMonitoredObjectFactory();
    rootMonitoredObject =
        f.createMonitoredObject(nameOfTheRoot, description);
}
 
Example #19
Source File: MonitoringManagerImpl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public void close() {
    MonitoringManagerFactory f =
        MonitoringFactories.getMonitoringManagerFactory();
    f.remove(rootMonitoredObject.getName());
}
 
Example #20
Source File: ORB.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
protected ORB()
{
    // Initialize logging first, since it is needed nearly
    // everywhere (for example, in TypeCodeImpl).
    wrapperMap = new ConcurrentHashMap();
    wrapper = ORBUtilSystemException.get( this,
        CORBALogDomains.RPC_PRESENTATION ) ;
    omgWrapper = OMGSystemException.get( this,
        CORBALogDomains.RPC_PRESENTATION ) ;

    typeCodeMap = new HashMap();

    primitiveTypeCodeConstants = new TypeCodeImpl[] {
        new TypeCodeImpl(this, TCKind._tk_null),
        new TypeCodeImpl(this, TCKind._tk_void),
        new TypeCodeImpl(this, TCKind._tk_short),
        new TypeCodeImpl(this, TCKind._tk_long),
        new TypeCodeImpl(this, TCKind._tk_ushort),
        new TypeCodeImpl(this, TCKind._tk_ulong),
        new TypeCodeImpl(this, TCKind._tk_float),
        new TypeCodeImpl(this, TCKind._tk_double),
        new TypeCodeImpl(this, TCKind._tk_boolean),
        new TypeCodeImpl(this, TCKind._tk_char),
        new TypeCodeImpl(this, TCKind._tk_octet),
        new TypeCodeImpl(this, TCKind._tk_any),
        new TypeCodeImpl(this, TCKind._tk_TypeCode),
        new TypeCodeImpl(this, TCKind._tk_Principal),
        new TypeCodeImpl(this, TCKind._tk_objref),
        null,       // tk_struct
        null,       // tk_union
        null,       // tk_enum
        new TypeCodeImpl(this, TCKind._tk_string),
        null,       // tk_sequence
        null,       // tk_array
        null,       // tk_alias
        null,       // tk_except
        new TypeCodeImpl(this, TCKind._tk_longlong),
        new TypeCodeImpl(this, TCKind._tk_ulonglong),
        new TypeCodeImpl(this, TCKind._tk_longdouble),
        new TypeCodeImpl(this, TCKind._tk_wchar),
        new TypeCodeImpl(this, TCKind._tk_wstring),
        new TypeCodeImpl(this, TCKind._tk_fixed),
        new TypeCodeImpl(this, TCKind._tk_value),
        new TypeCodeImpl(this, TCKind._tk_value_box),
        new TypeCodeImpl(this, TCKind._tk_native),
        new TypeCodeImpl(this, TCKind._tk_abstract_interface)
    } ;

    monitoringManager =
        MonitoringFactories.getMonitoringManagerFactory( ).
            createMonitoringManager(
            MonitoringConstants.DEFAULT_MONITORING_ROOT,
            MonitoringConstants.DEFAULT_MONITORING_ROOT_DESCRIPTION);
}
 
Example #21
Source File: ORB.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
protected ORB()
{
    // Initialize logging first, since it is needed nearly
    // everywhere (for example, in TypeCodeImpl).
    wrapperMap = new ConcurrentHashMap();
    wrapper = ORBUtilSystemException.get( this,
        CORBALogDomains.RPC_PRESENTATION ) ;
    omgWrapper = OMGSystemException.get( this,
        CORBALogDomains.RPC_PRESENTATION ) ;

    typeCodeMap = new HashMap();

    primitiveTypeCodeConstants = new TypeCodeImpl[] {
        new TypeCodeImpl(this, TCKind._tk_null),
        new TypeCodeImpl(this, TCKind._tk_void),
        new TypeCodeImpl(this, TCKind._tk_short),
        new TypeCodeImpl(this, TCKind._tk_long),
        new TypeCodeImpl(this, TCKind._tk_ushort),
        new TypeCodeImpl(this, TCKind._tk_ulong),
        new TypeCodeImpl(this, TCKind._tk_float),
        new TypeCodeImpl(this, TCKind._tk_double),
        new TypeCodeImpl(this, TCKind._tk_boolean),
        new TypeCodeImpl(this, TCKind._tk_char),
        new TypeCodeImpl(this, TCKind._tk_octet),
        new TypeCodeImpl(this, TCKind._tk_any),
        new TypeCodeImpl(this, TCKind._tk_TypeCode),
        new TypeCodeImpl(this, TCKind._tk_Principal),
        new TypeCodeImpl(this, TCKind._tk_objref),
        null,       // tk_struct
        null,       // tk_union
        null,       // tk_enum
        new TypeCodeImpl(this, TCKind._tk_string),
        null,       // tk_sequence
        null,       // tk_array
        null,       // tk_alias
        null,       // tk_except
        new TypeCodeImpl(this, TCKind._tk_longlong),
        new TypeCodeImpl(this, TCKind._tk_ulonglong),
        new TypeCodeImpl(this, TCKind._tk_longdouble),
        new TypeCodeImpl(this, TCKind._tk_wchar),
        new TypeCodeImpl(this, TCKind._tk_wstring),
        new TypeCodeImpl(this, TCKind._tk_fixed),
        new TypeCodeImpl(this, TCKind._tk_value),
        new TypeCodeImpl(this, TCKind._tk_value_box),
        new TypeCodeImpl(this, TCKind._tk_native),
        new TypeCodeImpl(this, TCKind._tk_abstract_interface)
    } ;

    monitoringManager =
        MonitoringFactories.getMonitoringManagerFactory( ).
            createMonitoringManager(
            MonitoringConstants.DEFAULT_MONITORING_ROOT,
            MonitoringConstants.DEFAULT_MONITORING_ROOT_DESCRIPTION);
}
 
Example #22
Source File: MonitoringManagerImpl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
MonitoringManagerImpl(String nameOfTheRoot, String description) {
    MonitoredObjectFactory f =
        MonitoringFactories.getMonitoredObjectFactory();
    rootMonitoredObject =
        f.createMonitoredObject(nameOfTheRoot, description);
}
 
Example #23
Source File: MonitoringManagerImpl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public void close() {
    MonitoringManagerFactory f =
        MonitoringFactories.getMonitoringManagerFactory();
    f.remove(rootMonitoredObject.getName());
}
 
Example #24
Source File: ThreadPoolImpl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
private void initializeMonitoring() {
    // Get root monitored object
    MonitoredObject root = MonitoringFactories.getMonitoringManagerFactory().
            createMonitoringManager(MonitoringConstants.DEFAULT_MONITORING_ROOT, null).
            getRootMonitoredObject();

    // Create the threadpool monitoring root
    MonitoredObject threadPoolMonitoringObjectRoot = root.getChild(
                MonitoringConstants.THREADPOOL_MONITORING_ROOT);
    if (threadPoolMonitoringObjectRoot == null) {
        threadPoolMonitoringObjectRoot =  MonitoringFactories.
                getMonitoredObjectFactory().createMonitoredObject(
                MonitoringConstants.THREADPOOL_MONITORING_ROOT,
                MonitoringConstants.THREADPOOL_MONITORING_ROOT_DESCRIPTION);
        root.addChild(threadPoolMonitoringObjectRoot);
    }
    threadpoolMonitoredObject = MonitoringFactories.
                getMonitoredObjectFactory().
                createMonitoredObject(name,
                MonitoringConstants.THREADPOOL_MONITORING_DESCRIPTION);

    threadPoolMonitoringObjectRoot.addChild(threadpoolMonitoredObject);

    LongMonitoredAttributeBase b1 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_CURRENT_NUMBER_OF_THREADS,
                MonitoringConstants.THREADPOOL_CURRENT_NUMBER_OF_THREADS_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.currentNumberOfThreads());
            }
        };
    threadpoolMonitoredObject.addAttribute(b1);
    LongMonitoredAttributeBase b2 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_NUMBER_OF_AVAILABLE_THREADS,
                MonitoringConstants.THREADPOOL_CURRENT_NUMBER_OF_THREADS_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.numberOfAvailableThreads());
            }
        };
    threadpoolMonitoredObject.addAttribute(b2);
    LongMonitoredAttributeBase b3 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_NUMBER_OF_BUSY_THREADS,
                MonitoringConstants.THREADPOOL_NUMBER_OF_BUSY_THREADS_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.numberOfBusyThreads());
            }
        };
    threadpoolMonitoredObject.addAttribute(b3);
    LongMonitoredAttributeBase b4 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_AVERAGE_WORK_COMPLETION_TIME,
                MonitoringConstants.THREADPOOL_AVERAGE_WORK_COMPLETION_TIME_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.averageWorkCompletionTime());
            }
        };
    threadpoolMonitoredObject.addAttribute(b4);
    LongMonitoredAttributeBase b5 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_CURRENT_PROCESSED_COUNT,
                MonitoringConstants.THREADPOOL_CURRENT_PROCESSED_COUNT_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.currentProcessedCount());
            }
        };
    threadpoolMonitoredObject.addAttribute(b5);

    // Add the monitored object for the WorkQueue

    threadpoolMonitoredObject.addChild(
            ((WorkQueueImpl)workQueue).getMonitoredObject());
}
 
Example #25
Source File: ORB.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
protected ORB()
{
    // Initialize logging first, since it is needed nearly
    // everywhere (for example, in TypeCodeImpl).
    wrapperMap = new ConcurrentHashMap();
    wrapper = ORBUtilSystemException.get( this,
        CORBALogDomains.RPC_PRESENTATION ) ;
    omgWrapper = OMGSystemException.get( this,
        CORBALogDomains.RPC_PRESENTATION ) ;

    typeCodeMap = new HashMap();

    primitiveTypeCodeConstants = new TypeCodeImpl[] {
        new TypeCodeImpl(this, TCKind._tk_null),
        new TypeCodeImpl(this, TCKind._tk_void),
        new TypeCodeImpl(this, TCKind._tk_short),
        new TypeCodeImpl(this, TCKind._tk_long),
        new TypeCodeImpl(this, TCKind._tk_ushort),
        new TypeCodeImpl(this, TCKind._tk_ulong),
        new TypeCodeImpl(this, TCKind._tk_float),
        new TypeCodeImpl(this, TCKind._tk_double),
        new TypeCodeImpl(this, TCKind._tk_boolean),
        new TypeCodeImpl(this, TCKind._tk_char),
        new TypeCodeImpl(this, TCKind._tk_octet),
        new TypeCodeImpl(this, TCKind._tk_any),
        new TypeCodeImpl(this, TCKind._tk_TypeCode),
        new TypeCodeImpl(this, TCKind._tk_Principal),
        new TypeCodeImpl(this, TCKind._tk_objref),
        null,       // tk_struct
        null,       // tk_union
        null,       // tk_enum
        new TypeCodeImpl(this, TCKind._tk_string),
        null,       // tk_sequence
        null,       // tk_array
        null,       // tk_alias
        null,       // tk_except
        new TypeCodeImpl(this, TCKind._tk_longlong),
        new TypeCodeImpl(this, TCKind._tk_ulonglong),
        new TypeCodeImpl(this, TCKind._tk_longdouble),
        new TypeCodeImpl(this, TCKind._tk_wchar),
        new TypeCodeImpl(this, TCKind._tk_wstring),
        new TypeCodeImpl(this, TCKind._tk_fixed),
        new TypeCodeImpl(this, TCKind._tk_value),
        new TypeCodeImpl(this, TCKind._tk_value_box),
        new TypeCodeImpl(this, TCKind._tk_native),
        new TypeCodeImpl(this, TCKind._tk_abstract_interface)
    } ;

    monitoringManager =
        MonitoringFactories.getMonitoringManagerFactory( ).
            createMonitoringManager(
            MonitoringConstants.DEFAULT_MONITORING_ROOT,
            MonitoringConstants.DEFAULT_MONITORING_ROOT_DESCRIPTION);
}
 
Example #26
Source File: MonitoringManagerImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
MonitoringManagerImpl(String nameOfTheRoot, String description) {
    MonitoredObjectFactory f =
        MonitoringFactories.getMonitoredObjectFactory();
    rootMonitoredObject =
        f.createMonitoredObject(nameOfTheRoot, description);
}
 
Example #27
Source File: MonitoringManagerImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public void close() {
    MonitoringManagerFactory f =
        MonitoringFactories.getMonitoringManagerFactory();
    f.remove(rootMonitoredObject.getName());
}
 
Example #28
Source File: ThreadPoolImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
private void initializeMonitoring() {
    // Get root monitored object
    MonitoredObject root = MonitoringFactories.getMonitoringManagerFactory().
            createMonitoringManager(MonitoringConstants.DEFAULT_MONITORING_ROOT, null).
            getRootMonitoredObject();

    // Create the threadpool monitoring root
    MonitoredObject threadPoolMonitoringObjectRoot = root.getChild(
                MonitoringConstants.THREADPOOL_MONITORING_ROOT);
    if (threadPoolMonitoringObjectRoot == null) {
        threadPoolMonitoringObjectRoot =  MonitoringFactories.
                getMonitoredObjectFactory().createMonitoredObject(
                MonitoringConstants.THREADPOOL_MONITORING_ROOT,
                MonitoringConstants.THREADPOOL_MONITORING_ROOT_DESCRIPTION);
        root.addChild(threadPoolMonitoringObjectRoot);
    }
    threadpoolMonitoredObject = MonitoringFactories.
                getMonitoredObjectFactory().
                createMonitoredObject(name,
                MonitoringConstants.THREADPOOL_MONITORING_DESCRIPTION);

    threadPoolMonitoringObjectRoot.addChild(threadpoolMonitoredObject);

    LongMonitoredAttributeBase b1 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_CURRENT_NUMBER_OF_THREADS,
                MonitoringConstants.THREADPOOL_CURRENT_NUMBER_OF_THREADS_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.currentNumberOfThreads());
            }
        };
    threadpoolMonitoredObject.addAttribute(b1);
    LongMonitoredAttributeBase b2 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_NUMBER_OF_AVAILABLE_THREADS,
                MonitoringConstants.THREADPOOL_CURRENT_NUMBER_OF_THREADS_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.numberOfAvailableThreads());
            }
        };
    threadpoolMonitoredObject.addAttribute(b2);
    LongMonitoredAttributeBase b3 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_NUMBER_OF_BUSY_THREADS,
                MonitoringConstants.THREADPOOL_NUMBER_OF_BUSY_THREADS_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.numberOfBusyThreads());
            }
        };
    threadpoolMonitoredObject.addAttribute(b3);
    LongMonitoredAttributeBase b4 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_AVERAGE_WORK_COMPLETION_TIME,
                MonitoringConstants.THREADPOOL_AVERAGE_WORK_COMPLETION_TIME_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.averageWorkCompletionTime());
            }
        };
    threadpoolMonitoredObject.addAttribute(b4);
    LongMonitoredAttributeBase b5 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_CURRENT_PROCESSED_COUNT,
                MonitoringConstants.THREADPOOL_CURRENT_PROCESSED_COUNT_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.currentProcessedCount());
            }
        };
    threadpoolMonitoredObject.addAttribute(b5);

    // Add the monitored object for the WorkQueue

    threadpoolMonitoredObject.addChild(
            ((WorkQueueImpl)workQueue).getMonitoredObject());
}
 
Example #29
Source File: ThreadPoolImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
private void initializeMonitoring() {
    // Get root monitored object
    MonitoredObject root = MonitoringFactories.getMonitoringManagerFactory().
            createMonitoringManager(MonitoringConstants.DEFAULT_MONITORING_ROOT, null).
            getRootMonitoredObject();

    // Create the threadpool monitoring root
    MonitoredObject threadPoolMonitoringObjectRoot = root.getChild(
                MonitoringConstants.THREADPOOL_MONITORING_ROOT);
    if (threadPoolMonitoringObjectRoot == null) {
        threadPoolMonitoringObjectRoot =  MonitoringFactories.
                getMonitoredObjectFactory().createMonitoredObject(
                MonitoringConstants.THREADPOOL_MONITORING_ROOT,
                MonitoringConstants.THREADPOOL_MONITORING_ROOT_DESCRIPTION);
        root.addChild(threadPoolMonitoringObjectRoot);
    }
    threadpoolMonitoredObject = MonitoringFactories.
                getMonitoredObjectFactory().
                createMonitoredObject(name,
                MonitoringConstants.THREADPOOL_MONITORING_DESCRIPTION);

    threadPoolMonitoringObjectRoot.addChild(threadpoolMonitoredObject);

    LongMonitoredAttributeBase b1 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_CURRENT_NUMBER_OF_THREADS,
                MonitoringConstants.THREADPOOL_CURRENT_NUMBER_OF_THREADS_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.currentNumberOfThreads());
            }
        };
    threadpoolMonitoredObject.addAttribute(b1);
    LongMonitoredAttributeBase b2 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_NUMBER_OF_AVAILABLE_THREADS,
                MonitoringConstants.THREADPOOL_CURRENT_NUMBER_OF_THREADS_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.numberOfAvailableThreads());
            }
        };
    threadpoolMonitoredObject.addAttribute(b2);
    LongMonitoredAttributeBase b3 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_NUMBER_OF_BUSY_THREADS,
                MonitoringConstants.THREADPOOL_NUMBER_OF_BUSY_THREADS_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.numberOfBusyThreads());
            }
        };
    threadpoolMonitoredObject.addAttribute(b3);
    LongMonitoredAttributeBase b4 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_AVERAGE_WORK_COMPLETION_TIME,
                MonitoringConstants.THREADPOOL_AVERAGE_WORK_COMPLETION_TIME_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.averageWorkCompletionTime());
            }
        };
    threadpoolMonitoredObject.addAttribute(b4);
    LongMonitoredAttributeBase b5 = new
        LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_CURRENT_PROCESSED_COUNT,
                MonitoringConstants.THREADPOOL_CURRENT_PROCESSED_COUNT_DESCRIPTION) {
            public Object getValue() {
                return new Long(ThreadPoolImpl.this.currentProcessedCount());
            }
        };
    threadpoolMonitoredObject.addAttribute(b5);

    // Add the monitored object for the WorkQueue

    threadpoolMonitoredObject.addChild(
            ((WorkQueueImpl)workQueue).getMonitoredObject());
}
 
Example #30
Source File: MonitoringManagerImpl.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
MonitoringManagerImpl(String nameOfTheRoot, String description) {
    MonitoredObjectFactory f =
        MonitoringFactories.getMonitoredObjectFactory();
    rootMonitoredObject =
        f.createMonitoredObject(nameOfTheRoot, description);
}