Fix JSP reference to old PluginManager. Update comments referencing PluginManager. Remove old plugin.reusable.* configs as they are no longer needed

This commit is contained in:
Tim Donohue
2015-10-30 11:34:41 -05:00
parent 829ea782da
commit fadfa351dd
15 changed files with 33 additions and 80 deletions

View File

@@ -28,7 +28,7 @@ usage events may be transmitted, persisted, or processed.
<p>
At appropriate points in the processing of user actions, events may be
assembled and "fired". What happens when an event is fired is configurable
via the PluginManager. One must configure a plugin for the AbstractUsageEvent
via the PluginService. One must configure a plugin for the AbstractUsageEvent
class, defined in this package, to select an event processing implementation.
</p>

View File

@@ -71,7 +71,7 @@ import org.jdom.xpath.XPath;
* Since there is significant overhead in reading the properties file to
* configure the crosswalk, and a crosswalk instance may be used any number
* of times, we recommend caching one instance of the crosswalk for each
* name and simply reusing those instances. The PluginManager does this
* name and simply reusing those instances. The PluginService does this
* by default.
*
* @author Larry Stone
@@ -222,7 +222,7 @@ public class MODSDisseminationCrosswalk extends SelfNamedPlugin
String myAlias = getPluginInstanceName();
if (myAlias == null)
{
log.error("Must use PluginManager to instantiate MODSDisseminationCrosswalk so the class knows its name.");
log.error("Must use PluginService to instantiate MODSDisseminationCrosswalk so the class knows its name.");
return;
}
String cmPropName = CONFIG_PREFIX+myAlias;

View File

@@ -62,7 +62,7 @@ import org.jdom.input.SAXBuilder;
* Since there is significant overhead in reading the properties file to
* configure the crosswalk, and a crosswalk instance may be used any number
* of times, we recommend caching one instance of the crosswalk for each
* alias and simply reusing those instances. The PluginManager does
* alias and simply reusing those instances. The PluginService does
* this by default.
* <p>
* Each named crosswalk has two other types of configuration lines:
@@ -219,7 +219,7 @@ public class QDCCrosswalk extends SelfNamedPlugin
if (myName == null)
{
throw new CrosswalkInternalException("Cannot determine plugin name, " +
"You must use PluginManager to instantiate QDCCrosswalk so the instance knows its name.");
"You must use PluginService to instantiate QDCCrosswalk so the instance knows its name.");
}
// grovel DSpace configuration for namespaces

View File

@@ -65,14 +65,14 @@ import org.jdom.transform.XSLTransformer;
* was modified since it was last loaded. This lets you edit and test
* stylesheets without restarting DSpace.
* <p>
* You must use the <code>PluginManager</code> to instantiate an
* You must use the <code>PluginService</code> to instantiate an
* XSLT crosswalk plugin, e.g.
* <pre> IngestionCrosswalk xwalk = PluginManager.getPlugin(IngestionCrosswalk.class, "LOM");</pre>
* <pre> IngestionCrosswalk xwalk = CoreServiceFactory.getInstance().getPluginService().getPlugin(IngestionCrosswalk.class, "LOM");</pre>
* <p>
* Since there is significant overhead in reading the properties file to
* configure the crosswalk, and a crosswalk instance may be used any number
* of times, we recommend caching one instance of the crosswalk for each
* alias and simply reusing those instances. The <code>PluginManager</code>
* alias and simply reusing those instances. The <code>PluginService</code>
* does this automatically.
*
* @author Larry Stone
@@ -138,7 +138,7 @@ public abstract class XSLTCrosswalk extends SelfNamedPlugin
String myAlias = getPluginInstanceName();
if (myAlias == null)
{
log.error("Must use PluginManager to instantiate XSLTCrosswalk so the class knows its name.");
log.error("Must use PluginService to instantiate XSLTCrosswalk so the class knows its name.");
return null;
}
String cmPropName = CONFIG_PREFIX+direction+"."+myAlias+CONFIG_STYLESHEET;

View File

@@ -110,8 +110,8 @@ public class XSLTDisseminationCrosswalk
String myAlias = getPluginInstanceName();
if (myAlias == null)
{
log.error("Must use PluginManager to instantiate XSLTDisseminationCrosswalk so the class knows its name.");
throw new CrosswalkInternalException("Must use PluginManager to instantiate XSLTDisseminationCrosswalk so the class knows its name.");
log.error("Must use PluginService to instantiate XSLTDisseminationCrosswalk so the class knows its name.");
throw new CrosswalkInternalException("Must use PluginService to instantiate XSLTDisseminationCrosswalk so the class knows its name.");
}
// all configs for this plugin instance start with this:

View File

@@ -37,21 +37,10 @@ import java.util.List;
* <P>
* All Package disseminators should either extend this abstract class
* or implement <code>PackageDisseminator</code> to better suit their needs.
* <P>
* WARNING: If you choose to extend this Abstract class, you must DISABLE
* plugin instance caching for your new class in dspace.cfg. This will ensure
* that "packageFileList" and any other global instance variables are RESET
* for each package dissemination. To DISABLE plugin instance caching, just place
* the following configuration in your dspace.cfg:
* <code>
* plugin.reusable.[full-class-name] = false
* </code>
* For more information see the org.dspace.core.PluginManager cacheMe() method,
* which defaults to caching all plugin class instances.
*
* @author Tim Donohue
* @see PackageDisseminator
* @see PluginManager
* @see PluginService
*/
public abstract class AbstractPackageDisseminator
implements PackageDisseminator

View File

@@ -50,21 +50,10 @@ import org.dspace.workflow.WorkflowException;
* <P>
* All Package ingesters should either extend this abstract class
* or implement <code>PackageIngester</code> to better suit their needs.
* <P>
* WARNING: If you choose to extend this Abstract class, you must DISABLE
* plugin instance caching for your new class in dspace.cfg. This will ensure
* the "pkgIngestedMap" and any other global instance variables are RESET
* for each package ingest. To DISABLE plugin instance caching, just place
* the following configuration in your dspace.cfg:
* <code>
* plugin.reusable.[full-class-name] = false
* </code>
* For more information see the org.dspace.core.PluginManager cacheMe() method,
* which defaults to caching all plugin class instances.
*
* @author Tim Donohue
* @see PackageIngester
* @see PluginManager
* @see PluginService
*/
public abstract class AbstractPackageIngester
implements PackageIngester

View File

@@ -24,8 +24,8 @@ import org.springframework.beans.factory.annotation.Autowired;
/**
* The Legacy Plugin Service is a very simple component container (based on the
* legacy PluginManager class). It reads defined "plugins" (interfaces) from
* config file(s) and makes them available to the API. (@TODO: Someday, this
* legacy PluginManager class from <=5.x). It reads defined "plugins" (interfaces)
* from config file(s) and makes them available to the API. (@TODO: Someday, this
* entire "plugin" framework needs to be replaced by Spring Beans.)
* <p>
* It creates and organizes components (plugins), and helps select a plugin in
@@ -72,7 +72,6 @@ public class LegacyPluginServiceImpl implements PluginService
private static final String SEQUENCE_PREFIX = "plugin.sequence.";
private static final String NAMED_PREFIX = "plugin.named.";
private static final String SELFNAMED_PREFIX = "plugin.selfnamed.";
private static final String REUSABLE_PREFIX = "plugin.reusable.";
/** Configuration name of paths to search for third-party plugins. */
private static final String CLASSPATH = "plugin.classpath";
@@ -565,8 +564,6 @@ public class LegacyPluginServiceImpl implements PluginService
Map<String, String> sequenceKey = new HashMap<String, String>();
Map<String, String> namedKey = new HashMap<String, String>();
Map<String, String> selfnamedKey = new HashMap<String, String>();
Map<String, String> reusableKey = new HashMap<String, String>();
HashMap<String, String> keyMap = new HashMap<String, String>();
// Find all property keys starting with "plugin."
List<String> keys = configurationService.getPropertyKeys("plugin.");
@@ -589,10 +586,6 @@ public class LegacyPluginServiceImpl implements PluginService
{
selfnamedKey.put(key.substring(SELFNAMED_PREFIX.length()), key);
}
else if (key.startsWith(REUSABLE_PREFIX))
{
reusableKey.put(key.substring(REUSABLE_PREFIX.length()), key);
}
else
{
log.error("Key with unknown prefix \"" + key + "\" in DSpace configuration");
@@ -607,7 +600,6 @@ public class LegacyPluginServiceImpl implements PluginService
allInterfaces.addAll(sequenceKey .keySet());
allInterfaces.addAll(namedKey.keySet());
allInterfaces.addAll(selfnamedKey.keySet());
allInterfaces.addAll(reusableKey.keySet());
Iterator<String> ii = allInterfaces.iterator();
while (ii.hasNext())
{
@@ -714,17 +706,6 @@ public class LegacyPluginServiceImpl implements PluginService
}
}
}
// 5. all classes named in Reusable config lines must be other classes.
Iterator<String> ri = reusableKey.keySet().iterator();
while (ri.hasNext())
{
String rk = ri.next();
if (!(allImpls.containsKey(rk)))
{
log.error("In plugin.reusable configuration, class \"" + rk + "\" is NOT a plugin implementation class.");
}
}
}
/**

View File

@@ -8,7 +8,7 @@
package org.dspace.core;
/**
* Indicates fatal error in Plugin Manager configuration.
* Indicates fatal error in PluginService configuration.
* <p>
* This error is only thrown when the effect of a configuration problem
* (<i>e.g.</i> missing value for a Single Plugin) is likely to leave
@@ -16,7 +16,7 @@ package org.dspace.core;
*
* @author Larry Stone
* @version $Revision$
* @see PluginManager
* @see PluginService
*/
public class PluginConfigurationError extends Error

View File

@@ -19,7 +19,7 @@ package org.dspace.core;
*
* @author Larry Stone
* @version $Revision$
* @see PluginManager
* @see PluginService
*/
public class PluginInstantiationException extends RuntimeException

View File

@@ -22,11 +22,11 @@ package org.dspace.core;
* configuration file.
* <p>
* See the documentation in the
* <code>PluginManager</code> class for more details.
* <code>PluginService</code> class for more details.
*
* @author Larry Stone
* @version $Revision$
* @see PluginManager
* @see PluginService
*/
public abstract class SelfNamedPlugin
{
@@ -58,7 +58,7 @@ public abstract class SelfNamedPlugin
* Get an instance's particular name.
* Returns the name by which the class was chosen when
* this instance was created. Only works for instances created
* by <code>PluginManager</code>, or if someone remembers to call <code>setPluginName.</code>
* by <code>PluginService</code>, or if someone remembers to call <code>setPluginName.</code>
* <p>
* Useful when the implementation class wants to be configured differently
* when it is invoked under different names.
@@ -73,7 +73,7 @@ public abstract class SelfNamedPlugin
/**
* Set the name under which this plugin was instantiated.
* Not to be invoked by application code, it is
* called automatically by <code>PluginManager.getNamedPlugin()</code>
* called automatically by <code>PluginService.getNamedPlugin()</code>
* when the plugin is instantiated.
*
* @param name -- name used to select this class.

View File

@@ -9,7 +9,11 @@ package org.dspace.core.service;
/**
* A service to manage "plugins". At this point, it's based off of the structure
* of the legacy PluginManager, until a better plugin definition is created.
* of the legacy PluginManager (<=5.x), until a better plugin definition is created.
* <p>
* In DSpace, a "plugin" corresponds simply to a Java interface. Plugin implementations
* are simply classes which implement that interface (and often they are given unique
* names by which the plugin implementations are referenced/loaded).
*
* @author Tim Donohue
*/

View File

@@ -37,7 +37,7 @@
<%@ page import="org.dspace.content.Community" %>
<%@ page import="org.dspace.core.Context" %>
<%@ page import="org.dspace.core.LogManager" %>
<%@ page import="org.dspace.core.PluginManager" %>
<%@ page import="org.dspace.core.factory.CoreServiceFactory" %>
<%@ page import="org.dspace.plugin.SiteHomeProcessor" %>
<%
@@ -53,7 +53,7 @@
try
{
SiteHomeProcessor[] chp = (SiteHomeProcessor[]) PluginManager.getPluginSequence(SiteHomeProcessor.class);
SiteHomeProcessor[] chp = (SiteHomeProcessor[]) CoreServiceFactory.getInstance().getPluginService().getPluginSequence(SiteHomeProcessor.class);
for (int i = 0; i < chp.length; i++)
{
chp[i].process(context, request, response);

View File

@@ -325,7 +325,7 @@ http.proxy.host = ${http.proxy.host}
http.proxy.port = ${http.proxy.port}
#### Media Filter / Format Filter plugins (through PluginManager) ####
#### Media Filter / Format Filter plugins (through PluginService) ####
# Media/Format Filters help to full-text index content or
# perform automated format conversions
@@ -517,22 +517,12 @@ plugin.named.org.dspace.content.packager.PackageDisseminator = \
org.dspace.content.packager.DSpaceMETSDisseminator = METS, \
org.dspace.content.packager.RoleDisseminator = DSPACE-ROLES
# Do NOT cache AIP/METS Disseminator plugin instances, as their exported obj lists
# (in AbstractPackageDisseminator) need to be reset each time a new export occurs
plugin.reusable.org.dspace.content.packager.DSpaceAIPDisseminator = false
plugin.reusable.org.dspace.content.packager.DSpaceMETSDisseminator = false
plugin.named.org.dspace.content.packager.PackageIngester = \
org.dspace.content.packager.DSpaceAIPIngester = AIP, \
org.dspace.content.packager.PDFPackager = Adobe PDF\, PDF, \
org.dspace.content.packager.DSpaceMETSIngester = METS, \
org.dspace.content.packager.RoleIngester = DSPACE-ROLES
# Do NOT cache AIP/METS Ingester plugin instances, as their imported obj lists
# (in AbstractPackageIngester) need to be reset each time a new import occurs
plugin.reusable.org.dspace.content.packager.DSpaceAIPIngester = false
plugin.reusable.org.dspace.content.packager.DSpaceMETSIngester = false
#### METS ingester configuration:
# These settings configure how DSpace will ingest a METS-based package
@@ -1074,7 +1064,7 @@ webui.browse.index.4 = subject:metadata:dc.subject.*:text
#
# This is defined much the same as above. The parameter after the metadata
# just lets the sorter know which normalisation to use - standard normalisations are title,
# text or date - however additional normalisations can be defined using the PluginManager.
# text or date - however additional normalisations can be defined using the PluginService.
#
# The final parts of the configuration is optional - whether to SHOW (the default) or
# HIDE the option from the sorting controls in the user interface. This can be useful if

View File

@@ -249,13 +249,13 @@ plugin.single.org.dspace.sword2.SwordEntryIngester = \
plugin.single.org.dspace.sword2.SwordEntryDisseminator = \
org.dspace.sword2.SimpleDCEntryDisseminator
# note that we replace ";" with "_" as ";" is not permitted in the PluginManager names
# note that we replace ";" with "_" as ";" is not permitted in the PluginService names
plugin.named.org.dspace.sword2.SwordContentDisseminator = \
org.dspace.sword2.SimpleZipContentDisseminator = http://purl.org/net/sword/package/SimpleZip, \
org.dspace.sword2.FeedContentDisseminator = application/atom+xml, \
org.dspace.sword2.FeedContentDisseminator = application/atom+xml_type_feed
# note that we replace ";" with "_" as ";" is not permitted in the PluginManager names
# note that we replace ";" with "_" as ";" is not permitted in the PluginService names
plugin.named.org.dspace.sword2.SwordStatementDisseminator = \
org.dspace.sword2.AtomStatementDisseminator = atom, \
org.dspace.sword2.OreStatementDisseminator = rdf, \