author | dfuchs |
Thu, 04 Sep 2008 14:46:36 +0200 | |
changeset 1156 | bbc2d15aaf7a |
parent 2 | 90ce3da70b43 |
child 5506 | 202f599c92aa |
permissions | -rw-r--r-- |
2 | 1 |
/* |
1156
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
2 |
* Copyright 2002-2008 Sun Microsystems, Inc. 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 |
|
7 |
* published by the Free Software Foundation. Sun designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Sun in the LICENSE file that accompanied this code. |
|
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 |
* |
|
21 |
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
|
22 |
* CA 95054 USA or visit www.sun.com if you need additional information or |
|
23 |
* have any questions. |
|
24 |
*/ |
|
25 |
||
26 |
package com.sun.jmx.interceptor; |
|
27 |
||
28 |
||
1156
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
29 |
import java.io.ObjectInputStream; |
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
30 |
import javax.management.InstanceNotFoundException; |
2 | 31 |
import javax.management.MBeanException; |
1156
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
32 |
import javax.management.MBeanServer; |
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
33 |
import javax.management.ObjectName; |
2 | 34 |
import javax.management.OperationsException; |
1156
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
35 |
import javax.management.ReflectionException; |
2 | 36 |
import javax.management.loading.ClassLoaderRepository; |
37 |
||
38 |
/** |
|
39 |
* <p>This interface specifies the behavior to be implemented by an |
|
40 |
* MBean Server Interceptor. An MBean Server Interceptor has |
|
41 |
* essentially the same interface as an MBean Server. An MBean Server |
|
42 |
* forwards received requests to its default interceptor, which may |
|
43 |
* handle them itself or forward them to other interceptors. The |
|
44 |
* default interceptor may be changed via the {@link |
|
45 |
* com.sun.jmx.mbeanserver.SunJmxMBeanServer#setMBeanServerInterceptor} |
|
46 |
* method.</p> |
|
47 |
* |
|
48 |
* <p>The initial default interceptor provides the standard MBean |
|
49 |
* Server behavior. It handles a collection of named MBeans, each |
|
50 |
* represented by a Java object. A replacement default interceptor |
|
51 |
* may build on this behavior, for instance by adding logging or |
|
52 |
* security checks, before forwarding requests to the initial default |
|
53 |
* interceptor. Or, it may route each request to one of a number of |
|
54 |
* sub-interceptors, for instance based on the {@link ObjectName} in |
|
55 |
* the request.</p> |
|
56 |
* |
|
57 |
* <p>An interceptor, default or not, need not implement MBeans as |
|
58 |
* Java objects, in the way that the initial default interceptor does. |
|
59 |
* It may instead implement <em>virtual MBeans</em>, which do not |
|
60 |
* exist as Java objects when they are not in use. For example, these |
|
61 |
* MBeans could be implemented by forwarding requests to a database, |
|
62 |
* or to a remote MBean server, or by performing system calls to query |
|
63 |
* or modify system resources.</p> |
|
64 |
* |
|
65 |
* @since 1.5 |
|
66 |
*/ |
|
1156
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
67 |
public interface MBeanServerInterceptor extends MBeanServer { |
2 | 68 |
/** |
1156
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
69 |
* This method should never be called. |
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
70 |
* Usually hrows UnsupportedOperationException. |
2 | 71 |
*/ |
1156
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
72 |
public Object instantiate(String className) |
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
73 |
throws ReflectionException, MBeanException; |
2 | 74 |
/** |
1156
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
75 |
* This method should never be called. |
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
76 |
* Usually throws UnsupportedOperationException. |
2 | 77 |
*/ |
1156
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
78 |
public Object instantiate(String className, ObjectName loaderName) |
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
79 |
throws ReflectionException, MBeanException, |
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
80 |
InstanceNotFoundException; |
2 | 81 |
/** |
1156
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
82 |
* This method should never be called. |
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
83 |
* Usually throws UnsupportedOperationException. |
2 | 84 |
*/ |
1156
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
85 |
public Object instantiate(String className, Object[] params, |
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
86 |
String[] signature) throws ReflectionException, MBeanException; |
2 | 87 |
|
88 |
/** |
|
1156
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
89 |
* This method should never be called. |
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
90 |
* Usually throws UnsupportedOperationException. |
2 | 91 |
*/ |
1156
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
92 |
public Object instantiate(String className, ObjectName loaderName, |
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
93 |
Object[] params, String[] signature) |
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
94 |
throws ReflectionException, MBeanException, |
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
95 |
InstanceNotFoundException; |
2 | 96 |
|
97 |
/** |
|
1156
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
98 |
* This method should never be called. |
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
99 |
* Usually throws UnsupportedOperationException. |
2 | 100 |
*/ |
1156
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
101 |
@Deprecated |
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
102 |
public ObjectInputStream deserialize(ObjectName name, byte[] data) |
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
103 |
throws InstanceNotFoundException, OperationsException; |
2 | 104 |
|
105 |
/** |
|
1156
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
106 |
* This method should never be called. |
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
107 |
* Usually throws UnsupportedOperationException. |
2 | 108 |
*/ |
1156
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
109 |
@Deprecated |
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
110 |
public ObjectInputStream deserialize(String className, byte[] data) |
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
111 |
throws OperationsException, ReflectionException; |
2 | 112 |
|
113 |
/** |
|
1156
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
114 |
* This method should never be called. |
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
115 |
* Usually hrows UnsupportedOperationException. |
2 | 116 |
*/ |
1156
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
117 |
@Deprecated |
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
118 |
public ObjectInputStream deserialize(String className, |
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
119 |
ObjectName loaderName, byte[] data) |
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
120 |
throws InstanceNotFoundException, OperationsException, |
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
121 |
ReflectionException; |
2 | 122 |
|
123 |
/** |
|
1156
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
124 |
* This method should never be called. |
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
125 |
* Usually throws UnsupportedOperationException. |
2 | 126 |
*/ |
1156
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
127 |
public ClassLoaderRepository getClassLoaderRepository(); |
2 | 128 |
|
129 |
} |
|
1156
bbc2d15aaf7a
5072476: RFE: support cascaded (federated) MBean Servers
dfuchs
parents:
2
diff
changeset
|
130 |