// Path: openqa.engine/src/main/java/org/aksw/openqa/component/object/IParams.java
// public interface IParams extends IObject {
// 	public IComponent getSource();
// }
// 
// Path: openqa.engine/src/main/java/org/aksw/openqa/component/object/IResult.java
// public interface IResult extends IParams {
// 	public IParams getInputParam();
// }
// 
// Path: openqa.engine/src/main/java/org/aksw/openqa/component/providers/impl/InterpreterProvider.java
// public class InterpreterProvider extends PluginProcessProvider<Interpreter, IInterpreterFactory> {
//     public InterpreterProvider(List<? extends ClassLoader> classLoaders, ServiceProvider serviceProvider) {
// 		super(IInterpreterFactory.class, classLoaders, serviceProvider);
// 	}
//     
//     public InterpreterProvider() {    	
//     }
// }
// 
// Path: openqa.engine/src/main/java/org/aksw/openqa/component/providers/impl/ServiceProvider.java
// public class ServiceProvider extends AbstractPluginProvider<IService, IServiceFactory> {
// 	public ServiceProvider(List<? extends ClassLoader> classLoaders) {
// 		super(IServiceFactory.class, classLoaders, null);
// 	}
// 	
// 	public ServiceProvider() {
// 	}
// }
// 
// Path: openqa.engine/src/main/java/org/aksw/openqa/component/providers/impl/SynthesizerProvider.java
// public class SynthesizerProvider extends PluginProcessProvider<ISynthesizer, ISynthesizerFactory> {
// 	public SynthesizerProvider(List<? extends ClassLoader> classLoaders, ServiceProvider serviceProvider) {
// 		super(ISynthesizerFactory.class, classLoaders, serviceProvider);
// 	}
// 	
// 	public SynthesizerProvider() {		
// 	}
// }
// 
// Path: openqa.engine/src/main/java/org/aksw/openqa/component/ui/render/InfoGraphRender.java
// public interface InfoGraphRender extends IRender, IPlugin {
// 	public boolean canRender(IContext context, InfoNode node) throws Exception;
// }


import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import javax.servlet.ServletOutputStream;
import org.aksw.openqa.component.IPlugin;
import org.aksw.openqa.component.IProvider;
import org.aksw.openqa.component.context.IContext;
import org.aksw.openqa.component.object.IParams;
import org.aksw.openqa.component.object.IResult;
import org.aksw.openqa.component.object.Params;
import org.aksw.openqa.component.providers.impl.InterpreterProvider;
import org.aksw.openqa.component.providers.impl.RenderProvider;
import org.aksw.openqa.component.providers.impl.ResolverProvider;
import org.aksw.openqa.component.providers.impl.RetrieverProvider;
import org.aksw.openqa.component.providers.impl.ServiceProvider;
import org.aksw.openqa.component.providers.impl.SynthesizerProvider;
import org.aksw.openqa.component.ui.render.InfoGraphRender;
import org.aksw.openqa.component.ui.render.InfoNode;
import org.apache.log4j.Logger;
			logger.info("Parameterizing");
			
			// param set
			for(Entry<String, Object> entry : processParams.entrySet())
				token.setParam(entry.getKey(), entry.getValue());
			
			List<IParams> params = new ArrayList<IParams>();
			params.add(token);
			
			logger.debug("Interpreting");
			// Input Interpreter
			InterpreterProvider interpreterProvider = (InterpreterProvider) providers.get(InterpreterProvider.class);
			List<? extends IParams> interpretations = interpreterProvider.process(params, serviceProvider, context);
			logger.debug("Number of interpretations: " + interpretations.size());
			
			logger.debug("Retrieving ");
			// Processing
			RetrieverProvider retrieverProvider = (RetrieverProvider) providers.get(RetrieverProvider.class);
			List<? extends IParams> consultResults = retrieverProvider.process(interpretations, serviceProvider, context);	
			logger.debug("Number of consult results: " + consultResults.size());
			
			logger.debug("Synthesizing");
			// Synthesizing
			SynthesizerProvider synthesizerProvider = (SynthesizerProvider) providers.get(SynthesizerProvider.class);
			List<? extends IParams> syntheses = synthesizerProvider.process(consultResults, serviceProvider, context);
			logger.debug("Number of syntheses: " + syntheses.size());
			
			logger.debug("Resolving");
			// Resolving
			ResolverProvider resolverProvider = (ResolverProvider) providers.get(ResolverProvider.class);
// Path: openqa.engine/src/main/java/org/aksw/openqa/component/object/IParams.java
// public interface IParams extends IObject {
// 	public IComponent getSource();
// }
// 
// Path: openqa.engine/src/main/java/org/aksw/openqa/component/object/IResult.java
// public interface IResult extends IParams {
// 	public IParams getInputParam();
// }
// 
// Path: openqa.engine/src/main/java/org/aksw/openqa/component/providers/impl/InterpreterProvider.java
// public class InterpreterProvider extends PluginProcessProvider<Interpreter, IInterpreterFactory> {
//     public InterpreterProvider(List<? extends ClassLoader> classLoaders, ServiceProvider serviceProvider) {
// 		super(IInterpreterFactory.class, classLoaders, serviceProvider);
// 	}
//     
//     public InterpreterProvider() {    	
//     }
// }
// 
// Path: openqa.engine/src/main/java/org/aksw/openqa/component/providers/impl/ServiceProvider.java
// public class ServiceProvider extends AbstractPluginProvider<IService, IServiceFactory> {
// 	public ServiceProvider(List<? extends ClassLoader> classLoaders) {
// 		super(IServiceFactory.class, classLoaders, null);
// 	}
// 	
// 	public ServiceProvider() {
// 	}
// }
// 
// Path: openqa.engine/src/main/java/org/aksw/openqa/component/providers/impl/SynthesizerProvider.java
// public class SynthesizerProvider extends PluginProcessProvider<ISynthesizer, ISynthesizerFactory> {
// 	public SynthesizerProvider(List<? extends ClassLoader> classLoaders, ServiceProvider serviceProvider) {
// 		super(ISynthesizerFactory.class, classLoaders, serviceProvider);
// 	}
// 	
// 	public SynthesizerProvider() {		
// 	}
// }
// 
// Path: openqa.engine/src/main/java/org/aksw/openqa/component/ui/render/InfoGraphRender.java
// public interface InfoGraphRender extends IRender, IPlugin {
// 	public boolean canRender(IContext context, InfoNode node) throws Exception;
// }


// Path: openqa.webserver/src/main/java/org/aksw/openqa/OpenQA.java
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import javax.servlet.ServletOutputStream;
import org.aksw.openqa.component.IPlugin;
import org.aksw.openqa.component.IProvider;
import org.aksw.openqa.component.context.IContext;
import org.aksw.openqa.component.object.IParams;
import org.aksw.openqa.component.object.IResult;
import org.aksw.openqa.component.object.Params;
import org.aksw.openqa.component.providers.impl.InterpreterProvider;
import org.aksw.openqa.component.providers.impl.RenderProvider;
import org.aksw.openqa.component.providers.impl.ResolverProvider;
import org.aksw.openqa.component.providers.impl.RetrieverProvider;
import org.aksw.openqa.component.providers.impl.ServiceProvider;
import org.aksw.openqa.component.providers.impl.SynthesizerProvider;
import org.aksw.openqa.component.ui.render.InfoGraphRender;
import org.aksw.openqa.component.ui.render.InfoNode;
import org.apache.log4j.Logger;

			logger.info("Parameterizing");
			
			// param set
			for(Entry<String, Object> entry : processParams.entrySet())
				token.setParam(entry.getKey(), entry.getValue());
			
			List<IParams> params = new ArrayList<IParams>();
			params.add(token);
			
			logger.debug("Interpreting");
			// Input Interpreter
			InterpreterProvider interpreterProvider = (InterpreterProvider) providers.get(InterpreterProvider.class);
			List<? extends IParams> interpretations = interpreterProvider.process(params, serviceProvider, context);
			logger.debug("Number of interpretations: " + interpretations.size());
			
			logger.debug("Retrieving ");
			// Processing
			RetrieverProvider retrieverProvider = (RetrieverProvider) providers.get(RetrieverProvider.class);
			List<? extends IParams> consultResults = retrieverProvider.process(interpretations, serviceProvider, context);	
			logger.debug("Number of consult results: " + consultResults.size());
			
			logger.debug("Synthesizing");
			// Synthesizing
			SynthesizerProvider synthesizerProvider = (SynthesizerProvider) providers.get(SynthesizerProvider.class);
			List<? extends IParams> syntheses = synthesizerProvider.process(consultResults, serviceProvider, context);
			logger.debug("Number of syntheses: " + syntheses.size());
			
			logger.debug("Resolving");
			// Resolving
			ResolverProvider resolverProvider = (ResolverProvider) providers.get(ResolverProvider.class);
			List<? extends IResult> resolved = resolverProvider.process(syntheses, serviceProvider, context);