01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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: */package org.apache.geronimo.tomcat.deployment;
17:
18: import java.util.Map;
19:
20: import org.apache.geronimo.common.DeploymentException;
21: import org.apache.geronimo.deployment.DeploymentContext;
22: import org.apache.geronimo.gbean.AbstractName;
23: import org.apache.geronimo.gbean.GBeanData;
24: import org.apache.geronimo.j2ee.deployment.Module;
25: import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
26: import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
27: import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
28: import org.apache.geronimo.kernel.repository.Environment;
29: import org.apache.geronimo.webservices.SerializableWebServiceContainerFactoryGBean;
30:
31: /**
32: * @version $Rev: 539121 $ $Date: 2007-05-17 14:20:58 -0700 (Thu, 17 May 2007) $
33: */
34: public class MockWebServiceBuilder implements WebServiceBuilder {
35: public void findWebServices(Module module, boolean isEJB,
36: Map correctedPortLocations, Environment environment,
37: Map sharedContext) throws DeploymentException {
38: }
39:
40: public boolean configurePOJO(GBeanData targetGBean,
41: String servletName, Module module, String seiClassName,
42: DeploymentContext context) throws DeploymentException {
43: AbstractName webServiceContainerFactoryName = context
44: .getNaming().createChildName(
45: targetGBean.getAbstractName(),
46: "webServiceContainer",
47: NameFactory.GERONIMO_SERVICE);
48: GBeanData webServiceContainerFactoryGBean = new GBeanData(
49: webServiceContainerFactoryName,
50: SerializableWebServiceContainerFactoryGBean.GBEAN_INFO);
51: webServiceContainerFactoryGBean.setAttribute(
52: "webServiceContainer", new MockWebServiceContainer());
53: try {
54: context.addGBean(webServiceContainerFactoryGBean);
55: } catch (GBeanAlreadyExistsException e) {
56: throw new DeploymentException(
57: "Could not add webServiceContainerFactoryGBean", e);
58: }
59: targetGBean.setReferencePattern("WebServiceContainerFactory",
60: webServiceContainerFactoryName);
61: return true;
62: }
63:
64: public boolean configureEJB(GBeanData targetGBean, String ejbName,
65: Module module, Map sharedContext, ClassLoader classLoader)
66: throws DeploymentException {
67: return true;
68: }
69: }
|