001 /** 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017 018 package org.apache.geronimo.web.deployment; 019 020 import javax.enterprise.deploy.model.DeployableObject; 021 import javax.enterprise.deploy.shared.ModuleType; 022 import javax.enterprise.deploy.spi.DeploymentConfiguration; 023 024 import org.apache.geronimo.deployment.ModuleConfigurer; 025 import org.apache.geronimo.gbean.GBeanInfo; 026 import org.apache.geronimo.gbean.GBeanInfoBuilder; 027 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory; 028 029 /** 030 * @version $Rev: 495635 $ $Date: 2007-01-12 11:46:40 -0500 (Fri, 12 Jan 2007) $ 031 */ 032 public class WARConfigurer implements ModuleConfigurer { 033 public DeploymentConfiguration createConfiguration(DeployableObject deployable) { 034 if (ModuleType.WAR.equals(deployable.getType())) { 035 return new WARConfiguration(deployable); 036 } else { 037 return null; 038 } 039 } 040 041 public ModuleType getModuleType() { 042 return ModuleType.WAR; 043 } 044 045 public static final GBeanInfo GBEAN_INFO; 046 047 static { 048 GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(WARConfigurer.class, NameFactory.DEPLOYMENT_CONFIGURER); 049 infoFactory.addInterface(ModuleConfigurer.class); 050 GBEAN_INFO = infoFactory.getBeanInfo(); 051 } 052 053 public static GBeanInfo getGBeanInfo() { 054 return GBEAN_INFO; 055 } 056 }