Package org.jboss.dna.graph.observe

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


            } finally {
                this.sourcesLock.readLock().unlock();
            }
        }
        // Create a repository context for this source ...
        final ObservationBus observationBus = this.observationBus;
        RepositoryContext repositoryContext = new RepositoryContext() {
            /**
             * {@inheritDoc}
             *
             * @see org.jboss.dna.graph.connector.RepositoryContext#getExecutionContext()
             */
            public ExecutionContext getExecutionContext() {
                return RepositoryLibrary.this.getExecutionContext();
            }

            /**
             * {@inheritDoc}
             *
             * @see org.jboss.dna.graph.connector.RepositoryContext#getRepositoryConnectionFactory()
             */
            public RepositoryConnectionFactory getRepositoryConnectionFactory() {
                return RepositoryLibrary.this;
            }

            /**
             * {@inheritDoc}
             *
             * @see org.jboss.dna.graph.connector.RepositoryContext#getObserver()
             */
            public Observer getObserver() {
                return observationBus.hasObservers() ? observationBus : null;
            }

            /**
             * {@inheritDoc}
             *
 
View Full Code Here


        // Add an extension-based detector by default ...
        detectors.addDetector(new MimeTypeDetectorConfig("ExtensionDetector", "Extension-based MIME type detector",
                                                         ExtensionBasedMimeTypeDetector.class));

        // Create the RepositoryContext that the configuration repository source should use ...
        ObservationBus configurationChangeBus = new ObservationBus();
        RepositoryContext configContext = new SimpleRepositoryContext(context, configurationChangeBus, null);
        final RepositorySource configSource = this.configuration.getRepositorySource();
        configSource.initialize(configContext);

        // Create the RepositoryService, pointing it to the configuration repository ...
        Path pathToConfigurationRoot = this.configuration.getPath();
        String configWorkspaceName = this.configuration.getWorkspace();
        repositoryService = new RepositoryService(configSource, configWorkspaceName, pathToConfigurationRoot, context, problems);

        // Now register the repository service to be notified of changes to the configuration ...
        configurationChangeBus.register(repositoryService);

        // Create the sequencing service ...
        executorService = new ScheduledThreadPoolExecutor(10); // Use a magic number for now
        sequencingService = new SequencingService();
        sequencingService.setExecutionContext(context);
View Full Code Here

TOP

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

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.