Examples of ApplicationLauncher


Examples of org.eclipse.osgi.service.runnable.ApplicationLauncher

  public void frameworkStopping(BundleContext context) {
    // Shutdown the ApplicationLauncher service if it is available.
    ServiceReference launcherRef = context.getServiceReference(ApplicationLauncher.class.getName());
    if (launcherRef != null) {
      ApplicationLauncher launcher = (ApplicationLauncher) context.getService(launcherRef);
      // this will force a currently running application to stop.
      launcher.shutdown();
      context.ungetService(launcherRef);
    }
  }
View Full Code Here

Examples of org.eclipse.osgi.service.runnable.ApplicationLauncher

    lock(appHandle);
    boolean isDefault = appHandle.isDefault();
    if (((EclipseAppDescriptor) appHandle.getApplicationDescriptor()).getThreadType() == EclipseAppDescriptor.FLAG_TYPE_MAIN_THREAD) {
      // use the ApplicationLauncher provided by the framework to ensure it is launched on the main thread
      DefaultApplicationListener curDefaultApplicationListener = null;
      ApplicationLauncher appLauncher = null;
      synchronized (this) {
        appLauncher = (ApplicationLauncher) launcherTracker.getService();
        if (appLauncher == null) {
          if (isDefault) {
            // we need to wait to allow the ApplicationLauncher to get registered;
            // save the handle to be launched as soon as the ApplicationLauncher is available
            defaultMainThreadAppHandle = appHandle;
            return;
          }
          throw new ApplicationException(ApplicationException.APPLICATION_INTERNAL_ERROR);
        }
        curDefaultApplicationListener = defaultAppListener;
      }
      if (curDefaultApplicationListener != null)
        curDefaultApplicationListener.launch(appHandle);
      else
        appLauncher.launch(appHandle, appHandle.getArguments().get(IApplicationContext.APPLICATION_ARGS));
    } else {
      AnyThreadAppLauncher.launchEclipseApplication(appHandle);
      DefaultApplicationListener curDefaultApplicationListener = null;
      if (isDefault) {
        ApplicationLauncher appLauncher = null;
        synchronized (this) {
          appLauncher = (ApplicationLauncher) launcherTracker.getService();
          if (defaultAppListener == null)
            defaultAppListener = new DefaultApplicationListener(appHandle);
          curDefaultApplicationListener = defaultAppListener;
          if (appLauncher == null) {
            // we need to wait to allow the ApplicationLauncher to get registered;
            // save the default app listener to be launched as soon as the ApplicationLauncher is available
            defaultMainThreadAppHandle = curDefaultApplicationListener;
            return;
          }
        }
        appLauncher.launch(curDefaultApplicationListener, null);
      }
    }
  }
View Full Code Here

Examples of org.eclipse.osgi.service.runnable.ApplicationLauncher

    }
    return null;
  }

  public Object addingService(ServiceReference reference) {
    ApplicationLauncher appLauncher;
    ParameterizedRunnable appRunnable;
    synchronized (this) {
      appLauncher = (ApplicationLauncher) context.getService(reference);
      // see if there is a default main threaded application waiting to run
      appRunnable = defaultMainThreadAppHandle;
      // null out so we do not attempt to start this handle again
      defaultMainThreadAppHandle = null;
    }
    if (appRunnable != null)
      // found a main threaded app; start it now that the app launcher is available
      appLauncher.launch(appRunnable, appRunnable instanceof EclipseAppHandle ? ((EclipseAppHandle) appRunnable).getArguments().get(IApplicationContext.APPLICATION_ARGS) : null);
    return appLauncher;
  }
View Full Code Here

Examples of org.springframework.richclient.application.ApplicationLauncher

    // presenting the splash screen, initializing the Application
    // singleton instance, creating the application window to display
    // the initial page.

    try {
      new ApplicationLauncher(startupContextPath, new String[] { richclientApplicationContextPath });
    }
    catch (RuntimeException e) {
      logger.error("RuntimeException during startup", e);
    }
  }
View Full Code Here

Examples of org.springframework.richclient.application.ApplicationLauncher

            String businessLayerClientContextPath = rootContextDirectoryClassPath + "/clientserver/client-context.xml";

            String securityContextPath = rootContextDirectoryClassPath + "/clientserver/security-context-client.xml";

            new ApplicationLauncher(startupContextPath, new String[] { richclientApplicationContextPath,
                    businessLayerClientContextPath, securityContextPath });
        } catch (Exception e) {
            System.exit(1);
        }
    }
View Full Code Here

Examples of org.springframework.richclient.application.ApplicationLauncher

        // The ApplicationLauncher is responsible for loading the contexts,
        // presenting the splash screen, initializing the Application
        // singleton instance, creating the application window to display
        // the initial page.
        try {
            new ApplicationLauncher(startupContextPath, new String[] { richclientApplicationContextPath });
        } catch (RuntimeException e) {
            logger.error("RuntimeException during startup", e);
        }
    }
View Full Code Here

Examples of org.springframework.richclient.application.ApplicationLauncher

        // The ApplicationLauncher is responsible for loading the contexts,
        // presenting the splash screen, initializing the Application
        // singleton instance, creating the application window to display
        // the initial page.
        try {
            new ApplicationLauncher(startupContextPath, new String[] { richclientApplicationContextPath });
        } catch (RuntimeException e) {
            logger.error("RuntimeException during startup", e);
        }
    }
View Full Code Here

Examples of org.springframework.richclient.application.ApplicationLauncher

    // presenting the splash screen, initializing the Application
    // singleton instance, creating the application window to display
    // the initial page.

    try {
      new ApplicationLauncher(startupContextPath, new String[] { richclientApplicationContextPath });
    }
    catch (RuntimeException e) {
      logger.error("RuntimeException during startup", e);
    }
  }
View Full Code Here

Examples of org.springframework.richclient.application.ApplicationLauncher

  private static final String PAGE_CONTEXT = CONTEXT_ROOT + "/pagesApplicationContext.xml";
  private static final String STARTUP_CONTEXT = CONTEXT_ROOT + "/richclient-startup-context.xml";

  public static void main( String[] args ) {
    try {
      new ApplicationLauncher( STARTUP_CONTEXT, new String[]{APPLICATION_CONTEXT, PAGE_CONTEXT} );
    } catch ( Exception e ) {
      e.printStackTrace();
      System.exit( 1 );
    }
  }
View Full Code Here

Examples of org.springframework.richclient.application.ApplicationLauncher

    // presenting the splash screen, initializing the Application
    // singleton instance, creating the application window to display
    // the initial page.

    try {
      new ApplicationLauncher(startupContextPath, new String[] { richclientApplicationContextPath });
    }
    catch (RuntimeException e) {
      logger.error("RuntimeException during startup", 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.