01: package com.bostech.corporation.component.echo;
02:
03: import javax.jbi.messaging.MessageExchange.Role;
04: import javax.wsdl.extensions.ExtensibilityElement;
05: import javax.wsdl.extensions.ExtensionRegistry;
06:
07: import org.apache.commons.logging.Log;
08: import org.apache.commons.logging.LogFactory;
09:
10: import com.bostech.corporation.component.echo.wsdl.EchoProvider;
11: import com.bostech.corporation.component.echo.wsdl.EchoProviderExtension;
12: import com.bostechcorp.cbesb.runtime.ccsl.jbi.messaging.CbComponent;
13: import com.bostechcorp.cbesb.runtime.ccsl.jbi.messaging.CbEndpoint;
14: import com.bostechcorp.cbesb.runtime.ccsl.jbi.messaging.Wsdl1Deployer;
15: import com.bostechcorp.cbesb.runtime.component.util.wsdl.BaseBinding;
16: import com.bostechcorp.cbesb.runtime.component.util.wsdl.BaseCommonAttribute;
17:
18: public class EchoWsdl1Deployer extends Wsdl1Deployer {
19: protected final transient Log logger = LogFactory
20: .getLog(getClass());
21:
22: public EchoWsdl1Deployer(CbComponent component) {
23: super (component);
24: }
25:
26: protected CbEndpoint createEndpoint(
27: ExtensibilityElement[] portElement,
28: ExtensibilityElement[] bindingElement) {
29: logger.debug("createEndpoint portElement=" + portElement);
30:
31: EchoEndpoint endpoint = new EchoEndpoint();
32:
33: EchoProvider inputPortElement = (EchoProvider) portElement[0];
34: //logger.debug("portElement="+ inputPortElement);
35: endpoint.setOutput_to_Log(inputPortElement.getOutput_to_Log());
36: endpoint.setOutput_Style(inputPortElement.getOutput_Style());
37:
38: endpoint.setRole(Role.PROVIDER);
39: endpoint.setDefaultMep(((BaseCommonAttribute) portElement[0])
40: .getDefaultMep());
41:
42: return endpoint;
43: }
44:
45: /* (non-Javadoc)
46: * @see org.apache.servicemix.common.wsdl.AbstractWsdlDeployer#filterPortElement(javax.wsdl.extensions.ExtensibilityElement)
47: */
48: protected boolean filterPortElement(ExtensibilityElement element) {
49: return element instanceof BaseCommonAttribute;
50: }
51:
52: /* (non-Javadoc)
53: * @see org.apache.servicemix.common.wsdl.AbstractWsdlDeployer#filterBindingElement(javax.wsdl.extensions.ExtensibilityElement)
54: */
55: protected boolean filterBindingElement(ExtensibilityElement element) {
56: return element instanceof BaseBinding;
57: }
58:
59: /* (non-Javadoc)
60: * @see org.apache.servicemix.common.wsdl.AbstractWsdlDeployer#registerExtensions(javax.wsdl.extensions.ExtensionRegistry)
61: */
62: protected void registerExtensions(ExtensionRegistry registry) {
63: super .registerExtensions(registry);
64: //TODO: add code like this: FileInputExtension.register(registry);
65: EchoProviderExtension.register(registry);
66: }
67:
68: }
|