Examples of IEarlyStarter


Examples of org.emrys.webosgi.core.extension.IEarlyStarter

        try {
          // Only when specified starter be created and invoked.
          if (when != Integer.parseInt(ele.getAttribute("when")))
            continue;

          IEarlyStarter starter = (IEarlyStarter) ele
              .createExecutableExtension("class");
          int priority = Integer.parseInt(ele
              .getAttribute("priority"));
          map.put(starter, priority);
        } catch (Exception e) {
          // e.printStackTrace();
          fwkActivator.log(e);
        }
      }
    }

    // Sort starters by their priority integer, the smaller one is be
    // invoked at first.
    List<IEarlyStarter> starters = new ArrayList<IEarlyStarter>(map
        .keySet());

    Collections.sort(starters, new Comparator<IEarlyStarter>() {
      public int compare(IEarlyStarter o1, IEarlyStarter o2) {
        return (map.get(o1) > map.get(o2)) ? -1 : 0;
      }
    });

    for (IEarlyStarter starter : starters) {
      try {
        starter.start();
      } catch (Exception e) {
        fwkActivator.log(e);
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.