Package org.jboss.dna.graph.observe

Examples of org.jboss.dna.graph.observe.Observer


                return originalConnectionFactory.createConnection(sourceName);
            }
        };

        // Create an observer so that we know what changes are being made in the delegate ...
        final Observer observer = new Observer() {
            /**
             * {@inheritDoc}
             *
             * @see org.jboss.dna.graph.observe.Observer#notify(org.jboss.dna.graph.observe.Changes)
             */
 
View Full Code Here



    PathRequestProcessor createRequestProcessor( ExecutionContext context,
                                                 PathRepositorySource source ) {
        RepositoryContext repositoryContext = source.getRepositoryContext();
        Observer observer = repositoryContext != null ? repositoryContext.getObserver() : null;
        boolean updatesAllowed = source.areUpdatesAllowed();

        /**
         * Read-only implementations can use a NOP transaction.
         */
 
View Full Code Here

                    this.configuration = loadRepository(name, repositoryContext);
                }
                config = this.configuration;
            }
        }
        Observer observer = this.context != null ? this.context.getObserver() : null;
        return new FederatedRepositoryConnection(config, observer);
    }
View Full Code Here

            sw = new Stopwatch();
            sw.start();
        }
        // Do any commands update/write?
        RepositoryContext repositoryContext = this.source.getRepositoryContext();
        Observer observer = repositoryContext != null ? repositoryContext.getObserver() : null;
        RequestProcessor processor = new MapRequestProcessor(context, this.repository, observer, source.areUpdatesAllowed());

        boolean commit = true;
        MapRepositoryTransaction txn = repository.startTransaction(request.isReadOnly());
        try {
View Full Code Here

            final Iterator<Observer> observerIterator = observers.iterator();

            Runnable sender = new Runnable() {
                public void run() {
                    while (observerIterator.hasNext()) {
                        Observer observer = observerIterator.next();
                        assert observer != null;
                        observer.notify(changes);
                    }
                }
            };

            // Now let the executor service run this in another thread ...
View Full Code Here

                                                  indexRules, analyzer);

            // Set up an original source observer to keep the index up to date ...
            if (updateIndexesSynchronously) {
                this.service = null;
                this.searchObserver = new Observer() {
                    @SuppressWarnings( "synthetic-access" )
                    public void notify( Changes changes ) {
                        if (changes.getSourceName().equals(sourceName)) {
                            process(changes);
                        }
                    }
                };
            } else {
                // It's asynchronous, so create a single-threaded executor and an observer that enqueues the results
                this.service = Executors.newCachedThreadPool();
                this.searchObserver = new Observer() {
                    @SuppressWarnings( "synthetic-access" )
                    public void notify( final Changes changes ) {
                        if (changes.getSourceName().equals(sourceName)) {
                            service.submit(new Runnable() {
                                public void run() {
View Full Code Here

                    this.configuration = loadRepository(name, repositoryContext);
                }
                config = this.configuration;
            }
        }
        Observer observer = this.context != null ? this.context.getObserver() : null;
        return new FederatedRepositoryConnection(config, observer);
    }
View Full Code Here

            public RepositoryConnectionFactory getRepositoryConnectionFactory() {
                return connectionFactory;
            }

            public Observer getObserver() {
                return new Observer() {
                    public void notify( Changes changes ) {
                        // -----------------------------------------------------------
                        // NOTE THAT THE SEARCH ENGINE IS UPDATED IN-THREAD !!!!!!!!!!
                        // -----------------------------------------------------------
                        // This means the indexing should be done before the graph operations return
View Full Code Here

TOP

Related Classes of org.jboss.dna.graph.observe.Observer

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.