Examples of Environment


Examples of de.matrixweb.smaller.config.Environment

    new File(tempIn, "in").createNewFile();

    final Processor processor = new Processor();
    processor.setSrc("in");
    final ConfigFile configFile = new ConfigFile();
    final Environment env = configFile.getEnvironments().get("first");
    env.setPipeline(new String[] { "processor" });
    env.getProcessors().put("processor", processor);
    env.setProcess("out");

    final byte[] bytes = util.zip(tempIn,
        Arrays.asList("a.test", "dir/b.test", "dir/dir/c.test"), configFile);
    util.unzip(tempOut, bytes);
View Full Code Here

Examples of de.tuhrig.thofu.Environment

    // error checking
    if (parameters.size() != ((LList) tokens).size())
      throw new LException("[wrong number of arguments] - expected " + parameters.size() + ", but were " + ((LList) tokens).size() + " [args = " + ((LList) tokens) + "]");

    // we make a new and empty inner environment
    Environment inner = new Environment(environment, name);

    for (Entry<LSymbol, Container> current : closure.entrySet()) {

      if(!parameters.contains(current.getKey()) && !inner.contains(current.getKey())) {
 
        inner.put(current.getKey(), current.getValue());
      }
     
      if(closureParameters.contains(current.getKey())) {
       
        inner.put(current.getKey(), current.getValue());
      }
    }

    for (int i = 0; i < parameters.size(); i++) {

      LSymbol key = LSymbol.get(parameters.get(i));

      LObject object = ((LList) tokens).get(i);

      if(!(object instanceof LOperation))
        object = object.run(inner, null);

      inner.put(key, object);
   

    LObject result = null;

    for(LObject definition : definitions) {
View Full Code Here

Examples of eu.stratosphere.nephele.execution.Environment

   *
   * @param vertexId the ID of the task to be unregistered
   * @param task the task to be unregistered
   */
  public void unregister(ExecutionVertexID vertexId, Task task) {
    final Environment environment = task.getEnvironment();

    // destroy and remove OUTPUT channels from registered channels and cache
    for (ChannelID id : environment.getOutputChannelIDs()) {
      Channel channel = this.channels.remove(id);
      if (channel != null) {
        channel.destroy();
      }

      this.receiverCache.remove(channel);
    }

    // destroy and remove INPUT channels from registered channels and cache
    for (ChannelID id : environment.getInputChannelIDs()) {
      Channel channel = this.channels.remove(id);
      if (channel != null) {
        channel.destroy();
      }

      this.receiverCache.remove(channel);
    }

    // clear and remove INPUT side buffer pools
    for (GateID id : environment.getInputGateIDs()) {
      LocalBufferPoolOwner bufferPool = this.localBuffersPools.remove(id);
      if (bufferPool != null) {
        bufferPool.clearLocalBufferPool();
      }
    }
View Full Code Here

Examples of fr.obeo.releng.targetplatform.Environment

      EList<Resource.Diagnostic> _errors_1 = _eResource_1.getErrors();
      boolean _isEmpty = _errors_1.isEmpty();
      Assert.assertTrue(_join, _isEmpty);
      EList<TargetContent> _contents = tp.getContents();
      Iterable<Environment> _filter = Iterables.<Environment>filter(_contents, Environment.class);
      final Environment env = IterableExtensions.<Environment>head(_filter);
      String _operatingSystem = env.getOperatingSystem();
      Assert.assertEquals("win32", _operatingSystem);
      String _architecture = env.getArchitecture();
      Assert.assertEquals("x86_64", _architecture);
      String _windowingSystem = env.getWindowingSystem();
      Assert.assertEquals("motif", _windowingSystem);
      Locale _locale = new Locale("en", "us");
      Locale _localization = env.getLocalization();
      Assert.assertEquals(_locale, _localization);
      IExecutionEnvironmentsManager _executionEnvironmentsManager = JavaRuntime.getExecutionEnvironmentsManager();
      IExecutionEnvironment _environment = _executionEnvironmentsManager.getEnvironment("JavaSE-1.7");
      IExecutionEnvironment _executionEnvironment = env.getExecutionEnvironment();
      Assert.assertEquals(_environment, _executionEnvironment);
    } catch (Throwable _e) {
      throw Exceptions.sneakyThrow(_e);
    }
  }
View Full Code Here

Examples of fr.utbm.gi.vi51.framework.environment.Environment

        JOptionPane.YES_NO_OPTION,
        JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION;

    FrameworkGUI gui = new GUI(WORLD_SIZE_X, WORLD_SIZE_Y);
   
    Environment environment = new WorldModel(WORLD_SIZE_X, WORLD_SIZE_Y);
   
    FrameworkLauncher.launchEnvironment(environment, gui, EXECUTION_DELAY);

    Rabbit a = new Rabbit(steering) ;   
    FrameworkLauncher.launchAgent(a) ;
View Full Code Here

Examples of freemarker.core.Environment

  public void render(String template, ValueStack stack, Writer writer, Component component)
      throws Exception {
    SimpleHash model = buildModel(stack, component);
    Object prevTag = model.get("tag");
    model.put("tag", component);
    Environment env = getEnvironment(template, stack, model, writer);
    env.process();
    if (null != prevTag) {
      model.put("tag", prevTag);
    }
  }
View Full Code Here

Examples of fysix.engine.Environment

      Vector bullets = new Vector();
      int delay = 0;
      Renderer r = new Renderer();
     
        FysixEngine fe = FysixEngine.GetContext();
        Environment env = new Environment() {
            public Vector2d getEnvironmentAccelerationAtPoint(Point2d p) {
                return new Vector2d(0.0,0.0);
            }
      public double getEnvironmentalResistanceAtPoint(Point2d p) {
        return 1.0;
View Full Code Here

Examples of gov.nysenate.openleg.Environment

                this.printUsage(opts);
                System.exit(1);
            }
        }

        Environment env = Application.getEnvironment();
        DataProcessor process = new DataProcessor();
        for (String task : tasks) {
            // TODO: With Java7 we can make this a switch case
            if (task.equals("stage")) {
                process.stage(env.getStagingDirectory(), env.getWorkingDirectory());
            }
            else if (task.equals("collate")) {
                process.collate(env.getWorkingDirectory());
            }
            else if (task.equals("ingest")) {
                process.ingest(env.getWorkingDirectory(), Application.getStorage());
                if (changeFile != null) {
                    ChangeLogger.writeToFile(changeFile);
                }
            }
            else if (task.equals("push")) {
                if (ChangeLogger.getChangeLog().isEmpty()) {
                    if (changeFile != null) {
                        ChangeLogger.readFromFile(changeFile);
                    }
                    else {
                        System.err.println("Unable to push with an empty change log.");
                    }
                }
                process.push(Application.getStorage(), ChangeLogger.getEntries(), services);
            }
            else if (task.equalsIgnoreCase("archive")) {
                process.archive(env.getWorkingDirectory(), env.getArchiveDirectory());
            }
            else {
                System.err.println("Invalid task.");
                System.exit(1);
            }
View Full Code Here

Examples of grails.util.Environment

        plugins.put(plugin.getName(), plugin);
        classNameToPluginMap.put(plugin.getPluginClass().getName(), plugin);
    }

    protected boolean canRegisterPlugin(GrailsPlugin plugin) {
        Environment environment = Environment.getCurrent();
        return plugin.isEnabled() && plugin.supportsEnvironment(environment);
    }
View Full Code Here

Examples of hudson.model.Environment

                        ParametersAction parameters = getAction(ParametersAction.class);
                        if (parameters != null)
                            parameters.createBuildWrappers(MavenModuleSetBuild.this,wrappers);

                        for( BuildWrapper w : wrappers) {
                            Environment e = w.setUp(MavenModuleSetBuild.this, launcher, listener);
                            if(e==null)
                                return (r = Result.FAILURE);
                            buildEnvironments.add(e);
                            e.buildEnvVars(envVars); // #3502: too late for getEnvironment to do this
                        }

                      // run pre build steps
                      if(!preBuild(listener,project.getPrebuilders())
                        || !preBuild(listener,project.getPostbuilders())
                        || !preBuild(listener,project.getPublishers())){
                        r = FAILURE;
                            return r;
                      }

                      if(!build(listener,project.getPrebuilders().toList())){
                        r = FAILURE;
                            return r;
                  }

                        String settingsConfigId = project.getSettingConfigId();
                        if (StringUtils.isNotBlank(settingsConfigId)) {
                            SettingConfig settingsConfig = SettingsProviderUtils.findSettings(settingsConfigId);
                            if (settingsConfig == null) {
                                logger.println(" your Apache Maven build is setup to use a config with id " + settingsConfigId
                                                   + " but cannot find the config");
                            } else {
                                logger.println("using settings config with name " + settingsConfig.name);
                                if (settingsConfig.content != null ) {
                                    remoteSettings = SettingsProviderUtils.copyConfigContentToFilePath( settingsConfig, getWorkspace() );
                                    project.setAlternateSettings( remoteSettings.getRemote() );
                                }
                            }
                        }

                        String globalSettingsConfigId = project.getGlobalSettingConfigId();
                        if (StringUtils.isNotBlank(globalSettingsConfigId)) {
                            SettingConfig settingsConfig = SettingsProviderUtils.findSettings(globalSettingsConfigId);
                            if (settingsConfig == null) {
                                logger.println(" your Apache Maven build is setup to use a global settings config with id " + globalSettingsConfigId
                                                   + " but cannot find the config");
                            } else {
                                logger.println("using global settings config with name " + settingsConfig.name);
                                if (settingsConfig.content != null ) {
                                    remoteGlobalSettings = SettingsProviderUtils.copyConfigContentToFilePath( settingsConfig, getWorkspace() );
                                    project.globalSettingConfigPath = remoteGlobalSettings.getRemote();
                                }
                            }
                        } else {
                          // make sure the transient field is clean
                          project.globalSettingConfigPath = null;
                        }

                        parsePoms(listener, logger, envVars, mvn, mavenVersion); // #5428 : do pre-build *before* parsing pom
                        SplittableBuildListener slistener = new SplittableBuildListener(listener);
                        proxies = new HashMap<ModuleName, ProxyImpl2>();
                        List<ModuleName> changedModules = new ArrayList<ModuleName>();
                       
                        if (project.isIncrementalBuild() && !getChangeSet().isEmptySet()) {
                            changedModules.addAll(getUnbuildModulesSinceLastSuccessfulBuild());
                        }

                        for (MavenModule m : project.sortedActiveModules) {
                            MavenBuild mb = m.newBuild();
                            // JENKINS-8418
                            mb.setBuiltOnStr( getBuiltOnStr() );
                            // Check if incrementalBuild is selected and that there are changes -
                            // we act as if incrementalBuild is not set if there are no changes.
                            if (!MavenModuleSetBuild.this.getChangeSet().isEmptySet()
                                && project.isIncrementalBuild()) {
                                //If there are changes for this module, add it.
                                // Also add it if we've never seen this module before,
                                // or if the previous build of this module failed or was unstable.
                                if ((mb.getPreviousBuiltBuild() == null) ||
                                    (!getChangeSetFor(m).isEmpty())
                                    || (mb.getPreviousBuiltBuild().getResult().isWorseThan(Result.SUCCESS))) {
                                    changedModules.add(m.getModuleName());
                                }
                            }

                            mb.setWorkspace(getModuleRoot().child(m.getRelativePath()));
                            proxies.put(m.getModuleName(), mb.new ProxyImpl2(MavenModuleSetBuild.this,slistener));
                        }

                        // run the complete build here

                        // figure out the root POM location.
                        // choice of module root ('ws' in this method) is somewhat arbitrary
                        // when multiple CVS/SVN modules are checked out, so also check
                        // the path against the workspace root if that seems like what the user meant (see issue #1293)
                        String rootPOM = project.getRootPOM(envVars); // JENKINS-13822
                        FilePath pom = getModuleRoot().child(rootPOM);
                        FilePath parentLoc = getWorkspace().child(rootPOM);
                        if(!pom.exists() && parentLoc.exists())
                            pom = parentLoc;

                       
                        final ProcessCache.MavenProcess process;
                       
                        boolean maven3orLater = mavenBuildInformation.isMaven3OrLater();
                        if ( maven3orLater )
                        {
                            LOGGER.fine( "using maven 3 " + mavenVersion );
                            process =
                                MavenBuild.mavenProcessCache.get( launcher.getChannel(), slistener,
                                                                  new Maven3ProcessFactory( project, launcher, envVars, getMavenOpts(listener, envVars),
                                                                                            pom.getParent() ) );
                        }
                        else
                        {
                            LOGGER.fine( "using maven 2 " + mavenVersion );
                            process =
                                MavenBuild.mavenProcessCache.get( launcher.getChannel(), slistener,
                                                                  new MavenProcessFactory( project, launcher, envVars,getMavenOpts(listener, envVars),
                                                                                           pom.getParent() ) );
                        }
                        ArgumentListBuilder margs = new ArgumentListBuilder().add("-B").add("-f", pom.getRemote());
                        FilePath localRepo = project.getLocalRepository().locate(MavenModuleSetBuild.this);
                        if(localRepo!=null)
                            margs.add("-Dmaven.repo.local="+localRepo.getRemote());

                        if (project.globalSettingConfigPath != null)
                            margs.add("-gs" , project.globalSettingConfigPath);


                       
                        // If incrementalBuild is set
                        // and the previous build didn't specify that we need a full build
                        // and we're on Maven 2.1 or later
                        // and there's at least one module listed in changedModules,
                        // then do the Maven incremental build commands.
                        // If there are no changed modules, we're building everything anyway.
                        boolean maven2_1orLater = new ComparableVersion (mavenVersion).compareTo( new ComparableVersion ("2.1") ) >= 0;
                        boolean needsFullBuild = getPreviousCompletedBuild() != null &&
                            getPreviousCompletedBuild().getAction(NeedsFullBuildAction.class) != null;
                        if (project.isIncrementalBuild() && !needsFullBuild && maven2_1orLater && !changedModules.isEmpty()) {
                            margs.add("-amd");
                            margs.add("-pl", Util.join(changedModules, ","));
                        }

                        if (project.getAlternateSettings() != null) {
                            if (IOUtils.isAbsolute(project.getAlternateSettings())) {
                                margs.add("-s").add(project.getAlternateSettings());
                            } else {
                                FilePath mrSettings = getModuleRoot().child(project.getAlternateSettings());
                                FilePath wsSettings = getWorkspace().child(project.getAlternateSettings());
                                if (!wsSettings.exists() && mrSettings.exists())
                                    wsSettings = mrSettings;
                               
                                margs.add("-s").add(wsSettings.getRemote());
                            }
                        }

                       
                        final List<MavenArgumentInterceptorAction> argInterceptors = this.getBuild().getActions(MavenArgumentInterceptorAction.class);
                       
            // find the correct maven goals and options, there might by an action overruling the defaults
                        String goals = project.getGoals(); // default
                        for (MavenArgumentInterceptorAction mavenArgInterceptor : argInterceptors) {
                          final String goalsAndOptions = mavenArgInterceptor.getGoalsAndOptions((MavenModuleSetBuild)this.getBuild());
              if(StringUtils.isNotBlank(goalsAndOptions)){
                            goals = goalsAndOptions;
                                // only one interceptor is allowed to overwrite the whole "goals and options" string
                            break;
                          }
            }
            margs.addTokenized(envVars.expand(goals));

            // enable the interceptors to change the whole command argument list
            // all available interceptors are allowed to modify the argument list
            for (MavenArgumentInterceptorAction mavenArgInterceptor : argInterceptors) {
              final ArgumentListBuilder newMargs = mavenArgInterceptor.intercept(margs, (MavenModuleSetBuild)this.getBuild());
              if (newMargs != null) {
                margs = newMargs;
              }
            }                       
                       
                        final AbstractMavenBuilder builder;
                        if (maven3orLater) {
                            builder =
                                new Maven3Builder( slistener, proxies, project.sortedActiveModules, margs.toList(), envVars, mavenBuildInformation );
                        } else {
                            builder =
                                new Maven2Builder(slistener, proxies, project.sortedActiveModules, margs.toList(), envVars, mavenBuildInformation);
                        }
                       
                        MavenProbeAction mpa=null;
                        try {
                            mpa = new MavenProbeAction(project,process.channel);
                            addAction(mpa);
                            r = process.call(builder);
                            return r;
                        } finally {
                            builder.end(launcher);
                            getActions().remove(mpa);
                            process.discard();
                        }                           
                       
                    } catch (InterruptedException e) {
                        r = Executor.currentExecutor().abortResult();
                        throw e;
                    } finally {
                  // only run post build steps if requested...
                        if (r==null || r.isBetterOrEqualTo(project.getRunPostStepsIfResult())) {
                            if(!build(listener,project.getPostbuilders().toList())){
                                r = FAILURE;
                    }
                  }
                 
                        if (r != null) {
                            setResult(r);
                        }

                        // tear down in reverse order
                        boolean failed=false;
                        for( int i=buildEnvironments.size()-1; i>=0; i-- ) {
                            if (!buildEnvironments.get(i).tearDown(MavenModuleSetBuild.this,listener)) {
                                failed=true;
                            }                   
                        }
                        // WARNING The return in the finally clause will trump any return before
                        if (failed) return Result.FAILURE;
                    }
                }
               
               
                return r;
            } catch (AbortException e) {
                if(e.getMessage()!=null)
                    listener.error(e.getMessage());
                return Result.FAILURE;
            } catch (InterruptedIOException e) {
                e.printStackTrace(listener.error("Aborted Maven execution for InterruptedIOException"));
                return Executor.currentExecutor().abortResult();
            } catch (IOException e) {
                e.printStackTrace(listener.error(Messages.MavenModuleSetBuild_FailedToParsePom()));
                return Result.FAILURE;
            } catch (RunnerAbortedException e) {
                return Result.FAILURE;
            } catch (RuntimeException e) {
                // bug in the code.
                e.printStackTrace(listener.error("Processing failed due to a bug in the code. Please report this to jenkinsci-users@googlegroups.com"));
                logger.println("project="+project);
                logger.println("project.getModules()="+project.getModules());
                logger.println("project.getRootModule()="+project.getRootModule());
                throw e;
            } finally {
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.