Пример #1
0
  public void initialize() {
    super.initialize();
    repository =
        (IAppRepositoryManager) getConnectedComponents().get(IAppRepositoryManager.class.getName());

    componentManager =
        (IComponentManager) getConnectedComponents().get(IComponentManager.class.getName());

    repository.open();
  }
Пример #2
0
  public void startService() {
    super.startService();

    if (repository.getInstalledAppNames().size() > 0) {
      loadAndInitializeApps();

      Vector services = repository.listServices();
      String serviceName;
      IService service;

      for (int i = 0; i < services.size(); i++) {
        serviceName = (String) services.elementAt(i);
        service = (IService) componentManager.resolveComponent(serviceName);
        service.startService();
      }

      ISensorManager sensorManager =
          (ISensorManager) componentManager.resolveComponent(ISensorManager.class.getName());
      sensorManager.startService();
    }
  }
Пример #3
0
 public void destroy() {
   super.destroy();
   battery = null;
 }
Пример #4
0
 public void initialize() {
   super.initialize();
   battery = Spot.getInstance().getPowerController().getBattery();
 }