KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > admin > server > core > mbean > config > JCAAdminHandler


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 package com.sun.enterprise.admin.server.core.mbean.config;
25
26 //JMX imports
27
import javax.management.MBeanInfo JavaDoc;
28
29 //Admin imports
30
import com.sun.enterprise.admin.common.exception.JCAAdminException;
31 import com.sun.enterprise.admin.common.ResourceAdapterInfo;
32 import com.sun.enterprise.admin.server.core.mbean.meta.MBeanEasyConfig;
33
34 //JDK imports
35
import java.util.Properties JavaDoc;
36 import java.util.List JavaDoc;
37
38 /**
39     Handler for all JMS related admin requests.
40     <p>
41     ObjectName of this MBean is:
42         ias:type=jmsadmin
43 */

44
45 public class JCAAdminHandler extends AdminBase {
46
47   public JCAAdminHandler() {
48   }
49
50   /**
51    *return a list of resource adapter names that are deployed
52    */

53   public Object JavaDoc[] listResourceAdapterNames(String JavaDoc iASInstanceName) throws JCAAdminException {
54        return null;
55   }
56   
57   /**
58    *return the properties of a specific resource adapter
59    */

60   public ResourceAdapterInfo getResourceAdapterProperties(String JavaDoc iasInstanceName,
61                                 String JavaDoc adapterName) throws JCAAdminException {
62       return null;
63   }
64   
65   /**
66    *return the value of a specific property for a specific resource adapter
67    */

68   public Object JavaDoc getResourceAdapterInstanceProperty(String JavaDoc iasInstanceName, String JavaDoc adapterInstance,
69                                       String JavaDoc propertyName) throws JCAAdminException {
70       return new Object JavaDoc();
71   }
72     /** Every resource MBean should override this method to execute specific
73      * operations on the MBean. This method is enhanced in 8.0. It was a no-op
74      * in 7.0. In 8.0, it is modified to invoke the actual method through
75      * reflection.
76      * @since 8.0
77      * @see javax.management.MBeanServer#invoke
78      * @see #getImplementingClass
79      */

80     protected Class JavaDoc getImplementingClass() {
81         return ( this.getClass() );
82     }
83     
84     /** Reflection requires the implementing object. */
85     protected Object JavaDoc getImplementingMBean() {
86         return ( this );
87     }
88     /** Implementation of getMBeanInfo. This appears here, so that this class
89      * can do additional things in case it wants to have different information
90      * in the MBeanInfo. Ideally the superclass AdminBase should be able to do
91      * this.
92     */

93     public MBeanInfo JavaDoc getMBeanInfo()
94     {
95         try {
96             return (new MBeanEasyConfig(getClass(), mAttrs, mOpers, null)).getMBeanInfo();
97         }
98         catch(Exception JavaDoc e) {
99             e.printStackTrace();
100             return null;
101         }
102     }
103     
104     final String JavaDoc[] mAttrs = new String JavaDoc[0];
105     
106     final String JavaDoc[] mOpers = new String JavaDoc[]
107     {
108         "getResourceAdapterInstanceProperty(String iasInstanceName, String adapterInstance), INFO",
109         "getResourceAdapterProperties(String iasInstanceName, String adapterName), INFO",
110         "listResourceAdapterNames(String iASInstanceName), INFO",
111     };
112 }
113
Popular Tags