KickJava   Java API By Example, From Geeks To Geeks.

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


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.*;
28
29 //Config imports
30
import com.sun.enterprise.config.ConfigException;
31 import com.sun.enterprise.config.serverbeans.ServerTags;
32
33 //Admin imports
34
import com.sun.enterprise.admin.server.core.mbean.meta.MBeanEasyConfig;
35 import com.sun.enterprise.admin.common.exception.MBeanConfigException;
36 import com.sun.enterprise.admin.common.constant.ConfigAttributeName;
37 import com.sun.enterprise.admin.common.ObjectNames;
38
39 /**
40     Represents a JMS-resource.
41
42     ObjectName of this MBean is:
43         ias: component=jms-resource, instance-name=<instance-name>
44 */

45 public class ManagedJMSResource extends ConfigMBeanBase implements ConfigAttributeName.JMSResource
46 {
47     private static final String JavaDoc[][] MAPLIST = {
48         {kJndiName, ATTRIBUTE + ServerTags.JNDI_NAME},
49         {kResType, ATTRIBUTE + ServerTags.RES_TYPE},
50 //ms1 {kEnabled, ATTRIBUTE + ServerTags.ENABLED},
51
{kDescription, ATTRIBUTE + PSEUDO_ATTR_DESCRIPTION},
52     };
53
54     private static final String JavaDoc[] ATTRIBUTES =
55     {
56         kJndiName + ", String, R" ,
57         kResType + ", String, RW" ,
58 //ms1 kEnabled + ", boolean, RW" ,
59
kDescription + ", String, RW" ,
60     };
61
62     private static final String JavaDoc[] OPERATIONS = null;
63
64     /**
65         Default constructor sets MBean description tables
66     */

67     public ManagedJMSResource() throws MBeanConfigException
68     {
69         this.setDescriptions(MAPLIST, ATTRIBUTES, OPERATIONS);
70     }
71
72     /**
73         Constructs Config MBean for JMS Resource.
74         @param instanceName The server instance name.
75         @param jndiName JNDI name associated with given resource
76     */

77     public ManagedJMSResource(String JavaDoc instanceName, String JavaDoc jndiName)
78         throws MBeanConfigException
79     {
80         this(); //set description tables
81
initialize(ObjectNames.kJmsResourceType, new String JavaDoc[]{instanceName, jndiName});
82
83     }
84 }
85
Popular Tags