Package org.apache.cocoon.environment.background

Examples of org.apache.cocoon.environment.background.BackgroundEnvironment


        } catch (ContextException e) {
          throw new JobExecutionException(e);
        }
       
        try {
            m_env = new BackgroundEnvironment(m_logger, envContext);
        } catch (MalformedURLException e) {
            // Unlikely to happen
            throw new JobExecutionException(e);
        }
View Full Code Here


        String jobrole = null;
       
        ServiceManager manager = (ServiceManager)data.get(QuartzJobScheduler.DATA_MAP_MANAGER);
    org.apache.cocoon.environment.Context envContext =
      (org.apache.cocoon.environment.Context)data.get(QuartzJobScheduler.DATA_MAP_ENV_CONTEXT);
        BackgroundEnvironment env;
    try {
      env = new BackgroundEnvironment(logger, envContext, manager);
    } catch (MalformedURLException mue) {
      // Unlikely to happen
      throw new JobExecutionException(mue);
    }
        CocoonComponentManager.enterEnvironment(env, env.getManager(), env.getProcessor());
        boolean release = false;
        try {
            jobrole = (String)data.get(QuartzJobScheduler.DATA_MAP_ROLE);

            if (null == jobrole) {
View Full Code Here

    protected InputStream process(String uri) throws Exception {
        // use the CachingOutputStream because it buffers all bytes written
        CachingOutputStream os =
            new CachingOutputStream(new NullOutputStream());
        File c = new File(this.context.getRealPath("/"));
        BackgroundEnvironment env =
            new BackgroundEnvironment(uri, "", c, os, this.getLogger());
        process(uri, env);
        os.close();
        return new ByteArrayInputStream(os.getContent());
    }
View Full Code Here

                if (getLogger().isDebugEnabled()) {
                    getLogger().debug("Refreshing " + this.uri);
                }

                // Setup Environment
                final BackgroundEnvironment env;
                try {
                    org.apache.cocoon.environment.Context ctx =
                            (org.apache.cocoon.environment.Context) context.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT);
                    env = new BackgroundEnvironment(ctx);
                } catch (ContextException e) {
                    throw new CascadingRuntimeException("No context found", e);
                }
                Processor processor;
                try {
                    processor = (Processor) manager.lookup(Processor.ROLE);
                } catch (ServiceException e) {
                    throw new CascadingRuntimeException("No processor found", e);
                }

                env.startingProcessing();
                try {
                    EnvironmentHelper.enterProcessor(processor, env);
                } catch (ProcessingException e) {
                    throw new CascadingRuntimeException("Can not enter processor", e);
                }
                try {
                    // Refresh Source
                    Source source = null;
                    try {
                        source = resolver.resolveURI(uri);
                        source.refresh();
                    } catch (IOException e) {
                        getLogger().error("Error refreshing source", e);
                    } finally {
                        if (source != null) {
                            resolver.release(source);
                        }
                    }
                } finally {
                    EnvironmentHelper.leaveProcessor();
                    env.finishingProcessing();
                    if (manager != null) {
                        manager.release(processor);
                    }
                }
            }
View Full Code Here

                if (getLogger().isDebugEnabled()) {
                    getLogger().debug("Refreshing " + this.uri);
                }

                // Setup Environment
                final BackgroundEnvironment env;
                try {
                    org.apache.cocoon.environment.Context ctx =
                            (org.apache.cocoon.environment.Context) context.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT);
                    env = new BackgroundEnvironment(getLogger(), ctx);
                } catch (ContextException e) {
                    throw new CascadingRuntimeException("No context found", e);
                } catch (MalformedURLException e) {
                    // Unlikely to happen
                    throw new CascadingRuntimeException("Invalid URL", e);
View Full Code Here

        } catch (ContextException e) {
          throw new JobExecutionException(e);
        }
       
        try {
            m_env = new BackgroundEnvironment(m_logger, envContext);
        } catch (MalformedURLException e) {
            // Unlikely to happen
            throw new JobExecutionException(e);
        }
View Full Code Here

        } catch (ContextException e) {
          throw new JobExecutionException(e);
        }
       
        try {
            m_env = new BackgroundEnvironment(m_logger, envContext);
        } catch (MalformedURLException e) {
            // Unlikely to happen
            throw new JobExecutionException(e);
        }
View Full Code Here

                if (getLogger().isDebugEnabled()) {
                    getLogger().debug("Refreshing " + this.uri);
                }

                // Setup Environment
                final BackgroundEnvironment env;
                try {
                    org.apache.cocoon.environment.Context ctx =
                            (org.apache.cocoon.environment.Context) context.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT);
                    env = new BackgroundEnvironment(getLogger(), ctx);
                } catch (ContextException e) {
                    throw new CascadingRuntimeException("No context found", e);
                } catch (MalformedURLException e) {
                    // Unlikely to happen
                    throw new CascadingRuntimeException("Invalid URL", e);
View Full Code Here

TOP

Related Classes of org.apache.cocoon.environment.background.BackgroundEnvironment

Copyright © 2018 www.massapicom. 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.