| 
 | The Meta-Environment API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnl.cwi.sen1.gui.plugin.DefaultStudioPlugin
nl.cwi.sen1.visbase.rstorecontainer.RStoreContainer
public class RStoreContainer
Contains the logic needed to communicate RStore data with other ToolBus-tools.
| Field Summary | |
|---|---|
| private  RStoreContainerBridge | m_bridge | 
| private  java.util.Map<java.io.File,java.lang.Integer> | m_earlierLoadedRStoreFilesMapUsed to track which RStore File's where loaded earlier | 
| private  java.util.Map<java.lang.Integer,RStoreTracker> | m_loadedRStoresMapHolds the loaded/parsed RStores | 
| private static org.apache.commons.logging.Log | m_log | 
| private  nl.cwi.sen1.gui.Studio | m_metaStudio | 
| private static aterm.pure.PureFactory | m_pureFactory | 
| Constructor Summary | |
|---|---|
|   | RStoreContainer()Default constructor. | 
| protected  | RStoreContainer(java.lang.String[] args)Constructor used when started by the ToolBus. | 
| Method Summary | |
|---|---|
| static aterm.ATerm | createDummyFactData()Creates dummy fact data which is used when no data can be loaded. | 
|  java.util.Map<java.io.File,java.lang.Integer> | getLoadedRStoreFilesMap()Returns the mapping from RStore filenames to ID's (belonging to the loaded RStoreTrackers). | 
|  java.util.Map<java.lang.Integer,RStoreTracker> | getLoadedRStoreTrackersMap()Returns the mapping from ID's to the loaded RStoreTrackers. | 
|  java.lang.String | getName()Returns the name to indentify this tool. | 
| static aterm.pure.PureFactory | getPureFactory()Returns the PureFactory object used by this class. | 
|  void | initStudioPlugin(nl.cwi.sen1.gui.Studio metaStudio)Initializes and connects this tool when started from the Meta-Environment. | 
| protected  java.io.InputStream | inputStreamFromFile(java.io.File file)Creates an InputStream object for the given file. | 
| static void | main(java.lang.String[] args)The main method is called by the ToolBus to start the RStoreContainer. | 
| protected  nl.cwi.sen1.relationstores.types.RStore | parseRStore(java.io.InputStream inputStream)Parses RStore data from an input stream. | 
|  aterm.ATerm | rcGetFactData(int rStoreId,
                           int factId)Called by the RStoreContainerInterface ToolBus process to load the data belonging to a fact from an earlier loaded RStore file. | 
|  aterm.ATerm | rcGetRstore(int rStoreId)Returns the RStore for RStoreId | 
|  aterm.ATerm | rcGetRstoreFacts(int id)Called by the RStoreContainerInterface ToolBus process to load the facts from an earlier loaded RStore file. | 
|  aterm.ATerm | rcLoadRstore(java.lang.String filename)Called by the RStoreContainerInterface ToolBus process to load an RStore file. | 
|  aterm.ATerm | rcLoadRstore(java.lang.String filename,
                         aterm.ATerm rstoreData)Called by the RStoreContainerInterface ToolBus process to load an RStore directly from an ATerm | 
|  aterm.ATerm | rcUnloadRstore(int id)Called by the RStoreContainerInterface ToolBus process to unload an earlier loaded RStore | 
|  void | recAckEvent(aterm.ATerm t0)Called by the RStoreContainerInterface ToolBus process when the fact-update event is received | 
|  void | recTerminate(aterm.ATerm message)Handles terminate message. | 
| protected  int | registerRStore(java.io.File rStoreFileReference,
                             nl.cwi.sen1.relationstores.types.RStore rStore)Registers a loaded RStore in the RStores map. | 
| protected  void | sendFactUpdatedEvents(java.lang.Integer rStoreId,
                                           java.util.List<java.lang.Integer> updatedFactIds)Sends snd-event(rc-fact-updated(messages
 (RStore,FactId) over the toolbus | 
| Methods inherited from class nl.cwi.sen1.gui.plugin.DefaultStudioPlugin | 
|---|
| addStudioPluginListener, fireStudioPluginClosed, removeStudioPluginListener | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
private RStoreContainerBridge m_bridge
private nl.cwi.sen1.gui.Studio m_metaStudio
private java.util.Map<java.lang.Integer,RStoreTracker> m_loadedRStoresMap
private java.util.Map<java.io.File,java.lang.Integer> m_earlierLoadedRStoreFilesMap
private static aterm.pure.PureFactory m_pureFactory
private static final org.apache.commons.logging.Log m_log
| Constructor Detail | 
|---|
public RStoreContainer()
protected RStoreContainer(java.lang.String[] args)
args - The arguments passed by the ToolBus.| Method Detail | 
|---|
public static void main(java.lang.String[] args)
args - The arguments passed by the ToolBus.public java.lang.String getName()
getName in interface nl.cwi.sen1.gui.plugin.StudioPluginpublic void initStudioPlugin(nl.cwi.sen1.gui.Studio metaStudio)
initStudioPlugin in interface nl.cwi.sen1.gui.plugin.StudioPluginmetaStudio - Reference to the Meta-Studio to connect to.
public aterm.ATerm rcLoadRstore(java.lang.String filename,
                                aterm.ATerm rstoreData)
rcLoadRstore in interface RStoreContainerTiffilename - Filename of the RStore file, if it would be written to disk.
public aterm.ATerm rcLoadRstore(java.lang.String filename)
rcLoadRstore in interface RStoreContainerTiffilename - Filename of the RStore file to load.
public aterm.ATerm rcGetRstoreFacts(int id)
rcGetRstoreFacts in interface RStoreContainerTifid - ID of the loaded RStore file.
public aterm.ATerm rcGetFactData(int rStoreId,
                                 int factId)
rcGetFactData in interface RStoreContainerTifrStoreId - ID of the loaded RStore file.factId - ID of the fact to load.
public aterm.ATerm rcUnloadRstore(int id)
rcUnloadRstore in interface RStoreContainerTifid - the ID of the earlier loaded RStore
snd-value(rc-rstore-unloaded()) public void recAckEvent(aterm.ATerm t0)
recAckEvent in interface RStoreContainerTifpublic static aterm.ATerm createDummyFactData()
public void recTerminate(aterm.ATerm message)
recTerminate in interface RStoreContainerTifmessage - The received message.public static aterm.pure.PureFactory getPureFactory()
public java.util.Map<java.lang.Integer,RStoreTracker> getLoadedRStoreTrackersMap()
public java.util.Map<java.io.File,java.lang.Integer> getLoadedRStoreFilesMap()
getLoadedRStoreTrackersMap()
protected java.io.InputStream inputStreamFromFile(java.io.File file)
                                           throws java.io.FileNotFoundException
file - File to create an input stream for.
java.lang.RuntimeException - if the input stream is null.
java.io.FileNotFoundException - if the input File cannot be found.
protected nl.cwi.sen1.relationstores.types.RStore parseRStore(java.io.InputStream inputStream)
                                                       throws RStoreParseException
inputStream - The input stream to parse.
java.lang.RuntimeException - if the input stream is null.
RStoreParseException - if parsing of RStore input fails.
protected int registerRStore(java.io.File rStoreFileReference,
                             nl.cwi.sen1.relationstores.types.RStore rStore)
rStoreFileReference - the reference to the File that was used to create the RStorerStore - The RStore to register.
java.lang.RuntimeException - if File and/or RStore input is null.
protected void sendFactUpdatedEvents(java.lang.Integer rStoreId,
                                     java.util.List<java.lang.Integer> updatedFactIds)
snd-event(rc-fact-updated(,))   messages
 (RStore,FactId) over the toolbus
rStoreId - the ID of the RStore to which the updated facts belongupdatedFactIds - a list of ID's of updated facts
java.lang.RuntimeException - if input is null.public aterm.ATerm rcGetRstore(int rStoreId)
rcGetRstore in interface RStoreContainerTifrStoreId - the ID of the RStore to retrieve| 
 | The Meta-Environment API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||