Changeset 7377


Ignore:
Timestamp:
12/09/10 13:23:03 (9 years ago)
Author:
aivar
Message:

Added a single-instance implementation option. This uses the multi-instance code but throttles plugin class instance creation so that only one instance is active at a time for a given plugin class.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/maven/projects/deep-zoom-plugin/src/main/java/loci/multiinstanceplugin/PluginLauncher.java

    r7367 r7377  
    1818 */ 
    1919public class PluginLauncher implements IPluginLauncher { 
     20    public static boolean s_singleInstance = false; 
    2021    UUID m_id = UUID.randomUUID(); 
    2122    Class m_pluginClass; 
     
    7677                Thread pluginThread = new PluginThread(inputImages); 
    7778                pluginThread.start(); 
     79 
     80                if (s_singleInstance) { 
     81                    try { 
     82                        pluginThread.join(); 
     83                    } 
     84                    catch (InterruptedException e) { 
     85                        System.out.println("LauncherThread.run() insterrupted on join"); 
     86                    } 
     87                } 
    7888            } 
    7989        } 
Note: See TracChangeset for help on using the changeset viewer.