org.apache.karaf.shell.dev.watch
Class BundleWatcher

java.lang.Object
  extended by org.apache.karaf.shell.dev.watch.BundleWatcher
All Implemented Interfaces:
java.lang.Runnable, java.util.EventListener, org.osgi.framework.BundleListener

public class BundleWatcher
extends java.lang.Object
implements java.lang.Runnable, org.osgi.framework.BundleListener

A Runnable singleton which watches at the defined location for bundle updates.


Constructor Summary
BundleWatcher()
          Construcotr
 
Method Summary
 void add(java.lang.String url)
          Adds a Bundle URLs to the watch list.
 void bundleChanged(org.osgi.framework.BundleEvent event)
           
 org.osgi.framework.BundleContext getBundleContext()
           
 java.io.File getBundleExternalLocation(java.io.File localRepository, org.osgi.framework.Bundle bundle)
          Returns the location of the Bundle inside the local maven repository.
 java.util.List<org.osgi.framework.Bundle> getBundlesByURL(java.lang.String url)
          Returns the bundles that match
 org.osgi.service.cm.ConfigurationAdmin getConfigurationAdmin()
           
 long getInterval()
           
 java.io.File getLocalRepository()
           
 java.util.List<java.lang.String> getWatchURLs()
           
protected  boolean isMavenSnapshotUrl(java.lang.String url)
           
 boolean isRunning()
           
 void remove(java.lang.String url)
          Removes a bundle URLs from the watch list.
protected  org.ops4j.pax.url.maven.commons.MavenConfiguration retrieveMavenConfiguration()
           
 void run()
           
 void setBundleContext(org.osgi.framework.BundleContext bundleContext)
           
 void setConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin configurationAdmin)
           
 void setInterval(long interval)
           
 void setWatchURLs(java.util.List<java.lang.String> watchURLs)
           
 void start()
           
 void stop()
          Stops the execution of the thread and releases the singleton instance
protected  boolean wildCardMatch(java.lang.String text, java.lang.String pattern)
          Matches text using a pattern containing wildcards.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BundleWatcher

public BundleWatcher()
Construcotr

Method Detail

bundleChanged

public void bundleChanged(org.osgi.framework.BundleEvent event)
Specified by:
bundleChanged in interface org.osgi.framework.BundleListener

run

public void run()
Specified by:
run in interface java.lang.Runnable

add

public void add(java.lang.String url)
Adds a Bundle URLs to the watch list.

Parameters:
url -

remove

public void remove(java.lang.String url)
Removes a bundle URLs from the watch list.

Parameters:
url -

getBundleExternalLocation

public java.io.File getBundleExternalLocation(java.io.File localRepository,
                                              org.osgi.framework.Bundle bundle)
Returns the location of the Bundle inside the local maven repository.

Parameters:
bundle -
Returns:

getLocalRepository

public java.io.File getLocalRepository()

retrieveMavenConfiguration

protected org.ops4j.pax.url.maven.commons.MavenConfiguration retrieveMavenConfiguration()

getBundlesByURL

public java.util.List<org.osgi.framework.Bundle> getBundlesByURL(java.lang.String url)
Returns the bundles that match

Parameters:
url -
Returns:

isMavenSnapshotUrl

protected boolean isMavenSnapshotUrl(java.lang.String url)

wildCardMatch

protected boolean wildCardMatch(java.lang.String text,
                                java.lang.String pattern)
Matches text using a pattern containing wildcards.

Parameters:
text -
pattern -
Returns:

start

public void start()

stop

public void stop()
Stops the execution of the thread and releases the singleton instance


getConfigurationAdmin

public org.osgi.service.cm.ConfigurationAdmin getConfigurationAdmin()

setConfigurationAdmin

public void setConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin configurationAdmin)

getBundleContext

public org.osgi.framework.BundleContext getBundleContext()

setBundleContext

public void setBundleContext(org.osgi.framework.BundleContext bundleContext)

getWatchURLs

public java.util.List<java.lang.String> getWatchURLs()

setWatchURLs

public void setWatchURLs(java.util.List<java.lang.String> watchURLs)

getInterval

public long getInterval()

setInterval

public void setInterval(long interval)

isRunning

public boolean isRunning()


Copyright © 2007-2011 Apache Software Foundation. All Rights Reserved.