Source Code Cross Referenced for JvmThreadInstanceTableMeta.java in  » 6.0-JDK-Modules-sun » management » sun » management » snmp » jvmmib » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules sun » management » sun.management.snmp.jvmmib 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2003-2004 Sun Microsystems, Inc.  All Rights Reserved.
003:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004:         *
005:         * This code is free software; you can redistribute it and/or modify it
006:         * under the terms of the GNU General Public License version 2 only, as
007:         * published by the Free Software Foundation.  Sun designates this
008:         * particular file as subject to the "Classpath" exception as provided
009:         * by Sun in the LICENSE file that accompanied this code.
010:         *
011:         * This code is distributed in the hope that it will be useful, but WITHOUT
012:         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013:         * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
014:         * version 2 for more details (a copy is included in the LICENSE file that
015:         * accompanied this code).
016:         *
017:         * You should have received a copy of the GNU General Public License version
018:         * 2 along with this work; if not, write to the Free Software Foundation,
019:         * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020:         *
021:         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022:         * CA 95054 USA or visit www.sun.com if you need additional information or
023:         * have any questions.
024:         */
025:
026:        package sun.management.snmp.jvmmib;
027:
028:        //
029:        // Generated by mibgen version 5.0 (06/02/03) when compiling JVM-MANAGEMENT-MIB in standard metadata mode.
030:        //
031:
032:        // java imports
033:        //
034:        import java.io.Serializable;
035:        import java.util.Vector;
036:
037:        // jmx imports
038:        //
039:        import javax.management.MBeanServer;
040:        import javax.management.ObjectName;
041:        import com.sun.jmx.snmp.SnmpCounter;
042:        import com.sun.jmx.snmp.SnmpCounter64;
043:        import com.sun.jmx.snmp.SnmpGauge;
044:        import com.sun.jmx.snmp.SnmpInt;
045:        import com.sun.jmx.snmp.SnmpUnsignedInt;
046:        import com.sun.jmx.snmp.SnmpIpAddress;
047:        import com.sun.jmx.snmp.SnmpTimeticks;
048:        import com.sun.jmx.snmp.SnmpOpaque;
049:        import com.sun.jmx.snmp.SnmpString;
050:        import com.sun.jmx.snmp.SnmpStringFixed;
051:        import com.sun.jmx.snmp.SnmpOid;
052:        import com.sun.jmx.snmp.SnmpNull;
053:        import com.sun.jmx.snmp.SnmpValue;
054:        import com.sun.jmx.snmp.SnmpVarBind;
055:        import com.sun.jmx.snmp.SnmpStatusException;
056:
057:        // jdmk imports
058:        //
059:        import com.sun.jmx.snmp.agent.SnmpIndex;
060:        import com.sun.jmx.snmp.agent.SnmpMib;
061:        import com.sun.jmx.snmp.agent.SnmpMibTable;
062:        import com.sun.jmx.snmp.agent.SnmpMibSubRequest;
063:        import com.sun.jmx.snmp.agent.SnmpStandardObjectServer;
064:
065:        /**
066:         * The class is used for implementing the "JvmThreadInstanceTable" group.
067:         * The group is defined with the following oid: 1.3.6.1.4.1.42.2.145.3.163.1.1.3.10.
068:         */
069:        public class JvmThreadInstanceTableMeta extends SnmpMibTable implements 
070:                Serializable {
071:
072:            /**
073:             * Constructor for the table. Initialize metadata for "JvmThreadInstanceTableMeta".
074:             * The reference on the MBean server is updated so the entries created through an SNMP SET will be AUTOMATICALLY REGISTERED in Java DMK.
075:             */
076:            public JvmThreadInstanceTableMeta(SnmpMib myMib,
077:                    SnmpStandardObjectServer objserv) {
078:                super (myMib);
079:                objectserver = objserv;
080:            }
081:
082:            /**
083:             * Factory method for "JvmThreadInstanceEntry" entry metadata class.
084:             * 
085:             * You can redefine this method if you need to replace the default
086:             * generated metadata class with your own customized class.
087:             * 
088:             * @param snmpEntryName Name of the SNMP Entry object (conceptual row) ("JvmThreadInstanceEntry")
089:             * @param tableName Name of the table in which the entries are registered ("JvmThreadInstanceTable")
090:             * @param mib The SnmpMib object in which this table is registered
091:             * @param server MBeanServer for this table entries (may be null)
092:             * 
093:             * @return An instance of the metadata class generated for the
094:             *         "JvmThreadInstanceEntry" conceptual row (JvmThreadInstanceEntryMeta)
095:             * 
096:             **/
097:            protected JvmThreadInstanceEntryMeta createJvmThreadInstanceEntryMetaNode(
098:                    String snmpEntryName, String tableName, SnmpMib mib,
099:                    MBeanServer server) {
100:                return new JvmThreadInstanceEntryMeta(mib, objectserver);
101:            }
102:
103:            // ------------------------------------------------------------
104:            // 
105:            // Implements the "createNewEntry" method defined in "SnmpMibTable".
106:            // See the "SnmpMibTable" Javadoc API for more details.
107:            // 
108:            // ------------------------------------------------------------
109:
110:            public void createNewEntry(SnmpMibSubRequest req, SnmpOid rowOid,
111:                    int depth) throws SnmpStatusException {
112:                if (factory != null)
113:                    factory.createNewEntry(req, rowOid, depth, this );
114:                else
115:                    throw new SnmpStatusException(
116:                            SnmpStatusException.snmpRspNoAccess);
117:            }
118:
119:            // ------------------------------------------------------------
120:            // 
121:            // Implements the "isRegistrationRequired" method defined in "SnmpMibTable".
122:            // See the "SnmpMibTable" Javadoc API for more details.
123:            // 
124:            // ------------------------------------------------------------
125:
126:            public boolean isRegistrationRequired() {
127:                return false;
128:            }
129:
130:            public void registerEntryNode(SnmpMib mib, MBeanServer server) {
131:                node = createJvmThreadInstanceEntryMetaNode(
132:                        "JvmThreadInstanceEntry", "JvmThreadInstanceTable",
133:                        mib, server);
134:            }
135:
136:            // ------------------------------------------------------------
137:            // 
138:            // Implements the "addEntry" method defined in "SnmpMibTable".
139:            // See the "SnmpMibTable" Javadoc API for more details.
140:            // 
141:            // ------------------------------------------------------------
142:
143:            public synchronized void addEntry(SnmpOid rowOid,
144:                    ObjectName objname, Object entry)
145:                    throws SnmpStatusException {
146:                if (!(entry instanceof  JvmThreadInstanceEntryMBean))
147:                    throw new ClassCastException("Entries for Table \""
148:                            + "JvmThreadInstanceTable"
149:                            + "\" must implement the \""
150:                            + "JvmThreadInstanceEntryMBean" + "\" interface.");
151:                super .addEntry(rowOid, objname, entry);
152:            }
153:
154:            // ------------------------------------------------------------
155:            // 
156:            // Implements the "get" method defined in "SnmpMibTable".
157:            // See the "SnmpMibTable" Javadoc API for more details.
158:            // 
159:            // ------------------------------------------------------------
160:
161:            public void get(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
162:                    throws SnmpStatusException {
163:                JvmThreadInstanceEntryMBean entry = (JvmThreadInstanceEntryMBean) getEntry(rowOid);
164:                synchronized (this ) {
165:                    node.setInstance(entry);
166:                    node.get(req, depth);
167:                }
168:            }
169:
170:            // ------------------------------------------------------------
171:            // 
172:            // Implements the "set" method defined in "SnmpMibTable".
173:            // See the "SnmpMibTable" Javadoc API for more details.
174:            // 
175:            // ------------------------------------------------------------
176:
177:            public void set(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
178:                    throws SnmpStatusException {
179:                if (req.getSize() == 0)
180:                    return;
181:
182:                JvmThreadInstanceEntryMBean entry = (JvmThreadInstanceEntryMBean) getEntry(rowOid);
183:                synchronized (this ) {
184:                    node.setInstance(entry);
185:                    node.set(req, depth);
186:                }
187:            }
188:
189:            // ------------------------------------------------------------
190:            // 
191:            // Implements the "check" method defined in "SnmpMibTable".
192:            // See the "SnmpMibTable" Javadoc API for more details.
193:            // 
194:            // ------------------------------------------------------------
195:
196:            public void check(SnmpMibSubRequest req, SnmpOid rowOid, int depth)
197:                    throws SnmpStatusException {
198:                if (req.getSize() == 0)
199:                    return;
200:
201:                JvmThreadInstanceEntryMBean entry = (JvmThreadInstanceEntryMBean) 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,
220:                    Object data) 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,
243:                    Object data, int pduVersion) {
244:                try {
245:                    JvmThreadInstanceEntryMBean entry = (JvmThreadInstanceEntryMBean) getEntry(rowOid);
246:                    synchronized (this ) {
247:                        node.setInstance(entry);
248:                        return node.skipVariable(var, data, pduVersion);
249:                    }
250:                } catch (SnmpStatusException x) {
251:                    return false;
252:                }
253:            }
254:
255:            /**
256:             * Reference to the entry metadata.
257:             */
258:            private JvmThreadInstanceEntryMeta node;
259:
260:            /**
261:             * Reference to the object server.
262:             */
263:            protected SnmpStandardObjectServer objectserver;
264:
265:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.