jdk/src/share/classes/sun/management/snmp/jvminstr/JVM_MANAGEMENT_MIB_IMPL.java
author mchung
Tue, 17 Jan 2012 15:55:40 -0800
changeset 11530 a9d059c15b80
parent 5506 202f599c92aa
child 14342 8435a30053c1
permissions -rw-r--r--
7117570: Warnings in sun.mangement.* and its subpackages Reviewed-by: mchung, dsamersoff Contributed-by: kurchi.subhra.hazra@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
package sun.management.snmp.jvminstr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
// java imports
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
//
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.util.Hashtable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.util.List;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.util.ArrayList;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.util.Iterator;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import java.lang.ref.WeakReference;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
// jmx imports
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
//
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
import javax.management.MBeanServer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
import javax.management.ObjectName;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
import javax.management.InstanceAlreadyExistsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
import javax.management.NotificationEmitter;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
import javax.management.NotificationListener;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
import javax.management.Notification;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
import javax.management.ListenerNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
import javax.management.openmbean.CompositeData;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
// jdmk imports
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
//
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
import com.sun.jmx.snmp.agent.SnmpMib;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
import com.sun.jmx.snmp.daemon.SnmpAdaptorServer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
import com.sun.jmx.snmp.SnmpPeer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
import com.sun.jmx.snmp.SnmpParameters;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
import com.sun.jmx.snmp.SnmpOidTable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
import com.sun.jmx.snmp.SnmpOid;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
import com.sun.jmx.snmp.SnmpVarBindList;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
import com.sun.jmx.snmp.SnmpVarBind;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
import com.sun.jmx.snmp.SnmpCounter;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
import com.sun.jmx.snmp.SnmpCounter64;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
import com.sun.jmx.snmp.SnmpString;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
import com.sun.jmx.snmp.SnmpInt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
import com.sun.jmx.snmp.Enumerated;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
import com.sun.jmx.snmp.agent.SnmpMibTable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
import sun.management.snmp.jvmmib.JVM_MANAGEMENT_MIBOidTable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
import sun.management.snmp.jvmmib.JVM_MANAGEMENT_MIB;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
import sun.management.snmp.jvmmib.JvmMemoryMeta;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
import sun.management.snmp.jvmmib.JvmThreadingMeta;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
import sun.management.snmp.jvmmib.JvmRuntimeMeta;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
import sun.management.snmp.jvmmib.JvmClassLoadingMeta;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
import sun.management.snmp.jvmmib.JvmCompilationMeta;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
import sun.management.snmp.util.MibLogger;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
import sun.management.snmp.util.SnmpCachedData;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
import sun.management.snmp.util.SnmpTableHandler;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
//java management imports
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
import java.lang.management.ManagementFactory;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
import java.lang.management.MemoryPoolMXBean;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
import java.lang.management.MemoryNotificationInfo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
import java.lang.management.MemoryType;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
public class JVM_MANAGEMENT_MIB_IMPL extends JVM_MANAGEMENT_MIB {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    private static final long serialVersionUID = -8104825586888859831L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    private static final MibLogger log =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
        new MibLogger(JVM_MANAGEMENT_MIB_IMPL.class);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    private static WeakReference<SnmpOidTable> tableRef;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    public static SnmpOidTable getOidTable() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
        SnmpOidTable table = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
        if(tableRef == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
            table =  new JVM_MANAGEMENT_MIBOidTable();
11530
a9d059c15b80 7117570: Warnings in sun.mangement.* and its subpackages
mchung
parents: 5506
diff changeset
    93
            tableRef = new WeakReference<>(table);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
            return table;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        table = tableRef.get();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
        if(table == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
            table = new JVM_MANAGEMENT_MIBOidTable();
11530
a9d059c15b80 7117570: Warnings in sun.mangement.* and its subpackages
mchung
parents: 5506
diff changeset
   100
            tableRef = new WeakReference<>(table);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
        return table;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * Handler waiting for memory <CODE>Notification</CODE>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     * Translate each JMX notification in SNMP trap.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
    private class NotificationHandler implements NotificationListener {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        public void handleNotification(Notification notification,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
                                       Object handback) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
            log.debug("handleNotification", "Received notification [ " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
                      notification.getType() + "]");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
            String type = notification.getType();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
            if (type.equals(MemoryNotificationInfo.MEMORY_THRESHOLD_EXCEEDED) ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
                type.equals(MemoryNotificationInfo.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
                    MEMORY_COLLECTION_THRESHOLD_EXCEEDED)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
                MemoryNotificationInfo minfo = MemoryNotificationInfo.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
                    from((CompositeData) notification.getUserData());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
                SnmpCounter64 count = new SnmpCounter64(minfo.getCount());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
                SnmpCounter64 used =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
                    new SnmpCounter64(minfo.getUsage().getUsed());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
                SnmpString poolName = new SnmpString(minfo.getPoolName());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
                SnmpOid entryIndex =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
                    getJvmMemPoolEntryIndex(minfo.getPoolName());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
                if (entryIndex == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
                    log.error("handleNotification",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
                              "Error: Can't find entry index for Memory Pool: "
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
                              + minfo.getPoolName() +": " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
                              "No trap emitted for " + type);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
                    return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
                SnmpOid trap = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
                final SnmpOidTable mibTable = getOidTable();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
                try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
                    SnmpOid usedOid  = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
                    SnmpOid countOid = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
                    if (type.equals(MemoryNotificationInfo.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
                                   MEMORY_THRESHOLD_EXCEEDED)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
                        trap = new SnmpOid(mibTable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
                        resolveVarName("jvmLowMemoryPoolUsageNotif").getOid());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
                        usedOid =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
                            new SnmpOid(mibTable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
                            resolveVarName("jvmMemPoolUsed").getOid() +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
                                    "." + entryIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
                        countOid =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
                            new SnmpOid(mibTable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
                            resolveVarName("jvmMemPoolThreshdCount").getOid()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
                                    + "." + entryIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
                    } else if  (type.equals(MemoryNotificationInfo.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
                                   MEMORY_COLLECTION_THRESHOLD_EXCEEDED)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
                        trap = new SnmpOid(mibTable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
                        resolveVarName("jvmLowMemoryPoolCollectNotif").
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
                                           getOid());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
                        usedOid =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
                            new SnmpOid(mibTable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
                            resolveVarName("jvmMemPoolCollectUsed").getOid() +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
                                        "." + entryIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
                        countOid =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
                            new SnmpOid(mibTable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
                            resolveVarName("jvmMemPoolCollectThreshdCount").
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
                                        getOid() +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
                                        "." + entryIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
                    //Datas
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
                    SnmpVarBindList list = new SnmpVarBindList();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
                    SnmpOid poolNameOid =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
                        new SnmpOid(mibTable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
                                    resolveVarName("jvmMemPoolName").getOid() +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
                                    "." + entryIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
                    SnmpVarBind varCount = new SnmpVarBind(countOid, count);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
                    SnmpVarBind varUsed = new SnmpVarBind(usedOid, used);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
                    SnmpVarBind varPoolName = new SnmpVarBind(poolNameOid,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
                                              poolName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
                    list.add(varPoolName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
                    list.add(varCount);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
                    list.add(varUsed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
                    sendTrap(trap, list);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
                }catch(Exception e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
                    log.error("handleNotification",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
                              "Exception occured : " + e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     * List of notification targets.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
    private ArrayList<NotificationTarget> notificationTargets =
11530
a9d059c15b80 7117570: Warnings in sun.mangement.* and its subpackages
mchung
parents: 5506
diff changeset
   201
            new ArrayList<>();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
    private final NotificationEmitter emitter;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
    private final NotificationHandler handler;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     * Instantiate a JVM MIB intrusmentation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     * A <CODE>NotificationListener</CODE> is added to the <CODE>MemoryMXBean</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * <CODE>NotificationEmitter</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
    public JVM_MANAGEMENT_MIB_IMPL() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
        handler = new NotificationHandler();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
        emitter = (NotificationEmitter) ManagementFactory.getMemoryMXBean();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
        emitter.addNotificationListener(handler, null, null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
    private synchronized void sendTrap(SnmpOid trap, SnmpVarBindList list) {
11530
a9d059c15b80 7117570: Warnings in sun.mangement.* and its subpackages
mchung
parents: 5506
diff changeset
   218
        final Iterator<NotificationTarget> iterator = notificationTargets.iterator();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
        final SnmpAdaptorServer adaptor =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
            (SnmpAdaptorServer) getSnmpAdaptor();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
        if (adaptor == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
            log.error("sendTrap", "Cannot send trap: adaptor is null.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
            return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
        if (!adaptor.isActive()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
            log.config("sendTrap", "Adaptor is not active: trap not sent.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
            return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
        while(iterator.hasNext()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
            NotificationTarget target = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
            try {
11530
a9d059c15b80 7117570: Warnings in sun.mangement.* and its subpackages
mchung
parents: 5506
diff changeset
   235
                target = iterator.next();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
                SnmpPeer peer =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
                    new SnmpPeer(target.getAddress(), target.getPort());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
                SnmpParameters p = new SnmpParameters();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
                p.setRdCommunity(target.getCommunity());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
                peer.setParams(p);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
                log.debug("handleNotification", "Sending trap to " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
                          target.getAddress() + ":" + target.getPort());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
                adaptor.snmpV2Trap(peer, trap, list, null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
            }catch(Exception e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
                log.error("sendTrap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
                          "Exception occured while sending trap to [" +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
                          target + "]. Exception : " + e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
                log.debug("sendTrap",e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     * Add a notification target.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
     * @param target The target to add
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     * @throws IllegalArgumentException If target parameter is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
    public synchronized void addTarget(NotificationTarget target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
        throws IllegalArgumentException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
        if(target == null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
            throw new IllegalArgumentException("Target is null");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
        notificationTargets.add(target);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     * Remove notification listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
    public void terminate() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
            emitter.removeNotificationListener(handler);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
        }catch(ListenerNotFoundException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
            log.error("terminate", "Listener Not found : " + e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
     * Add notification targets.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
     * @param targets A list of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
     * <CODE>sun.management.snmp.jvminstr.NotificationTarget</CODE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
     * @throws IllegalArgumentException If targets parameter is null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
    public synchronized void addTargets(List<NotificationTarget> targets)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
        throws IllegalArgumentException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
        if(targets == null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
            throw new IllegalArgumentException("Target list is null");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
        notificationTargets.addAll(targets);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
     * Factory method for "JvmMemory" group MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
     * You can redefine this method if you need to replace the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
     * generated MBean class with your own customized class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
     * @param groupName Name of the group ("JvmMemory")
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
     * @param groupOid  OID of this group
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
     * @param groupObjname ObjectName for this group (may be null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
     * @param server    MBeanServer for this group (may be null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
     * @return An instance of the MBean class generated for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
     *         "JvmMemory" group (JvmMemory)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
     * Note that when using standard metadata,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
     * the returned object must implement the "JvmMemoryMBean"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
     * interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
     **/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
    protected Object createJvmMemoryMBean(String groupName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
                String groupOid,  ObjectName groupObjname,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
                                          MBeanServer server)  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
        // Note that when using standard metadata,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
        // the returned object must implement the "JvmMemoryMBean"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
        // interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
        if (server != null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
            return new JvmMemoryImpl(this,server);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
        else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
            return new JvmMemoryImpl(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
     * Factory method for "JvmMemory" group metadata class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
     * You can redefine this method if you need to replace the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
     * generated metadata class with your own customized class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
     * @param groupName Name of the group ("JvmMemory")
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
     * @param groupOid  OID of this group
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
     * @param groupObjname ObjectName for this group (may be null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     * @param server    MBeanServer for this group (may be null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
     * @return An instance of the metadata class generated for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
     *         "JvmMemory" group (JvmMemoryMeta)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
     **/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
    protected JvmMemoryMeta createJvmMemoryMetaNode(String groupName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
                                                    String groupOid,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
                                                    ObjectName groupObjname,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
                                                    MBeanServer server) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
        return new JvmMemoryMetaImpl(this, objectserver);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
     * Factory method for "JvmThreading" group metadata class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
     * You can redefine this method if you need to replace the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
     * generated metadata class with your own customized class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
     * @param groupName Name of the group ("JvmThreading")
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
     * @param groupOid  OID of this group
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
     * @param groupObjname ObjectName for this group (may be null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
     * @param server    MBeanServer for this group (may be null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
     * @return An instance of the metadata class generated for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
     *         "JvmThreading" group (JvmThreadingMeta)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
     **/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
    protected JvmThreadingMeta createJvmThreadingMetaNode(String groupName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
                                                          String groupOid,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
                                                          ObjectName groupObjname,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
                                                          MBeanServer server)  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
        return new JvmThreadingMetaImpl(this, objectserver);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
     * Factory method for "JvmThreading" group MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
     * You can redefine this method if you need to replace the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
     * generated MBean class with your own customized class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
     * @param groupName Name of the group ("JvmThreading")
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
     * @param groupOid  OID of this group
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
     * @param groupObjname ObjectName for this group (may be null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
     * @param server    MBeanServer for this group (may be null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
     * @return An instance of the MBean class generated for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
     *         "JvmThreading" group (JvmThreading)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
     * Note that when using standard metadata,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
     * the returned object must implement the "JvmThreadingMBean"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
     * interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
     **/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
    protected Object createJvmThreadingMBean(String groupName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
                                             String groupOid,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
                                             ObjectName groupObjname,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
                                             MBeanServer server)  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
        // Note that when using standard metadata,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
        // the returned object must implement the "JvmThreadingMBean"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
        // interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
        if (server != null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
            return new JvmThreadingImpl(this,server);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
        else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
            return new JvmThreadingImpl(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
     * Factory method for "JvmRuntime" group metadata class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
     * You can redefine this method if you need to replace the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
     * generated metadata class with your own customized class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
     * @param groupName Name of the group ("JvmRuntime")
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
     * @param groupOid  OID of this group
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
     * @param groupObjname ObjectName for this group (may be null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
     * @param server    MBeanServer for this group (may be null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
     * @return An instance of the metadata class generated for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
     *         "JvmRuntime" group (JvmRuntimeMeta)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
     **/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
    protected JvmRuntimeMeta createJvmRuntimeMetaNode(String groupName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
                                                      String groupOid,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
                                                      ObjectName groupObjname,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
                                                      MBeanServer server)  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
        return new JvmRuntimeMetaImpl(this, objectserver);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
     * Factory method for "JvmRuntime" group MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     * You can redefine this method if you need to replace the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     * generated MBean class with your own customized class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
     * @param groupName Name of the group ("JvmRuntime")
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
     * @param groupOid  OID of this group
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
     * @param groupObjname ObjectName for this group (may be null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
     * @param server    MBeanServer for this group (may be null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
     * @return An instance of the MBean class generated for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
     *         "JvmRuntime" group (JvmRuntime)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
     * Note that when using standard metadata,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
     * the returned object must implement the "JvmRuntimeMBean"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
     * interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
     **/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
    protected Object createJvmRuntimeMBean(String groupName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
                                           String groupOid,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
                                           ObjectName groupObjname,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
                                           MBeanServer server)  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
        // Note that when using standard metadata,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
        // the returned object must implement the "JvmRuntimeMBean"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
        // interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
        if (server != null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
            return new JvmRuntimeImpl(this,server);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
        else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
            return new JvmRuntimeImpl(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
     * Factory method for "JvmCompilation" group metadata class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
     * You can redefine this method if you need to replace the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
     * generated metadata class with your own customized class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
     * @param groupName Name of the group ("JvmCompilation")
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
     * @param groupOid  OID of this group
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
     * @param groupObjname ObjectName for this group (may be null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
     * @param server    MBeanServer for this group (may be null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
     * @return An instance of the metadata class generated for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
     *         "JvmCompilation" group (JvmCompilationMeta)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
     **/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
    protected JvmCompilationMeta
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
        createJvmCompilationMetaNode(String groupName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
                                     String groupOid,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
                                     ObjectName groupObjname,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
                                     MBeanServer server)  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
        // If there is no compilation system, the jvmCompilation  will not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
        // be instantiated.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
        if (ManagementFactory.getCompilationMXBean() == null) return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
        return super.createJvmCompilationMetaNode(groupName,groupOid,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
                                                  groupObjname,server);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
     * Factory method for "JvmCompilation" group MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
     * You can redefine this method if you need to replace the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
     * generated MBean class with your own customized class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
     * @param groupName Name of the group ("JvmCompilation")
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
     * @param groupOid  OID of this group
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
     * @param groupObjname ObjectName for this group (may be null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
     * @param server    MBeanServer for this group (may be null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
     * @return An instance of the MBean class generated for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
     *         "JvmCompilation" group (JvmCompilation)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
     * Note that when using standard metadata,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
     * the returned object must implement the "JvmCompilationMBean"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
     * interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
     **/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
    protected Object createJvmCompilationMBean(String groupName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
                String groupOid,  ObjectName groupObjname, MBeanServer server)  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
        // Note that when using standard metadata,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
        // the returned object must implement the "JvmCompilationMBean"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
        // interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
        if (server != null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
            return new JvmCompilationImpl(this,server);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
        else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
            return new JvmCompilationImpl(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
     * Factory method for "JvmOS" group MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
     * You can redefine this method if you need to replace the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
     * generated MBean class with your own customized class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
     * @param groupName Name of the group ("JvmOS")
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
     * @param groupOid  OID of this group
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
     * @param groupObjname ObjectName for this group (may be null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
     * @param server    MBeanServer for this group (may be null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
     * @return An instance of the MBean class generated for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
     *         "JvmOS" group (JvmOS)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
     * Note that when using standard metadata,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
     * the returned object must implement the "JvmOSMBean"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
     * interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
     **/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
    protected Object createJvmOSMBean(String groupName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
                String groupOid,  ObjectName groupObjname, MBeanServer server)  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
        // Note that when using standard metadata,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
        // the returned object must implement the "JvmOSMBean"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
        // interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
        if (server != null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
            return new JvmOSImpl(this,server);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
        else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
            return new JvmOSImpl(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
     * Factory method for "JvmClassLoading" group MBean.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
     * You can redefine this method if you need to replace the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
     * generated MBean class with your own customized class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
     * @param groupName Name of the group ("JvmClassLoading")
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
     * @param groupOid  OID of this group
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
     * @param groupObjname ObjectName for this group (may be null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
     * @param server    MBeanServer for this group (may be null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
     * @return An instance of the MBean class generated for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
     *         "JvmClassLoading" group (JvmClassLoading)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
     * Note that when using standard metadata,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
     * the returned object must implement the "JvmClassLoadingMBean"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
     * interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
     **/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
    protected Object createJvmClassLoadingMBean(String groupName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
                                                String groupOid,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
                                                ObjectName groupObjname,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
                                                MBeanServer server)  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
        // Note that when using standard metadata,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
        // the returned object must implement the "JvmClassLoadingMBean"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
        // interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
        if (server != null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
            return new JvmClassLoadingImpl(this,server);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
        else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
            return new JvmClassLoadingImpl(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
    static String validDisplayStringTC(String str) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
        if(str == null) return "";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
        if(str.length() > DISPLAY_STRING_MAX_LENGTH) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
            return str.substring(0, DISPLAY_STRING_MAX_LENGTH);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
        else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
            return str;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
    static String validJavaObjectNameTC(String str) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
        if(str == null) return "";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
        if(str.length() > JAVA_OBJECT_NAME_MAX_LENGTH) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
            return str.substring(0, JAVA_OBJECT_NAME_MAX_LENGTH);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
        else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
            return str;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
    static String validPathElementTC(String str) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
        if(str == null) return "";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
        if(str.length() > PATH_ELEMENT_MAX_LENGTH) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
            return str.substring(0, PATH_ELEMENT_MAX_LENGTH);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
        else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   609
            return str;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
    static String validArgValueTC(String str) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
        if(str == null) return "";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
90ce3da70b43 Initial load
duke
parents:
diff changeset
   615
        if(str.length() > ARG_VALUE_MAX_LENGTH) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
            return str.substring(0, ARG_VALUE_MAX_LENGTH);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
        else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
            return str;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
     * WARNING: This should probably be moved to JvmMemPoolTableMetaImpl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
     **/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   625
    private SnmpTableHandler getJvmMemPoolTableHandler(Object userData) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
        final SnmpMibTable meta =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
            getRegisteredTableMeta("JvmMemPoolTable");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   628
        if (! (meta instanceof JvmMemPoolTableMetaImpl)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   629
            final String err = ((meta==null)?"No metadata for JvmMemPoolTable":
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
                                "Bad metadata class for JvmMemPoolTable: " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
                                meta.getClass().getName());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
            log.error("getJvmMemPoolTableHandler", err);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
            return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   635
        final JvmMemPoolTableMetaImpl memPoolTable =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   636
            (JvmMemPoolTableMetaImpl) meta;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   637
        return memPoolTable.getHandler(userData);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   638
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   639
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
     * WARNING: This should probably be moved to JvmMemPoolTableMetaImpl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   642
     **/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   643
    private int findInCache(SnmpTableHandler handler,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
                            String poolName) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   645
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
        if (!(handler instanceof SnmpCachedData)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   647
            if (handler != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   648
                final String err = "Bad class for JvmMemPoolTable datas: " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   649
                    handler.getClass().getName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   650
                log.error("getJvmMemPoolEntry", err);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   651
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   652
            return -1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   653
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   654
90ce3da70b43 Initial load
duke
parents:
diff changeset
   655
        final SnmpCachedData data = (SnmpCachedData)handler;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   656
        final int len = data.datas.length;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   657
        for (int i=0; i < data.datas.length ; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   658
            final MemoryPoolMXBean pool = (MemoryPoolMXBean) data.datas[i];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   659
            if (poolName.equals(pool.getName())) return i;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   660
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   661
        return -1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   662
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   663
90ce3da70b43 Initial load
duke
parents:
diff changeset
   664
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   665
     * WARNING: This should probably be moved to JvmMemPoolTableMetaImpl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   666
     **/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   667
    private SnmpOid getJvmMemPoolEntryIndex(SnmpTableHandler handler,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   668
                                            String poolName) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
        final int index = findInCache(handler,poolName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   670
        if (index < 0) return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   671
        return ((SnmpCachedData)handler).indexes[index];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   672
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   673
90ce3da70b43 Initial load
duke
parents:
diff changeset
   674
    private SnmpOid getJvmMemPoolEntryIndex(String poolName) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   675
        return getJvmMemPoolEntryIndex(getJvmMemPoolTableHandler(null),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   676
                                       poolName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   677
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   678
90ce3da70b43 Initial load
duke
parents:
diff changeset
   679
    // cache validity
90ce3da70b43 Initial load
duke
parents:
diff changeset
   680
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   681
    // Should we define a property for this? Should we have different
90ce3da70b43 Initial load
duke
parents:
diff changeset
   682
    // cache validity periods depending on which table we cache?
90ce3da70b43 Initial load
duke
parents:
diff changeset
   683
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   684
    public long validity() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   685
        return DEFAULT_CACHE_VALIDITY_PERIOD;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   686
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   687
90ce3da70b43 Initial load
duke
parents:
diff changeset
   688
    // Defined in RFC 2579
90ce3da70b43 Initial load
duke
parents:
diff changeset
   689
    private final static int DISPLAY_STRING_MAX_LENGTH=255;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   690
    private final static int JAVA_OBJECT_NAME_MAX_LENGTH=1023;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   691
    private final static int PATH_ELEMENT_MAX_LENGTH=1023;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   692
    private final static int ARG_VALUE_MAX_LENGTH=1023;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   693
    private final static int DEFAULT_CACHE_VALIDITY_PERIOD=1000;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   694
}