org.ops4j.pax.runner.osgi
Class RunnerBundle

java.lang.Object
  extended by org.ops4j.pax.runner.osgi.UnsupportedBundle
      extended by org.ops4j.pax.runner.osgi.RunnerBundle
All Implemented Interfaces:
org.osgi.framework.Bundle

public class RunnerBundle
extends UnsupportedBundle


Field Summary
 
Fields inherited from interface org.osgi.framework.Bundle
ACTIVE, INSTALLED, RESOLVED, SIGNERS_ALL, SIGNERS_TRUSTED, START_ACTIVATION_POLICY, START_TRANSIENT, STARTING, STOP_TRANSIENT, STOPPING, UNINSTALLED
 
Constructor Summary
RunnerBundle()
          Default constructor.
RunnerBundle(java.net.URL location)
          Creates a bundle with a specific location (valid URL).
 
Method Summary
 long getLastModified()
          Always return zero = long time ago, so provisioning service will force an update.
 java.net.URL getLocationAsURL()
          Returns the url for the bundle.
 java.net.URL getResource(java.lang.String name)
          Delegates to class loader.
 java.lang.Integer getStartLevel()
          Returns the start level of the bundle.
 int getState()
           
 void setStartLevel(java.lang.Integer startLevel)
          The start level of the bundle.
 boolean shouldStart()
          Returns true if the bundle should be started.
 boolean shouldUpdate()
          Returns true of the bundle whould be updated.
 void start()
           
 java.lang.String toString()
           
 void update()
          Called by provisioning system if the update option is set on the bundle to be installed.
 
Methods inherited from class org.ops4j.pax.runner.osgi.UnsupportedBundle
findEntries, getBundleContext, getBundleId, getEntry, getEntryPaths, getHeaders, getHeaders, getLocation, getRegisteredServices, getResources, getServicesInUse, getSignerCertificates, getSymbolicName, getVersion, hasPermission, loadClass, start, stop, stop, uninstall, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RunnerBundle

public RunnerBundle()
Default constructor. Used for bundles that are part of runner.


RunnerBundle

public RunnerBundle(java.net.URL location)
Creates a bundle with a specific location (valid URL). Used for bundles installed by a scanner.

Parameters:
location - URL of the bundle to be installed later on
Method Detail

getState

public int getState()
Specified by:
getState in interface org.osgi.framework.Bundle
Overrides:
getState in class UnsupportedBundle

start

public void start()
           throws org.osgi.framework.BundleException
Specified by:
start in interface org.osgi.framework.Bundle
Overrides:
start in class UnsupportedBundle
Throws:
org.osgi.framework.BundleException

shouldStart

public boolean shouldStart()
Returns true if the bundle should be started.

Returns:
true if the bundle should be started

setStartLevel

public void setStartLevel(java.lang.Integer startLevel)
The start level of the bundle. Set by start level service.

Parameters:
startLevel - start level of the bundle.

getStartLevel

public java.lang.Integer getStartLevel()
Returns the start level of the bundle. If it returns null the start level was not set so a default start level should apply.

Returns:
the start level of the bundle or null if not set

update

public void update()
Called by provisioning system if the update option is set on the bundle to be installed.

Specified by:
update in interface org.osgi.framework.Bundle
Overrides:
update in class UnsupportedBundle

getLastModified

public long getLastModified()
Always return zero = long time ago, so provisioning service will force an update.

Specified by:
getLastModified in interface org.osgi.framework.Bundle
Overrides:
getLastModified in class UnsupportedBundle
Returns:
zero (0)

shouldUpdate

public boolean shouldUpdate()
Returns true of the bundle whould be updated.

Returns:
true if the bundle shoud be updated

getLocationAsURL

public java.net.URL getLocationAsURL()
Returns the url for the bundle.

Returns:
an url

getResource

public java.net.URL getResource(java.lang.String name)
Delegates to class loader.

Specified by:
getResource in interface org.osgi.framework.Bundle
Overrides:
getResource in class UnsupportedBundle

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2006-2012 OPS4J - Open Participation Software for Java. All Rights Reserved.