org.jmux.app.component
Class SingletonProcess

java.lang.Object
  extended by org.jmux.app.component.AbstractComponent
      extended by org.jmux.app.component.AbstractControl
          extended by org.jmux.app.component.SingletonProcess
All Implemented Interfaces:
Component, Control

public class SingletonProcess
extends AbstractControl

This component ensures that only one version of an application is started on a single machine. Given Java's lack of system wide mutexes, the way we to do this is to try to bind a to a socket. A less resource expensive alternative would be to use java.nio locking. I'm not sure how portable this is though. In some environments, atomic locking is flaky at best. Older implementations of NFS on Linux come to mind.

Configuration settings

Author:
donaldw

Constructor Summary
SingletonProcess()
           
 
Method Summary
 void configure(Config config, App app)
           
 void start()
           
 void stop()
           
 
Methods inherited from class org.jmux.app.component.AbstractComponent
getConfig, log, logDebug, logDebug, logError, logError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingletonProcess

public SingletonProcess()
Method Detail

configure

public void configure(Config config,
                      App app)
Specified by:
configure in interface Component
Overrides:
configure in class AbstractComponent

start

public void start()

stop

public void stop()


Copyright © 2006-2008 jmux.org. All Rights Reserved.