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