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


Java StatementAgentInstanceRWLockImpl类代码示例

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


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

示例1: testCreateNoJoin

import com.espertech.esper.core.service.StatementAgentInstanceRWLockImpl; //导入依赖的package包/类
public void testCreateNoJoin() {
    EPStatementHandle stmtHande = new EPStatementHandle(1, "id", null, StatementType.SELECT, "text", false, null, 1, false, false, new MultiMatchHandlerFactoryImpl().getDefaultHandler());
    EPStatementAgentInstanceHandle stmtAgentHandle = new EPStatementAgentInstanceHandle(stmtHande, new StatementAgentInstanceRWLockImpl(false), -1, null, null);

    streams = new EventStream[4];
    streams[0] = streamFactoryService.createStream(1, filterSpecs[0], supportFilterService, stmtAgentHandle, false, null, false, false, null, false, 0, false).getFirst();
    streams[1] = streamFactoryService.createStream(2, filterSpecs[0], supportFilterService, stmtAgentHandle, false, null, false, false, null, false, 0, false).getFirst();
    streams[2] = streamFactoryService.createStream(3, filterSpecs[1], supportFilterService, stmtAgentHandle, false, null, false, false, null, false, 0, false).getFirst();
    streams[3] = streamFactoryService.createStream(4, filterSpecs[2], supportFilterService, stmtAgentHandle, false, null, false, false, null, false, 0, false).getFirst();

    // Streams are reused
    assertSame(streams[0], streams[1]);
    assertSame(streams[0], streams[2]);
    assertNotSame(streams[0], streams[3]);

    // Type is ok
    assertEquals(SupportBean.class, streams[0].getEventType().getUnderlyingType());

    // 2 filters are active now
    assertEquals(2, supportFilterService.getAdded().size());
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:22,代码来源:TestStreamFactorySvcImpl.java

示例2: testCreateNoJoin

import com.espertech.esper.core.service.StatementAgentInstanceRWLockImpl; //导入依赖的package包/类
public void testCreateNoJoin()
{
    EPStatementHandle stmtHande = new EPStatementHandle("id", "id", null, "text", false, null, 1, false);
    EPStatementAgentInstanceHandle stmtAgentHandle = new EPStatementAgentInstanceHandle(stmtHande, new StatementAgentInstanceRWLockImpl("abc", false), -1, null);

    streams = new EventStream[4];
    streams[0] = streamFactoryService.createStream("id1", filterSpecs[0], supportFilterService, stmtAgentHandle, false, false, null, false, false, null, false).getFirst();
    streams[1] = streamFactoryService.createStream("id2", filterSpecs[0], supportFilterService, stmtAgentHandle, false, false, null, false, false, null, false).getFirst();
    streams[2] = streamFactoryService.createStream("id3", filterSpecs[1], supportFilterService, stmtAgentHandle, false, false, null, false, false, null, false).getFirst();
    streams[3] = streamFactoryService.createStream("id4", filterSpecs[2], supportFilterService, stmtAgentHandle, false, false, null, false, false, null, false).getFirst();

    // Streams are reused
    assertSame(streams[0], streams[1]);
    assertSame(streams[0], streams[2]);
    assertNotSame(streams[0], streams[3]);

    // Type is ok
    assertEquals(SupportBean.class, streams[0].getEventType().getUnderlyingType());

    // 2 filters are active now
    assertEquals(2, supportFilterService.getAdded().size());
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:23,代码来源:TestStreamFactorySvcImpl.java

示例3: testDropNoJoin

import com.espertech.esper.core.service.StatementAgentInstanceRWLockImpl; //导入依赖的package包/类
public void testDropNoJoin() {
    EPStatementHandle stmtHande = new EPStatementHandle(1, "id", null, StatementType.SELECT, "text", false, null, 1, false, false, new MultiMatchHandlerFactoryImpl().getDefaultHandler());
    EPStatementAgentInstanceHandle stmtAgentHandle = new EPStatementAgentInstanceHandle(stmtHande, new StatementAgentInstanceRWLockImpl(false), -1, null, null);
    streams = new EventStream[4];
    streams[0] = streamFactoryService.createStream(1, filterSpecs[0], supportFilterService, stmtAgentHandle, false, null, false, false, null, false, 0, false).getFirst();
    streams[1] = streamFactoryService.createStream(2, filterSpecs[0], supportFilterService, stmtAgentHandle, false, null, false, false, null, false, 0, false).getFirst();
    streams[2] = streamFactoryService.createStream(3, filterSpecs[1], supportFilterService, stmtAgentHandle, false, null, false, false, null, false, 0, false).getFirst();
    streams[3] = streamFactoryService.createStream(4, filterSpecs[2], supportFilterService, stmtAgentHandle, false, null, false, false, null, false, 0, false).getFirst();

    streamFactoryService.dropStream(filterSpecs[0], supportFilterService, false, false, false, false);
    streamFactoryService.dropStream(filterSpecs[1], supportFilterService, false, false, false, false);
    assertEquals(0, supportFilterService.getRemoved().size());

    // Filter removed
    streamFactoryService.dropStream(filterSpecs[0], supportFilterService, false, false, false, false);
    assertEquals(1, supportFilterService.getRemoved().size());

    streamFactoryService.dropStream(filterSpecs[2], supportFilterService, false, false, false, false);
    assertEquals(2, supportFilterService.getRemoved().size());

    // Something already removed
    try {
        streamFactoryService.dropStream(filterSpecs[2], supportFilterService, false, false, false, false);
        TestCase.fail();
    } catch (IllegalStateException ex) {
        // Expected
    }
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:29,代码来源:TestStreamFactorySvcImpl.java

示例4: testDropNoJoin

import com.espertech.esper.core.service.StatementAgentInstanceRWLockImpl; //导入依赖的package包/类
public void testDropNoJoin()
{
    EPStatementHandle stmtHande = new EPStatementHandle("id", "id", null, "text", false, null, 1, false);
    EPStatementAgentInstanceHandle stmtAgentHandle = new EPStatementAgentInstanceHandle(stmtHande, new StatementAgentInstanceRWLockImpl("abc", false), -1, null);
    streams = new EventStream[4];
    streams[0] = streamFactoryService.createStream("id1", filterSpecs[0], supportFilterService, stmtAgentHandle, false, false, null, false, false, null, false).getFirst();
    streams[1] = streamFactoryService.createStream("id2", filterSpecs[0], supportFilterService, stmtAgentHandle, false, false, null, false, false, null, false).getFirst();
    streams[2] = streamFactoryService.createStream("id3", filterSpecs[1], supportFilterService, stmtAgentHandle, false, false, null, false, false, null, false).getFirst();
    streams[3] = streamFactoryService.createStream("id4", filterSpecs[2], supportFilterService, stmtAgentHandle, false, false, null, false, false, null, false).getFirst();

    streamFactoryService.dropStream(filterSpecs[0], supportFilterService, false, false, false, false, false);
    streamFactoryService.dropStream(filterSpecs[1], supportFilterService, false, false, false, false, false);
    assertEquals(0, supportFilterService.getRemoved().size());

    // Filter removed
    streamFactoryService.dropStream(filterSpecs[0], supportFilterService, false, false, false, false, false);
    assertEquals(1, supportFilterService.getRemoved().size());

    streamFactoryService.dropStream(filterSpecs[2], supportFilterService, false, false, false, false, false);
    assertEquals(2, supportFilterService.getRemoved().size());

    // Something already removed
    try
    {
        streamFactoryService.dropStream(filterSpecs[2], supportFilterService, false,  false, false, false, false);
        TestCase.fail();
    }
    catch (IllegalStateException ex)
    {
        // Expected
    }
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:33,代码来源:TestStreamFactorySvcImpl.java


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