001/*
002 * Copyright (c) 2003-2010 The Regents of the University of California.
003 * All rights reserved.
004 *
005 * '$Author: crawl $'
006 * '$Date: 2012-07-11 20:23:34 +0000 (Wed, 11 Jul 2012) $' 
007 * '$Revision: 30168 $'
008 * 
009 * Permission is hereby granted, without written agreement and without
010 * license or royalty fees, to use, copy, modify, and distribute this
011 * software and its documentation for any purpose, provided that the above
012 * copyright notice and the following two paragraphs appear in all copies
013 * of this software.
014 *
015 * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
016 * FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
017 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
018 * THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
019 * SUCH DAMAGE.
020 *
021 * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
022 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
023 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
024 * PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
025 * CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
026 * ENHANCEMENTS, OR MODIFICATIONS.
027 *
028 */
029
030package org.kepler.objectmanager.cache;
031
032import java.io.IOException;
033
034import org.kepler.objectmanager.lsid.KeplerLSID;
035import org.kepler.reporting.roml.ReportLayout;
036
037/**
038 * Class that represents an object in the CacheManager. This class should be
039 * extended by each type of object that wants to control its own lifecycle
040 * events and serialization events.
041 */
042public class ReportLayoutCacheObject extends CacheObject {
043        private ReportLayout reportLayout = null;
044
045        public ReportLayoutCacheObject() {
046                super();
047        }
048
049        /**
050         * construct a new CacheObject
051         */
052        public ReportLayoutCacheObject(String name, KeplerLSID lsid) {
053                super(name, lsid);
054        }
055
056        /**
057         * This returns a reportLayout object from file. You'll need to cast the
058         * object to a ReportLayout to use it.
059         */
060        public Object getObject() {
061                return reportLayout;
062        }
063
064
065        /**
066         * set the data file that is associated with this RawDataCacheObject
067         */
068        public void setReportLayout(ReportLayout rl) throws IOException {
069                this.reportLayout = rl;
070        }
071
072        /**
073         * call back for when this object is added to the cache
074         */
075        public void objectAdded() {
076                // System.out.println("object " + lsid.toString() + " added");
077        }
078
079        /**
080         * call back for when this object is removed by the user
081         */
082        public void objectRemoved() {
083                // System.out.println("object " + lsid.toString() + " removed");
084        }
085
086        /**
087         * call back for when this object is purged by CacheManager
088         */
089        public void objectPurged() {
090                // System.out.println("object " + lsid.toString() + " purged");
091        }
092
093}