KickJava   Java API By Example, From Geeks To Geeks.

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


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.ObjectNames;
36 import com.sun.enterprise.admin.common.exception.MBeanConfigException;
37 import com.sun.enterprise.admin.common.constant.ConfigAttributeName;
38
39 public class ManagedEjbContainer extends ConfigMBeanBase implements ConfigAttributeName.EjbContainer
40 {
41  private static final String JavaDoc[][] MAPLIST = {
42    { kMinBeansInPool, ATTRIBUTE + ServerTags.STEADY_POOL_SIZE},
43    { kBeanIncrementCount, ATTRIBUTE + ServerTags.POOL_RESIZE_QUANTITY},
44    { kMaxPoolSize, ATTRIBUTE + ServerTags.MAX_POOL_SIZE},
45    { kCacheResizeQuantity, ATTRIBUTE + ServerTags.CACHE_RESIZE_QUANTITY},
46    { kMaxBeansInCache, ATTRIBUTE + ServerTags.MAX_CACHE_SIZE},
47    { kIdleInPoolTimeoutInSeconds, ATTRIBUTE + ServerTags.POOL_IDLE_TIMEOUT_IN_SECONDS},
48    { kIdleInCacheTimeoutInSeconds, ATTRIBUTE + ServerTags.CACHE_IDLE_TIMEOUT_IN_SECONDS},
49    { kRemovalTimeoutInSeconds, ATTRIBUTE + ServerTags.REMOVAL_TIMEOUT_IN_SECONDS},
50    { kVictimSelectionAlgorithm, ATTRIBUTE + ServerTags.VICTIM_SELECTION_POLICY},
51    { kCommitOption, ATTRIBUTE + ServerTags.COMMIT_OPTION },
52 //ms1 { kLogLevel, ATTRIBUTE + ServerTags.LOG_LEVEL},
53
// { kMonitoringEnabled, ATTRIBUTE + ServerTags.MONITORING_ENABLED }
54
};
55
56  private static final String JavaDoc[] ATTRIBUTES = {
57    kMinBeansInPool + ", int, RW",
58    kBeanIncrementCount + ", int, RW",
59    kMaxPoolSize + ", int, RW",
60    kCacheResizeQuantity + ", int, RW",
61    kMaxBeansInCache + ", int, RW",
62    kIdleInPoolTimeoutInSeconds + ", int, RW",
63    kIdleInCacheTimeoutInSeconds + ", int, RW",
64    kRemovalTimeoutInSeconds + ", int, RW",
65    kVictimSelectionAlgorithm + ", String, RW",
66    kCommitOption + ", String, RW",
67 //ms1 kLogLevel + ", String, RW",
68
// kMonitoringEnabled + ", boolean, RW",
69
};
70
71  private static final String JavaDoc[] OPERATIONS = null;
72  
73     /**
74         Default constructor set MBean description tables
75     */

76     public ManagedEjbContainer() throws MBeanConfigException
77     {
78         this.setDescriptions(MAPLIST, ATTRIBUTES, OPERATIONS);
79     }
80
81     /**
82         Constructs Config MBean for EjbContainer.
83         @param instanceName The server instance name.
84     */

85     public ManagedEjbContainer(String JavaDoc instanceName) throws MBeanConfigException
86     {
87         this();
88         initialize(ObjectNames.kEjbContainer, new String JavaDoc[]{instanceName});
89     }
90 }
91
Popular Tags