001    // Copyright 2004, 2005 The Apache Software Foundation
002    //
003    // Licensed under the Apache License, Version 2.0 (the "License");
004    // you may not use this file except in compliance with the License.
005    // You may obtain a copy of the License at
006    //
007    //     http://www.apache.org/licenses/LICENSE-2.0
008    //
009    // Unless required by applicable law or agreed to in writing, software
010    // distributed under the License is distributed on an "AS IS" BASIS,
011    // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012    // See the License for the specific language governing permissions and
013    // limitations under the License.
014    
015    package org.apache.tapestry.event;
016    
017    import java.util.EventObject;
018    
019    import org.apache.tapestry.IPage;
020    import org.apache.tapestry.IRequestCycle;
021    
022    /**
023     *  Encapsulates information related to the page listener
024     *  interfaces.
025     *
026     *  @author Howard Lewis Ship
027     *  @since 1.0.5
028     * 
029     **/
030    
031    public class PageEvent extends EventObject
032    {
033        private static final long serialVersionUID = -6167989946862112436L;
034        
035            private transient IPage page;
036        private transient IRequestCycle requestCycle;
037    
038        /**
039         *  Constructs a new instance of the event.  The
040         *  {@link EventObject#getSource()} of the event will
041         *  be the {@link IPage}.
042         *
043         **/
044    
045        public PageEvent(IPage page, IRequestCycle cycle)
046        {
047            super(page);
048    
049            this.page = page;
050            this.requestCycle = cycle;
051        }
052    
053        public IPage getPage()
054        {
055            return page;
056        }
057    
058        public IRequestCycle getRequestCycle()
059        {
060            return requestCycle;
061        }
062    }