Examples of RequestProcessor


Examples of org.apache.wink.server.internal.RequestProcessor

        // to actually inspect the list in the 'data' object in the MessageBodyReaders in the ProvidersRegistry would take a lot of
        // reflection and hacking.  We'll at least confirm that only 5 (due to AssetProvider) are in the ProvidersRegistry.

        RestServlet servlet = (RestServlet)this.getServlet();
        ServletContext context = servlet.getServletContext();
        RequestProcessor processor = (RequestProcessor) context.getAttribute(RequestProcessor.class.getName());
        DeploymentConfiguration config = processor.getConfiguration();
        ProvidersRegistry providersRegistry = config.getProvidersRegistry();
        // to confirm that the ignores are indeed happening, I need to get the private field
        // "messageBodyReaders" object, then it's superclass "data" object and inspect it:
        Field field = providersRegistry.getClass().getDeclaredField("messageBodyReaders");
        field.setAccessible(true);
View Full Code Here

Examples of org.apache.wink.server.internal.RequestProcessor

        String requestProcessorAttribute = "MOCK_REQUEST_PROCESSOR";
        DeploymentConfiguration configuration = new DeploymentConfiguration();
        configuration.init();

        RequestProcessor requestProcessor = new RequestProcessor(configuration);

        MockServletContext servletContext = new MockServletContext();
        servletContext.setAttribute(requestProcessorAttribute, requestProcessor);

        MockServletConfig servletConfig = new MockServletConfig(servletContext);
View Full Code Here

Examples of org.apache.zookeeper.server.RequestProcessor

        return self.leader;
    }
   
    @Override
    protected void setupRequestProcessors() {
        RequestProcessor finalProcessor = new FinalRequestProcessor(this);
        RequestProcessor toBeAppliedProcessor = new Leader.ToBeAppliedRequestProcessor(
                finalProcessor, getLeader().toBeApplied);
        commitProcessor = new CommitProcessor(toBeAppliedProcessor,
                Long.toString(getServerId()), false);
        commitProcessor.start();
        RequestProcessor proposalProcessor = new ProposalRequestProcessor(this,
                commitProcessor);
        firstProcessor = new PrepRequestProcessor(this, proposalProcessor);
        ((PrepRequestProcessor)firstProcessor).start();
    }
View Full Code Here

Examples of org.apache.zookeeper.server.RequestProcessor

        return self.leader;
    }
   
    @Override
    protected void setupRequestProcessors() {
        RequestProcessor finalProcessor = new FinalRequestProcessor(this);
        RequestProcessor toBeAppliedProcessor = new Leader.ToBeAppliedRequestProcessor(
                finalProcessor, getLeader().toBeApplied);
        commitProcessor = new CommitProcessor(toBeAppliedProcessor,
                Long.toString(getServerId()), false);
        commitProcessor.start();
        ProposalRequestProcessor proposalProcessor = new ProposalRequestProcessor(this,
View Full Code Here

Examples of org.apache.zookeeper.server.RequestProcessor

        return self.follower;
    }     

    @Override
    protected void setupRequestProcessors() {
        RequestProcessor finalProcessor = new FinalRequestProcessor(this);
        commitProcessor = new CommitProcessor(finalProcessor,
                Long.toString(getServerId()), true);
        commitProcessor.start();
        firstProcessor = new FollowerRequestProcessor(this, commitProcessor);
        ((FollowerRequestProcessor) firstProcessor).start();
View Full Code Here

Examples of org.apache.zookeeper.server.RequestProcessor

    @Override
    protected void setupRequestProcessors() {     
        // We might consider changing the processor behaviour of
        // Observers to, for example, remove the disk sync requirements.
        // Currently, they behave almost exactly the same as followers.
        RequestProcessor finalProcessor = new FinalRequestProcessor(this);
        commitProcessor = new CommitProcessor(finalProcessor,
                Long.toString(getServerId()), true);
        commitProcessor.start();
        firstProcessor = new ObserverRequestProcessor(this, commitProcessor);
        ((ObserverRequestProcessor) firstProcessor).start();
View Full Code Here

Examples of org.apache.zookeeper.server.RequestProcessor

        return self.leader;
    }
   
    @Override
    protected void setupRequestProcessors() {
        RequestProcessor finalProcessor = new FinalRequestProcessor(this);
        RequestProcessor toBeAppliedProcessor = new Leader.ToBeAppliedRequestProcessor(
                finalProcessor, getLeader().toBeApplied);
        commitProcessor = new CommitProcessor(toBeAppliedProcessor,
                Long.toString(getServerId()), false);
        commitProcessor.start();
        ProposalRequestProcessor proposalProcessor = new ProposalRequestProcessor(this,
View Full Code Here

Examples of org.jboss.dna.graph.request.processor.RequestProcessor

         */
        public void execute( ExecutionContext context,
                             Request request ) throws RepositorySourceException {
            if (request instanceof AccessQueryRequest) {
                AccessQueryRequest queryRequest = (AccessQueryRequest)request;
                RequestProcessor searchProcessor = searchEngine().createProcessor(context, null, true);
                try {
                    searchProcessor.process(queryRequest);
                } finally {
                    searchProcessor.close();
                }
            } else if (request instanceof FullTextSearchRequest) {
                FullTextSearchRequest searchRequest = (FullTextSearchRequest)request;
                RequestProcessor searchProcessor = searchEngine().createProcessor(context, null, true);
                try {
                    searchProcessor.process(searchRequest);
                } finally {
                    searchProcessor.close();
                }
            } else if (request instanceof CompositeRequest) {
                CompositeRequest composite = (CompositeRequest)request;
                CompositeRequestChannel channel = null;
                RequestProcessor searchProcessor = null;
                try {
                    for (Request nested : composite) {
                        if (nested instanceof AccessQueryRequest) {
                            AccessQueryRequest queryRequest = (AccessQueryRequest)request;
                            if (searchProcessor == null) searchProcessor = searchEngine().createProcessor(context, null, true);
                            searchProcessor.process(queryRequest);
                        } else if (nested instanceof FullTextSearchRequest) {
                            FullTextSearchRequest searchRequest = (FullTextSearchRequest)request;
                            if (searchProcessor == null) searchProcessor = searchEngine().createProcessor(context, null, true);
                            searchProcessor.process(searchRequest);
                        } else {
                            // Delegate to the channel ...
                            if (channel == null) {
                                // Create a connection factory that always returns the delegate connection ...
                                RepositoryConnectionFactory connectionFactory = new RepositoryConnectionFactory() {
                                    /**
                                     * {@inheritDoc}
                                     *
                                     * @see org.jboss.dna.graph.connector.RepositoryConnectionFactory#createConnection(java.lang.String)
                                     */
                                    public RepositoryConnection createConnection( String sourceName )
                                        throws RepositorySourceException {
                                        assert delegate().getName().equals(sourceName);
                                        return delegateConnection();
                                    }
                                };
                                channel = new CompositeRequestChannel(delegate().getName());
                                channel.start(executorService, context, connectionFactory);
                            }
                            channel.add(request);
                        }
                    }
                } finally {
                    try {
                        if (searchProcessor != null) {
                            searchProcessor.close();
                        }
                    } finally {
                        if (channel != null) {
                            try {
                                channel.close();
View Full Code Here

Examples of org.jboss.dna.graph.request.processor.RequestProcessor

         */
        public void execute( final ExecutionContext context,
                             final Request request ) throws RepositorySourceException {
            if (request instanceof AccessQueryRequest) {
                AccessQueryRequest queryRequest = (AccessQueryRequest)request;
                RequestProcessor searchProcessor = searchEngine().createProcessor(context, null, true);
                try {
                    searchProcessor.process(queryRequest);
                } finally {
                    searchProcessor.close();
                }
            } else if (request instanceof FullTextSearchRequest) {
                FullTextSearchRequest searchRequest = (FullTextSearchRequest)request;
                RequestProcessor searchProcessor = searchEngine().createProcessor(context, null, true);
                try {
                    searchProcessor.process(searchRequest);
                } finally {
                    searchProcessor.close();
                }
            } else if (request instanceof CompositeRequest) {
                CompositeRequest composite = (CompositeRequest)request;
                List<Request> delegateRequests = null;
                RequestProcessor searchProcessor = null;
                try {
                    Request delegateRequest = composite;
                    for (Request nested : composite) {
                        if (nested instanceof AccessQueryRequest) {
                            AccessQueryRequest queryRequest = (AccessQueryRequest)request;
                            if (searchProcessor == null) searchProcessor = searchEngine().createProcessor(context, null, true);
                            searchProcessor.process(queryRequest);
                            delegateRequest = null;
                        } else if (nested instanceof FullTextSearchRequest) {
                            FullTextSearchRequest searchRequest = (FullTextSearchRequest)request;
                            if (searchProcessor == null) searchProcessor = searchEngine().createProcessor(context, null, true);
                            searchProcessor.process(searchRequest);
                            delegateRequest = null;
                        } else {
                            // Delegate the request ...
                            if (delegateRequests == null) {
                                delegateRequests = new LinkedList<Request>();
                            }
                            delegateRequests.add(request);
                        }
                    }
                    if (delegateRequest == null) {
                        // Then there was at least one query or search request ...
                        if (delegateRequests != null) {
                            // There was other requests ...
                            assert !delegateRequests.isEmpty();
                            delegateRequest = CompositeRequest.with(delegateRequests);
                            delegateConnection().execute(context, delegateRequest);
                        } else {
                            // There were no other requests in the composite other than the search and/or query requests ...
                            // So nothing to do ...
                        }
                    } else {
                        // There were no search or query requests, so delegate the orginal composite request ...
                        delegateConnection().execute(context, request);
                    }
                } finally {
                    if (searchProcessor != null) {
                        searchProcessor.close();
                    }
                }
            } else {
                // Just a single, non-query and non-search request ...
                delegateConnection().execute(context, request);
View Full Code Here

Examples of org.jboss.dna.graph.request.processor.RequestProcessor

     *      org.jboss.dna.graph.request.Request)
     */
    public void execute( final ExecutionContext context,
                         final Request request ) throws RepositorySourceException {

        RequestProcessor processor = new SVNRepositoryRequestProcessor(sourceName, defaultWorkspace, availableWorkspaceNames,
                                                                       creatingWorkspacesAllowed, context, updatesAllowed,
                                                                       accessData);
        try {
            processor.process(request);
        } finally {
            processor.close();
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.