KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > cli > jmx > support > CLISupport


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23  
24 /*
25  * $Header: /cvs/glassfish/admin-cli/cli-api/src/java/com/sun/cli/jmx/support/CLISupport.java,v 1.3 2005/12/25 03:45:45 tcfujii Exp $
26  * $Revision: 1.3 $
27  * $Date: 2005/12/25 03:45:45 $
28  */

29  
30
31  
32 package com.sun.cli.jmx.support;
33  
34 import javax.management.*;
35 import java.io.IOException JavaDoc;
36
37
38 public final class CLISupport implements CLISupportMBean
39 {
40     private CLISupportMBeanImpl mImpl;
41     
42
43     /*
44         Constructor takes the MBeanServerConnection which should be used to implement
45         its functionality. This *need not be* the same MBeanServerConnection as the
46         one in which this MBean itself is registered.
47      */

48         public
49     CLISupport( MBeanServerConnection conn, AliasMgrMBean aliasMgr )
50         throws Exception JavaDoc
51     {
52         mImpl = new CLISupportMBeanImpl( conn, aliasMgr );
53     }
54     
55         public ResultsForGetSet []
56     mbeanGet( String JavaDoc attrs, String JavaDoc [] targets) throws Exception JavaDoc
57     {
58         final ResultsForGetSet [] result = mImpl.mbeanGet( attrs, targets );
59         
60         return( result );
61     }
62     
63
64         public ResultsForGetSet []
65     mbeanSet( String JavaDoc attrs, String JavaDoc [] targets ) throws Exception JavaDoc
66     {
67         final ResultsForGetSet [] result = mImpl.mbeanSet( attrs, targets );
68         
69         return( result );
70     }
71     
72      
73         public InvokeResult []
74     mbeanInvoke( String JavaDoc operationName, String JavaDoc args, String JavaDoc [] targets )
75         throws Exception JavaDoc
76     {
77         final InvokeResult [] result = mImpl.mbeanInvoke( operationName, args, targets );
78         
79         return( result );
80     }
81
82
83         public InspectResult
84     mbeanInspect( InspectRequest request, ObjectName name )
85         throws Exception JavaDoc
86     {
87         final InspectResult result = (InspectResult)mImpl.mbeanInspect( request, name );
88         
89         return( result );
90     }
91     
92         public InspectResult []
93     mbeanInspect( InspectRequest request, String JavaDoc [] targets )
94         throws Exception JavaDoc
95     {
96         final InspectResult [] result = mImpl.mbeanInspect( request, targets );
97         
98         return( result );
99     }
100     
101         public ObjectName []
102     mbeanFind( String JavaDoc [] patterns )
103         throws Exception JavaDoc
104     {
105         final ObjectName [] result = mImpl.mbeanFind( patterns );
106         
107         return( result );
108     }
109     
110     
111         public ObjectName []
112     mbeanFind( String JavaDoc [] patterns, String JavaDoc regexList)
113         throws Exception JavaDoc
114     {
115         final ObjectName [] result = mImpl.mbeanFind( patterns, regexList );
116         
117         return( result );
118     }
119     
120     
121         public ObjectName []
122     resolveTargets( final String JavaDoc [] targets ) throws Exception JavaDoc
123     {
124         final ObjectName [] resolved = mImpl.resolveTargets( targets );
125         
126         return( resolved );
127     }
128     
129         public void
130     mbeanCreate( String JavaDoc name, String JavaDoc theClass, String JavaDoc args ) throws Exception JavaDoc
131     {
132         mImpl.mbeanCreate( name, theClass, args );
133     }
134     
135         public void
136     mbeanUnregister( String JavaDoc name ) throws Exception JavaDoc
137     {
138         mImpl.mbeanUnregister( name );
139     }
140     
141         public int
142     mbeanCount( ) throws Exception JavaDoc
143     {
144         return( mImpl.mbeanCount( ) );
145     }
146     
147         public String JavaDoc []
148     mbeanDomains( ) throws Exception JavaDoc
149     {
150         return( mImpl.mbeanDomains( ) );
151     }
152     
153         public void
154     mbeanListen(
155         boolean start,
156         String JavaDoc [] targets,
157         NotificationListener listener,
158         NotificationFilter filter,
159         Object JavaDoc handback ) throws Exception JavaDoc
160     {
161         mImpl.mbeanListen( start, targets, listener, filter, handback );
162     }
163     
164 }
165
166
Popular Tags