KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > servicemix > jms > JmsWsdl1Deployer


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17 package org.apache.servicemix.jms;
18
19 import javax.wsdl.extensions.ExtensibilityElement;
20 import javax.wsdl.extensions.ExtensionRegistry;
21
22 import org.apache.servicemix.common.BaseComponent;
23 import org.apache.servicemix.common.Endpoint;
24 import org.apache.servicemix.common.wsdl1.AbstractWsdl1Deployer;
25 import org.apache.servicemix.common.wsdl1.JbiEndpoint;
26 import org.apache.servicemix.jms.wsdl.JmsAddress;
27 import org.apache.servicemix.jms.wsdl.JmsBinding;
28 import org.apache.servicemix.jms.wsdl.JmsExtension;
29
30 /**
31  * @author gnodet
32  *
33  */

34 public class JmsWsdl1Deployer extends AbstractWsdl1Deployer {
35
36     public JmsWsdl1Deployer(BaseComponent component) {
37         super(component);
38     }
39
40     protected Endpoint createEndpoint(ExtensibilityElement portElement,
41                                       ExtensibilityElement bindingElement,
42                                       JbiEndpoint jbiEndpoint) {
43         if (jbiEndpoint == null) {
44             return null;
45         }
46         JmsEndpoint endpoint = new JmsEndpoint();
47         endpoint.setRole(jbiEndpoint.getRole());
48         endpoint.setDefaultMep(jbiEndpoint.getDefaultMep());
49         endpoint.setDefaultOperation(jbiEndpoint.getDefaultOperation());
50         endpoint.setDestinationStyle(((JmsAddress) portElement).getDestinationStyle());
51         endpoint.setInitialContextFactory(((JmsAddress) portElement).getInitialContextFactory());
52         endpoint.setJmsProviderDestinationName(((JmsAddress) portElement).getJmsProviderDestinationName());
53         endpoint.setJndiConnectionFactoryName(((JmsAddress) portElement).getJndiConnectionFactoryName());
54         endpoint.setJndiDestinationName(((JmsAddress) portElement).getJndiDestinationName());
55         endpoint.setJndiProviderURL(((JmsAddress) portElement).getJndiProviderURL());
56         return endpoint;
57     }
58
59     /* (non-Javadoc)
60      * @see org.apache.servicemix.common.wsdl.AbstractWsdlDeployer#filterPortElement(javax.wsdl.extensions.ExtensibilityElement)
61      */

62     protected boolean filterPortElement(ExtensibilityElement element) {
63         return element instanceof JmsAddress;
64     }
65
66     /* (non-Javadoc)
67      * @see org.apache.servicemix.common.wsdl.AbstractWsdlDeployer#filterBindingElement(javax.wsdl.extensions.ExtensibilityElement)
68      */

69     protected boolean filterBindingElement(ExtensibilityElement element) {
70         return element instanceof JmsBinding;
71     }
72
73     /* (non-Javadoc)
74      * @see org.apache.servicemix.common.wsdl.AbstractWsdlDeployer#registerExtensions(javax.wsdl.extensions.ExtensionRegistry)
75      */

76     protected void registerExtensions(ExtensionRegistry registry) {
77         super.registerExtensions(registry);
78         JmsExtension.register(registry);
79     }
80
81 }
82
Popular Tags