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: SequencingWsdl1Deployer.java 1429 2006-10-04 01:55:27Z mpreston $
023: */
024:
025: package com.bostechcorp.cbesb.runtime.component.cbr;
026:
027: import javax.wsdl.extensions.ExtensibilityElement;
028: import javax.wsdl.extensions.ExtensionRegistry;
029:
030: //import org.apache.servicemix.common.BaseComponent;
031: //import org.apache.servicemix.common.Endpoint;
032: //import org.apache.servicemix.common.wsdl1.AbstractWsdl1Deployer;
033: //import org.apache.servicemix.common.wsdl1.JbiEndpoint;
034:
035: import com.bostechcorp.cbesb.runtime.ccsl.jbi.messaging.*;
036:
037: import com.bostechcorp.cbesb.runtime.component.cbr.wsdl.CBRBinding;
038: import com.bostechcorp.cbesb.runtime.component.cbr.wsdl.CBRConfig;
039: import com.bostechcorp.cbesb.runtime.component.cbr.wsdl.CBRConfigExtension;
040: import com.bostechcorp.cbesb.runtime.component.cbr.wsdl.CBRTrxId;
041:
042: public class CBRWsdl1Deployer extends Wsdl1Deployer {
043:
044: /**
045: * @param arg0
046: */
047: public CBRWsdl1Deployer(CbComponent component) {
048: super (component);
049:
050: }
051:
052: /*
053: * (non-Javadoc)
054: *
055: * @see org.apache.servicemix.common.wsdl1.AbstractWsdl1Deployer#createEndpoint(javax.wsdl.extensions.ExtensibilityElement,
056: * javax.wsdl.extensions.ExtensibilityElement,
057: * org.apache.servicemix.common.wsdl1.JbiEndpoint)
058: */
059: @Override
060: protected CbEndpoint createEndpoint(
061: ExtensibilityElement[] portElement,
062: ExtensibilityElement[] bindingElement) {
063: logger.debug("createEndpoint portElement=" + portElement);
064:
065: CBREndpoint endpoint = new CBREndpoint();
066:
067: if (portElement[0] instanceof CBRConfig) {
068: CBRConfig config = (CBRConfig) portElement[0];
069: logger.debug("CBRConfig=" + config);
070: endpoint.setRole(config.getRole());
071: endpoint.setDefaultMep(config.getDefaultMep());
072: endpoint.setDefaultOperation(config.getDefaultOperation());
073: endpoint.setRoutingRules(config.getRoutingRules());
074:
075: CBRTrxId trxId = config.getTrxId();
076: endpoint.setType(trxId.getType());
077: endpoint.setOffset(trxId.getOffset());
078: endpoint.setLength(trxId.getLength());
079: endpoint.setDelimiter(trxId.getDelimiter());
080: endpoint.setIndex(trxId.getIndex());
081: endpoint.setExpression(trxId.getExpression());
082: endpoint.setScriptEngine(trxId.getScriptEngine());
083: endpoint.setScriptClass(trxId.getScriptClass());
084: endpoint.setScriptMethod(trxId.getScriptMethod());
085: }
086:
087: return endpoint;
088:
089: }
090:
091: /*
092: * (non-Javadoc)
093: *
094: * @see org.apache.servicemix.common.wsdl1.AbstractWsdl1Deployer#filterBindingElement(javax.wsdl.extensions.ExtensibilityElement)
095: */
096: @Override
097: protected boolean filterBindingElement(ExtensibilityElement element) {
098: return (element instanceof CBRBinding);
099: }
100:
101: /*
102: * (non-Javadoc)
103: *
104: * @see org.apache.servicemix.common.wsdl1.AbstractWsdl1Deployer#filterPortElement(javax.wsdl.extensions.ExtensibilityElement)
105: */
106: @Override
107: protected boolean filterPortElement(ExtensibilityElement element) {
108: return (element instanceof CBRConfig);
109: }
110:
111: protected void registerExtensions(ExtensionRegistry registry) {
112: super.registerExtensions(registry);
113: CBRConfigExtension.register(registry);
114: }
115: }
|