public void updatePermissions() {
   ApplicationManager applicationManager = ApplicationManager.getApplicationManager();
   while (applicationManager.inStartup()) {
     try {
       Thread.sleep(200);
     } catch (InterruptedException e) {
       XLogger.warn(getClass(), "sleep interrupted in");
     }
   }
   setPermissions();
 }
Exemplo n.º 2
0
  /**
   * Check if a process is running
   *
   * @param processName the process name to check
   * @return true if processName is running
   */
  public static boolean isProcessRunning(String processName) {
    boolean foundProcess = false;
    ApplicationManager appManager = ApplicationManager.getApplicationManager();
    ApplicationDescriptor[] appDescriptors = appManager.getVisibleApplications();

    for (int i = 0; i < appDescriptors.length; i++) {
      if (processName.equalsIgnoreCase(appDescriptors[i].getModuleName())) {
        foundProcess = true;
        break;
      }
    }

    return foundProcess;
  }