01: package com.bostech.corporation.component.x12splitter;
02:
03: import javax.wsdl.extensions.ExtensibilityElement;
04: import javax.wsdl.extensions.ExtensionRegistry;
05:
06: import org.apache.commons.logging.Log;
07: import org.apache.commons.logging.LogFactory;
08:
09: import com.bostech.corporation.component.x12splitter.wsdl.X12SplitterProvider;
10: import com.bostech.corporation.component.x12splitter.wsdl.X12SplitterProviderExtension;
11: import com.bostechcorp.cbesb.runtime.ccsl.jbi.messaging.CbComponent;
12: import com.bostechcorp.cbesb.runtime.ccsl.jbi.messaging.CbEndpoint;
13: import com.bostechcorp.cbesb.runtime.ccsl.jbi.messaging.Wsdl1Deployer;
14: import com.bostechcorp.cbesb.runtime.component.util.wsdl.BaseBinding;
15: import com.bostechcorp.cbesb.runtime.component.util.wsdl.BaseCommonAttribute;
16:
17: public class X12SplitterWsdl1Deployer extends Wsdl1Deployer {
18:
19: protected final transient Log logger = LogFactory
20: .getLog(getClass());
21:
22: public X12SplitterWsdl1Deployer(CbComponent component) {
23: super (component);
24: }
25:
26: protected CbEndpoint createEndpoint(
27: ExtensibilityElement[] portElement,
28: ExtensibilityElement[] bindingElement) {
29:
30: X12SplitterEndpoint endpoint = new X12SplitterEndpoint();
31: // if JBI extension is used, its value (role, defaultMep, defaultOperation) will no longer be used
32: if (portElement[0] instanceof X12SplitterProvider) {
33: X12SplitterProvider provider = (X12SplitterProvider) portElement[0];
34: endpoint.setRole(provider.getRole());
35: endpoint.setDefaultMep(provider.getDefaultMep());
36: endpoint.setContext(this .component.getComponentContext());
37: endpoint.setDestinationServiceName(provider
38: .getDestinationServiceName());
39: endpoint.setDestinationEndpointName(provider
40: .getDestinationEndpointName());
41: }
42:
43: return endpoint;
44: }
45:
46: /* (non-Javadoc)
47: * @see org.apache.servicemix.common.wsdl.AbstractWsdlDeployer#filterPortElement(javax.wsdl.extensions.ExtensibilityElement)
48: */
49: protected boolean filterPortElement(ExtensibilityElement element) {
50: return element instanceof BaseCommonAttribute;
51: }
52:
53: /* (non-Javadoc)
54: * @see org.apache.servicemix.common.wsdl.AbstractWsdlDeployer#filterBindingElement(javax.wsdl.extensions.ExtensibilityElement)
55: */
56: protected boolean filterBindingElement(ExtensibilityElement element) {
57: return element instanceof BaseBinding;
58: }
59:
60: /* (non-Javadoc)
61: * @see org.apache.servicemix.common.wsdl.AbstractWsdlDeployer#registerExtensions(javax.wsdl.extensions.ExtensionRegistry)
62: */
63: protected void registerExtensions(ExtensionRegistry registry) {
64: super.registerExtensions(registry);
65: X12SplitterProviderExtension.register(registry);
66: }
67: }
|