KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > config > impl > ConfigEnvironmentImpl


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  * DefaultConfigContextSettings.java
26  *
27  * Created on January 12, 2004, 11:44 AM
28  */

29
30 package com.sun.enterprise.config.impl;
31
32 import com.sun.enterprise.config.pluggable.ConfigEnvironment;
33 import com.sun.enterprise.config.pluggable.ConfigBeansSettings;
34 import com.sun.enterprise.config.pluggable.ConfigBeanInterceptor;
35
36 /**
37  * This class creates a default implementation of ConfigEnvironment
38  * but this class has to be extended for setting 2 attributes.
39  * url and rootClass return empty.
40  *
41  * @author sridatta
42  */

43 public class ConfigEnvironmentImpl implements ConfigEnvironment {
44     
45     private boolean _autoCommitFlag = false;
46     private boolean _readOnlyFlag = true;
47     private boolean _cachingEnabledFlag = false;
48     private boolean _assertNotInCache = false;
49     
50     private ConfigBeanInterceptor _cbInterceptor = null;
51     private String JavaDoc _url = null;
52     private String JavaDoc _handler = "com.sun.enterprise.config.serverbeans.ServerValidationHandler";
53     private String JavaDoc _rootClass = "com.sun.enterprise.config.serverbeans.Domain";
54
55     
56     /** Creates a new instance */
57     public ConfigEnvironmentImpl() {
58     }
59
60     public boolean isAutoCommitOn() {
61         return _autoCommitFlag;
62     }
63     
64     public void setAutoCommitOn(boolean value) {
65         _autoCommitFlag = value;
66     }
67     
68     public ConfigBeanInterceptor getConfigBeanInterceptor() {
69         return _cbInterceptor;
70     }
71     
72     public void setConfigBeanInterceptor(ConfigBeanInterceptor cbInterceptor) {
73         _cbInterceptor = cbInterceptor;
74     }
75     
76     /**
77      * returns null
78      * Needs to be overridden
79      */

80     public String JavaDoc getUrl() {
81         return _url;
82     }
83     
84     public void setUrl(String JavaDoc url) {
85         _url = url;
86     }
87     
88     public String JavaDoc getHandler() {
89         return _handler;
90     }
91     
92     public void setHandler(String JavaDoc handler) {
93         _handler = handler;
94     }
95     
96     public boolean isReadOnly() {
97         return _readOnlyFlag;
98     }
99     
100      public void setReadOnly(boolean value) {
101         _readOnlyFlag = value;
102     }
103      
104     /**
105      * returns null by default.
106      * Needs to be overridden
107      */

108     public String JavaDoc getRootClass() {
109         return _rootClass;
110     }
111     
112      public void setRootClass(String JavaDoc rootClass) {
113         _rootClass = rootClass;
114     }
115      
116     public boolean isCachingEnabled() {
117         return _cachingEnabledFlag;
118     }
119     
120     public void setCachingEnabled(boolean value) {
121         _cachingEnabledFlag = value;
122     }
123     
124     public ConfigBeansSettings getConfigBeansSettings() {
125         return new ConfigBeansSettingsImpl();
126     }
127     
128 }
129
Popular Tags