public class DirectoryMonitor extends Object implements org.osgi.framework.BundleActivator, Watcher, org.osgi.util.tracker.ServiceTrackerCustomizer<Deployer,Deployer>
| Modifier and Type | Field and Description |
|---|---|
protected List<Deployer> |
deployers
List of deployers.
|
| Constructor and Description |
|---|
DirectoryMonitor() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acquireReadLockIfNotHeld()
Acquires the read lock only and only if no read lock is already held by the current thread.
|
boolean |
acquireWriteLockIfNotHeld()
Acquires the write lock only and only if the write lock is not already held by the current thread.
|
boolean |
add(File directory,
boolean watch)
Adds a directory to the watcher.
|
boolean |
add(File directory,
long polling)
Adds a directory to the watcher.
|
Deployer |
addingService(org.osgi.framework.ServiceReference<Deployer> reference) |
void |
modifiedService(org.osgi.framework.ServiceReference<Deployer> reference,
Deployer o) |
boolean |
releaseReadLockIfHeld()
Releases the read lock only and only if the read lock is held by the current thread.
|
boolean |
releaseWriteLockIfHeld()
Releases the write lock only and only if the write lock is held by the current thread.
|
boolean |
removeAndStopIfNeeded(File directory)
If the directory was added, remove it.
|
void |
removedService(org.osgi.framework.ServiceReference<Deployer> reference,
Deployer deployer) |
void |
start(org.osgi.framework.BundleContext context) |
void |
stop(org.osgi.framework.BundleContext context) |
public boolean acquireWriteLockIfNotHeld()
public boolean releaseWriteLockIfHeld()
public boolean acquireReadLockIfNotHeld()
public boolean releaseReadLockIfHeld()
public void start(org.osgi.framework.BundleContext context)
throws IOException
start in interface org.osgi.framework.BundleActivatorIOExceptionpublic void stop(org.osgi.framework.BundleContext context)
stop in interface org.osgi.framework.BundleActivatorpublic Deployer addingService(org.osgi.framework.ServiceReference<Deployer> reference)
public void modifiedService(org.osgi.framework.ServiceReference<Deployer> reference, Deployer o)
public void removedService(org.osgi.framework.ServiceReference<Deployer> reference, Deployer deployer)
public boolean add(File directory, boolean watch)
public boolean add(File directory, long polling)
public boolean removeAndStopIfNeeded(File directory)
removeAndStopIfNeeded in interface Watcherdirectory - the directoryCopyright © 2009–2014 OW2 Chameleon. All rights reserved.