some more minor mods to the module manager, and implementation of the module
uninstallation page
This commit is contained in:
@@ -26,6 +26,8 @@ public interface Module
|
||||
{
|
||||
public QualifiedNameKey getModuleID();
|
||||
|
||||
public String getDescription();
|
||||
|
||||
public void install(Principal installer, DynamoLog log) throws DatabaseException, ModuleException;
|
||||
|
||||
public void uninstall(Principal uninstaller, DynamoLog log) throws DatabaseException, ModuleException;
|
||||
|
||||
@@ -25,6 +25,8 @@ public interface ModuleFunctions
|
||||
{
|
||||
public QualifiedNameKey getModuleID();
|
||||
|
||||
public String getDescription();
|
||||
|
||||
public void initialize(ModuleSite site, ServiceProvider services) throws ModuleException;
|
||||
|
||||
public void shutdown();
|
||||
|
||||
@@ -298,7 +298,7 @@ class IndexServiceImpl implements IndexService
|
||||
|
||||
private final List doQuery(Query query, int offset, int count) throws IndexException
|
||||
{
|
||||
SubsetCollector subc = new SubsetCollector(offset,count);
|
||||
SubsetCollector subc = new SubsetCollector(offset,count+1);
|
||||
List rc = null;
|
||||
IndexReader irdr = null;
|
||||
IndexSearcher srch = null;
|
||||
|
||||
@@ -284,6 +284,12 @@ class ModuleLoader extends URLClassLoader implements Module
|
||||
|
||||
} // end getModuleID
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return m_modfuncs.getDescription();
|
||||
|
||||
} // end getDescription
|
||||
|
||||
public synchronized void install(Principal installer, DynamoLog log) throws DatabaseException, ModuleException
|
||||
{
|
||||
if (m_ops.isModuleInstalled(m_filename))
|
||||
|
||||
@@ -261,16 +261,19 @@ public class ModuleManager implements NamedObject, ComponentInitialize, Componen
|
||||
QualifiedNameKey qname = new QualifiedNameKey(namespace,name);
|
||||
synchronized (this)
|
||||
{ // look up module in hash table
|
||||
ModuleLoader rc = (ModuleLoader)(m_qname_to_module.get(qname));
|
||||
if (rc!=null)
|
||||
return (Module)rc;
|
||||
return (Module)(m_qname_to_module.get(qname));
|
||||
|
||||
} // end synchronized block
|
||||
|
||||
return null;
|
||||
|
||||
} // end findModule
|
||||
|
||||
public synchronized Module findModuleByFilename(String filename)
|
||||
{
|
||||
// look for the right module already in the map
|
||||
return (Module)(m_jar_to_module.get(filename));
|
||||
|
||||
} // end findModuleByFilename
|
||||
|
||||
public Module loadModule(String name, boolean initialize) throws ModuleException
|
||||
{
|
||||
ModuleLoader rc = null;
|
||||
|
||||
@@ -29,6 +29,8 @@ public interface ModuleOperations
|
||||
{
|
||||
public Module findModule(String namespace, String name);
|
||||
|
||||
public Module findModuleByFilename(String filename);
|
||||
|
||||
public Module loadModule(String name, boolean initialize) throws ModuleException;
|
||||
|
||||
public void freeUnusedModules();
|
||||
|
||||
@@ -35,6 +35,8 @@ public class Main implements ModuleFunctions
|
||||
private static final QualifiedNameKey ID =
|
||||
new QualifiedNameKey("http://www.silverwrist.com/NS/dynamo/2003/05/18/testapp","testmodule");
|
||||
|
||||
private static final String DESCR = "Dynamo Test Module";
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Attributes
|
||||
*--------------------------------------------------------------------------------
|
||||
@@ -62,6 +64,12 @@ public class Main implements ModuleFunctions
|
||||
|
||||
} // end getModuleID
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return DESCR;
|
||||
|
||||
} // end getDescription
|
||||
|
||||
public void initialize(ModuleSite site, ServiceProvider services) throws ModuleException
|
||||
{
|
||||
m_site = site;
|
||||
|
||||
Reference in New Issue
Block a user