当前位置: 首页>>代码示例>>Java>>正文


Java TransformerServer.start方法代码示例

本文整理汇总了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();
}
 
开发者ID:fusepoolP3,项目名称:p3-batchrefine,代码行数:18,代码来源:BatchRefineTransformerCLI.java

示例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();
}
 
开发者ID:fusepoolP3,项目名称:p3-dictionary-matcher-transformer,代码行数:32,代码来源:Main.java

示例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();
            }
        }
    });
}
 
开发者ID:fusepoolP3,项目名称:p3-dictionary-matcher-transformer,代码行数:17,代码来源:TransformerTest.java

示例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());
}
 
开发者ID:fusepoolP3,项目名称:p3-silkdedup,代码行数:23,代码来源:DuplicatesTransformerTest.java

示例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());
   
}
 
开发者ID:fusepoolP3,项目名称:p3-silkdedup,代码行数:19,代码来源:SilkConfigTest.java

示例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();
    }
}
 
开发者ID:fusepoolP3,项目名称:p3-transformer-howto,代码行数:23,代码来源:SedTransformer.java

示例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() );
}
 
开发者ID:fusepoolP3,项目名称:p3-osm-transformer,代码行数:14,代码来源:OsmRdfTransformerTest.java

示例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();
}
 
开发者ID:fusepoolP3,项目名称:p3-pipeline-transformer,代码行数:20,代码来源:Main.java

示例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());
   
}
 
开发者ID:fusepoolP3,项目名称:p3-geo-enriching-transformer,代码行数:13,代码来源:GeoEnrichingTransformerTest.java

示例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();
}
 
开发者ID:fusepoolP3,项目名称:p3-osm-transformer,代码行数:6,代码来源:Main.java

示例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);
}
 
开发者ID:fusepoolP3,项目名称:p3-batchrefine,代码行数:7,代码来源:TestSupport.java

示例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();
}
 
开发者ID:fusepoolP3,项目名称:p3-geo-enriching-transformer,代码行数:6,代码来源:Main.java

示例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();
}
 
开发者ID:fusepoolP3,项目名称:p3-silkdedup,代码行数:10,代码来源:Main.java


注:本文中的eu.fusepool.p3.transformer.server.TransformerServer.start方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。