001: /*
002: * This file or a portion of this file is licensed under the terms of
003: * the Globus Toolkit Public License, found in file GTPL, or at
004: * http://www.globus.org/toolkit/download/license.html. This notice must
005: * appear in redistributions of this file, with or without modification.
006: *
007: * Redistributions of this Software, with or without modification, must
008: * reproduce the GTPL in: (1) the Software, or (2) the Documentation or
009: * some other similar material which is provided with the Software (if
010: * any).
011: *
012: * Copyright 1999-2004 University of Chicago and The University of
013: * Southern California. All rights reserved.
014: */
015: package org.griphyn.vdl.directive;
016:
017: import org.griphyn.common.util.Currently;
018: import org.griphyn.common.util.Version;
019: import org.griphyn.vdl.util.Logging;
020: import org.griphyn.vdl.util.ChimeraProperties;
021:
022: import java.util.MissingResourceException;
023: import java.io.IOException;
024:
025: /**
026: * The base class for directives. Directives are a set of
027: * high-level common modules that facilitate user interaction
028: * with the Chimera system.
029: *
030: * @author Jens-S. Vöckler
031: * @author Yong Zhao
032: * @version $Revision: 50 $
033: */
034: public abstract class Directive {
035: /**
036: * Logging instance
037: */
038: protected Logging m_logger;
039:
040: /**
041: * verbose logging mode
042: */
043: protected boolean m_verbose;
044:
045: /**
046: * properties instance
047: */
048: protected ChimeraProperties m_props;
049:
050: /**
051: * Constructor, initialize logging and properties instance
052: */
053: public Directive() throws IOException, MissingResourceException {
054: m_logger = Logging.instance();
055: m_verbose = false;
056: m_props = ChimeraProperties.instance();
057: }
058:
059: /**
060: * set verbose mode
061: * @param v true for verbose mode, false otherwise
062: */
063: public void setVerbose(boolean v) {
064: m_verbose = v;
065: }
066:
067: /**
068: * get verbose mode
069: */
070: public boolean getVerbose() {
071: return m_verbose;
072: }
073:
074: /**
075: * set logging instance
076: * @param logger the logging instance
077: */
078: public void setLogger(Logging logger) {
079: if (logger != null)
080: m_logger = logger;
081: }
082:
083: /**
084: * get logging instance
085: */
086: public Logging getLogger() {
087: return m_logger;
088: }
089:
090: /**
091: * get properties instance
092: */
093: public ChimeraProperties getProperties() {
094: return m_props;
095: }
096:
097: /**
098: * set properties instance
099: * @param props the chimera properties instance
100: */
101: public void setProperties(ChimeraProperties props) {
102: if (props != null)
103: m_props = props;
104: }
105: }
|