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    package org.apache.geronimo.console.gbean;
018    
019    import org.apache.geronimo.gbean.GBeanInfo;
020    import org.apache.geronimo.gbean.GBeanInfoBuilder;
021    
022    /**
023     * A GBean that implements ContextForward.  This way any Geronimo module can
024     * add forwards to the console.
025     *
026     * @version $Rev: 706640 $ $Date: 2008-10-21 14:44:05 +0000 (Tue, 21 Oct 2008) $
027     */
028    public class ContextForwardGBean implements ContextForward {
029        private String portalPathPrefix;
030        private String portletContextPath;
031        private String portletServletPath;
032    
033        public ContextForwardGBean(String portalPathPrefix, String portletContextPath, String portletServletPath) {
034            this.portalPathPrefix = portalPathPrefix;
035            this.portletContextPath = portletContextPath;
036            this.portletServletPath = portletServletPath;
037        }
038    
039        public String getPortalPathPrefix() {
040            return portalPathPrefix;
041        }
042    
043        public String getPortletContextPath() {
044            return portletContextPath;
045        }
046    
047        public String getPortletServletPath() {
048            return portletServletPath;
049        }
050    
051        public static final GBeanInfo GBEAN_INFO;
052        static {
053            GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(ContextForwardGBean.class);
054            infoFactory.addAttribute("portalPathPrefix", String.class, true, true);
055            infoFactory.addAttribute("portletContextPath", String.class, true, true);
056            infoFactory.addAttribute("portletServletPath", String.class, true, true);
057            infoFactory.addInterface(ContextForward.class);
058            infoFactory.setConstructor(new String[]{"portalPathPrefix","portletContextPath","portletServletPath"});
059            GBEAN_INFO = infoFactory.getBeanInfo();
060        }
061        public static GBeanInfo getGBeanInfo() {
062            return GBEAN_INFO;
063        }
064    }