Package org.jboss.dna.common.collection

Examples of org.jboss.dna.common.collection.Problems


     * @param connectionFactory the factory for {@link RepositoryConnection}s can be obtained; may not be null
     * @return a configuration reflecting the current state of this instance
     */
    protected synchronized FederatedRepositoryConfig getRepositoryConfiguration( ExecutionContext context,
                                                                                 RepositoryConnectionFactory connectionFactory ) {
        Problems problems = new SimpleProblems();
        ValueFactories valueFactories = context.getValueFactories();
        PathFactory pathFactory = valueFactories.getPathFactory();
        NameFactory nameFactory = valueFactories.getNameFactory();
        ValueFactory<Long> longFactory = valueFactories.getLongFactory();

View Full Code Here


        }

        JcrEngine engine = configuration.build();
        engine.start();

        Problems problems = engine.getProblems();
        // Print all of the problems from the engine configuration ...
        for (Problem problem : problems) {
            System.err.println(problem);
        }
        if (problems.hasErrors()) {
            throw new IllegalStateException("Problems starting JCR repository");
        }

        ExecutionContext executionContext = engine.getExecutionContext();
        executionContext.getNamespaceRegistry().register(TestLexicon.Namespace.PREFIX, TestLexicon.Namespace.URI);
View Full Code Here

    public PlanNode optimize( QueryContext context,
                              PlanNode plan ) {
        LinkedList<OptimizerRule> rules = new LinkedList<OptimizerRule>();
        populateRuleStack(rules, context.getHints());

        Problems problems = context.getProblems();
        while (rules.peek() != null && !problems.hasErrors()) {
            OptimizerRule nextRule = rules.poll();
            logger.debug("Running query optimizer rule {0}", nextRule);
            plan = nextRule.execute(context, plan, rules);
        }
View Full Code Here

            }

            JcrEngine engine = configuration.build();
            engine.start();

            Problems problems = engine.getProblems();
            // Print all of the problems from the engine configuration ...
            for (Problem problem : problems) {
                System.err.println(problem);
            }
            if (problems.hasErrors()) {
                throw new IllegalStateException("Problems starting JCR repository");
            }

            ExecutionContext executionContext = engine.getExecutionContext();
            executionContext.getNamespaceRegistry().register(TestLexicon.Namespace.PREFIX, TestLexicon.Namespace.URI);
View Full Code Here

     * @param connectionFactory the factory for {@link RepositoryConnection}s can be obtained; may not be null
     * @return a configuration reflecting the current state of this instance
     */
    protected synchronized FederatedRepositoryConfig getRepositoryConfiguration( ExecutionContext context,
                                                                                 RepositoryConnectionFactory connectionFactory ) {
        Problems problems = new SimpleProblems();
        ValueFactories valueFactories = context.getValueFactories();
        NameFactory nameFactory = valueFactories.getNameFactory();
        ValueFactory<Long> longFactory = valueFactories.getLongFactory();
        ProjectionParser projectionParser = ProjectionParser.getInstance();

View Full Code Here

        JcrConfiguration config = new JcrConfiguration();
        engine = config.loadFrom(JndiRepositoryFactory.class.getResourceAsStream(configResourceName)).build();
        engine.start();

        Problems problems = engine.getProblems();
        for (Problem problem : problems) {
            switch (problem.getStatus()) {
                case ERROR:
                    log.error(problem.getThrowable(), problem.getMessage(), problem.getParameters());
                    break;
                case WARNING:
                    log.warn(problem.getThrowable(), problem.getMessage(), problem.getParameters());
                    break;
                case INFO:
                    log.info(problem.getThrowable(), problem.getMessage(), problem.getParameters());
                    break;
            }
        }

        if (problems.hasErrors()) {
            throw new RepositoryException(JcrI18n.couldNotStartEngine.text());
        }
        log.info(JcrI18n.engineStarted, (System.currentTimeMillis() - start));
    }
View Full Code Here

     * @param resourceNames the name of the resources to load; these resources must be on the classpath
     * @throws IOException if an error loading or reading the any of the resources occurs
     */
    public CndNodeTypeSource( String resourceNames[] ) throws IOException {

        Problems problems = new SimpleProblems();

        // Graph creation requires a context, but there are no security implications for this and namespace mappings are
        // specified in the CND file itself
        ExecutionContext context = new ExecutionContext();
        PathFactory pathFactory = context.getValueFactories().getPathFactory();
View Full Code Here

                String sourceName = changedPath.getLastSegment().getName().getLocalName();
                getRepositoryLibrary().removeSource(sourceName);
            } else {
                // The add/change/remove is either at or below a source, so try to create a new source for it ...
                Path sourcePath = changedNodeIsPotentiallySource ? changedPath : changedPath.subpath(0, configPath.size() + 1);
                Problems problems = new SimpleProblems();
                // Now read the node and create the source ...
                Graph graph = Graph.create(getConfigurationSourceName(), getRepositoryLibrary(), getExecutionEnvironment());
                try {
                    String workspaceName = getConfigurationWorkspaceName();
                    if (workspaceName != null) graph.useWorkspace(workspaceName);
View Full Code Here

TOP

Related Classes of org.jboss.dna.common.collection.Problems

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.