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: JMSWsdl1Deployer.java 1206 2006-09-23 03:51:32Z fling $
023: */
024: package com.bostechcorp.cbesb.runtime.component.jms;
025:
026: import javax.wsdl.extensions.ExtensibilityElement;
027: import javax.wsdl.extensions.ExtensionRegistry;
028:
029: //import org.apache.servicemix.common.BaseComponent;
030: //import org.apache.servicemix.common.Endpoint;
031: //import org.apache.servicemix.common.wsdl1.AbstractWsdl1Deployer;
032: //import org.apache.servicemix.common.wsdl1.JbiEndpoint;
033: import com.bostechcorp.cbesb.runtime.ccsl.jbi.messaging.*;
034:
035: import com.bostechcorp.cbesb.runtime.component.jms.wsdl.JMSAddress;
036: import com.bostechcorp.cbesb.runtime.component.jms.wsdl.JMSBinding;
037: import com.bostechcorp.cbesb.runtime.component.jms.wsdl.JMSExtension;
038:
039: public class JMSWsdl1Deployer extends Wsdl1Deployer {
040:
041: public JMSWsdl1Deployer(CbComponent component) {
042: super (component);
043: }
044:
045: protected CbEndpoint createEndpoint(
046: ExtensibilityElement[] portElement,
047: ExtensibilityElement[] bindingElement) {
048:
049: logger.debug("CreateEndpoint portElement=" + portElement[0]);
050:
051: JMSEndpoint endpoint = new JMSEndpoint();
052: if (portElement[0] instanceof JMSAddress) {
053: JMSAddress config = (JMSAddress) portElement[0];
054: endpoint.setRole(config.getRole());
055: endpoint.setDefaultMep(config.getDefaultMep());
056: endpoint.setDefaultOperation(config.getDefaultOperation());
057: endpoint.setJndiInitialContextFactory(config
058: .getJndiInitialContextFactory());
059: endpoint.setJndiProviderUrl(config.getJndiProviderUrl());
060: endpoint.setJndiConnectionFactoryName(config
061: .getJndiConnectionFactoryName());
062: endpoint.setDestinationStyle(config.getDestinationStyle());
063: endpoint.setTargetDestinationName(config
064: .getTargetDestinationName());
065: endpoint.setReplyDestinationName(config
066: .getReplyDestinationName());
067: endpoint.setAwaitTimeout(config.getAwaitTimeout());
068: endpoint.setReplyTimeout(config.getReplyTimeout());
069: endpoint
070: .setRecordsPerMessage(config.getRecordsPerMessage());
071: endpoint.setReadStyle(config.getReadStyle());
072: endpoint.setRecordType(config.getRecordType());
073: endpoint.setWriteStyle(config.getWriteStyle());
074: endpoint.setCharset(config.getCharset());
075: //JMS 1.2
076: endpoint.setTransactional(config.isTransactional());
077: endpoint.setRetry(config.isRetry());
078: endpoint.setRetryInterval(config.getRetryInterval());
079: endpoint.setMaxRetryCount(config.getMaxRetryCount());
080: endpoint.setEnableQuery(config.isEnableQuery());
081: endpoint.setQueryExpression(config.getQueryExpression());
082: endpoint.setDLQ(config.getDLQ());
083: endpoint.setSavaMetadata(config.isSaveMetadata());
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 JMSAddress;
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 JMSBinding;
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: JMSExtension.register(registry);
115: }
116: }
|