Java Code Examples for org.osgi.framework.FrameworkEvent#STARTLEVEL_CHANGED

The following examples show how to use org.osgi.framework.FrameworkEvent#STARTLEVEL_CHANGED . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NetigsoStartLevelTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public synchronized void frameworkEvent(FrameworkEvent fe) {
    if (fe.getType() == FrameworkEvent.STARTLEVEL_CHANGED) {
        levelChanged = true;
        notifyAll();
    }
}
 
Example 2
Source File: FrameworkLifecycleHandler.java    From atlas with Apache License 2.0 5 votes vote down vote up
@Override
public void frameworkEvent(FrameworkEvent event) {
    switch (event.getType()) {
        case 0:/* STARTING */
            starting();
            break;
        case FrameworkEvent.STARTED:
            started();
            break;
        case FrameworkEvent.STARTLEVEL_CHANGED:
        case FrameworkEvent.PACKAGES_REFRESHED:
        case FrameworkEvent.ERROR:
    }

}
 
Example 3
Source File: LogFrameworkListener.java    From knopflerfish.org with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * The framework event callback method inserts all framework events into
 * the log. Events of type <code>error</code> are logged at the error
 * level other event types are logged on the info level.
 * <p/>
 * FrameworkListener callback.
 * 
 * @param fe
 *            the framework event that has occurred.
 */
public void frameworkEvent(FrameworkEvent fe) {
    int level = LogService.LOG_INFO;
    String msg = null;
    // We always include the Exception even though
    // the specification says differently
    Throwable thr = fe.getThrowable();
    switch (fe.getType()) {
    case FrameworkEvent.ERROR:
        msg = "FrameworkEvent ERROR";
        level = LogService.LOG_ERROR;
        break;
    case FrameworkEvent.STARTED:
        msg = "FrameworkEvent STARTED";
        level = LogService.LOG_INFO;
        break;
    case FrameworkEvent.STARTLEVEL_CHANGED:
        msg = "FrameworkEvent STARTLEVEL_CHANGED";
        level = LogService.LOG_INFO;
        break;
    case FrameworkEvent.PACKAGES_REFRESHED:
        msg = "FrameworkEvent PACKAGES_REFRESHED";
        level = LogService.LOG_INFO;
        break;
    case FrameworkEvent.WARNING:
        msg   = "FrameworkEvent WARNING";
        level = LogService.LOG_INFO; // sic! According to spec.
        break;
    case FrameworkEvent.INFO:
        msg   = "FrameworkEvent INFO";
        level = LogService.LOG_INFO;
        break;
    default:
        msg = "FrameworkEvent <" + fe.getType() + ">";
        level = LogService.LOG_WARNING;
        break;     
    }
    lrsf.log(new LogEntryImpl(fe.getBundle(), level, msg, thr));
}
 
Example 4
Source File: Desktop.java    From knopflerfish.org with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void frameworkEvent(FrameworkEvent ev)
{
  if (!alive) {
    return;
  }
  switch (ev.getType()) {
  case FrameworkEvent.STARTLEVEL_CHANGED:
    updateStartLevel();
    break;
  }
}