issueEvent(new StartLevelEvent(StartLevelEvent.CHANGE_BUNDLE_SL, newSL, newSL, (Bundle)bundle, framework)); } } catch (IOException e) { framework.publishFrameworkEvent(FrameworkEvent.ERROR, bundle, e); }
issueEvent( new StartLevelEvent( StartLevelEvent.CHANGE_BUNDLE_SL, newSL, (Bundle) bundle)); } } catch (IOException e) { framework.publishFrameworkEvent(FrameworkEvent.ERROR, bundle, e); }
    public void setBundleStartLevel(org.osgi.framework.Bundle bundle, int newSL) {        String exceptionText="";        if (bundle.getBundleId()==0) {  // system bundle has id=0            exceptionText = Msg.formatter.getString("STARTLEVEL_CANT_CHANGE_SYSTEMBUNDLE_STARTLEVEL");        } else if (bundle.getState() == Bundle.UNINSTALLED) {            exceptionText = Msg.formatter.getString("BUNDLE_UNINSTALLED_EXCEPTION");        } else if (newSL <= 0) {            exceptionText = Msg.formatter.getString("STARTLEVEL_EXCEPTION_INVALID_REQUESTED_STARTLEVEL", ""+newSL);        }        if (exceptionText.length()>0) {            throw new IllegalArgumentException(exceptionText);        }        try {            // if the bundle's startlevel is not already at the requested startlevel            if (newSL != ((org.eclipse.osgi.framework.internal.core.Bundle)bundle).startLevel) {				Bundle b = (Bundle) bundle;				b.bundledata.setStartLevel(newSL);                b.bundledata.save();                ((org.eclipse.osgi.framework.internal.core.Bundle)bundle).startLevel = newSL;                framework.checkAdminPermission();                // handle starting or stopping the bundle asynchronously                issueEvent(new StartLevelEvent(StartLevelEvent.CHANGE_BUNDLE_SL, newSL, newSL, (Bundle)bundle, framework));            }        } catch (IOException e) {            framework.publishFrameworkEvent(FrameworkEvent.ERROR, bundle, e);        }    }