本文整理汇总了Java中eu.fusepool.p3.transformer.server.TransformerServer.start方法的典型用法代码示例。如果您正苦于以下问题:Java TransformerServer.start方法的具体用法?Java TransformerServer.start怎么用?Java TransformerServer.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eu.fusepool.p3.transformer.server.TransformerServer
的用法示例。
在下文中一共展示了TransformerServer.start方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: start
import eu.fusepool.p3.transformer.server.TransformerServer; //导入方法依赖的package包/类
private void start() throws Exception {
TransformerServer server = new TransformerServer(fPort, fCORS);
switch (fTransformer) {
case sync:
server.start(new SynchronousTransformer(cmd.getEngine(), cmd.getExporterProperties()));
break;
case async:
server.start(new AsynchronousTransformer(cmd.getAsyncEngine()));
break;
}
server.join();
}
示例2: start
import eu.fusepool.p3.transformer.server.TransformerServer; //导入方法依赖的package包/类
/**
* Starts the transformer server.
*
* @param arguments contains the port on which the server will listen
* @throws Exception
*/
private static void start(Arguments arguments) throws Exception {
TransformerServer server = new TransformerServer(arguments.getPort(), arguments.enableCors());
// create the singleton instance of Serializer
Serializer.getInstance();
// create the singleton instance of Parser
Parser.getInstance();
server.start(
new TransformerFactory() {
@Override
public Transformer getTransformer(HttpServletRequest request) {
switch (request.getMethod()) {
case "GET":
return new DictionaryMatcherTransformer();
case "POST":
return new DictionaryMatcherTransformer(request.getQueryString());
default:
throw new TransformerException(HttpServletResponse.SC_METHOD_NOT_ALLOWED, "ERROR: Method \"" + request.getMethod() + "\" is not allowed!");
}
}
});
server.join();
}
示例3: setUp
import eu.fusepool.p3.transformer.server.TransformerServer; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
final int port = findFreePort();
baseURI = "http://localhost:" + port + "/";
TransformerServer server = new TransformerServer(port, false);
server.start(new TransformerFactory() {
@Override
public Transformer getTransformer(HttpServletRequest request) {
if (StringUtils.isNotEmpty(request.getQueryString())) {
return new DictionaryMatcherTransformer(request.getQueryString());
} else {
return new DictionaryMatcherTransformer();
}
}
});
}
示例4: setUp
import eu.fusepool.p3.transformer.server.TransformerServer; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
// load the SILK config file
mockSilkConfig = IOUtils.toByteArray(getClass().getResourceAsStream(MOCK_SILK));
ttlFile = FileUtil.inputStreamToFile(getClass().getResourceAsStream("testfoaf.ttl"), "test-", ".ttl");
InputStream inttl = new FileInputStream(ttlFile);
ttlData = IOUtils.toByteArray(inttl);
inttl.close();
rdfFile = FileUtil.inputStreamToFile(getClass().getResourceAsStream("testfoaf.rdf"), "test-", ".rdf");
InputStream inrdf = new FileInputStream(rdfFile);
rdfData = IOUtils.toByteArray(inrdf);
inrdf.close();
final int port = findFreePort();
baseUri = "http://localhost:" + port + "/";
RestAssured.baseURI = "http://localhost:" + port + "/";
TransformerServer server = new TransformerServer(port);
server.start(new DuplicatesTransformer());
}
示例5: setUp
import eu.fusepool.p3.transformer.server.TransformerServer; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
ttlFile = FileUtil.inputStreamToFile(getClass().getResourceAsStream("testfoaf.ttl"), "test-", ".ttl");
//ttlFile = FileUtil.inputStreamToFile(getClass().getResourceAsStream("eventi.ttl"), "test-", ".ttl");
InputStream inttl = new FileInputStream(ttlFile);
ttlData = IOUtils.toByteArray(inttl);
inttl.close();
silkconf = IOUtils.toByteArray(getClass().getResourceAsStream("silk-config-file.xml"));
//silkconf = IOUtils.toByteArray(getClass().getResourceAsStream("silk-config-dbpedia.xml"));
final int transformerServerPort = findFreePort();
transformerBaseUri = "http://localhost:" + transformerServerPort + "/";
RestAssured.baseURI = transformerBaseUri;
TransformerServer server = new TransformerServer(transformerServerPort);
server.start(new DuplicatesTransformer());
}
示例6: _main
import eu.fusepool.p3.transformer.server.TransformerServer; //导入方法依赖的package包/类
public void _main(String[] args) throws Exception {
CmdLineParser parser = new CmdLineParser(this);
try {
parser.parseArgument(args);
} catch (CmdLineException e) {
parser.printUsage(System.out);
System.exit(-1);
}
TransformerServer server = new TransformerServer(fPort, false);
if (fType.equals(Transformer.sync))
server.start(new SedTransformer());
else
server.start(new AsyncSedTransformer());
try {
server.join();
} catch (InterruptedException ex) {
fLogger.error("Internal error: ", ex);
Thread.currentThread().interrupt();
}
}
示例7: setUp
import eu.fusepool.p3.transformer.server.TransformerServer; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
// load the input data
inputData = IOUtils.toByteArray(getClass().getResourceAsStream(INPUT_DATA));
//load the xml data
xmlData = IOUtils.toByteArray(getClass().getResourceAsStream(XML_DATA));
// set up the transformer
transformerServerPort = findFreePort();
transformerBaseUri = "http://localhost:" + transformerServerPort + "/";
RestAssured.baseURI = transformerBaseUri;
TransformerServer server = new TransformerServer(transformerServerPort, false);
server.start( new OsmTransformerFactory() );
}
示例8: start
import eu.fusepool.p3.transformer.server.TransformerServer; //导入方法依赖的package包/类
/**
* Starts the transformer server.
*
* @param arguments contains the port on which the server will listen
* @throws Exception
*/
private static void start(Arguments arguments) throws Exception {
TransformerServer server = new TransformerServer(arguments.getPort(), arguments.enableCors());
server.start(
new TransformerFactory() {
@Override
public Transformer getTransformer(HttpServletRequest request) {
return new PipelineTransformer(request.getQueryString(), request.getHeader("Accept"));
}
});
server.join();
}
示例9: setUp
import eu.fusepool.p3.transformer.server.TransformerServer; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
mockServerDataSet1 = IOUtils.toByteArray(getClass().getResourceAsStream("farmacie-trentino-uuid.ttl"));
mockServerDataSet2 = IOUtils.toByteArray(getClass().getResourceAsStream("local-business-trento-uuid.ttl"));
final int transformerServerPort = findFreePort();
transformerBaseUri = "http://localhost:" + transformerServerPort + "/";
RestAssured.baseURI = transformerBaseUri;
TransformerServer server = new TransformerServer(transformerServerPort);
server.start(new GeoEnrichingTransformerFactory());
}
示例10: start
import eu.fusepool.p3.transformer.server.TransformerServer; //导入方法依赖的package包/类
private static void start(Arguments arguments) throws Exception {
TransformerServer server = new TransformerServer(arguments.getPort(), false);
server.start(new OsmTransformerFactory());
server.join();
}
示例11: startTransformerServer
import eu.fusepool.p3.transformer.server.TransformerServer; //导入方法依赖的package包/类
private void startTransformerServer(Transformer transformer) throws Exception {
final int port = findFreePort();
RestAssured.baseURI = "http://localhost:" + port + "/";
TransformerServer server = new TransformerServer(port, false);
server.start(transformer);
}
示例12: start
import eu.fusepool.p3.transformer.server.TransformerServer; //导入方法依赖的package包/类
private static void start(Arguments arguments) throws Exception {
TransformerServer server = new TransformerServer(arguments.getPort());
server.start(new GeoEnrichingTransformerFactory());
server.join();
}
示例13: start
import eu.fusepool.p3.transformer.server.TransformerServer; //导入方法依赖的package包/类
private static void start(Arguments arguments) throws Exception {
TransformerServer server = new TransformerServer(arguments.getPort());
//InputStream in = Main.class.getResourceAsStream("bla.txt");
server.start( new DuplicatesTransformerFactory() );
server.join();
}