KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis > deployment > wsdd > providers > WSDDComProvider


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

16 package org.apache.axis.deployment.wsdd.providers;
17
18 import org.apache.axis.EngineConfiguration;
19 import org.apache.axis.Handler;
20 import org.apache.axis.deployment.wsdd.WSDDConstants;
21 import org.apache.axis.deployment.wsdd.WSDDProvider;
22 import org.apache.axis.deployment.wsdd.WSDDService;
23 import org.apache.axis.providers.BasicProvider;
24 import org.apache.axis.utils.ClassUtils;
25
26
27 /**
28  *
29  */

30 public class WSDDComProvider
31     extends WSDDProvider
32 {
33     public static final String JavaDoc OPTION_PROGID = "ProgID";
34     public static final String JavaDoc OPTION_THREADING_MODEL = "threadingModel";
35     
36     public String JavaDoc getName() {
37         return WSDDConstants.PROVIDER_COM;
38     }
39
40     public Handler newProviderInstance(WSDDService service,
41                                        EngineConfiguration registry)
42         throws Exception JavaDoc
43     {
44         Class JavaDoc _class = ClassUtils.forName("org.apache.axis.providers.ComProvider");
45
46         BasicProvider provider = (BasicProvider) _class.newInstance();
47
48         String JavaDoc option = service.getParameter("ProgID");
49
50         if (!option.equals("")) {
51             provider.setOption(OPTION_PROGID, option);
52         }
53
54         option = service.getParameter("threadingModel");
55
56         if (option!= null && !option.equals("")) {
57             provider.setOption(OPTION_THREADING_MODEL, option);
58         }
59
60         return provider;
61     }
62 }
63
Popular Tags