|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object blackboard.platform.plugin.PlugInManager
public class PlugInManager
The PlugInManager
is responsible for maintaining plugin
definitions for the system. It acts as a broker for application code
to access plugin definitions, and organizes plugins based on which
virtual installation they were installed to.
Additionally, the PlugInManager
is responsible for initializing system
permissions for PlugIns as they are loaded into the system.
Within a virtual installation, plugins are uniquely identified by their
unique handle, a combination of two pieces of information: the vendor id, and the
handle. An example would be something like bb-webeq
. However, file system
and URL references include the bbuid
associated with the virtual installation.
E.g., bb-webeq-[vid]
is the URL.
File system is laid out a little differently from the URL, /vi/[vid]/plugins/bb-webeq/webapp for the executable code, and /plugins/bbuid/bb-webeq/config for configuration data.
PlugIn
Field Summary | |
---|---|
java.lang.String |
BUILDING_BLOCKS_CATALOG
Download URL for system extensions |
Constructor Summary | |
---|---|
PlugInManager()
|
Method Summary | |
---|---|
void |
deactivatePlugIn(Id id)
Sets plugins status to inactive and unregisters the webapp |
void |
disablePlugIn(Id id)
Disables the plugin specified by Id. |
void |
enablePlugIn(Id id)
Enables the specified plugin. |
java.util.List |
getAvailableContentHandlers()
Deprecated. a filtering iterator is the preferred method for getting this information |
java.util.List |
getAvailablePlugIns()
Deprecated. plugin availability can be determined either through a filtering interator, or by examining the available property directly. |
java.io.File |
getBundleFile(Id plugInId,
BbLocale locale)
|
java.lang.String |
getBundleName(Id plugInId)
|
static java.lang.String |
getCatalogUrl()
Utility method to calculate the catalog URL from a navigation item. |
ContentHandler |
getContentHandler(java.lang.String handle)
Returns the ContentHandler for the given handle in the current
virtual installation. |
java.util.List |
getContentHandlers()
Returns a list of installed content handlers. |
Version |
getContentSystemVersion()
Returns the current Content System version, or null if the
Content System is not installed. |
Version |
getPlatformVersion()
Returns the current platform version. |
PlugIn |
getPlugIn(Id id)
Returns the PlugIn identified by the specified Id . |
protected PlugIn |
getPlugIn(Id id,
VirtualInstallation vi)
Simply returns the identified plugin for the specified virtual installation |
PlugIn |
getPlugIn(java.lang.String vid,
java.lang.String handle)
Returns the plug-in for the given vendor id and handle. |
java.io.File |
getPlugInDir(PlugIn plugIn)
Gets the root directory for a plugin |
java.util.List |
getPlugInLocales(Id plugInId)
|
java.util.List |
getPlugIns()
Returns a list of installed plug-ins. |
java.io.File |
getPlugInsConfigDirectory()
Deprecated. due to virtual installation layout changes, this method is no longer valid. Use PlugInConfig instead. |
java.io.File |
getPlugInsDirectory(VirtualInstallation vi)
Returns the plug-ins directory. |
java.lang.Class |
getServiceInterface()
Returns the Class for this interface implementation. |
java.io.File |
getTempDirectory()
Returns the upload temp space. |
boolean |
isPlugInLocalized(Id plugInId)
|
void |
refreshCachedInfo()
Loads the plugin and content handler definitions into an in-memory cache. |
void |
registerModule(Module module,
java.sql.Connection conn)
Registers the specified module in the database. |
void |
reInit()
Reloads plugin info from the database, initializing webapps as necessary. |
void |
removePlugIn(Id id)
Deletes the specified plugin. |
void |
serviceInit(ConfigurationService config)
Initialization method called by framework at system startup. |
void |
serviceShutdown()
Implementation method required for service implementations. |
void |
serviceStartup()
Implementation method required for service implementations. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final java.lang.String BUILDING_BLOCKS_CATALOG
Constructor Detail |
---|
public PlugInManager()
Method Detail |
---|
public void serviceInit(ConfigurationService config) throws InitializationException
config
- configuration service for application
InitializationException
- thrown if the it cannot access required services,
or cannot load the plugin data into the cachepublic void refreshCachedInfo() throws InitializationException
This method should only called directly from serviceInit() and reInit(). All other invocations should occur as a byproduct of invalidateCaches().
Note that to avoid circular reloads, this method does not invalidate the caches. Also, this method assumes that Context is already set by the caller.
InitializationException
- thrown if the data cannot be loaded for
any reason. This should result in a fatal startup error.public void reInit() throws PersistenceException
PersistenceException
- Thrown if an error is encountered while loading plugin data.public java.lang.Class getServiceInterface()
public void serviceShutdown()
public void serviceStartup()
public java.io.File getPlugInsConfigDirectory()
PlugInConfig
instead.
null
. See below.public java.io.File getTempDirectory()
public boolean isPlugInLocalized(Id plugInId)
public Version getPlatformVersion()
public Version getContentSystemVersion()
null
if the
Content System is not installed.
public PlugIn getPlugIn(java.lang.String vid, java.lang.String handle)
vid
- the vendor id. Typically this is a four character alphanumeric keyhandle
- a unique key assigned by the vendor. Typically this is simply an
alphanumeric key.
PlugIn
matching the vendor id and handle within
the current VirtualInstallation
. If no VirtualInstallation
is detected, null
is returned.public PlugIn getPlugIn(Id id)
PlugIn
identified by the specified Id
. The object
is retrieved from the current VirtualInstallation
cache. If no Virtual Installation
is currently set, null is returned.
id
- Id of the plugin to return
null
if Virtual Installation is not set, or if there
is no matching PlugIn.protected PlugIn getPlugIn(Id id, VirtualInstallation vi)
id
- vi
-
public java.util.List getPlugIns()
VirtualInstallation
.
If no VirtualInstallation
is detected, null is returned.public java.util.List getAvailablePlugIns()
public ContentHandler getContentHandler(java.lang.String handle)
ContentHandler
for the given handle in the current
virtual installation.
handle
- the unique string handle for the plugin
ContentHandler
installed in the current virtual installation.
If a virtual installation is not obtained from context, null is returned.public java.util.List getContentHandlers()
null
is returnedpublic java.util.List getAvailableContentHandlers()
public void removePlugIn(Id id) throws PersistenceException
id
- plugin to remove
PersistenceException
- thrown if the database cannot be updated. The plugin remains enabled.public void disablePlugIn(Id id) throws PersistenceException
id
- plugin to disable.
PersistenceException
public void enablePlugIn(Id id) throws PersistenceException
id
- plugin to enable
PersistenceException
public void deactivatePlugIn(Id id) throws PersistenceException
id
- plugin to deactivate
PersistenceException
public void registerModule(Module module, java.sql.Connection conn) throws PersistenceException
module
- Module to persistconn
- Database connection. Caller is assumed to control the transaction.
PersistenceException
public java.io.File getPlugInDir(PlugIn plugIn)
plugIn
- plugin to retrieve directory
public java.io.File getPlugInsDirectory(VirtualInstallation vi)
vi
- The VirtualInstallation that we want to get the
plugins directory for
public static java.lang.String getCatalogUrl()
public java.lang.String getBundleName(Id plugInId)
plugInId
-
public java.util.List getPlugInLocales(Id plugInId)
PlugInId
-
public java.io.File getBundleFile(Id plugInId, BbLocale locale)
plugin
- locale
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |