Search in sources :

Example 6 with ArrayType

use of javax.management.openmbean.ArrayType in project drools by kiegroup.

the class KnowledgeBaseMonitoring method initOpenMBeanInfo.

/**
 *  Initialize the open mbean metadata
 */
private void initOpenMBeanInfo() {
    OpenMBeanAttributeInfoSupport[] attributes = new OpenMBeanAttributeInfoSupport[4];
    OpenMBeanConstructorInfoSupport[] constructors = new OpenMBeanConstructorInfoSupport[1];
    OpenMBeanOperationInfoSupport[] operations = new OpenMBeanOperationInfoSupport[2];
    MBeanNotificationInfo[] notifications = new MBeanNotificationInfo[0];
    try {
        // Define the attributes
        attributes[0] = new OpenMBeanAttributeInfoSupport(ATTR_ID, "Knowledge Base Id", SimpleType.STRING, true, false, false);
        attributes[1] = new OpenMBeanAttributeInfoSupport(ATTR_SESSION_COUNT, "Number of created sessions for this Knowledge Base", SimpleType.LONG, true, false, false);
        attributes[2] = new OpenMBeanAttributeInfoSupport(ATTR_GLOBALS, "List of globals", globalsTableType, true, false, false);
        attributes[3] = new OpenMBeanAttributeInfoSupport(ATTR_PACKAGES, "List of Packages", new ArrayType(1, SimpleType.STRING), true, false, false);
        // No arg constructor
        constructors[0] = new OpenMBeanConstructorInfoSupport("KnowledgeBaseMonitoringMXBean", "Constructs a KnowledgeBaseMonitoringMXBean instance.", new OpenMBeanParameterInfoSupport[0]);
        // Operations
        OpenMBeanParameterInfo[] params = new OpenMBeanParameterInfoSupport[0];
        operations[0] = new OpenMBeanOperationInfoSupport(OP_START_INTERNAL_MBEANS, "Creates, registers and starts all the dependent MBeans that allow monitor all the details in this KnowledgeBase.", params, SimpleType.VOID, MBeanOperationInfo.INFO);
        operations[1] = new OpenMBeanOperationInfoSupport(OP_STOP_INTERNAL_MBEANS, "Stops and disposes all the dependent MBeans that allow monitor all the details in this KnowledgeBase.", params, SimpleType.VOID, MBeanOperationInfo.INFO);
        // Build the info
        info = new OpenMBeanInfoSupport(this.getClass().getName(), "Knowledge Base Monitor MXBean", attributes, constructors, operations, notifications);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : OpenMBeanParameterInfo(javax.management.openmbean.OpenMBeanParameterInfo) OpenMBeanInfoSupport(javax.management.openmbean.OpenMBeanInfoSupport) OpenMBeanParameterInfoSupport(javax.management.openmbean.OpenMBeanParameterInfoSupport) OpenDataException(javax.management.openmbean.OpenDataException) AttributeNotFoundException(javax.management.AttributeNotFoundException) ReflectionException(javax.management.ReflectionException) NotCompliantMBeanException(javax.management.NotCompliantMBeanException) InvalidAttributeValueException(javax.management.InvalidAttributeValueException) MBeanException(javax.management.MBeanException) RuntimeOperationsException(javax.management.RuntimeOperationsException) ArrayType(javax.management.openmbean.ArrayType) MBeanNotificationInfo(javax.management.MBeanNotificationInfo) OpenMBeanConstructorInfoSupport(javax.management.openmbean.OpenMBeanConstructorInfoSupport) OpenMBeanAttributeInfoSupport(javax.management.openmbean.OpenMBeanAttributeInfoSupport) OpenMBeanOperationInfoSupport(javax.management.openmbean.OpenMBeanOperationInfoSupport)

Example 7 with ArrayType

use of javax.management.openmbean.ArrayType in project druid by alibaba.

the class JdbcSqlStat method getCompositeType.

public static CompositeType getCompositeType() throws JMException {
    if (COMPOSITE_TYPE != null) {
        return COMPOSITE_TYPE;
    }
    OpenType<?>[] indexTypes = new OpenType<?>[] { //
    SimpleType.LONG, //
    SimpleType.STRING, //
    SimpleType.STRING, //
    SimpleType.LONG, //
    SimpleType.LONG, //
    SimpleType.LONG, //
    SimpleType.DATE, //
    SimpleType.LONG, //
    JMXUtils.getThrowableCompositeType(), //
    SimpleType.LONG, //
    SimpleType.LONG, //
    SimpleType.DATE, //
    SimpleType.LONG, //
    SimpleType.LONG, //
    SimpleType.LONG, //
    SimpleType.LONG, //
    SimpleType.STRING, //
    SimpleType.STRING, //
    SimpleType.STRING, //
    SimpleType.STRING, //
    SimpleType.STRING, //
    SimpleType.DATE, //
    SimpleType.STRING, //
    SimpleType.LONG, //
    SimpleType.STRING, //
    new ArrayType<Long>(SimpleType.LONG, true), //
    SimpleType.STRING, //
    SimpleType.LONG, //
    SimpleType.LONG, //
    new ArrayType<Long>(SimpleType.LONG, true), //
    new ArrayType<Long>(SimpleType.LONG, true), //
    new ArrayType<Long>(SimpleType.LONG, true), //
    SimpleType.LONG, //
    SimpleType.LONG, //
    SimpleType.LONG, //
    SimpleType.LONG, //
    SimpleType.LONG, //
    SimpleType.LONG, //
    SimpleType.LONG, //
    SimpleType.LONG, //
    SimpleType.LONG };
    String[] indexNames = { //
    "ID", //
    "DataSource", //
    "SQL", //
    "ExecuteCount", //
    "ErrorCount", //
    "TotalTime", //
    "LastTime", //
    "MaxTimespan", //
    "LastError", //
    "EffectedRowCount", //
    "FetchRowCount", //
    "MaxTimespanOccurTime", //
    "BatchSizeMax", //
    "BatchSizeTotal", //
    "ConcurrentMax", //
    "RunningCount", //
    "Name", //
    "File", //
    "LastErrorMessage", //
    "LastErrorClass", //
    "LastErrorStackTrace", //
    "LastErrorTime", //
    "DbType", //
    "InTransactionCount", //
    "URL", //
    "Histogram", //
    "LastSlowParameters", //
    "ResultSetHoldTime", //
    "ExecuteAndResultSetHoldTime", //
    "FetchRowCountHistogram", //
    "EffectedRowCountHistogram", //
    "ExecuteAndResultHoldTimeHistogram", //
    "EffectedRowCountMax", //
    "FetchRowCountMax", "ClobOpenCount", //
    "BlobOpenCount", //
    "ReadStringLength", //
    "ReadBytesLength", //
    "InputStreamOpenCount", //
    "ReaderOpenCount", //
    "HASH" };
    String[] indexDescriptions = indexNames;
    COMPOSITE_TYPE = new CompositeType("SqlStatistic", "Sql Statistic", indexNames, indexDescriptions, indexTypes);
    return COMPOSITE_TYPE;
}
Also used : ArrayType(javax.management.openmbean.ArrayType) OpenType(javax.management.openmbean.OpenType) CompositeType(javax.management.openmbean.CompositeType)

Aggregations

ArrayType (javax.management.openmbean.ArrayType)7 CompositeType (javax.management.openmbean.CompositeType)4 OpenType (javax.management.openmbean.OpenType)4 OpenDataException (javax.management.openmbean.OpenDataException)3 MBeanException (javax.management.MBeanException)2 NotCompliantMBeanException (javax.management.NotCompliantMBeanException)2 FileInputStream (java.io.FileInputStream)1 FileOutputStream (java.io.FileOutputStream)1 ObjectInputStream (java.io.ObjectInputStream)1 ObjectOutputStream (java.io.ObjectOutputStream)1 GenericArrayType (java.lang.reflect.GenericArrayType)1 ParameterizedType (java.lang.reflect.ParameterizedType)1 ArrayList (java.util.ArrayList)1 AttributeNotFoundException (javax.management.AttributeNotFoundException)1 InvalidAttributeValueException (javax.management.InvalidAttributeValueException)1 MBeanNotificationInfo (javax.management.MBeanNotificationInfo)1 ObjectName (javax.management.ObjectName)1 ReflectionException (javax.management.ReflectionException)1 RuntimeOperationsException (javax.management.RuntimeOperationsException)1 CompositeData (javax.management.openmbean.CompositeData)1