Examples of ApplicationContext


Examples of de.scoopgmbh.copper.monitoring.client.context.ApplicationContext

 
  static Logger logger = LoggerFactory.getLogger(MonitorMain.class);

  @Override
  public void start(final Stage primaryStage) { //Stage = window
    ApplicationContext applicationContext = new ApplicationContext();
    primaryStage.titleProperty().bind(new SimpleStringProperty("Copper Monitor (server: ").concat(applicationContext.serverAdressProperty().concat(")")));
    new Button(); // Trigger loading of default stylesheet
    final Scene scene = new Scene(applicationContext.getMainPane(), 1300, 900, Color.WHEAT);

    scene.getStylesheets().add(this.getClass().getResource("/de/scoopgmbh/copper/gui/css/base.css").toExternalForm());
   
    primaryStage.setScene(scene);
    primaryStage.show();
   
    //"--name=value".
    Map<String, String> parameter = getParameters().getNamed();
    String monitorServerAdress = parameter.get("monitorServerAdress");
    String monitorServerUser = parameter.get("monitorServerUser");
    String monitorServerPassword = parameter.get("monitorServerPassword");

    if (!Strings.isNullOrEmpty(monitorServerAdress)){
      applicationContext.setHttpGuiCopperDataProvider(monitorServerAdress,monitorServerUser,monitorServerPassword);
    } else {
      applicationContext.createLoginForm().show();
        }

//        new Thread(){
//             {
//                 setDaemon(true);
View Full Code Here

Examples of diva.gui.ApplicationContext

    /**
     * Construct a new instance of the Tutorial, running in a new
     * application context.
     */
    public static void main(String[] argv) {
        AppContext context = new ApplicationContext();
        new ApplicationTutorial(context);
    }
View Full Code Here

Examples of jpianotrain.ApplicationContext

* @author methke01
* @since 0.0.2
*/
public class ExternalURLHandler {
  public static void handle(URL u) {
    ApplicationContext ctx=ApplicationContext.getInstance();
    if (urlDialog==null) {
      urlDialog=new URLDialog(ctx.getDefaultDialogOwner());
    }
    urlDialog.setUrl(u);
    urlDialog.setVisible(true);
  }
View Full Code Here

Examples of juzu.request.ApplicationContext

            // Lazy load the bundle here
            if (!bundleLoaded) {
              bundleLoaded = true;
              if (locale != null) {
                ApplicationContext applicationContext = Request.getCurrent().getApplicationContext();
                if (applicationContext != null) {
                  bundle = applicationContext.resolveBundle(locale);
                }
              }
            }

            //
View Full Code Here

Examples of org.apache.airavata.gfac.context.ApplicationContext

            jobExecutionContext.setProperty(Constants.PROP_TOPIC,this.configuration.getTopic());
            jobExecutionContext.setProperty(Constants.PROP_BROKER_URL,this.configuration.getBrokerURL().toASCIIString());
            jobExecutionContext.setProperty(Constants.PROP_WORKFLOW_INSTANCE_ID,this.configuration.getTopic());


            ApplicationContext applicationContext = new ApplicationContext();
            applicationContext.setApplicationDeploymentDescription(applicationDescription);
            applicationContext.setHostDescription(registeredHost);
            applicationContext.setServiceDescription(serviceDescription);

            jobExecutionContext.setApplicationContext(applicationContext);

            jobExecutionContext.setOutMessageContext(getOutParameters(serviceDescription));
            jobExecutionContext.setInMessageContext(new MessageContext(actualParameters));
View Full Code Here

Examples of org.apache.airavata.gfac.context.ApplicationContext

    @Before
    public void setUp() throws Exception {

        GFacConfiguration gFacConfiguration = new GFacConfiguration(null);
        //have to set InFlwo Handlers and outFlowHandlers
        ApplicationContext applicationContext = new ApplicationContext();
        HostDescription host = new HostDescription();
        host.getType().setHostName("localhost");
        host.getType().setHostAddress("localhost");
        applicationContext.setHostDescription(host);
        /*
           * App
           */
        ApplicationDescription appDesc = new ApplicationDescription();
        ApplicationDeploymentDescriptionType app = appDesc.getType();
        ApplicationDeploymentDescriptionType.ApplicationName name = ApplicationDeploymentDescriptionType.ApplicationName.Factory.newInstance();
        name.setStringValue("EchoLocal");
        app.setApplicationName(name);

        /*
           * Use bat file if it is compiled on Windows
           */
        if (SystemUtils.IS_OS_WINDOWS) {
            URL url = this.getClass().getClassLoader().getResource("echo.bat");
            app.setExecutableLocation(url.getFile());
        } else {
            //for unix and Mac
            app.setExecutableLocation("/bin/echo");
        }

        /*
           * Default tmp location
           */
        String tempDir = System.getProperty("java.io.tmpdir");
        if (tempDir == null) {
            tempDir = "/tmp";
        }

        app.setScratchWorkingDirectory(tempDir);
        app.setStaticWorkingDirectory(tempDir);
        app.setInputDataDirectory(tempDir + File.separator + "input");
        app.setOutputDataDirectory(tempDir + File.separator + "output");
        app.setStandardOutput(tempDir + File.separator + "echo.stdout");
        app.setStandardError(tempDir + File.separator + "echo.stderr");

        applicationContext.setApplicationDeploymentDescription(appDesc);

        /*
           * Service
           */
        ServiceDescription serv = new ServiceDescription();
        serv.getType().setName("SimpleEcho");

        List<InputParameterType> inputList = new ArrayList<InputParameterType>();
        InputParameterType input = InputParameterType.Factory.newInstance();
        input.setParameterName("echo_input");
        input.setParameterType(StringParameterType.Factory.newInstance());
        inputList.add(input);
        InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList
                .size()]);

        List<OutputParameterType> outputList = new ArrayList<OutputParameterType>();
        OutputParameterType output = OutputParameterType.Factory.newInstance();
        output.setParameterName("echo_output");
        output.setParameterType(StringParameterType.Factory.newInstance());
        outputList.add(output);
        OutputParameterType[] outputParamList = outputList
                .toArray(new OutputParameterType[outputList.size()]);

        serv.getType().setInputParametersArray(inputParamList);
        serv.getType().setOutputParametersArray(outputParamList);

        jobExecutionContext = new JobExecutionContext(gFacConfiguration,serv.getType().getName());
        jobExecutionContext.setApplicationContext(applicationContext);
        /*
        * Host
        */
        applicationContext.setServiceDescription(serv);

        MessageContext inMessage = new MessageContext();
        ActualParameter echo_input = new ActualParameter();
    ((StringParameterType)echo_input.getType()).setValue("echo_output=hello");
        inMessage.addParameter("echo_input", echo_input);
View Full Code Here

Examples of org.apache.airavata.gfac.core.context.ApplicationContext

        URL resource = this.getClass().getClassLoader().getResource(org.apache.airavata.common.utils.Constants.GFAC_CONFIG_XML);
        File configFile = new File(resource.getPath());
        GFacConfiguration gFacConfiguration = GFacConfiguration.create(configFile, null, null);
        //have to set InFlwo Handlers and outFlowHandlers
        ApplicationContext applicationContext = new ApplicationContext();
        HostDescription host = new HostDescription();
        host.getType().setHostName("localhost");
        host.getType().setHostAddress("localhost");
        applicationContext.setHostDescription(host);
        /*
           * App
           */
        ApplicationDescription appDesc = new ApplicationDescription();
        ApplicationDeploymentDescriptionType app = appDesc.getType();
        ApplicationDeploymentDescriptionType.ApplicationName name = ApplicationDeploymentDescriptionType.ApplicationName.Factory.newInstance();
        name.setStringValue("EchoLocal");
        app.setApplicationName(name);

        /*
           * Use bat file if it is compiled on Windows
           */
        if (SystemUtils.IS_OS_WINDOWS) {
            URL url = this.getClass().getClassLoader().getResource("echo.bat");
            app.setExecutableLocation(url.getFile());
        } else {
            //for unix and Mac
            app.setExecutableLocation("/bin/echo");
        }

        /*
           * Default tmp location
           */
        String tempDir = System.getProperty("java.io.tmpdir");
        if (tempDir == null) {
            tempDir = "/tmp";
        }

        app.setScratchWorkingDirectory(tempDir);
        app.setStaticWorkingDirectory(tempDir);
        app.setInputDataDirectory(tempDir + File.separator + "input");
        app.setOutputDataDirectory(tempDir + File.separator + "output");
        app.setStandardOutput(tempDir + File.separator + "echo.stdout");
        app.setStandardError(tempDir + File.separator + "echo.stderr");

        applicationContext.setApplicationDeploymentDescription(appDesc);

        /*
           * Service
           */
        ServiceDescription serv = new ServiceDescription();
        serv.getType().setName("SimpleEcho");

        List<InputParameterType> inputList = new ArrayList<InputParameterType>();
        InputParameterType input = InputParameterType.Factory.newInstance();
        input.setParameterName("echo_input");
        input.setParameterType(StringParameterType.Factory.newInstance());
        inputList.add(input);
        InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList
                .size()]);

        List<OutputParameterType> outputList = new ArrayList<OutputParameterType>();
        OutputParameterType output = OutputParameterType.Factory.newInstance();
        output.setParameterName("echo_output");
        output.setParameterType(StringParameterType.Factory.newInstance());
        outputList.add(output);
        OutputParameterType[] outputParamList = outputList
                .toArray(new OutputParameterType[outputList.size()]);

        serv.getType().setInputParametersArray(inputParamList);
        serv.getType().setOutputParametersArray(outputParamList);

        jobExecutionContext = new JobExecutionContext(gFacConfiguration, serv.getType().getName());
        jobExecutionContext.setApplicationContext(applicationContext);
        /*
        * Host
        */
        applicationContext.setServiceDescription(serv);

        MessageContext inMessage = new MessageContext();
        ActualParameter echo_input = new ActualParameter();
        ((StringParameterType) echo_input.getType()).setValue("echo_output=hello");
        inMessage.addParameter("echo_input", echo_input);
View Full Code Here

Examples of org.apache.avalon.phoenix.interfaces.ApplicationContext

                    final Application newApp = new DefaultApplication();
                    final Logger childLogger =
                        getLogger().getChildLogger( name );
                    ContainerUtil.enableLogging( newApp, childLogger );

                    final ApplicationContext context =
                        createApplicationContext( entry );
                    newApp.setApplicationContext( context );

                    ContainerUtil.initialize( newApp );
View Full Code Here

Examples of org.apache.catalina.core.ApplicationContext

    RedisSessionManager sessionManager = null;
    ApplicationContextFacade appContextFacadeObj = (ApplicationContextFacade)request.session().raw().getServletContext();
    try {
      Field applicationContextField = appContextFacadeObj.getClass().getDeclaredField("context");
      applicationContextField.setAccessible(true);
      ApplicationContext appContextObj = (ApplicationContext)applicationContextField.get(appContextFacadeObj);
      Field standardContextField = appContextObj.getClass().getDeclaredField("context");
      standardContextField.setAccessible(true);
      StandardContext standardContextObj = (StandardContext)standardContextField.get(appContextObj);
      sessionManager = (RedisSessionManager)standardContextObj.getManager();
    } catch (Exception e) { }
    return sessionManager;
View Full Code Here

Examples of org.apache.pivot.wtk.ApplicationContext

            // host is obscured. For a full description of why this is the case,
            // see http://people.apache.org/~tvolkert/tests/scrolling/

            ScrollPane scrollPane = (ScrollPane)getComponent();
            ApplicationContext.DisplayHost displayHost = scrollPane.getDisplay().getDisplayHost();
            ApplicationContext applicationContext = displayHost.getApplicationContext();

            optimizeScrolling = (displayHost.getScale() == 1
                && (applicationContext instanceof DesktopApplicationContext
                || (displayHost.getPeer().canDetermineObscurity()
                && !displayHost.getPeer().isObscured())));
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.