01: /*
02: * <copyright>
03: *
04: * Copyright 2003-2004 BBNT Solutions, LLC
05: * under sponsorship of the Defense Advanced Research Projects
06: * Agency (DARPA).
07: *
08: * You can redistribute this software and/or modify it under the
09: * terms of the Cougaar Open Source License as published on the
10: * Cougaar Open Source Website (www.cougaar.org).
11: *
12: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
13: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
14: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
15: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
16: * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
18: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22: * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23: *
24: * </copyright>
25: */
26: package org.cougaar.lib.vishnu.client;
27:
28: import java.util.Collection;
29: import java.util.Date;
30: import java.util.List;
31: import java.util.Map;
32: import java.util.Vector;
33:
34: import org.cougaar.lib.param.ParamMap;
35: import org.cougaar.planning.ldm.asset.Asset;
36: import org.cougaar.util.log.Logger;
37: import org.w3c.dom.Document;
38:
39: /**
40: * Base class for Modes and ResultHandlers that help the VishnuPlugin to do its work.
41: * <p>
42: * Holds references to the ModeListener(VishnuPlugin) and utility objects like the
43: * xmlProcessor, VishnuComm, DomUtil, Config, and the parameter map.
44: */
45: public class PluginHelper {
46: public PluginHelper(ModeListener parent, VishnuComm comm,
47: XMLProcessor xmlProcessor, VishnuDomUtil domUtil,
48: VishnuConfig config, ParamMap myParamTable, Logger logger) {
49: this .parent = parent;
50: this .comm = comm;
51: this .xmlProcessor = xmlProcessor;
52: this .domUtil = domUtil;
53: this .config = config;
54:
55: this .myParamTable = myParamTable;
56: this .logger = logger;
57:
58: localSetup();
59: }
60:
61: protected ParamMap getMyParams() {
62: return myParamTable;
63: }
64:
65: protected void localSetup() {
66: try {
67: showTiming = getMyParams().getBooleanParam("showTiming");
68: } catch (Exception e) {
69: showTiming = true;
70: }
71: }
72:
73: protected ParamMap myParamTable;
74: protected VishnuComm comm;
75: protected ModeListener parent;
76: protected boolean showTiming;
77: protected XMLProcessor xmlProcessor;
78: protected VishnuDomUtil domUtil;
79: protected VishnuConfig config;
80: protected Logger logger;
81: }
|