* org.jboss.dna.graph.request.Request)
*/
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);