|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.plugin.AbstractPlugin net.sf.basedb.plugins.executor.AbstractIOSupport
public abstract class AbstractIOSupport
Abstract base class that is useful for plug-ins that need to implement
the IOSupport
interface and don't want to be visible as
standalone plug-ins.
ExternalProgramExecutor
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface net.sf.basedb.core.plugin.Plugin |
---|
Plugin.MainType |
Field Summary | |
---|---|
private ExternalProgramExecutor |
executor
|
Fields inherited from class net.sf.basedb.core.plugin.AbstractPlugin |
---|
annotationSection, configuration, COPY_ANNOTATIONS, job, OVERWRITE_ANNOTATIONS, sc |
Fields inherited from interface net.sf.basedb.plugins.executor.IOSupport |
---|
COMMAND_CONFIGURE_IO_JOB, COMMAND_CONFIGURE_IO_PLUGIN, COMMAND_EXECUTE_IO_JOB |
Constructor Summary | |
---|---|
AbstractIOSupport()
|
Method Summary | |
---|---|
protected ExternalProgramExecutor |
getExecutor()
Get the external program executor that invoked the plug-in. |
Set<GuiContext> |
getGuiContexts()
Get a set containing all items that the plugin handles. |
String |
getShortName()
A default implementation to maintain backwards compatibility. |
void |
init(SessionControl sc,
ParameterValues configuration,
ParameterValues job,
ExternalProgramExecutor executor)
Replaces the regular plug-in initialisation method. |
String |
isInContext(GuiContext context,
Object item)
Check if the plugin can be used on the specified object. |
protected abstract String |
performIO(DbControl dc,
ProgressReporter progress)
Perform the IO operation. |
boolean |
requiresConfiguration()
Returns FALSE, since that is how the plugins used to work before this method was introduced. |
void |
run(Request request,
Response response,
ProgressReporter progress)
Accepts the IOSupport.COMMAND_EXECUTE_IO_JOB command. |
boolean |
supportsConfigurations()
Returns TRUE, since that is how the plugins used to work before this method was introduced. |
Methods inherited from class net.sf.basedb.core.plugin.AbstractPlugin |
---|
checkInterrupted, cloneParameterWithDefaultValue, closeLogFile, createLogFile, done, getCopyAnnotationsParmeter, getCurrentConfiguration, getCurrentJob, getJobOrConfigurationValue, getOverwriteAnnotationsParameters, getPermissions, init, log, log, storeValue, storeValue, storeValues, validateRequestParameters |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.basedb.core.plugin.InteractivePlugin |
---|
configure, getRequestInformation |
Methods inherited from interface net.sf.basedb.core.plugin.Plugin |
---|
done, getAbout, getMainType, getPermissions, init |
Field Detail |
---|
private ExternalProgramExecutor executor
Constructor Detail |
---|
public AbstractIOSupport()
Method Detail |
---|
public boolean supportsConfigurations()
AbstractPlugin
supportsConfigurations
in interface Plugin
supportsConfigurations
in class AbstractPlugin
public boolean requiresConfiguration()
AbstractPlugin
requiresConfiguration
in interface Plugin
requiresConfiguration
in class AbstractPlugin
public Set<GuiContext> getGuiContexts()
InteractivePlugin
Item.REPORTER
.
This information is used by client applications to put the plugin
in the proper place in the user interface.
getGuiContexts
in interface InteractivePlugin
public String isInContext(GuiContext context, Object item)
InteractivePlugin
BasicItem
or BasicData
object, or null if called from
a list context. A client application should only call this method for
contexts matching one of
the contexts in the set returned by the InteractivePlugin.getGuiContexts()
method. For GuiContext.Type.ITEM
contexts an item
of the correct type should be passed as a parameter.
The plug-in can response with a null value indicating success, a warning-level message or throw an exception to indicate an error-level message. Client application should normally only show error-level messages to users, unless the user has requested to see warning messages.
NOTE! Before BASE 2.4 all messages were treated as error-level messages.
isInContext
in interface InteractivePlugin
context
- The current context of the client application,
it is one of the values found in set returned by InteractivePlugin.getGuiContexts()
item
- The currently active item, it's type should match the
GuiContext.getItem()
type, or null if the context is a list
context
public void run(Request request, Response response, ProgressReporter progress)
IOSupport.COMMAND_EXECUTE_IO_JOB
command. The default
implementation starts a new transaction and then calls
performIO(DbControl, ProgressReporter)
which should be implemented by the
subclass.
run
in interface Plugin
request
- Request object with the command and parametersresponse
- Response object in for the plugin to response
throughprogress
- A ProgressReporter
where the plugin can report
its progess, can be nullpublic String getShortName()
getShortName
in interface IOSupport
public void init(SessionControl sc, ParameterValues configuration, ParameterValues job, ExternalProgramExecutor executor)
IOSupport
Plugin.init(SessionControl, ParameterValues, ParameterValues)
.
init
in interface IOSupport
executor
- The external executor plug-inprotected abstract String performIO(DbControl dc, ProgressReporter progress) throws IOException
dc
- A DbControl that can be used by the subclassprogress
- An optional progress reporter
IOException
protected ExternalProgramExecutor getExecutor()
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |