de.upb.swtpra05.group03.companycontrol.plugin
Class PluginLoader

java.lang.Object
  extended byde.upb.swtpra05.group03.companycontrol.plugin.PluginLoader

public class PluginLoader
extends java.lang.Object

The Loader Class for the Plugins. On Construction the Loader Class searches for plugins and loads them.

Version:
$Revision: 1.3 $

Field Summary
private  int anzahl
          Actual Amount of Plugins
private  CompanyControlClient client
          The CompanyControlClient used to send Messages from the Plugins
private  int companyID
          The Company ID
private  java.util.HashMap plugins
          HashMap to Store the Plugins
 
Constructor Summary
PluginLoader(CompanyControlClient client)
          Constructor
 
Method Summary
private  void addPackagePlugin(java.lang.String name, java.lang.String path)
          Manually adds a Plugin
 int getCompanyID()
          accessor method for the Company ID.
 PluginBase[] getPlugins()
          Returns all Plugins
 PluginBase loadPlugin(java.lang.String path)
          loads a Plugin (fails silently)
 void setCompanyID(int ID)
          Sets the Company ID
 void setIDHashMap(java.util.HashMap kerneltoshuttle)
          Sets the KernelIDtoShuttleAgentID HashMap for all Plugins.
 void shuttleChosen(int ID)
          Invoced when the User selects a Shuttle.
 void stationChosen(int ID)
          Invoced when the User select a Station.
 void updateAllPlugins(de.upb.swtpra.kernel.visualisation.RemoteObj msg)
          Invoces the Method update on all Plugins with the given Messge
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

plugins

private java.util.HashMap plugins
HashMap to Store the Plugins


anzahl

private int anzahl
Actual Amount of Plugins


client

private CompanyControlClient client
The CompanyControlClient used to send Messages from the Plugins


companyID

private int companyID
The Company ID

Constructor Detail

PluginLoader

public PluginLoader(CompanyControlClient client)
Constructor

Parameters:
client -
Method Detail

addPackagePlugin

private void addPackagePlugin(java.lang.String name,
                              java.lang.String path)
Manually adds a Plugin

Parameters:
name - The Name
path - the path of the Plugin

loadPlugin

public PluginBase loadPlugin(java.lang.String path)
loads a Plugin (fails silently)

Parameters:
path -
Returns:
the new loaded Plugin

getPlugins

public PluginBase[] getPlugins()
Returns all Plugins

Returns:
PluginBase[]

setCompanyID

public void setCompanyID(int ID)
Sets the Company ID

Parameters:
ID -

getCompanyID

public int getCompanyID()
accessor method for the Company ID. Used for testing

Returns:
int the company ID

updateAllPlugins

public void updateAllPlugins(de.upb.swtpra.kernel.visualisation.RemoteObj msg)
Invoces the Method update on all Plugins with the given Messge

Parameters:
msg - The Message for Invocation

shuttleChosen

public void shuttleChosen(int ID)
Invoced when the User selects a Shuttle.

Parameters:
ID -

stationChosen

public void stationChosen(int ID)
Invoced when the User select a Station.

Parameters:
ID -

setIDHashMap

public void setIDHashMap(java.util.HashMap kerneltoshuttle)
Sets the KernelIDtoShuttleAgentID HashMap for all Plugins.

Parameters:
kerneltoshuttle -