Package org.richfaces.resource.optimizer.resource.writer.impl

Examples of org.richfaces.resource.optimizer.resource.writer.impl.ResourceWriterImpl


            }

            faces = new FacesImpl(null, new FileNameMapperImpl(fileNameMappings), dynamicResourceHandler);
            faces.start();

            ResourceWriterImpl resourceWriter = new ResourceWriterImpl(new File(resourcesOutputDir), getDefaultResourceProcessors(), log, resourcesWithKnownOrder);
            ResourceTaskFactoryImpl taskFactory = new ResourceTaskFactoryImpl(faces, pack);
            taskFactory.setResourceWriter(resourceWriter);

            executorService = createExecutorService();
            CompletionService<Object> completionService = new CountingExecutorCompletionService<Object>(executorService);
            taskFactory.setCompletionService(completionService);
            taskFactory.setSkins(Iterables.toArray(Constants.COMMA_SPLITTER.split(skins), String.class));
            taskFactory.setLog(log);
            taskFactory.setFilter(createResourcesFilter());
            taskFactory.submit(foundResources);

            log.debug(completionService.toString());

            Future<Object> future = null;
            while (true) {
                future = completionService.take();
                if (future != null) {
                    try {
                        future.get();
                    } catch (ExecutionException e) {
                        log.error(e);
                    }
                } else {
                    break;
                }
            }

            log.debug(completionService.toString());

            resourceWriter.writeProcessedResourceMappings(new File(staticResourceMappingFile), staticResourcePrefix);
            resourceWriter.close();

        } catch (Exception e) {
            throw new IllegalStateException(e.getMessage(), e);
        } finally {
View Full Code Here


            }

            faces = new FacesImpl(null, new FileNameMapperImpl(fileNameMappings), dynamicResourceHandler);
            faces.start();

            ResourceWriterImpl resourceWriter = new ResourceWriterImpl(new File(resourcesOutputDir),
                getDefaultResourceProcessors(), getLogger(), resourcesWithKnownOrder);
            ResourceTaskFactoryImpl taskFactory = new ResourceTaskFactoryImpl(faces, pack);
            taskFactory.setResourceWriter(resourceWriter);

            executorService = createExecutorService();
            CompletionService<Object> completionService = new CountingExecutorCompletionService<Object>(executorService);
            taskFactory.setCompletionService(completionService);
            taskFactory.setSkins(skins);
            taskFactory.setLog(getLogger());
            taskFactory.setFilter(createResourcesFilter());
            taskFactory.submit(foundResources);

            getLog().debug(completionService.toString());

            Future<Object> future = null;
            while (true) {
                future = completionService.take();
                if (future != null) {
                    try {
                        future.get();
                    } catch (ExecutionException e) {
                        getLog().error(e);
                    }
                } else {
                    break;
                }
            }

            getLog().debug(completionService.toString());

            resourceWriter.writeProcessedResourceMappings(new File(staticResourceMappingFile), staticResourcePrefix);
            resourceWriter.close();
        } catch (Exception e) {
            throw new MojoExecutionException(e.getMessage(), e);
        } finally {

            if (cpResources != null) {
View Full Code Here

TOP

Related Classes of org.richfaces.resource.optimizer.resource.writer.impl.ResourceWriterImpl

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.