01: /*
02: * ChainBuilder ESB
03: * Visual Enterprise Integration
04: *
05: * Copyright (C) 2006 Bostech Corporation
06: *
07: * This program is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU General Public License as published by the
09: * Free Software Foundation; either version 2 of the License, or (at your option)
10: * any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15: * for more details.
16: *
17: * You should have received a copy of the GNU General Public License along with
18: * this program; if not, write to the Free Software Foundation, Inc.,
19: * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20: *
21: *
22: * $Id: SequencerComponent.java 7094 2007-04-26 07:40:09Z lzheng $
23: */
24: package com.bostechcorp.cbesb.common.sa.component;
25:
26: import javax.wsdl.WSDLException;
27:
28: import com.bostechcorp.cbesb.common.i18n.Message;
29: import com.bostechcorp.cbesb.common.i18n.Messages;
30: import com.bostechcorp.cbesb.common.sa.service.EndPoint;
31: import com.bostechcorp.cbesb.common.util.generators.SequencerServiceListDOMXmlGenerator;
32: import com.bostechcorp.cbesb.common.util.generators.wsdl.generators.AbstractWsdlGenaretor;
33: import com.bostechcorp.cbesb.common.util.generators.wsdl.generators.SequencerWsdlGenerator;
34:
35: public class SequencerComponent extends AbstractComponent {
36:
37: // private final String
38: // ns="xmlns:sequencer='http://cbesb.bostechcorp.com/wsdl/sequencer/1.0'";
39: // private final String
40: // serviceListNs="http://cbesb.bostechcorp.com/sequencer/servicelist/1.0\"";
41:
42: public SequencerComponent() {
43: super ();
44: }
45:
46: public String getComponentName() {
47: return "ChainBuilderESB-SE-Sequencing";
48: }
49:
50: @Override
51: public void generateWSDL(String path, String saName)
52: throws Exception {
53: for (int i = 0; i < getEndPointList().size(); i++) {
54: EndPoint endPoint = this .endPointList.get(i);
55: if (endPoint.getName() == null
56: || endPoint.getName().equals("")) {
57: throw new Exception(new Message(
58: Messages.FLOWEDITOR_MISSING_ENDPOINTNAME, this
59: .getName()).getMessage());
60: }
61: // generateDefinition(path, endPoint,saName);
62: AbstractWsdlGenaretor generator = getWsdlGenerator(path,
63: saName, endPoint);
64: generator.writeToFile();
65: generateServiceList(path, endPoint, saName);
66: }
67: }
68:
69: private void generateServiceList(String path, EndPoint endPoint,
70: String saName) {
71: SequencerServiceListDOMXmlGenerator listXmlGenerator = new SequencerServiceListDOMXmlGenerator(
72: path);
73: listXmlGenerator.setServiceList(endPoint, saName);
74: listXmlGenerator.write();
75: }
76:
77: @Override
78: protected AbstractWsdlGenaretor getWsdlGenerator(String path,
79: String saName, EndPoint ep) throws WSDLException {
80: return new SequencerWsdlGenerator(path, saName, getName(), this
81: .getComponentType(), ep);
82: }
83: }
|