Class ParentListener

All Implemented Interfaces:

public class ParentListener
extends java.lang.Thread

A class for detecting if the parent JVM that launched this process has terminated.

Patrick Luby

Field Summary
Fields inherited from class java.lang.Thread
Constructor Summary
ParentListener(java.lang.String path)
          Validates and caches a lock file created by the parent JVM.
Method Summary
 void run()
          Periodically check that the parent JVM has not terminated.
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public ParentListener(java.lang.String path)
Validates and caches a lock file created by the parent JVM.

path - the lock file that the parent JVM has an open FileOutputStream
Throws: - if the heartbeat cannot be converted into a valid File object
Method Detail


public void run()
Periodically check that the parent JVM has not terminated. On all platforms other than Windows, this method will check that has not been closed. On Windows NT, 2000, and XP the lock file specified in the ParentListener(String) constructor is monitored as reading will block the entire process on Windows machines that use some versions of Unix shells such as MKS, etc. No monitoring is done on Window 95, 98, and ME.

Specified by:
run in interface java.lang.Runnable
run in class java.lang.Thread

Copyright (c) 2001-2002 - Apache Software Foundation