edu.iu.iv.common
Class BasicIVC

java.lang.Object
  |
  +--edu.iu.iv.core.IVC
        |
        +--edu.iu.iv.common.BasicIVC

public class BasicIVC
extends IVC

Basic implementation of the IVC interface. All the registries, facades, the gui, the scheduler, and global data needed for this system is provided here.

Author:
Team IVC

Constructor Summary
BasicIVC()
          Constructs a new BasicIVC using default implementations for the plugin registry, persistence registry, and persistence facade.
 
Method Summary
 void addAddModelListener(AddModelListener listener)
          Adds an add model listener to the IVC.
 void addModel(java.lang.Object model)
          Adds a model to the system.
 ConfigFile getConfigFile()
          get the config file for the system.
 java.io.File getErrorLogFile()
          Gets the file object representing the current log file.
 java.util.logging.Logger getErrorLogger()
          Gets the logger associated with the IVC so that messages can be logged.
 IVCLogManager getIVCLogManager()
           
 IVCUserInterface getIVCUserInterface()
          Gets the IVC User Interface for the system.
 PersistenceRegistry getPersistenceRegistry()
          Gets the persistence registry.
 java.io.File getPluginPath()
          Gets the path to the plugin directory so plugins may access files in there if needed.
 PluginRegistry getPluginRegistry()
          Gets the plugin registry.
 Scheduler getScheduler()
          Gets the scheduler currently in use by the system.
 void removeAddModelListener(AddModelListener listener)
          Removes an add model listener from the list of those that will be notified when a model is added to the IVC.
 void setConfigFile(ConfigFile configFile)
          Set the associated config file for the IVC system.
 void setErrorLogFile(java.io.File errorLogFile, boolean append)
          If it is desired to save log messages to a file, this method must be called before logging any messages.
 void setPluginPath(java.io.File pluginPath)
          Sets the path to the plugin directory so that plugins may access files in the directory if they have some located there.
 void setScheduler(Scheduler scheduler)
          Sets the scheduler to be used by the system.
 
Methods inherited from class edu.iu.iv.core.IVC
getInstance
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicIVC

public BasicIVC()
Constructs a new BasicIVC using default implementations for the plugin registry, persistence registry, and persistence facade. The scheduler is initialized as a QueueScheduler.

Method Detail

getPluginRegistry

public PluginRegistry getPluginRegistry()
Description copied from class: IVC
Gets the plugin registry. This is the global registry where all plugins will be housed for the system.

Specified by:
getPluginRegistry in class IVC
Returns:
the plugin registry
See Also:
IVC.getPluginRegistry()

getPersistenceRegistry

public PersistenceRegistry getPersistenceRegistry()
Description copied from class: IVC
Gets the persistence registry. This is the global registry where all persisters will be housed for the system.

Specified by:
getPersistenceRegistry in class IVC
Returns:
the persistence registry
See Also:
IVC.getPersistenceRegistry()

addModel

public void addModel(java.lang.Object model)
              throws UnsupportedModelException
Description copied from class: IVC
Adds a model to the system. This will usually result in a new model being available through the GUI.

Specified by:
addModel in class IVC
Parameters:
model - the model to add. This can be any object that is supported by the plugins.
Throws:
UnsupportedModelException - if there is no plugin that can handle the model added, then an exception will be thrown.
See Also:
edu.iu.iv.core.IVC#addModel(edu.iu.iv.core.datamodels.DataModel)

addAddModelListener

public void addAddModelListener(AddModelListener listener)
Description copied from class: IVC
Adds an add model listener to the IVC. Every time a model is added to the system, all listeners will be notified.

Specified by:
addAddModelListener in class IVC
Parameters:
listener - a listener for models being added to the system.
See Also:
IVC.addAddModelListener(edu.iu.iv.core.AddModelListener)

removeAddModelListener

public void removeAddModelListener(AddModelListener listener)
Description copied from class: IVC
Removes an add model listener from the list of those that will be notified when a model is added to the IVC.

Specified by:
removeAddModelListener in class IVC
Parameters:
listener - the listener to remove
See Also:
IVC.removeAddModelListener(edu.iu.iv.core.AddModelListener)

getIVCUserInterface

public IVCUserInterface getIVCUserInterface()
Description copied from class: IVC
Gets the IVC User Interface for the system. This is the gui that is currently in use by IVC.

Specified by:
getIVCUserInterface in class IVC
Returns:
the IVC GUI.
See Also:
edu.iu.iv.core.IVC#getIVCToolkit()

getScheduler

public Scheduler getScheduler()
Description copied from class: IVC
Gets the scheduler currently in use by the system. The scheduler will allow for algorithms to be scheduled however the current scheduler does its scheduling.

Specified by:
getScheduler in class IVC
Returns:
the scheduler
See Also:
IVC.getScheduler()

setScheduler

public void setScheduler(Scheduler scheduler)
Description copied from class: IVC
Sets the scheduler to be used by the system.

Specified by:
setScheduler in class IVC
Parameters:
scheduler - the scheduler to be used.
See Also:
IVC.setScheduler(edu.iu.iv.core.Scheduler)

setPluginPath

public void setPluginPath(java.io.File pluginPath)
Description copied from class: IVC
Sets the path to the plugin directory so that plugins may access files in the directory if they have some located there.

Specified by:
setPluginPath in class IVC
Parameters:
pluginPath - the plugin directory.
See Also:
IVC.setPluginPath(java.io.File)

getPluginPath

public java.io.File getPluginPath()
Description copied from class: IVC
Gets the path to the plugin directory so plugins may access files in there if needed.

Specified by:
getPluginPath in class IVC
Returns:
the path to the plugin directory
See Also:
IVC.getPluginPath()

setConfigFile

public void setConfigFile(ConfigFile configFile)
Description copied from class: IVC
Set the associated config file for the IVC system. The config file consists of directories for libs and plugins and any other preferences needed in the system.

Specified by:
setConfigFile in class IVC
Parameters:
configFile - the config file
See Also:
IVC.setConfigFile(edu.iu.iv.common.boot.ConfigFile)

getConfigFile

public ConfigFile getConfigFile()
Description copied from class: IVC
get the config file for the system. The config file just keeps a bunch of parameter/value pairs for preferences and lib and plugin directory information. it is advisable to write out the config file after making any changes.

Specified by:
getConfigFile in class IVC
Returns:
the IVC's config file.
See Also:
IVC.getConfigFile()

getErrorLogger

public java.util.logging.Logger getErrorLogger()
Description copied from class: IVC
Gets the logger associated with the IVC so that messages can be logged.

Specified by:
getErrorLogger in class IVC
Returns:
The IVC's logger.
See Also:
IVC.getErrorLogger(), Logger

setErrorLogFile

public void setErrorLogFile(java.io.File errorLogFile,
                            boolean append)
                     throws java.io.IOException
If it is desired to save log messages to a file, this method must be called before logging any messages. If this is not done, then all log messages are redirected to System.err only.

Specified by:
setErrorLogFile in class IVC
Parameters:
errorLogFile - The path to the log file.
append - An optional flag that if true, makes the logger append to the log file rather than over-write it.
Throws:
java.io.IOException - If the logger could not be configured to write to the specified log file.
See Also:
IVC.setErrorLogFile(File, boolean)

getIVCLogManager

public IVCLogManager getIVCLogManager()
Specified by:
getIVCLogManager in class IVC

getErrorLogFile

public java.io.File getErrorLogFile()
Description copied from class: IVC
Gets the file object representing the current log file.

Specified by:
getErrorLogFile in class IVC
Returns:
The log file.
See Also:
IVC.getErrorLogFile()