Examples of ProcessorFactory


Examples of com.esri.gpt.catalog.publication.ProcessorFactory

  if (url != null && url.length() > 0){
    Publisher publisher = new Publisher(context);
        HttpClientRequest httpClient = HttpClientRequest.newRequest();
        ProcessingContext pContext = new ProcessingContext(context,publisher,httpClient,null,false);
        ProcessorFactory factory = new ProcessorFactory();
        ResourceProcessor processor = factory.interrogate(pContext,url);
        if (processor == null) {
          axlResponse = "Unable to process resource.";
          return axlResponse;
        }
        processor.setPublicationMethod(MmdEnums.PublicationMethod.batch.toString());
View Full Code Here

Examples of com.esri.gpt.catalog.publication.ProcessorFactory

}

public Query newQuery(Criteria crt) {
  RequestContext requestContext = RequestContext.extract(null);
  try {
    ResourceProcessor processor = new ProcessorFactory().interrogate(newProcessingContext(requestContext), info.getUrl(), info.newCredentials());
    return processor.createQuery(context, crt);
  } catch (IOException ex) {
    context.onIterationException(ex);
    return null;
  } finally {
View Full Code Here

Examples of com.esri.gpt.catalog.publication.ProcessorFactory

}

public Native getNativeResource() {
  RequestContext requestContext = RequestContext.extract(null);
  try {
    ResourceProcessor processor = new ProcessorFactory().interrogate(newProcessingContext(requestContext), info.getUrl(), info.newCredentials());
    return processor!=null? processor.getNativeResource(context): null;
  } catch (IOException ex) {
    context.onIterationException(ex);
    return null;
  } finally {
View Full Code Here

Examples of com.esri.gpt.catalog.publication.ProcessorFactory

        Publisher publisher = getSelectablePublishers().selectedAsPublisher(context,false);
        HttpClientRequest httpClient = HttpClientRequest.newRequest();
       
        ProcessingContext pContext = new ProcessingContext(context,publisher,httpClient,null,bValidateOnly);
        pContext.setMessageBroker(msgBroker);
        ProcessorFactory factory = new ProcessorFactory();
        ResourceProcessor processor = factory.interrogate(pContext,sExplicitPath);
       
        if (processor == null) {
          throw new IOException("Unable to process resource.");
        }
        processor.process();
View Full Code Here

Examples of de.matrixweb.smaller.resource.ProcessorFactory

    final Task task = new Task();
    task.setProcessor(processors);
    task.setIn(resources.toArray(new String[resources.size()]));
    task.setOut(new String[] { "output.js", "output.css" });
    task.setOptionsDefinition(options);
    final ProcessorFactory processorFactory = new JavaEEProcessorFactory();
    try {
      final VFS vfs = new VFS();
      try {
        vfs.mount(vfs.find("/"), new ServletFile(getServletContext(), "/"));
        this.result = new Pipeline(processorFactory).execute(
            Version.getCurrentVersion(), vfs, new VFSResourceResolver(vfs),
            task);
      } finally {
        vfs.dispose();
      }
    } catch (final IOException e) {
      throw new ServletException("Failed to setup vfs", e);
    } finally {
      processorFactory.dispose();
    }
  }
View Full Code Here

Examples of de.matrixweb.smaller.resource.ProcessorFactory

   * @see org.osgi.util.tracker.ServiceTracker#addingService(org.osgi.framework.ServiceReference)
   */
  @Override
  public ProcessorFactory addingService(
      final ServiceReference<ProcessorFactory> reference) {
    final ProcessorFactory processorFactory = super.addingService(reference);
    this.processorFactory = processorFactory;
    for (final ProcessorFactoryServiceListener listener : this.listeners) {
      listener.addedProcessorFactory(processorFactory);
    }
    return processorFactory;
View Full Code Here

Examples of de.matrixweb.smaller.resource.ProcessorFactory

      protected void executeSmaller(final File base,
          final List<String> includedFiles, final File target,
          final String host, final String port, final String proxyhost,
          final String proxyport, final ConfigFile configFile)
          throws ExecutionException {
        final ProcessorFactory processorFactory = new JavaEEProcessorFactory();
        try {
          final VFS vfs = new VFS(new Logger() {
            @Override
            public void debug(final String message) {
              getLog().debug(message);
            }

            @Override
            public void info(final String messsage) {
              getLog().info(messsage);
            }

            @Override
            public void error(final String message, final Exception e) {
              getLog().error(message, e);
            }
          });
          try {
            getLog().info("MVN: Adding " + base + " to VFS");
            vfs.mount(vfs.find("/"), new JavaFile(base));
            final ResourceResolver resolver = new VFSResourceResolver(vfs);
            final Manifest manifest = Manifest.fromConfigFile(configFile);
            final Pipeline pipeline = new Pipeline(processorFactory);
            pipeline.execute(Version.getCurrentVersion(), vfs, resolver,
                manifest, target);
          } finally {
            vfs.dispose();
          }
        } catch (final IOException e) {
          throw new ExecutionException("Embedded smaller failed", e);
        } finally {
          processorFactory.dispose();
        }
      }
    };
    client.execute();
  }
View Full Code Here

Examples of de.matrixweb.smaller.resource.ProcessorFactory

  protected boolean runToolChain(final Version minimum, final String file,
      final ToolChainCallback callback) throws Exception {
    if (Version.getCurrentVersion().isAtLeast(minimum)) {
      System.out.println("\nRun test: " + file);
      final File target = File.createTempFile("smaller-test-", ".dir");
      final ProcessorFactory processorFactory = new JavaEEProcessorFactory();
      try {
        assertTrue(target.delete());
        assertTrue(target.mkdir());
        final File source = FileUtils.toFile(this.getClass().getResource(
            "/" + file));
        final VFS vfs = new VFS();
        try {
          vfs.mount(vfs.find("/"), new JavaFile(source));
          final ResourceResolver resolver = new VFSResourceResolver(vfs);
          final Manifest manifest = getManifest(source);
          new Pipeline(processorFactory).execute(Version.getCurrentVersion(),
              vfs, resolver, manifest, target);
          callback.test(vfs, manifest);
        } finally {
          vfs.dispose();
        }
      } finally {
        processorFactory.dispose();
        FileUtils.deleteDirectory(target);
      }
      return true;
    }
    return false;
View Full Code Here

Examples of de.matrixweb.smaller.resource.ProcessorFactory

  /**
   * @see org.apache.tools.ant.Task#execute()
   */
  @Override
  public void execute() {
    final ProcessorFactory processorFactory = new JavaEEProcessorFactory();
    try {
      final File temp = File.createTempFile("smaller-ant", ".dir");
      try {
        temp.delete();
        temp.mkdirs();

        log("Reading config-file: " + this.configFilePath);
        final ConfigFile configFile = ConfigFile.read(this.configFilePath);

        final List<String> includedFiles = new ArrayList<String>();
        for (final String envName : configFile.getBuildServer()
            .getEnvironments()) {
          final Environment env = configFile.getEnvironments().get(envName);
          for (final String dir : env.getFiles().getFolder()) {
            copyFirstInputFile(env, dir, temp);

            File base = new File(dir);
            if (!base.isAbsolute()) {
              base = new File(this.configFilePath.getParentFile(),
                  base.getPath());
            }
            final String[] included = scanIncludedFiles(base.getAbsolutePath(),
                env.getFiles().getIncludes(), env.getFiles().getExcludes());

            for (final String include : included) {
              FileUtils.copyFile(new File(base, include), new File(temp,
                  include));
              includedFiles.add(include);
            }
          }
        }

        final VFS vfs = new VFS();
        try {
          vfs.mount(vfs.find("/"), new JavaFile(temp));
          final ResourceResolver resolver = new VFSResourceResolver(vfs);

          final Manifest manifest = Manifest.fromConfigFile(configFile);
          final Pipeline pipeline = new Pipeline(processorFactory);
          pipeline.execute(Version.getCurrentVersion(), vfs, resolver,
              manifest, this.target);
        } finally {
          vfs.dispose();
        }

      } finally {
        FileUtils.deleteDirectory(temp);
      }
    } catch (final IOException e) {
      log(Util.formatException(e), Project.MSG_ERR);
      throw new BuildException("Failed execute embedded smaller", e);
    } finally {
      processorFactory.dispose();
    }
  }
View Full Code Here

Examples of org.apache.camel.spi.ProcessorFactory

        ThreadPoolFactory threadPoolFactory = getBeanForType(ThreadPoolFactory.class);
        if (threadPoolFactory != null) {
            LOG.info("Using custom ThreadPoolFactory: {}", threadPoolFactory);
            getContext().getExecutorServiceManager().setThreadPoolFactory(threadPoolFactory);
        }
        ProcessorFactory processorFactory = getBeanForType(ProcessorFactory.class);
        if (processorFactory != null) {
            LOG.info("Using custom ProcessorFactory: {}", processorFactory);
            getContext().setProcessorFactory(processorFactory);
        }
        Debugger debugger = getBeanForType(Debugger.class);
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.