Examples of ResourceMapping


Examples of org.eclipse.core.resources.mapping.ResourceMapping

   * @return whether the given saveable contains any resources that
   * are descendants of the root resources
   */
  private boolean isDescendantOfRoots(Saveable saveable) {
    // First, try and adapt the saveable to a resource mapping.
    ResourceMapping mapping = ResourceUtil.getResourceMapping(saveable);
    if (mapping != null) {
      try {
        ResourceTraversal[] traversals = mapping.getTraversals(
            ResourceMappingContext.LOCAL_CONTEXT, null);
        for (int i = 0; i < traversals.length; i++) {
          ResourceTraversal traversal = traversals[i];
          IResource[] resources = traversal.getResources();
          for (int j = 0; j < resources.length; j++) {
View Full Code Here

Examples of org.eclipse.core.resources.mapping.ResourceMapping

    ResourceTraversal traversal1 = new ResourceTraversal(
        new IResource[] { resource1 }, 1, 0);
    ResourceTraversal traversal2 = new ResourceTraversal(
        new IResource[] { resource2 }, 1, 0);

    ResourceMapping mapping = mock(ResourceMapping.class);
    when(mapping.getTraversals(null, null)).thenReturn(
        new ResourceTraversal[] { traversal1, traversal2 });
    StructuredSelection selection = new StructuredSelection(mapping);

    IResource[] result = SelectionUtils.getSelectedResources(selection);
View Full Code Here

Examples of org.eclipse.core.resources.mapping.ResourceMapping

    GitSynchronizeDataSet gsds = new GitSynchronizeDataSet(gsd);
    GitResourceVariantTreeSubscriber subscriber = new GitResourceVariantTreeSubscriber(
        gsds);
    subscriber.init(new NullProgressMonitor());

    ResourceMapping mapping = AdapterUtils.adapt(workspaceFile,
        ResourceMapping.class);
    SubscriberScopeManager manager = new SubscriberScopeManager(
        subscriber.getName(), new ResourceMapping[] { mapping, },
        subscriber, true);
    manager.initialize(new NullProgressMonitor());
View Full Code Here

Examples of org.eclipse.core.resources.mapping.ResourceMapping

   * @param element the element for which the decoration was initially called
   * @param decoration the decoration
   * @throws CoreException
   */
  private void decorateResourceMapping(Object element, IDecoration decoration) throws CoreException {
    @SuppressWarnings("restriction")
    ResourceMapping mapping = Utils.getResourceMapping(element);

    IDecoratableResource decoRes;
    try {
      decoRes = new DecoratableResourceMapping(mapping);
View Full Code Here

Examples of org.jboss.mbui.client.aui.mapping.ResourceMapping

        DataInputOutput connectionAttributes = new DataInputOutput("connectionAttributes", "Connection");
        connectionAttributes.setRole(Edit);
        tabs.add(connectionAttributes);

        // reificationStrategies steps (required)
        Mapping tableMapping = new ResourceMapping("datasourceTable",
                "/profile=${profile}/subsystem=datasources/data-source=*")
                .addAttributes("${resource.name}", "jndi-name", "enabled");

        Mapping editMapping = new ResourceMapping("datasourceForm",
                "/profile=${profile}/subsystem=datasources/data-source=${datasource}")
                .addAttributes("${resource.name}", "jndi-name", "enabled", "driver-name",
                        "share-prepared-statements", "prepared-statements-cache-size");

        table.getEntityContext().addMapping(tableMapping);
View Full Code Here

Examples of org.ogce.namespaces.x2010.x08.x30.workflowResourceMapping.ResourceMappingDocument.ResourceMapping

  public static GlobusGatekeeperType findGateKeeper(ExecutionContext appExecContext, boolean wsgram) throws GfacException {
    WorkflowContextHeader header = appExecContext.getWorkflowHeader();
    boolean isSpruceEnabled = false;
    if (header != null) {
      isSpruceEnabled = (appExecContext.getWorkflowHeader().getURGENCY() != null);
      ResourceMapping resourceMapping = appExecContext.getWorkflowHeader().getResourceMappings().getResourceMappingArray()[0];
      if (resourceMapping != null) {
        URI gatekeeperfromResourceMapping = null;
        try {
          gatekeeperfromResourceMapping = new URI(resourceMapping.getGatekeeperEpr());
        } catch (URISyntaxException e) {
          throw new GfacException(e.getLocalizedMessage(), e);
        }
        if (gatekeeperfromResourceMapping != null) {
          log.info("Gate keeper selected from resource mapping");
          GlobusGatekeeperType gatekeeper = GlobusGatekeeperType.Factory.newInstance();

          if (!resourceMapping.getWsgramPreferred()) {
            if (resourceMapping.getJobManager() != null) {
              throw new GfacException("Job Manager parameter must not defined for Pre-WSGram in Resource Mapping, " + "include it with your gatekeepr EPR in resource mapping", FaultCode.InternalServiceError);
            }
          } else {
            if (resourceMapping.getJobManager() != null) {
              gatekeeper.setJobmanagertype(GlobusJobManagerType.Enum.forString(resourceMapping.getJobManager()));
            }
          }
          gatekeeper.setEndPointReference(gatekeeperfromResourceMapping.toString());
          return gatekeeper;
        }
View Full Code Here

Examples of org.ogce.namespaces.x2010.x08.x30.workflowResourceMapping.ResourceMappingDocument.ResourceMapping

        if(!outputDataDir.isEmpty()){
    jobAttr.addEnvVariable(outputDataDir, appExecContext.getExecutionModel().getOutputDataDir());
        }
    ApplicationDescriptionType app = appExecContext.getExecutionModel().getAplicationDesc();
    WorkflowContextHeader contextHeader = appExecContext.getWorkflowHeader();
    ResourceMapping resourceMapping = null;
    if (contextHeader != null) {
      resourceMapping = contextHeader.getResourceMappings().getResourceMappingArray(0);
    }

    log.info("Configure using App Desc = " + app.xmlText());
    if (resourceMapping != null && resourceMapping.getMaxWallTime() > 0) {
      log.info("Header Setting Max Wall Time" + resourceMapping.getMaxWallTime());
      jobAttr.setMaxWallTime(resourceMapping.getMaxWallTime());

    } else if (app.getMaxWallTime() > 0) {
      log.info("Setting max wall clock time to " + app.getMaxWallTime());

      if (app.getMaxWallTime() > 30 && app.getQueue() != null && app.getQueue().equals("debug")) {
        throw new GfacException("NCSA debug Queue only support jobs < 30 minutes", FaultCode.InvalidConfig);
      }

      jobAttr.setMaxWallTime(app.getMaxWallTime());
      jobAttr.set("proxy_timeout", "1");
    } else {
      jobAttr.setMaxWallTime(29);
    }

    if (appExecContext.getExecutionModel().getStdIn() != null) {
      jobAttr.setStdin(appExecContext.getExecutionModel().getStdIn());
    } else {
      Iterator<String> values = appExecContext.getExecutionModel().getInputParameters().iterator();
      while (values.hasNext()) {
        jobAttr.addArgument(values.next());
      }
    }
   
    if (resourceMapping != null && resourceMapping.getNodeCount() > 0) {
      log.info("Setting number of procs to " + resourceMapping.getNodeCount());
      jobAttr.set("hostCount", String.valueOf(resourceMapping.getNodeCount()));
    }else if (app.getHostCount() > 1) {
      jobAttr.set("hostCount", String.valueOf(app.getHostCount()));
    }
    if (resourceMapping != null && resourceMapping.getCpuCount() > 0) {
      log.info("Setting host count to " + resourceMapping.getCpuCount());
      jobAttr.setNumProcs(resourceMapping.getCpuCount());
     
    } else if (app.getCount() > 1) {
      log.info("Setting number of procs to " + app.getCount());
      jobAttr.setNumProcs(app.getCount());
    }

    if (app.getProject() != null && app.getProject().getProjectName() != null) {
      log.info("Setting project to " + app.getProject());
      jobAttr.setProject(app.getProject().getProjectName());
    }

    if (resourceMapping != null && resourceMapping.getQueueName() != null) {
      jobAttr.setQueue(resourceMapping.getQueueName());
    } else if (app.getQueue() != null && app.getQueue().getQueueName() != null) {
      log.info("Setting job queue to " + app.getQueue());
      jobAttr.setQueue(app.getQueue().getQueueName());
    }
    String jobType = JobType.SINGLE.toString() ;
View Full Code Here

Examples of org.richfaces.resource.mapping.ResourceMapping

            if (mapped == null) {
                return null;
            }

            return new ResourceMapping() {
                @Override
                public ResourcePath getResourcePath(FacesContext context) {
                    return new ResourceServletMapping(new ResourcePath(mapped)).getResourcePath(context);
                }
            };
View Full Code Here

Examples of org.richfaces.resource.mapping.ResourceMapping

     * org.richfaces.resource.ResourceKey)
     */
    @Override
    public Resource createResource(FacesContext context, ResourceKey resourceKey) {
        for (ResourceMapper mapper : mappers) {
            ResourceMapping mapping = mapper.mapResource(resourceKey);

            if (mapping != null) {
                ResourcePath path = mapping.getResourcePath(context);
                return new URLResource(path);
            }
        }

        return null;
View Full Code Here

Examples of org.springframework.data.rest.core.config.ResourceMapping

  @Autowired RepositoryRestConfiguration config;

  @Test
  public void shouldProvideResourceMappingForConfiguredRepository() throws Exception {
    ResourceMapping mapping = config.getResourceMappingForRepository(ConfiguredPersonRepository.class);

    assertThat(mapping, notNullValue());
    assertThat(mapping.getRel(), is("people"));
    assertThat(mapping.getPath(), is("people"));
    assertThat(mapping.isExported(), is(false));
  }
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.