author | alanb |
Fri, 02 Nov 2012 15:50:11 +0000 | |
changeset 14342 | 8435a30053c1 |
parent 11530 | a9d059c15b80 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
14342
8435a30053c1
7197491: update copyright year to match last edit in jdk8 jdk repository
alanb
parents:
11530
diff
changeset
|
2 |
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
package sun.management.snmp.jvmmib; |
|
27 |
||
28 |
// |
|
29 |
// Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode. |
|
30 |
// |
|
31 |
||
32 |
// java imports |
|
33 |
// |
|
34 |
import java.io.Serializable; |
|
35 |
import java.util.Vector; |
|
36 |
||
37 |
// jmx imports |
|
38 |
// |
|
39 |
import javax.management.MBeanServer; |
|
40 |
import javax.management.ObjectName; |
|
41 |
import com.sun.jmx.snmp.SnmpCounter; |
|
42 |
import com.sun.jmx.snmp.SnmpCounter64; |
|
43 |
import com.sun.jmx.snmp.SnmpGauge; |
|
44 |
import com.sun.jmx.snmp.SnmpInt; |
|
45 |
import com.sun.jmx.snmp.SnmpUnsignedInt; |
|
46 |
import com.sun.jmx.snmp.SnmpIpAddress; |
|
47 |
import com.sun.jmx.snmp.SnmpTimeticks; |
|
48 |
import com.sun.jmx.snmp.SnmpOpaque; |
|
49 |
import com.sun.jmx.snmp.SnmpString; |
|
50 |
import com.sun.jmx.snmp.SnmpStringFixed; |
|
51 |
import com.sun.jmx.snmp.SnmpOid; |
|
52 |
import com.sun.jmx.snmp.SnmpNull; |
|
53 |
import com.sun.jmx.snmp.SnmpValue; |
|
54 |
import com.sun.jmx.snmp.SnmpVarBind; |
|
55 |
import com.sun.jmx.snmp.SnmpStatusException; |
|
56 |
||
57 |
// jdmk imports |
|
58 |
// |
|
59 |
import com.sun.jmx.snmp.agent.SnmpIndex; |
|
60 |
import com.sun.jmx.snmp.agent.SnmpMib; |
|
61 |
import com.sun.jmx.snmp.agent.SnmpMibTable; |
|
62 |
import com.sun.jmx.snmp.agent.SnmpMibSubRequest; |
|
63 |
import com.sun.jmx.snmp.agent.SnmpStandardObjectServer; |
|
64 |
||
65 |
/** |
|
66 |
* The class is used for implementing the "JvmRTInputArgsTable" group. |
|
67 |
* The group is defined with the following oid: 1.3.6.1.4.1.42.2.145.3.163.1.1.4.20. |
|
68 |
*/ |
|
69 |
public class JvmRTInputArgsTableMeta extends SnmpMibTable implements Serializable { |
|
70 |
||
11530
a9d059c15b80
7117570: Warnings in sun.mangement.* and its subpackages
mchung
parents:
5506
diff
changeset
|
71 |
static final long serialVersionUID = 5395531763015738645L; |
2 | 72 |
/** |
73 |
* Constructor for the table. Initialize metadata for "JvmRTInputArgsTableMeta". |
|
74 |
* The reference on the MBean server is updated so the entries created through an SNMP SET will be AUTOMATICALLY REGISTERED in Java DMK. |
|
75 |
*/ |
|
76 |
public JvmRTInputArgsTableMeta(SnmpMib myMib, SnmpStandardObjectServer objserv) { |
|
77 |
super(myMib); |
|
78 |
objectserver = objserv; |
|
79 |
} |
|
80 |
||
81 |
||
82 |
/** |
|
83 |
* Factory method for "JvmRTInputArgsEntry" entry metadata class. |
|
84 |
* |
|
85 |
* You can redefine this method if you need to replace the default |
|
86 |
* generated metadata class with your own customized class. |
|
87 |
* |
|
88 |
* @param snmpEntryName Name of the SNMP Entry object (conceptual row) ("JvmRTInputArgsEntry") |
|
89 |
* @param tableName Name of the table in which the entries are registered ("JvmRTInputArgsTable") |
|
90 |
* @param mib The SnmpMib object in which this table is registered |
|
91 |
* @param server MBeanServer for this table entries (may be null) |
|
92 |
* |
|
93 |
* @return An instance of the metadata class generated for the |
|
94 |
* "JvmRTInputArgsEntry" conceptual row (JvmRTInputArgsEntryMeta) |
|
95 |
* |
|
96 |
**/ |
|
97 |
protected JvmRTInputArgsEntryMeta createJvmRTInputArgsEntryMetaNode(String snmpEntryName, String tableName, SnmpMib mib, MBeanServer server) { |
|
98 |
return new JvmRTInputArgsEntryMeta(mib, objectserver); |
|
99 |
} |
|
100 |
||
101 |
||
102 |
// ------------------------------------------------------------ |
|
103 |
// |
|
104 |
// Implements the "createNewEntry" method defined in "SnmpMibTable". |
|
105 |
// See the "SnmpMibTable" Javadoc API for more details. |
|
106 |
// |
|
107 |
// ------------------------------------------------------------ |
|
108 |
||
109 |
public void createNewEntry(SnmpMibSubRequest req, SnmpOid rowOid, int depth) |
|
110 |
throws SnmpStatusException { |
|
111 |
if (factory != null) |
|
112 |
factory.createNewEntry(req, rowOid, depth, this); |
|
113 |
else |
|
114 |
throw new SnmpStatusException( |
|
115 |
SnmpStatusException.snmpRspNoAccess); |
|
116 |
} |
|
117 |
||
118 |
||
119 |
||
120 |
// ------------------------------------------------------------ |
|
121 |
// |
|
122 |
// Implements the "isRegistrationRequired" method defined in "SnmpMibTable". |
|
123 |
// See the "SnmpMibTable" Javadoc API for more details. |
|
124 |
// |
|
125 |
// ------------------------------------------------------------ |
|
126 |
||
127 |
public boolean isRegistrationRequired() { |
|
128 |
return false; |
|
129 |
} |
|
130 |
||
131 |
||
132 |
||
133 |
public void registerEntryNode(SnmpMib mib, MBeanServer server) { |
|
134 |
node = createJvmRTInputArgsEntryMetaNode("JvmRTInputArgsEntry", "JvmRTInputArgsTable", mib, server); |
|
135 |
} |
|
136 |
||
137 |
||
138 |
// ------------------------------------------------------------ |
|
139 |
// |
|
140 |
// Implements the "addEntry" method defined in "SnmpMibTable". |
|
141 |
// See the "SnmpMibTable" Javadoc API for more details. |
|
142 |
// |
|
143 |
// ------------------------------------------------------------ |
|
144 |
||
145 |
public synchronized void addEntry(SnmpOid rowOid, ObjectName objname, |
|
146 |
Object entry) |
|
147 |
throws SnmpStatusException { |
|
148 |
if (! (entry instanceof JvmRTInputArgsEntryMBean) ) |
|
149 |
throw new ClassCastException("Entries for Table \"" + |
|
150 |
"JvmRTInputArgsTable" + "\" must implement the \"" + |
|
151 |
"JvmRTInputArgsEntryMBean" + "\" interface."); |
|
152 |
super.addEntry(rowOid, objname, entry); |
|
153 |
} |
|
154 |
||
155 |
||
156 |
// ------------------------------------------------------------ |
|
157 |
// |
|
158 |
// Implements the "get" method defined in "SnmpMibTable". |
|
159 |
// See the "SnmpMibTable" Javadoc API for more details. |
|
160 |
// |
|
161 |
// ------------------------------------------------------------ |
|
162 |
||
163 |
public void get(SnmpMibSubRequest req, SnmpOid rowOid, int depth) |
|
164 |
throws SnmpStatusException { |
|
165 |
JvmRTInputArgsEntryMBean entry = (JvmRTInputArgsEntryMBean) getEntry(rowOid); |
|
166 |
synchronized (this) { |
|
167 |
node.setInstance(entry); |
|
168 |
node.get(req,depth); |
|
169 |
} |
|
170 |
} |
|
171 |
||
172 |
// ------------------------------------------------------------ |
|
173 |
// |
|
174 |
// Implements the "set" method defined in "SnmpMibTable". |
|
175 |
// See the "SnmpMibTable" Javadoc API for more details. |
|
176 |
// |
|
177 |
// ------------------------------------------------------------ |
|
178 |
||
179 |
public void set(SnmpMibSubRequest req, SnmpOid rowOid, int depth) |
|
180 |
throws SnmpStatusException { |
|
181 |
if (req.getSize() == 0) return; |
|
182 |
||
183 |
JvmRTInputArgsEntryMBean entry = (JvmRTInputArgsEntryMBean) getEntry(rowOid); |
|
184 |
synchronized (this) { |
|
185 |
node.setInstance(entry); |
|
186 |
node.set(req,depth); |
|
187 |
} |
|
188 |
} |
|
189 |
||
190 |
// ------------------------------------------------------------ |
|
191 |
// |
|
192 |
// Implements the "check" method defined in "SnmpMibTable". |
|
193 |
// See the "SnmpMibTable" Javadoc API for more details. |
|
194 |
// |
|
195 |
// ------------------------------------------------------------ |
|
196 |
||
197 |
public void check(SnmpMibSubRequest req, SnmpOid rowOid, int depth) |
|
198 |
throws SnmpStatusException { |
|
199 |
if (req.getSize() == 0) return; |
|
200 |
||
201 |
JvmRTInputArgsEntryMBean entry = (JvmRTInputArgsEntryMBean) getEntry(rowOid); |
|
202 |
synchronized (this) { |
|
203 |
node.setInstance(entry); |
|
204 |
node.check(req,depth); |
|
205 |
} |
|
206 |
} |
|
207 |
||
208 |
/** |
|
209 |
* check that the given "var" identifies a columnar object. |
|
210 |
*/ |
|
211 |
public void validateVarEntryId( SnmpOid rowOid, long var, Object data ) |
|
212 |
throws SnmpStatusException { |
|
213 |
node.validateVarId(var, data); |
|
214 |
} |
|
215 |
||
216 |
/** |
|
217 |
* Returns true if "var" identifies a readable scalar object. |
|
218 |
*/ |
|
219 |
public boolean isReadableEntryId( SnmpOid rowOid, long var, Object data ) |
|
220 |
throws SnmpStatusException { |
|
221 |
return node.isReadable(var); |
|
222 |
} |
|
223 |
||
224 |
/** |
|
225 |
* Returns the arc of the next columnar object following "var". |
|
226 |
*/ |
|
227 |
public long getNextVarEntryId( SnmpOid rowOid, long var, Object data ) |
|
228 |
throws SnmpStatusException { |
|
229 |
long nextvar = node.getNextVarId(var, data); |
|
230 |
while (!isReadableEntryId(rowOid, nextvar, data)) |
|
231 |
nextvar = node.getNextVarId(nextvar, data); |
|
232 |
return nextvar; |
|
233 |
} |
|
234 |
||
235 |
// ------------------------------------------------------------ |
|
236 |
// |
|
237 |
// Implements the "skipEntryVariable" method defined in "SnmpMibTable". |
|
238 |
// See the "SnmpMibTable" Javadoc API for more details. |
|
239 |
// |
|
240 |
// ------------------------------------------------------------ |
|
241 |
||
242 |
public boolean skipEntryVariable( SnmpOid rowOid, long var, Object data, int pduVersion) { |
|
243 |
try { |
|
244 |
JvmRTInputArgsEntryMBean entry = (JvmRTInputArgsEntryMBean) getEntry(rowOid); |
|
245 |
synchronized (this) { |
|
246 |
node.setInstance(entry); |
|
247 |
return node.skipVariable(var, data, pduVersion); |
|
248 |
} |
|
249 |
} catch (SnmpStatusException x) { |
|
250 |
return false; |
|
251 |
} |
|
252 |
} |
|
253 |
||
254 |
||
255 |
/** |
|
256 |
* Reference to the entry metadata. |
|
257 |
*/ |
|
258 |
private JvmRTInputArgsEntryMeta node; |
|
259 |
||
260 |
/** |
|
261 |
* Reference to the object server. |
|
262 |
*/ |
|
263 |
protected SnmpStandardObjectServer objectserver; |
|
264 |
||
265 |
} |