KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > tomcat > deployment > MockWebServiceBuilder


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.geronimo.tomcat.deployment;
18
19 import java.util.Map JavaDoc;
20 import java.util.jar.JarFile JavaDoc;
21
22 import org.apache.geronimo.common.DeploymentException;
23 import org.apache.geronimo.deployment.DeploymentContext;
24 import org.apache.geronimo.gbean.AbstractName;
25 import org.apache.geronimo.gbean.GBeanData;
26 import org.apache.geronimo.j2ee.deployment.Module;
27 import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
28 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
29 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
30 import org.apache.geronimo.kernel.repository.Environment;
31 import org.apache.geronimo.webservices.SerializableWebServiceContainerFactoryGBean;
32
33 /**
34  * @version $Rev: 479496 $ $Date: 2006-11-26 20:57:00 -0500 (Sun, 26 Nov 2006) $
35  */

36 public class MockWebServiceBuilder implements WebServiceBuilder {
37     public void findWebServices(JarFile JavaDoc moduleFile, boolean isEJB, Map JavaDoc correctedPortLocations, Environment environment, Map JavaDoc sharedContext) throws DeploymentException {
38     }
39
40     public boolean configurePOJO(GBeanData targetGBean, String JavaDoc servletName, Module module, String JavaDoc seiClassName, DeploymentContext context) throws DeploymentException {
41         AbstractName webServiceContainerFactoryName = context.getNaming().createChildName(targetGBean.getAbstractName(), "webServiceContainer", NameFactory.GERONIMO_SERVICE);
42         GBeanData webServiceContainerFactoryGBean = new GBeanData(webServiceContainerFactoryName, SerializableWebServiceContainerFactoryGBean.GBEAN_INFO);
43         try {
44             context.addGBean(webServiceContainerFactoryGBean);
45         } catch (GBeanAlreadyExistsException e) {
46             throw new DeploymentException("Could not add webServiceContainerFactoryGBean", e);
47         }
48         targetGBean.setReferencePattern("WebServiceContainerFactory", webServiceContainerFactoryName);
49         return true;
50     }
51
52     public boolean configureEJB(GBeanData targetGBean, String JavaDoc ejbName, JarFile JavaDoc moduleFile, Map JavaDoc sharedContext, ClassLoader JavaDoc classLoader) throws DeploymentException {
53         return true;
54     }
55 }
56
Popular Tags