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
08: * it under the terms of the GNU General Public License as published by
09: * the Free Software Foundation; either version 2 of the License, or
10: * (at your option) 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
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * General Public License for more details.
16: *
17: * You should have received a copy of the GNU General Public License
18: * along with this program; if not, write to the Free Software
19: * Foundation, Inc.,59 Temple Place, Suite 330, Boston, MA 02111-1307
20: * USA
21: *
22: *
23: * $Id: XsltWsdl1Deployer.java 7273 2007-05-08 20:15:14Z mpreston $
24: */
25: package com.bostechcorp.cbesb.runtime.component.xslt;
26:
27: import javax.wsdl.extensions.ExtensibilityElement;
28: import javax.wsdl.extensions.ExtensionRegistry;
29:
30: import org.apache.commons.logging.Log;
31: import org.apache.commons.logging.LogFactory;
32:
33: //import org.apache.servicemix.common.BaseComponent;
34: //import org.apache.servicemix.common.Endpoint;
35: //import org.apache.servicemix.common.wsdl1.AbstractWsdl1Deployer;
36: //import org.apache.servicemix.common.wsdl1.JbiEndpoint;
37: import com.bostechcorp.cbesb.runtime.ccsl.jbi.messaging.*;
38:
39: import com.bostechcorp.cbesb.runtime.component.xslt.wsdl.XsltBinding;
40: import com.bostechcorp.cbesb.runtime.component.xslt.wsdl.XsltConfig;
41: import com.bostechcorp.cbesb.runtime.component.xslt.wsdl.XsltExtension;
42:
43: /**
44: * @author j.zhang
45: * @version 1.0.0
46: */
47: public class XsltWsdl1Deployer extends Wsdl1Deployer {
48: protected final transient Log logger = LogFactory
49: .getLog(getClass());
50:
51: public XsltWsdl1Deployer(CbComponent component) {
52: super (component);
53: }
54:
55: protected CbEndpoint createEndpoint(
56: ExtensibilityElement[] portElement,
57: ExtensibilityElement[] bindingElement) {
58:
59: logger.debug("createEndpoint portElement=" + portElement[0]);
60:
61: XsltEndpoint endpoint = new XsltEndpoint();
62:
63: if (portElement[0] instanceof XsltConfig) {
64: XsltConfig config = (XsltConfig) portElement[0];
65: endpoint.setRole(config.getRole());
66: endpoint.setDefaultMep(config.getDefaultMep());
67: endpoint.setDefaultOperation(config.getDefaultOperation());
68: endpoint.setXslLocation(config.getXslLocation());
69: }
70: return endpoint;
71: }
72:
73: protected boolean filterPortElement(ExtensibilityElement element) {
74: return (element instanceof XsltConfig);
75: }
76:
77: protected boolean filterBindingElement(ExtensibilityElement element) {
78: return element instanceof XsltBinding;
79: }
80:
81: protected void registerExtensions(ExtensionRegistry registry) {
82: super.registerExtensions(registry);
83: XsltExtension.register(registry);
84: }
85:
86: }
|