@Deprecated public class EssentialLegacyHooks extends LegacyHooks
LegacyHooks
to be used in the patched ImageJ 1.x.
This is the minimal implementation of LegacyHooks
and will be
installed by default after patching in the extension points into ImageJ 1.x.
On its own, it does not allow to override the extension points (such as the
editor) with different implementations; one needs to install different hooks using
the LegacyInjector.installHooks(ClassLoader, LegacyHooks)
method.
This class is also the perfect base class for all implementations of the
LegacyHooks
interface, e.g. to offer "real" extension mechanisms such
as the SciJava-common plugin framework.
LegacyHooks.FatJarNameComparator
Constructor and Description |
---|
EssentialLegacyHooks()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
error(Throwable t)
Deprecated.
Shows an exception.
|
boolean |
handleNoSuchMethodError(NoSuchMethodError error)
Deprecated.
Extension point to enhance ImageJ 1.x' error reporting upon
NoSuchMethodError . |
void |
initialized()
Deprecated.
First extension point to run just after ImageJ 1.x spun up.
|
Object |
interceptRunPlugIn(String className,
String arg)
Deprecated.
Intercepts LegacyInitializer's Context creation.
|
addMenuItem, addPluginClasspath, addPluginDirectory, autoGenerateConfigFile, autoGenerateConfigFile, createInEditor, debug, dispose, enableIJ1PluginDirs, getAppName, getContext, getIconURL, getMenuStructure, handleExtraPluginJars, installed, interceptOpen, isLegacyMode, log, newPluginClassLoader, openInEditor, quit, registerImage, runAfterRefreshMenus, showProgress, showProgress, showStatus, unregisterImage
public void error(Throwable t)
LegacyHooks
error
in class LegacyHooks
t
- the exceptionpublic boolean handleNoSuchMethodError(NoSuchMethodError error)
LegacyHooks
NoSuchMethodError
.handleNoSuchMethodError
in class LegacyHooks
error
- the exception to handlepublic void initialized()
LegacyHooks
initialized
in class LegacyHooks
public Object interceptRunPlugIn(String className, String arg)
One of the most critical code paths in Fiji
is how its runtime patches get installed. It calls the
LegacyEnvironment
, of course, but the idea is for said environment
to install the essential LegacyHooks
which then give ImageJ's
DefaultLegacyService a chance to spin up all of the legacy patches,
including Fiji's (which are add-ons on top of imagej-legacy
).
If this critical code path fails, Fiji fails to start up properly. Ideally,
this should never happen, but this is not an ideal world: corrupt
.jar
files and version skews caused by forgotten updates,
locally-modified files or simply by forward-incompatible downstream updates
can break any number of things in that path. So let's bend over another
inch (the existence of the ij1-patcher
speaks volumes about our
learned ability to do so) and try extra hard to keep things working even
under very unfavorable circumstances.
interceptRunPlugIn
in class LegacyHooks
className
- the class namearg
- the argument passed to the runPlugIn
methodCopyright © 2014–2022 ImageJ. All rights reserved.