View Javadoc

1   /*
2    * Copyright 2001-2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.apache.geronimo.ews.ws4j2ee.context.webservices.server.xmlbeans;
17  
18  import com.sun.java.xml.ns.j2Ee.WebservicesDocument;
19  import com.sun.java.xml.ns.j2Ee.WebservicesType;
20  import org.apache.geronimo.ews.ws4j2ee.context.webservices.server.AsbtractWSCFDocument;
21  import org.apache.geronimo.ews.ws4j2ee.context.webservices.server.WSCFException;
22  import org.apache.geronimo.ews.ws4j2ee.context.webservices.server.interfaces.WSCFConstants;
23  import org.apache.geronimo.ews.ws4j2ee.context.webservices.server.interfaces.WSCFDocument;
24  import org.apache.xmlbeans.XmlException;
25  
26  import java.io.IOException;
27  import java.io.InputStream;
28  
29  /***
30   * This will encapsulate the webservices.xml document and this is the start of the
31   * parsing tree.This will be used to support the the methods of the WSCFContext. The
32   * class tree and the Interface tree will strat from here and there will be sufficient
33   * functionality provided by each class to expose the information and to further
34   * drill down the element tree.
35   */
36  public class WSCFDocumentImpl extends AsbtractWSCFDocument implements WSCFConstants, WSCFDocument {
37      public WSCFDocumentImpl(InputStream in) throws WSCFException {
38          try {
39              WebservicesDocument wsDoc = WebservicesDocument.Factory.parse(in);
40              WebservicesType ws = wsDoc.getWebservices();
41              this.webservices = new WSCFWebservicesImpl(ws);
42          } catch (IOException je) {
43              throw new WSCFException(je);
44          } catch (XmlException je) {
45              throw new WSCFException(je);
46          }
47      }
48  }