1 /***
2 * JFoxSOAF, Service-Oriented Application Framework
3 *
4 * Copyright (C) www.huihoo.org
5 *
6 * Distributable under GNU LGPL For more information, please visit:
7 * http://www.huihoo.org/jfox/jfoxsoaf
8 */
9
10 package org.huihoo.jfox.soaf.schema.config;
11
12 import java.io.Reader;
13
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
16 import org.exolab.castor.xml.ValidationException;
17 import org.exolab.castor.xml.Validator;
18
19 /***
20 * Configuration.
21 *
22 * @author <a href="mailto:founder_chen@yahoo.com.cn">Peter Cheng </a>
23 * @version $Revision: 1.6 $ $Date: 2004/10/13 10:49:42 $
24 * @version Revision: 1.0
25 */
26
27 public class Configuration implements java.io.Serializable {
28
29 /***
30 * Field _serviceConfiguration
31 */
32 private ServiceConfiguration _serviceConfiguration;
33
34 /***
35 * Field _systemInterceptor
36 */
37 private SystemInterceptor _systemInterceptor;
38
39 public Configuration() {
40 super();
41 }
42
43 /***
44 * Method getServiceConfigurationReturns the value of field
45 * 'serviceConfiguration'.
46 *
47 * @return the value of field 'serviceConfiguration'.
48 */
49 public ServiceConfiguration getServiceConfiguration() {
50 return this._serviceConfiguration;
51 }
52
53 /***
54 * Method getSystemInterceptorReturns the value of field
55 * 'systemInterceptor'.
56 *
57 * @return the value of field 'systemInterceptor'.
58 */
59 public SystemInterceptor getSystemInterceptor() {
60 return this._systemInterceptor;
61 }
62
63 /***
64 * Method isValid
65 */
66 public boolean isValid() {
67 try {
68 validate();
69 } catch (org.exolab.castor.xml.ValidationException vex) {
70 return false;
71 }
72 return true;
73 }
74
75 /***
76 * Method marshal
77 *
78 * @param out
79 */
80 public void marshal(java.io.Writer out)
81 throws org.exolab.castor.xml.MarshalException,
82 org.exolab.castor.xml.ValidationException {
83
84 Marshaller.marshal(this, out);
85 }
86
87 /***
88 * Method marshal
89 *
90 * @param handler
91 */
92 public void marshal(org.xml.sax.ContentHandler handler)
93 throws java.io.IOException, org.exolab.castor.xml.MarshalException,
94 org.exolab.castor.xml.ValidationException {
95
96 Marshaller.marshal(this, handler);
97 }
98
99 /***
100 * Method setServiceConfigurationSets the value of field
101 * 'serviceConfiguration'.
102 *
103 * @param serviceConfiguration
104 * the value of field 'serviceConfiguration'.
105 */
106 public void setServiceConfiguration(
107 ServiceConfiguration serviceConfiguration) {
108 this._serviceConfiguration = serviceConfiguration;
109 }
110
111 /***
112 * Method setSystemInterceptorSets the value of field 'systemInterceptor'.
113 *
114 * @param systemInterceptor
115 * the value of field 'systemInterceptor'.
116 */
117 public void setSystemInterceptor(SystemInterceptor systemInterceptor) {
118 this._systemInterceptor = systemInterceptor;
119 }
120
121 /***
122 * Method unmarshal
123 *
124 * @param reader
125 */
126 public static Configuration unmarshal(Reader reader)
127 throws org.exolab.castor.xml.MarshalException,
128 org.exolab.castor.xml.ValidationException {
129 return (Configuration) Unmarshaller.unmarshal(
130 org.huihoo.jfox.soaf.schema.config.Configuration.class,
131 reader);
132 }
133
134 /***
135 * Method validate
136 */
137 public void validate() throws ValidationException {
138 Validator validator = new Validator();
139 validator.validate(this);
140 }
141
142 }