View Javadoc

1   /***
2    * @(#)Configuration.java
3    * 
4    * JFoxSOAF, Service-Oriented Application Framework
5    * 
6    * Copyright(c) JFoxSOAF Team
7    * 
8    * Licensed under the GNU LGPL, Version 2.1 (the "License"); 
9    * you may not use this file except in compliance with the License. 
10   * You may obtain a copy of the License at  
11   * 
12   * http://www.gnu.org/copyleft/lesser.html
13   * 
14   * Unless required by applicable law or agreed to in writing, software
15   * distributed under the License is distributed on an "AS IS" BASIS, 
16   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
17   * See the License for the specific language governing permissions and 
18   * limitations under the License. 
19   * 
20   * For more information, please visit:
21   * http://sourceforge.net/projects/jfox
22   */
23  
24  package org.huihoo.jfox.soaf.schema.config;
25  
26  import java.io.Reader;
27  
28  import org.exolab.castor.xml.Marshaller;
29  import org.exolab.castor.xml.Unmarshaller;
30  import org.exolab.castor.xml.ValidationException;
31  import org.exolab.castor.xml.Validator;
32  
33  /***
34   * Configuration.
35   * 
36   * @author <a href="mailto:founder_chen@yahoo.com.cn">Peter Cheng </a>
37   * @version $Revision: 1.10 $ $Date: 2005/05/22 06:47:43 $
38   * @version Revision: 1.0
39   */
40  
41  public class Configuration implements java.io.Serializable {
42  
43      /***
44       * Field _serviceConfiguration
45       */
46      private ServiceConfiguration _serviceConfiguration;
47  
48      /***
49       * Field _systemInterceptor
50       */
51      private SystemInterceptor _systemInterceptor;
52  
53      public Configuration() {
54          super();
55      }
56  
57      /***
58       * Method getServiceConfigurationReturns the value of field
59       * 'serviceConfiguration'.
60       * 
61       * @return the value of field 'serviceConfiguration'.
62       */
63      public ServiceConfiguration getServiceConfiguration() {
64          return this._serviceConfiguration;
65      }
66  
67      /***
68       * Method getSystemInterceptorReturns the value of field
69       * 'systemInterceptor'.
70       * 
71       * @return the value of field 'systemInterceptor'.
72       */
73      public SystemInterceptor getSystemInterceptor() {
74          return this._systemInterceptor;
75      }
76  
77      /***
78       * Method isValid
79       */
80      public boolean isValid() {
81          try {
82              validate();
83          } catch (org.exolab.castor.xml.ValidationException vex) {
84              return false;
85          }
86          return true;
87      }
88  
89      /***
90       * Method marshal
91       * 
92       * @param out
93       */
94      public void marshal(java.io.Writer out)
95              throws org.exolab.castor.xml.MarshalException,
96              org.exolab.castor.xml.ValidationException {
97  
98          Marshaller.marshal(this, out);
99      }
100 
101     /***
102      * Method marshal
103      * 
104      * @param handler
105      */
106     public void marshal(org.xml.sax.ContentHandler handler)
107             throws java.io.IOException, org.exolab.castor.xml.MarshalException,
108             org.exolab.castor.xml.ValidationException {
109 
110         Marshaller.marshal(this, handler);
111     }
112 
113     /***
114      * Method setServiceConfigurationSets the value of field
115      * 'serviceConfiguration'.
116      * 
117      * @param serviceConfiguration the value of field 'serviceConfiguration'.
118      */
119     public void setServiceConfiguration(
120             ServiceConfiguration serviceConfiguration) {
121         this._serviceConfiguration = serviceConfiguration;
122     }
123 
124     /***
125      * Method setSystemInterceptorSets the value of field 'systemInterceptor'.
126      * 
127      * @param systemInterceptor the value of field 'systemInterceptor'.
128      */
129     public void setSystemInterceptor(SystemInterceptor systemInterceptor) {
130         this._systemInterceptor = systemInterceptor;
131     }
132 
133     /***
134      * Method unmarshal
135      * 
136      * @param reader
137      */
138     public static Configuration unmarshal(Reader reader)
139             throws org.exolab.castor.xml.MarshalException,
140             org.exolab.castor.xml.ValidationException {
141         return (Configuration) Unmarshaller.unmarshal(
142                 org.huihoo.jfox.soaf.schema.config.Configuration.class, reader);
143     }
144 
145     /***
146      * Method validate
147      */
148     public void validate() throws ValidationException {
149         Validator validator = new Validator();
150         validator.validate(this);
151     }
152 
153 }