001: /*
002: * ChainBuilder ESB
003: * Visual Enterprise Integration
004: *
005: * Copyright (C) 2006 Bostech Corporation
006: *
007: * This program is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU General Public License as published by the
009: * Free Software Foundation; either version 2 of the License, or (at your option)
010: * any later version.
011: *
012: * This program is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
014: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
015: * for more details.
016: *
017: * You should have received a copy of the GNU General Public License along with
018: * this program; if not, write to the Free Software Foundation, Inc.,
019: * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020: *
021: *
022: * $Id: ParserWsdl1Deployer.java 7274 2007-05-08 20:15:15Z mpreston $
023: */
024: package com.bostechcorp.cbesb.runtime.component.parser;
025:
026: import javax.wsdl.extensions.ExtensibilityElement;
027: import javax.wsdl.extensions.ExtensionRegistry;
028:
029: import org.apache.commons.logging.Log;
030: import org.apache.commons.logging.LogFactory;
031:
032: //import org.apache.servicemix.common.BaseComponent;
033: //import org.apache.servicemix.common.Endpoint;
034: //import org.apache.servicemix.common.wsdl1.AbstractWsdl1Deployer;
035: //import org.apache.servicemix.common.wsdl1.JbiEndpoint;
036:
037: import com.bostechcorp.cbesb.runtime.ccsl.jbi.messaging.*;
038:
039: import com.bostechcorp.cbesb.runtime.component.parser.wsdl.ParserBinding;
040: import com.bostechcorp.cbesb.runtime.component.parser.wsdl.ParserConfig;
041: import com.bostechcorp.cbesb.runtime.component.parser.wsdl.ParserExtension;
042:
043: /**
044: * The WDSL deployer classes for Parser Component.
045: *
046: *
047: */
048: public class ParserWsdl1Deployer extends Wsdl1Deployer {
049:
050: protected final transient Log logger = LogFactory
051: .getLog(getClass());
052:
053: public ParserWsdl1Deployer(CbComponent component) {
054: super (component);
055: }
056:
057: protected CbEndpoint createEndpoint(
058: ExtensibilityElement[] portElement,
059: ExtensibilityElement[] bindingElement) {
060:
061: logger.debug("createEndpoint portElement=" + portElement[0]);
062:
063: ParserEndpoint endpoint = new ParserEndpoint();
064:
065: if (portElement[0] instanceof ParserConfig) {
066: ParserConfig config = (ParserConfig) portElement[0];
067: endpoint.setRole(config.getRole());
068: endpoint.setDefaultMep(config.getDefaultMep());
069: endpoint.setDefaultOperation(config.getDefaultOperation());
070: endpoint.setParserType(config.getParserType());
071: endpoint.setMsgDef(config.getMsgDef());
072: }
073: return endpoint;
074: }
075:
076: /*
077: * (non-Javadoc)
078: *
079: * @see org.apache.servicemix.common.wsdl.AbstractWsdlDeployer#filterPortElement(javax.wsdl.extensions.ExtensibilityElement)
080: */
081: protected boolean filterPortElement(ExtensibilityElement element) {
082: return (element instanceof ParserConfig);
083: }
084:
085: /*
086: * (non-Javadoc)
087: *
088: * @see org.apache.servicemix.common.wsdl.AbstractWsdlDeployer#filterBindingElement(javax.wsdl.extensions.ExtensibilityElement)
089: */
090: protected boolean filterBindingElement(ExtensibilityElement element) {
091: return element instanceof ParserBinding;
092: }
093:
094: /*
095: * (non-Javadoc)
096: *
097: * @see org.apache.servicemix.common.wsdl.AbstractWsdlDeployer#registerExtensions(javax.wsdl.extensions.ExtensionRegistry)
098: */
099: protected void registerExtensions(ExtensionRegistry registry) {
100: super.registerExtensions(registry);
101: ParserExtension.register(registry);
102: }
103:
104: }
|