001: /*
002: * Copyright 2005 jWic Group (http://www.jwic.de)
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: *
016: * de.jwic.spring.IocApplicationSetup
017: * Created on 23.05.2005
018: * $Id: IocApplicationSetup.java,v 1.2 2006/08/14 09:35:00 lordsam Exp $
019: */
020: package de.jwic.spring;
021:
022: import java.util.Properties;
023:
024: import de.jwic.base.IApplication;
025: import de.jwic.base.IApplicationSetup;
026:
027: /**
028: * Inversion-of-Control based implementation of the ApplicationSetup. This class
029: * may be used in an spring component container.
030: * Note that the application object must not be a singleton!
031: *
032: * @author Florian Lippisch
033: * @version $Revision: 1.2 $
034: */
035: public class IocApplicationSetup implements IApplicationSetup {
036:
037: private static final long serialVersionUID = 1L;
038:
039: private String name = null;
040: private IApplication application = null;
041: private boolean serializable = true;
042: private boolean singleSession = false;
043: private boolean requireAuthentication = false;
044: private boolean useAjaxRendering = true;
045: private Properties properties = null;
046:
047: /* (non-Javadoc)
048: * @see de.jwic.base.IApplicationSetup#getName()
049: */
050: public String getName() {
051: return name;
052: }
053:
054: /* (non-Javadoc)
055: * @see de.jwic.base.IApplicationSetup#createApplication()
056: */
057: public IApplication createApplication() {
058: return application;
059: }
060:
061: /* (non-Javadoc)
062: * @see de.jwic.base.IApplicationSetup#isSerializable()
063: */
064: public boolean isSerializable() {
065: return serializable;
066: }
067:
068: /* (non-Javadoc)
069: * @see de.jwic.base.IApplicationSetup#isSingleSession()
070: */
071: public boolean isSingleSession() {
072: return singleSession;
073: }
074:
075: /* (non-Javadoc)
076: * @see de.jwic.base.IApplicationSetup#isRequireAuthentication()
077: */
078: public boolean isRequireAuthentication() {
079: return requireAuthentication;
080: }
081:
082: /* (non-Javadoc)
083: * @see de.jwic.base.IApplicationSetup#getProperty(java.lang.String)
084: */
085: public String getProperty(String key) {
086: if (properties != null) {
087: return properties.getProperty(key);
088: }
089: return null;
090: }
091:
092: /**
093: * @return Returns the properties.
094: */
095: public Properties getProperties() {
096: return properties;
097: }
098:
099: /**
100: * @param properties The properties to set.
101: */
102: public void setProperties(Properties properties) {
103: this .properties = properties;
104: }
105:
106: /**
107: * @param name The name to set.
108: */
109: public void setName(String name) {
110: this .name = name;
111: }
112:
113: /**
114: * @param requireAuthentication The requireAuthentication to set.
115: */
116: public void setRequireAuthentication(boolean requireAuthentication) {
117: this .requireAuthentication = requireAuthentication;
118: }
119:
120: /**
121: * @param serializable The serializable to set.
122: */
123: public void setSerializable(boolean serializable) {
124: this .serializable = serializable;
125: }
126:
127: /**
128: * @param singleSession The singleSession to set.
129: */
130: public void setSingleSession(boolean singleSession) {
131: this .singleSession = singleSession;
132: }
133:
134: /* (non-Javadoc)
135: * @see de.jwic.base.IApplicationSetup#isUseAjaxRendering()
136: */
137: public boolean isUseAjaxRendering() {
138: return useAjaxRendering;
139: }
140:
141: /**
142: * @param useAjaxRendering The useAjaxRendering to set.
143: */
144: public void setUseAjaxRendering(boolean useAjaxRendering) {
145: this .useAjaxRendering = useAjaxRendering;
146: }
147:
148: /**
149: * @return Returns the application.
150: */
151: public IApplication getApplication() {
152: return application;
153: }
154:
155: /**
156: * @param application The application to set.
157: */
158: public void setApplication(IApplication application) {
159: this.application = application;
160: }
161: }
|