Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright (c) OSGi Alliance (2010). All Rights Reserved.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 package org.osgi.framework.startlevel;
 
Query and modify the start level information for a bundle. The start level object for a bundle can be obtained by calling bundle.adapt(BundleStartLevel.class) on the bundle.

The bundle associated with this BundleStartLevel object can be obtained by calling org.osgi.framework.BundleReference.getBundle().

Version:
$Id: 9a000be191fe3cb4ae82535a30940db0340d5356 $
ThreadSafe:
Noimplement:
 
 public interface BundleStartLevel extends BundleReference {
Return the assigned start level value for the bundle.

Returns:
The start level value of the bundle.
Throws:
java.lang.IllegalStateException If the bundle has been uninstalled.
See also:
setStartLevel(int)
 
 	int getStartLevel();

Assign a start level value to the bundle.

The bundle will be assigned the specified start level. The start level value assigned to the bundle will be persistently recorded by the Framework.

If the new start level for the bundle is lower than or equal to the active start level of the Framework and the bundle's autostart setting indicates this bundle must be started, the Framework will start the bundle as described in the org.osgi.framework.Bundle.start(int) method using the org.osgi.framework.Bundle.START_TRANSIENT option. The org.osgi.framework.Bundle.START_ACTIVATION_POLICY option must also be used if isActivationPolicyUsed() returns true. The actual starting of the bundle must occur asynchronously.

If the new start level for the bundle is higher than the active start level of the Framework, the Framework will stop the bundle as described in the org.osgi.framework.Bundle.stop(int) method using the org.osgi.framework.Bundle.STOP_TRANSIENT option. The actual stopping of the bundle must occur asynchronously.

Parameters:
startlevel The new start level for the bundle.
Throws:
java.lang.IllegalArgumentException If the specified start level is less than or equal to zero, or if the bundle is the system bundle.
java.lang.IllegalStateException If the bundle has been uninstalled.
java.lang.SecurityException If the caller does not have AdminPermission[bundle,EXECUTE] and the Java runtime environment supports permissions.
 
 	void setStartLevel(int startlevel);

Returns whether the bundle's autostart setting indicates it must be started.

The autostart setting of a bundle indicates whether the bundle is to be started when its start level is reached.

Returns:
true if the autostart setting of the bundle indicates it is to be started. false otherwise.
Throws:
java.lang.IllegalStateException If this bundle has been uninstalled.
See also:
org.osgi.framework.Bundle.START_TRANSIENT
 
 	boolean isPersistentlyStarted();

Returns whether the bundle's autostart setting indicates that the activation policy declared in the bundle manifest must be used.

The autostart setting of a bundle indicates whether the bundle's declared activation policy is to be used when the bundle is started.

Returns:
true if the bundle's autostart setting indicates the activation policy declared in the manifest must be used. false if the bundle must be eagerly activated.
Throws:
java.lang.IllegalStateException If the bundle has been uninstalled.
See also:
org.osgi.framework.Bundle.START_ACTIVATION_POLICY
New to GrepCode? Check out our FAQ X