001/**
002 * A composite entity that is the model contained by an ExceptionManager.
003 *
004 * Copyright (c) 2007-2014 The Regents of the University of California. All
005 * rights reserved. Permission is hereby granted, without written agreement and
006 * without license or royalty fees, to use, copy, modify, and distribute this
007 * software and its documentation for any purpose, provided that the above
008 * copyright notice and the following two paragraphs appear in all copies of
009 * this software.
010 *
011 * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
012 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
013 * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
014 * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
015 *
016 * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
017 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
018 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN
019 * "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO PROVIDE
020 * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
021 *
022 * PT_COPYRIGHT_VERSION_2 COPYRIGHTENDKEY
023 *
024 *
025 */
026package ptolemy.actor.lib;
027
028import ptolemy.kernel.CompositeEntity;
029import ptolemy.kernel.util.IllegalActionException;
030import ptolemy.kernel.util.NameDuplicationException;
031import ptolemy.kernel.util.Workspace;
032
033///////////////////////////////////////////////////////////////////
034//// ExceptionManagerModel
035
036/**
037 * A composite entity that is the model contained by an ExceptionManager.
038 *
039 * @author Elizabeth Latronico, based on ptolemy.data.ontologies.OntologySolverModel by Charles Shelton.
040 * @version $Id$
041 * @since Ptolemy II 10.0
042 * @Pt.ProposedRating Red (beth)
043 * @Pt.AcceptedRating Red (beth)
044 * @see ExceptionManager
045 */
046public class ExceptionManagerModel extends CompositeEntity {
047
048    /** Construct an ExceptionManager in the specified workspace.
049     *  If the workspace argument is null, then use the default workspace.
050     *  Add the entity to the workspace directory.
051     *  Increment the version number of the workspace.
052     *  @param workspace The workspace that will list the entity.
053     */
054    public ExceptionManagerModel(Workspace workspace) {
055        super(workspace);
056        _modelContainer = null;
057    }
058
059    /** Create a new ExceptionManagerModel with the specified name and container.
060     *  @param container The container for the solver model.
061     *  @param name The name for the solver model.
062     *  @exception IllegalActionException If the base class throws it.
063     *  @exception NameDuplicationException If the container already contains an
064     *   entity with the specified name.
065     */
066
067    public ExceptionManagerModel(CompositeEntity container, String name)
068            throws IllegalActionException, NameDuplicationException {
069        super(container, name);
070        _modelContainer = null;
071    }
072
073    /** Create a new ExceptionManagerModel with the specified workspace and the
074     *  specified ExceptionManager.
075     *  @param exceptionManager The ExceptionManager that contains the model.
076     *  @param workspace The workspace that will list the entity.
077     *  @exception IllegalActionException If this actor cannot be contained
078     *   by the proposed container (see the setContainer() method).
079     *  @exception NameDuplicationException If the name coincides with
080     *   an entity already in the container.
081     */
082    public ExceptionManagerModel(ExceptionManager exceptionManager,
083            Workspace workspace)
084            throws IllegalActionException, NameDuplicationException {
085        super(workspace);
086        _modelContainer = exceptionManager;
087    }
088
089    ///////////////////////////////////////////////////////////////////
090    ////                         public methods                    ////
091
092    /** Return the ExceptionManager that contains the model.
093     *  @return The ExceptionManager that contains this model.
094     *  @see #setModelContainer(ExceptionManager)
095     */
096    public ExceptionManager getModelContainer() {
097        return _modelContainer;
098    }
099
100    /** Set the exception manager that contains this model.
101     *  @param exceptionManager The exception manager that should contain this
102     *  model.
103     *  @see #getModelContainer()
104     */
105    public void setModelContainer(ExceptionManager exceptionManager) {
106        _modelContainer = exceptionManager;
107    }
108
109    ///////////////////////////////////////////////////////////////////
110    ////                         private variables                 ////
111
112    /** The ExceptionManager that contains this model */
113    private ExceptionManager _modelContainer;
114}