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: JdbcWsdl1Deployer.java 7271 2007-05-08 20:15:12Z mpreston $
023: */
024: package com.bostechcorp.cbesb.runtime.component.jdbc;
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; //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.jdbc.wsdl.JdbcBinding;
038: import com.bostechcorp.cbesb.runtime.component.jdbc.wsdl.JdbcConfig;
039: import com.bostechcorp.cbesb.runtime.component.jdbc.wsdl.JdbcExtension;
040:
041: /**
042: * The WDSL deployer classes for Parser Component.
043: *
044: * @author elu
045: *
046: */
047: public class JdbcWsdl1Deployer extends Wsdl1Deployer {
048:
049: protected final transient Log logger = LogFactory
050: .getLog(getClass());
051:
052: public JdbcWsdl1Deployer(CbComponent component) {
053: super (component);
054: }
055:
056: protected CbEndpoint createEndpoint(
057: ExtensibilityElement[] portElement,
058: ExtensibilityElement[] bindingElement) {
059:
060: logger.debug("createEndpoint portElement=" + portElement[0]);
061:
062: JdbcEndpoint endpoint = new JdbcEndpoint();
063:
064: if (portElement[0] instanceof JdbcConfig) {
065: JdbcConfig config = (JdbcConfig) portElement[0];
066: endpoint.setRole(config.getRole());
067: endpoint.setDefaultMep(config.getDefaultMep());
068: endpoint.setDefaultOperation(config.getDefaultOperation());
069:
070: endpoint.setDriver(config.getDriver());
071: endpoint.setUrl(config.getUrl());
072: endpoint.setUser(config.getUser());
073: endpoint.setPassword(config.getPassword());
074: endpoint.setRequestHandler(config.getRequestHandler());
075: endpoint.setExecHandler(config.getExecHandler());
076: endpoint.setAutoCommit(config.isAutoCommit());
077: endpoint
078: .setConnectionRetries(config.getConnectionRetries());
079: endpoint.setConnectionInterval(config
080: .getConnectionInterval());
081: endpoint.setTransactionTimeout(config
082: .getTransactionTimeout());
083: endpoint.setDefaultPageSize(config.getDefaultPageSize());
084:
085: }
086: return endpoint;
087: }
088:
089: /*
090: * (non-Javadoc)
091: *
092: * @see org.apache.servicemix.common.wsdl.AbstractWsdlDeployer#filterPortElement(javax.wsdl.extensions.ExtensibilityElement)
093: */
094: protected boolean filterPortElement(ExtensibilityElement element) {
095: return (element instanceof JdbcConfig);
096: }
097:
098: /*
099: * (non-Javadoc)
100: *
101: * @see org.apache.servicemix.common.wsdl.AbstractWsdlDeployer#filterBindingElement(javax.wsdl.extensions.ExtensibilityElement)
102: */
103: protected boolean filterBindingElement(ExtensibilityElement element) {
104: return element instanceof JdbcBinding;
105: }
106:
107: /*
108: * (non-Javadoc)
109: *
110: * @see org.apache.servicemix.common.wsdl.AbstractWsdlDeployer#registerExtensions(javax.wsdl.extensions.ExtensionRegistry)
111: */
112: protected void registerExtensions(ExtensionRegistry registry) {
113: super.registerExtensions(registry);
114: JdbcExtension.register(registry);
115: }
116:
117: }
|