public class SingleInstanceArgument extends AbstractConsoleArgument
This ConsoleArgument
plugin is unusual in that it tries to go first,
passing all command line arguments to an already-running instance of ImageJ
as appropriate. In cases where it does so successfully, it then shuts down
the application context.
The plugin scans the entire set of arguments to decide whether and how to attempt to contact another running instance of ImageJ.
The --forbid-single-instance
flag, in all cases, forbids ImageJ from
attempting to contact another running instance.
Conversely, the --force-single-instance
flag encourages ImageJ to
forward arguments to another running instance even if it otherwise would not
do so.
The --portXXX argument sets the communication channel to use when communicating with the other instance. The default is 7, but a different value can be given to create multiple "single instances" of ImageJ on different channels.
If neither --forbid-single-instance
nor
--force-single-instance
is given, the single instance logic is used
if all of the following conditions are met:
-batch
nor -ijpath
options have been
specified.
Finally, a note for the debugger: this plugin logs debug output for all code
paths, to make it easier to understand how and why the single instance logic
is invoked or skipped. One nice way to enable it in a targeted way is to pass
-Dscijava.log.level:net.imagej.legacy=debug
on the "right hand side"
(i.e. after a --
separator argument).
Constructor and Description |
---|
SingleInstanceArgument() |
Modifier and Type | Method and Description |
---|---|
void |
handle(LinkedList<String> args) |
boolean |
supports(LinkedList<String> args) |
getParam, isFlag
getInfo, getPriority, setInfo, setPriority, toString
context, getContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getType
getIdentifier, log
context, getContext, setContext
compareTo, getPriority, setPriority
getInfo, setInfo
getLocation
getVersion
public void handle(LinkedList<String> args)
public boolean supports(LinkedList<String> args)
supports
in interface Typed<LinkedList<String>>
supports
in class AbstractConsoleArgument
Copyright © 2014–2022 ImageJ. All rights reserved.