GraphLab Project

graphlab.platform.extension
Class ExtensionLoader

java.lang.Object
  extended by graphlab.platform.extension.ExtensionLoader
All Implemented Interfaces:
StorableOnExit

public class ExtensionLoader
extends java.lang.Object
implements StorableOnExit

The base class for loading extensions. This class performs loading and reloading of extensions, (from their source (.class or anyother format) files)

Author:
Azin Azadi

Field Summary
 
Fields inherited from interface graphlab.platform.preferences.lastsettings.StorableOnExit
SETTINGS
 
Constructor Summary
ExtensionLoader()
           
 
Method Summary
static java.util.HashSet<ExtensionHandler> getRegisteredExtensionHandlers()
           
static AbstractAction handleExtension(BlackBoard b, java.lang.Object e)
          gets e as an extension and tries to create Its relating AbstractAction using registered ExtensionHandlers
static java.lang.Object loadExtension(java.lang.Class extensionClass)
          returns an instance of extensionClass if the given extensionClass implements Extension (BasicExtension) or has default constructor, otherwise it returns null
static Extension loadUnknownExtension(java.io.File unknownFile, BlackBoard blackboard)
          returns an instance of extensionClsas if the given extensionClass implements Extension, otherwise it returns null
static void registerExtensionHandler(ExtensionHandler extHandler)
          Registers extHandler as an extension handler, so after this new extension that are loaded to GraphLab will be given to handler.
static void registerUnknownExtensionLoader(UnknownExtensionLoader e)
          register e as an unKnownExtensionLoader, which GraphLab will try to load "not .class files" with them
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtensionLoader

public ExtensionLoader()
Method Detail

registerExtensionHandler

public static void registerExtensionHandler(ExtensionHandler extHandler)
Registers extHandler as an extension handler, so after this new extension that are loaded to GraphLab will be given to handler.

calling this method will not affect previously loaded extensions.

Parameters:
extHandler -

getRegisteredExtensionHandlers

public static java.util.HashSet<ExtensionHandler> getRegisteredExtensionHandlers()

registerUnknownExtensionLoader

public static void registerUnknownExtensionLoader(UnknownExtensionLoader e)
register e as an unKnownExtensionLoader, which GraphLab will try to load "not .class files" with them

Parameters:
e -

handleExtension

public static AbstractAction handleExtension(BlackBoard b,
                                             java.lang.Object e)
gets e as an extension and tries to create Its relating AbstractAction using registered ExtensionHandlers


loadExtension

public static java.lang.Object loadExtension(java.lang.Class extensionClass)
returns an instance of extensionClass if the given extensionClass implements Extension (BasicExtension) or has default constructor, otherwise it returns null

Parameters:
extensionClass -
Returns:

loadUnknownExtension

public static Extension loadUnknownExtension(java.io.File unknownFile,
                                             BlackBoard blackboard)
returns an instance of extensionClsas if the given extensionClass implements Extension, otherwise it returns null

Parameters:
unknownFile -

GraphLab Project