00001package org.gridlab.gat.resources;
00002
00003
00004 import org.gridlab.gat.GATContext;
00005 import org.gridlab.gat.Preferences;
00006 import org.gridlab.gat.engine.GATEngine;
00007 import org.gridlab.gat.resources.cpi.HardwareResourceCpi;
00008
00009 /**
00010 * An instance of this interface is an abstract representation of a physical
00011 * hardware resource which is monitorable.
00012 * <p>
00013 * An instance of this interface presents an abstract, system-independent
00014 * view of a physical hardware resource which is monitorable. Various
00015 * systems use system-dependent means of representing a physical hardware
00016 * resource. GAT, however, uses an instance of this interface as an operating
00017 * system independent description of a physical hardware resource which
00018 * is monitorable.
00019 * <p>
00020 * An instance of this interface allows on to examine the various properties
00021 * of the physical hardware resource to which this instance
00022 * corresponds. In addition is allows one to monitor the physical
00023 * hardware resource to which this instance corresponds.
00024 */00025publicabstractclass HardwareResourceimplementsResource {
00026 GATContext gatContext;
00027 Preferences preferences;
00028
00029protectedHardwareResource(GATContext gatContext, Preferences preferences) {
00030 this.gatContext = gatContext;
00031 this.preferences = preferences;
00032 }
00033
00034publicstaticHardwareResourcecreate(GATContext gatContext) {
00035 returncreate(gatContext, null);
00036 }
00037
00038publicstaticHardwareResourcecreate(GATContext gatContext, Preferences preferences) {
00039 GATEngine gatEngine = GATEngine.getGATEngine();
00040 HardwareResourceCpi h = (HardwareResourceCpi) gatEngine.getAdaptor(HardwareResourceCpi.class,
00041 gatContext, preferences, null);
00042 return h;
00043 }
00044 }