ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/experimental/server/PluginManager/PluginFilterManager.java
(Generate patch)

Comparing experimental/server/PluginManager/PluginFilterManager.java (file contents):
Revision 1.2 by pjm2, Fri Dec 1 09:51:32 2000 UTC vs.
Revision 1.3 by pjm2, Fri Dec 1 14:38:47 2000 UTC

# Line 10 | Line 10 | import uk.ac.ukc.iscream.util.*;
10  
11   class PluginFilterManager {
12      
13    // public method to return an instance of a PluginFilterManager,
14    // as this class is a singleton.
15    public static PluginFilterManager init() throws AlreadyInitialisedException {
16        if (_instance != null){
17            throw new AlreadyInitialisedException("init() has already been called.");
18        }
19        _instance = new PluginFilterManager();
20        return _instance;
21    }
22    
13      // Return a reference to the single class.
14 +    // Construct it if it does not already exist, otherwise just return the reference.
15      public static PluginFilterManager getInstance() throws NotInitialisedException {
16          if (_instance == null){
17 <            throw new NotInitialisedException("An instance of PluginFilterManager hasn't been initialised yet!");
17 >            return new PluginFilterManager();
18          }
19          return _instance;
20      }
# Line 33 | Line 24 | class PluginFilterManager {
24      private PluginFilterManager(){
25          
26          System.out.println("Creating filter pipeline for plugin filters ...");
27 +        System.out.println("");
28          
29          // Look in the specified directory for "*__Plugin.class" files.
30          File file = new File(_directory);
# Line 50 | Line 42 | class PluginFilterManager {
42                  try {
43                      PluginFilter pf = (PluginFilter)ClassLoader.getSystemClassLoader().loadClass(files[i]).newInstance();
44                      _filterPipeline.add(pf);
45 <                    System.out.println("Added filter: "+files[i]);
45 >                    System.out.println("Added filter: "+files[i]+" ("+pf.getDescription()+")");
46                  }
47                  catch (InstantiationException e){
48                      System.out.println("Failed to add "+files[i]+" to the plugin filter pipeline.");
# Line 64 | Line 56 | class PluginFilterManager {
56                  //System.out.println("Ignoring "+files[i]+" in the plugin folder.");
57              }
58          }
59 <        
59 >
60 >        System.out.println("");        
61          System.out.println("The filter pipeline has been set up with "+_filterPipeline.size()+" plugin filters.");
62          
63      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines