imagej.patcher
Class EssentialLegacyHooks

java.lang.Object
  extended by imagej.patcher.LegacyHooks
      extended by imagej.patcher.EssentialLegacyHooks

Deprecated.

@Deprecated
public class EssentialLegacyHooks
extends LegacyHooks

The base 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 imagej.patcher.CodeHacker#installHooks(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.

Author:
Johannes Schindelin

Nested Class Summary
 
Nested classes/interfaces inherited from class imagej.patcher.LegacyHooks
LegacyHooks.FatJarNameComparator
 
Constructor Summary
EssentialLegacyHooks()
          Deprecated.  
 
Method Summary
 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.
 
Methods inherited from class imagej.patcher.LegacyHooks
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EssentialLegacyHooks

public EssentialLegacyHooks()
Deprecated. 
Method Detail

error

public void error(Throwable t)
Deprecated. 
Description copied from class: LegacyHooks
Shows an exception.

Overrides:
error in class LegacyHooks
Parameters:
t - the exception

handleNoSuchMethodError

public boolean handleNoSuchMethodError(NoSuchMethodError error)
Deprecated. 
Description copied from class: LegacyHooks
Extension point to enhance ImageJ 1.x' error reporting upon NoSuchMethodError.

Overrides:
handleNoSuchMethodError in class LegacyHooks
Parameters:
error - the exception to handle
Returns:
true if the error was handled by the legacy hook

initialized

public void initialized()
Deprecated. 
Description copied from class: LegacyHooks
First extension point to run just after ImageJ 1.x spun up.

Overrides:
initialized in class LegacyHooks

interceptRunPlugIn

public Object interceptRunPlugIn(String className,
                                 String arg)
Deprecated. 
Intercepts LegacyInitializer's Context creation.

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.

Overrides:
interceptRunPlugIn in class LegacyHooks
Parameters:
className - the class name
arg - the argument passed to the runPlugIn method
Returns:
the object to return, or null to let ImageJ 1.x handle the call


Copyright © 2009–2014 ImageJ. All rights reserved.