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


Java ContainerServer类代码示例

本文整理汇总了Java中org.simpleframework.http.core.ContainerServer的典型用法代码示例。如果您正苦于以下问题:Java ContainerServer类的具体用法?Java ContainerServer怎么用?Java ContainerServer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ContainerServer类属于org.simpleframework.http.core包,在下文中一共展示了ContainerServer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startServer

import org.simpleframework.http.core.ContainerServer; //导入依赖的package包/类
/**
 * Will start the Server Mock as well as the RabbitMQ Listener
 * 
 * @throws IOException
 * @throws IguanaException
 * @throws TimeoutException
 */
@BeforeClass
public static void startServer() throws IOException, IguanaException, TimeoutException {
	// start ServerMock
	mock = new StresstestServerMock();
	fastServer = new ContainerServer(mock);
	fastConnection = new SocketConnection(fastServer);
	address1 = new InetSocketAddress(8024);
	fastConnection.connect(address1);
	// start RabbitMQ listener
	// queue declare
	ConnectionFactory factory = new ConnectionFactory();
	factory.setHost("localhost");
	connection = factory.newConnection();
	channel = connection.createChannel();

	channel.queueDeclare(COMMON.CORE2RP_QUEUE_NAME, false, false, false, null);
}
 
开发者ID:dice-group,项目名称:IGUANA,代码行数:25,代码来源:StresstestTest.java

示例2: metaTest

import org.simpleframework.http.core.ContainerServer; //导入依赖的package包/类
/**
 * @throws IOException
 */
@Test
public void metaTest() throws IOException{
	fastServerContainer = new ServerMock();
       fastServer = new ContainerServer(fastServerContainer);
       fastConnection = new SocketConnection(fastServer);
       SocketAddress address1 = new InetSocketAddress(FAST_SERVER_PORT);
       fastConnection.connect(address1);
       
       String host = "http://localhost:8023";
       TriplestoreStorage store = new TriplestoreStorage(host, host);
       Properties p = new Properties();
	p.put(COMMON.EXPERIMENT_TASK_ID_KEY, "1/1/1");
    p.setProperty(COMMON.EXPERIMENT_ID_KEY, "1/1");
    p.setProperty(COMMON.CONNECTION_ID_KEY, "virtuoso");
    p.setProperty(COMMON.SUITE_ID_KEY, "1");
    p.setProperty(COMMON.DATASET_ID_KEY, "dbpedia");
    p.put(COMMON.RECEIVE_DATA_START_KEY, "true");
    p.put(COMMON.EXTRA_META_KEY, new Properties());
    p.put(COMMON.NO_OF_QUERIES, 2);
       store.addMetaData(p);
       
       assertEquals(metaExp.trim(), fastServerContainer.getActualContent().trim());
}
 
开发者ID:dice-group,项目名称:IGUANA,代码行数:27,代码来源:TriplestoreStorageTest.java

示例3: dataTest

import org.simpleframework.http.core.ContainerServer; //导入依赖的package包/类
/**
 * @throws IOException
 */
@Test
public void dataTest() throws IOException{
	fastServerContainer = new ServerMock();
       fastServer = new ContainerServer(fastServerContainer);
       fastConnection = new SocketConnection(fastServer);
       SocketAddress address1 = new InetSocketAddress(FAST_SERVER_PORT);
       fastConnection.connect(address1);
       
       String host = "http://localhost:8023";
       TriplestoreStorage store = new TriplestoreStorage(host, host);
       Properties p = new Properties();
       p.setProperty(COMMON.EXPERIMENT_TASK_ID_KEY, "1/1/1");
    p.put(COMMON.METRICS_PROPERTIES_KEY, "testMetric");
    p.put(COMMON.EXTRA_META_KEY, new Properties());
       
       Triple[] t = new Triple[1];
    t[0] = new Triple("a", "b", "c");
    store.addData(p, t);
    store.commit();
       assertEquals(dataExp.trim(),fastServerContainer.getActualContent().trim());
}
 
开发者ID:dice-group,项目名称:IGUANA,代码行数:25,代码来源:TriplestoreStorageTest.java

示例4: main

import org.simpleframework.http.core.ContainerServer; //导入依赖的package包/类
public static void main(String args[]) throws Exception {
    // use port if given
    try {
        port = Integer.parseInt(args[0]);
    } catch(Exception e) {
        // silently keep port at 8080
    }

    // initialize the Stanford Core NLP
    pipeline = new StanfordCoreNLP();

    // start the server
    Container container = new StanfordCoreNLPXMLServer();
    Server server = new ContainerServer(container);
    Connection connection = new SocketConnection(server);
    SocketAddress address = new InetSocketAddress(port);
    connection.connect(address);

    log.info("Initialized server at port " + port + ".");
}
 
开发者ID:nlohmann,项目名称:StanfordCoreNLPXMLServer,代码行数:21,代码来源:StanfordCoreNLPXMLServer.java

示例5: startServer

import org.simpleframework.http.core.ContainerServer; //导入依赖的package包/类
@Before
public void startServer() throws IOException {
    server = new ContainerServer(container);
    connection = new SocketConnection(server);
    SocketAddress address = new InetSocketAddress(SERVER_PORT);
    connection.connect(address);
}
 
开发者ID:dice-group,项目名称:Squirrel,代码行数:8,代码来源:AbstractServerMockUsingTest.java

示例6: startServer

import org.simpleframework.http.core.ContainerServer; //导入依赖的package包/类
@Before
public void startServer() throws IOException {
    fastServerContainer = new WaitingDocumentReturningServerMock(DOCUMENTS, 0);
    fastServer = new ContainerServer(fastServerContainer);
    fastConnection = new SocketConnection(fastServer);
    SocketAddress address1 = new InetSocketAddress(FAST_SERVER_PORT);
    fastConnection.connect(address1);
    slowServer = new ContainerServer(new WaitingDocumentReturningServerMock(DOCUMENTS, SLOW_SERVER_WAITING_TIME));
    slowConnection = new SocketConnection(slowServer);
    SocketAddress address2 = new InetSocketAddress(SLOW_SERVER_PORT);
    slowConnection.connect(address2);
}
 
开发者ID:dice-group,项目名称:gerbil,代码行数:13,代码来源:HttpBasedAnnotatorTest.java

示例7: init

import org.simpleframework.http.core.ContainerServer; //导入依赖的package包/类
@Override
public void init(DaemonContext dc) throws DaemonInitException, Exception {
    log.info("initializing ...");
    
    // Init ApiServer
    container = new ApiServer();
    server = new ContainerServer(container);
    connection = new SocketConnection(server);
    address = new InetSocketAddress(8082);
}
 
开发者ID:hlipala,项目名称:autoscaling,代码行数:11,代码来源:Main.java

示例8: main

import org.simpleframework.http.core.ContainerServer; //导入依赖的package包/类
public static void main(String[] list) throws Exception {
   Container container = new BlobStationServer();
   Server server = new ContainerServer(container);
   Connection connection = new SocketConnection(server);
   SocketAddress address = new InetSocketAddress(8080);

   connection.connect(address);   
}
 
开发者ID:blobrobotics,项目名称:bstation,代码行数:9,代码来源:BlobStationServer.java

示例9: HttpMockServer

import org.simpleframework.http.core.ContainerServer; //导入依赖的package包/类
public HttpMockServer(@Nonnull JSONObject jsonObject, @Nonnull ConfigReader configReader, @Nonnull NetworkType simulatedNetworkType)
        throws IOException, JSONException {
    ConfigResult config = new ConfigParser(configReader).parseConfig(jsonObject);
    MockNetworkLag networkLag = new MockNetworkLag(simulatedNetworkType);
    this.responseHandler = new ResponseHandler(config.responses, networkLag, configReader);
    Server server = new ContainerServer(this);
    conn = new SocketConnection(server);
    final SocketAddress sa = new InetSocketAddress(config.port);
    conn.connect(sa);
}
 
开发者ID:byoutline,项目名称:MockServer,代码行数:11,代码来源:HttpMockServer.java

示例10: setUp

import org.simpleframework.http.core.ContainerServer; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
	Server server = new ContainerServer(testContainer);
	connection = new SocketConnection(server);
	
	ServerSocket socketServer = new ServerSocket(0);
	port = socketServer.getLocalPort();
	socketServer.close();
	
	connection.connect(new InetSocketAddress(port));
}
 
开发者ID:Kixeye,项目名称:relax,代码行数:12,代码来源:AsyncRestClientTest.java

示例11: connect

import org.simpleframework.http.core.ContainerServer; //导入依赖的package包/类
public Connection connect() throws Exception {
    Server server = new ContainerServer(this);
    Connection connection = new SocketConnection(server);
    SocketAddress address = new InetSocketAddress(port);
    connection.connect(address);
    return connection;
}
 
开发者ID:bazaarvoice,项目名称:jersey-hmac-auth,代码行数:8,代码来源:ValidatingHttpServer.java

示例12: run

import org.simpleframework.http.core.ContainerServer; //导入依赖的package包/类
@Override
public void run() {
    try {
        Server server = new ContainerServer(this);
        Connection connection = new SocketConnection(server);
        SocketAddress address = new InetSocketAddress(port);
        connection.connect(address);
    } catch (IOException e) {
        e.printStackTrace();
    }
}
 
开发者ID:tarjeir,项目名称:vitus-elasticsearch-webintegration,代码行数:12,代码来源:WebServer.java

示例13: UPDATEWorkerTest

import org.simpleframework.http.core.ContainerServer; //导入依赖的package包/类
/**
 * @throws IOException
 */
public UPDATEWorkerTest() throws IOException {
	ServerMock mock = new ServerMock();
	ContainerServer fastServer = new ContainerServer(mock);
	fastConnection = new SocketConnection(fastServer);
	address1 = new InetSocketAddress(8023);
}
 
开发者ID:dice-group,项目名称:IGUANA,代码行数:10,代码来源:UPDATEWorkerTest.java

示例14: start

import org.simpleframework.http.core.ContainerServer; //导入依赖的package包/类
public void start(){
	org.simpleframework.transport.Server server;
	try {
		server = (org.simpleframework.transport.Server) new ContainerServer(reqHandler);
		@SuppressWarnings("resource")
		Connection connection = new SocketConnection(server);
	    SocketAddress address = new InetSocketAddress(port);
	    connection.connect(address);
	    System.out.println("Server runnung on port: "+port);
	} catch (IOException e) {
		e.printStackTrace();
	}
}
 
开发者ID:ael-code,项目名称:preston,代码行数:14,代码来源:Server.java

示例15: start

import org.simpleframework.http.core.ContainerServer; //导入依赖的package包/类
public void start() throws IOException {
    
    server = new FixdServer(new ContainerServer(container));
    connection = new SocketConnection(server, new LoggingAgent());
    SocketAddress address = new InetSocketAddress(port);
    
    actualConnectionAddress = (InetSocketAddress)connection.connect(address);
}
 
开发者ID:lantunes,项目名称:fixd,代码行数:9,代码来源:ServerFixture.java


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