本文整理汇总了Java中com.espertech.esper.client.ConfigurationOperations类的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationOperations类的具体用法?Java ConfigurationOperations怎么用?Java ConfigurationOperations使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ConfigurationOperations类属于com.espertech.esper.client包,在下文中一共展示了ConfigurationOperations类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: run
import com.espertech.esper.client.ConfigurationOperations; //导入依赖的package包/类
public void run(EPServiceProvider epService) throws Exception {
PlugInEventRepresentationContext initContext = SupportEventRepresentation.getInitContext();
assertEquals(new URI("type://test/support"), initContext.getEventRepresentationRootURI());
assertEquals("abc", initContext.getRepresentationInitializer());
assertNotNull(initContext.getEventAdapterService());
ConfigurationOperations runtimeConfig = epService.getEPAdministrator().getConfiguration();
runtimeConfig.addPlugInEventType("TestTypeOne", new URI[]{new URI("type://test/support?a=b&c=d")}, "t1");
PlugInEventTypeHandlerContext plugincontext = SupportEventRepresentation.getAcceptTypeContext();
assertEquals(new URI("type://test/support?a=b&c=d"), plugincontext.getEventTypeResolutionURI());
assertEquals("t1", plugincontext.getTypeInitializer());
assertEquals("TestTypeOne", plugincontext.getEventTypeName());
plugincontext = SupportEventRepresentation.getEventTypeContext();
assertEquals(new URI("type://test/support?a=b&c=d"), plugincontext.getEventTypeResolutionURI());
assertEquals("t1", plugincontext.getTypeInitializer());
assertEquals("TestTypeOne", plugincontext.getEventTypeName());
epService.getEPRuntime().getEventSender(new URI[]{new URI("type://test/support?a=b")});
PlugInEventBeanReflectorContext contextBean = SupportEventRepresentation.getEventBeanContext();
assertEquals("type://test/support?a=b", contextBean.getResolutionURI().toString());
}
开发者ID:espertechinc,项目名称:esper,代码行数:24,代码来源:ExecEventPlugInContextContent.java
示例2: save
import com.espertech.esper.client.ConfigurationOperations; //导入依赖的package包/类
@Override
public void save(final Type type)
{
final Map<String, Object> map = new HashMap<String, Object>(type.getProperties());
final EPAdministrator admin = epService.getEPAdministrator();
final ConfigurationOperations config = admin.getConfiguration();
final String name = type.getName();
logger.info("Saving type : " + name);
if (config.isEventTypeExists(name)) {
config.updateMapEventType(name, map);
return;
}
config.addEventType(name, map);
}
开发者ID:interruptus,项目名称:interruptus,代码行数:19,代码来源:TypeConfiguration.java
示例3: testListTypes
import com.espertech.esper.client.ConfigurationOperations; //导入依赖的package包/类
@Test
public void testListTypes()
{
final TypeConfiguration instance = new TypeConfiguration(epService);
final ConfigurationOperations config = mock(ConfigurationOperations.class);
final EPAdministrator admin = mock(EPAdministrator.class);
final EventType eventType1 = mock(EventType.class);
final EventType eventType2 = mock(EventType.class);
final EventType[] eventTypes = new EventType[]{
eventType1, eventType2
};
when(epService.getEPAdministrator()).thenReturn(admin);
when(admin.getConfiguration()).thenReturn(config);
when(config.getEventTypes()).thenReturn(eventTypes);
when(eventType1.getName()).thenReturn("EventType1");
when(eventType2.getName()).thenReturn("EventType2");
final List<String> result = instance.list();
assertEquals(2, result.size());
assertEquals("EventType1", result.get(0));
assertEquals("EventType2", result.get(1));
verify(config).getEventTypes();
}
开发者ID:interruptus,项目名称:interruptus,代码行数:27,代码来源:TypeConfigurationTest.java
示例4: testSaveNewType
import com.espertech.esper.client.ConfigurationOperations; //导入依赖的package包/类
@Test
public void testSaveNewType()
{
final TypeConfiguration instance = new TypeConfiguration(epService);
final ConfigurationOperations config = mock(ConfigurationOperations.class);
final EPAdministrator admin = mock(EPAdministrator.class);
final Map<String, String> properties = new HashMap<>();
final String name = "EventTypeX";
final Type type = new Type(name, properties);
final Map<String, Object> map = new HashMap<>();
properties.put("value", "string");
properties.put("key", "string");
map.putAll(properties);
when(admin.getConfiguration()).thenReturn(config);
when(epService.getEPAdministrator()).thenReturn(admin);
when(config.isEventTypeExists(eq(name))).thenReturn(Boolean.FALSE);
instance.save(type);
verify(config).isEventTypeExists(eq(name));
verify(config).addEventType(eq(name), eq(map));
}
开发者ID:interruptus,项目名称:interruptus,代码行数:25,代码来源:TypeConfigurationTest.java
示例5: testSaveExistingType
import com.espertech.esper.client.ConfigurationOperations; //导入依赖的package包/类
@Test
public void testSaveExistingType()
{
final TypeConfiguration instance = new TypeConfiguration(epService);
final ConfigurationOperations config = mock(ConfigurationOperations.class);
final EPAdministrator admin = mock(EPAdministrator.class);
final Map<String, String> properties = new HashMap<>();
final String name = "EventTypeY";
final Type type = new Type(name, properties);
final Map<String, Object> map = new HashMap<>();
properties.put("value", "string");
properties.put("key", "string");
map.putAll(properties);
when(admin.getConfiguration()).thenReturn(config);
when(epService.getEPAdministrator()).thenReturn(admin);
when(config.isEventTypeExists(eq(name))).thenReturn(Boolean.TRUE);
instance.save(type);
verify(config).isEventTypeExists(eq(name));
verify(config).updateMapEventType(eq(name), eq(map));
}
开发者ID:interruptus,项目名称:interruptus,代码行数:25,代码来源:TypeConfigurationTest.java
示例6: testRemoveExistingType
import com.espertech.esper.client.ConfigurationOperations; //导入依赖的package包/类
@Test
public void testRemoveExistingType()
{
final TypeConfiguration instance = new TypeConfiguration(epService);
final ConfigurationOperations config = mock(ConfigurationOperations.class);
final EPAdministrator admin = mock(EPAdministrator.class);
final String name = "EventTypeY";
when(admin.getConfiguration()).thenReturn(config);
when(epService.getEPAdministrator()).thenReturn(admin);
when(config.isEventTypeExists(eq(name))).thenReturn(Boolean.TRUE);
when(config.removeEventType(eq(name), eq(true))).thenReturn(Boolean.TRUE);
assertTrue(instance.remove(name));
verify(config).isEventTypeExists(eq(name));
verify(config).removeEventType(eq(name), eq(true));
}
开发者ID:interruptus,项目名称:interruptus,代码行数:18,代码来源:TypeConfigurationTest.java
示例7: testRemoveNotExistingType
import com.espertech.esper.client.ConfigurationOperations; //导入依赖的package包/类
@Test
public void testRemoveNotExistingType()
{
final TypeConfiguration instance = new TypeConfiguration(epService);
final ConfigurationOperations config = mock(ConfigurationOperations.class);
final EPAdministrator admin = mock(EPAdministrator.class);
final String name = "EventTypeY";
when(admin.getConfiguration()).thenReturn(config);
when(epService.getEPAdministrator()).thenReturn(admin);
when(config.isEventTypeExists(eq(name))).thenReturn(Boolean.FALSE);
when(config.removeEventType(eq(name), eq(true))).thenReturn(Boolean.TRUE);
assertTrue(instance.remove(name));
verify(config).isEventTypeExists(eq(name));
verify(config, never()).removeEventType(eq(name), eq(true));
}
开发者ID:interruptus,项目名称:interruptus,代码行数:18,代码来源:TypeConfigurationTest.java
示例8: run
import com.espertech.esper.client.ConfigurationOperations; //导入依赖的package包/类
public void run(EPServiceProvider epService) throws Exception {
if (SupportConfigFactory.skipTest(ExecEventPlugInConfigRuntimeTypeResolution.class)) {
return;
}
ConfigurationOperations ops = epService.getEPAdministrator().getConfiguration();
ops.addPlugInEventType("TestTypeOne", new URI[]{new URI("type://properties/test1/testtype")}, "t1");
ops.addPlugInEventType("TestTypeTwo", new URI[]{new URI("type://properties/test2")}, "t2");
ops.addPlugInEventType("TestTypeThree", new URI[]{new URI("type://properties/test3")}, "t3");
ops.addPlugInEventType("TestTypeFour", new URI[]{new URI("type://properties/test2/x"), new URI("type://properties/test3")}, "t4");
ExecEventPlugInConfigStaticTypeResolution.runAssertionCaseStatic(epService);
}
开发者ID:espertechinc,项目名称:esper,代码行数:13,代码来源:ExecEventPlugInConfigRuntimeTypeResolution.java
示例9: run
import com.espertech.esper.client.ConfigurationOperations; //导入依赖的package包/类
public void run(EPServiceProvider epService) throws Exception {
ConfigurationOperations configOps = epService.getEPAdministrator().getConfiguration();
configOps.addEventType("RootEvent", new String[]{"base"}, new Object[]{String.class});
configOps.addEventType("Sub1Event", new String[]{"sub1"}, new Object[]{String.class}, new ConfigurationEventTypeObjectArray(Collections.singleton("RootEvent")));
configOps.addEventType("Sub2Event", new String[]{"sub2"}, new Object[]{String.class}, new ConfigurationEventTypeObjectArray(Collections.singleton("RootEvent")));
configOps.addEventType("SubAEvent", new String[]{"suba"}, new Object[]{String.class}, new ConfigurationEventTypeObjectArray(Collections.singleton("Sub1Event")));
configOps.addEventType("SubBEvent", new String[]{"subb"}, new Object[]{String.class}, new ConfigurationEventTypeObjectArray(Collections.singleton("SubAEvent")));
ExecEventObjectArrayInheritanceConfigInit.runObjectArrInheritanceAssertion(epService);
}
开发者ID:espertechinc,项目名称:esper,代码行数:12,代码来源:ExecEventObjectArrayInheritanceConfigRuntime.java
示例10: EPAdministratorContext
import com.espertech.esper.client.ConfigurationOperations; //导入依赖的package包/类
/**
* Ctor.
* @param runtimeSPI
* @param services engine services
* @param configurationOperations configuration snapshot
* @param defaultStreamSelector default stream selection
*/
public EPAdministratorContext(EPRuntimeSPI runtimeSPI, EPServicesContext services, ConfigurationOperations configurationOperations, SelectClauseStreamSelectorEnum defaultStreamSelector)
{
this.runtimeSPI = runtimeSPI;
this.configurationOperations = configurationOperations;
this.defaultStreamSelector = defaultStreamSelector;
this.services = services;
}
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:15,代码来源:EPAdministratorContext.java
示例11: remove
import com.espertech.esper.client.ConfigurationOperations; //导入依赖的package包/类
@Override
public Boolean remove(final String name)
{
final EPAdministrator administrator = epService.getEPAdministrator();
final ConfigurationOperations config = administrator.getConfiguration();
if ( ! config.isEventTypeExists(name)) {
return true;
}
logger.info("Removing type : " + name);
return config.removeEventType(name, true);
}
开发者ID:interruptus,项目名称:interruptus,代码行数:15,代码来源:TypeConfiguration.java
示例12: getConfiguration
import com.espertech.esper.client.ConfigurationOperations; //导入依赖的package包/类
public ConfigurationOperations getConfiguration() {
return configurationOperations;
}
开发者ID:espertechinc,项目名称:esper,代码行数:4,代码来源:EPAdministratorImpl.java
示例13: getConfigurationOperations
import com.espertech.esper.client.ConfigurationOperations; //导入依赖的package包/类
/**
* Returns configuration.
* @return configuration
*/
public ConfigurationOperations getConfigurationOperations()
{
return configurationOperations;
}
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:9,代码来源:EPAdministratorContext.java
示例14: MessageCollectorService
import com.espertech.esper.client.ConfigurationOperations; //导入依赖的package包/类
public MessageCollectorService(final ConfigurationOperations esperConfig, final MessageService messageService, final InventoryService inventoryService)
{
this.esperConfig = esperConfig;
this.messageService = messageService;
this.inventoryService = inventoryService;
}
开发者ID:interruptus,项目名称:interruptus,代码行数:7,代码来源:MessageCollectorService.java
示例15: EPAdministratorContext
import com.espertech.esper.client.ConfigurationOperations; //导入依赖的package包/类
/**
* Ctor.
*
* @param runtimeSPI runtime spi
* @param services engine services
* @param configurationOperations configuration snapshot
* @param defaultStreamSelector default stream selection
*/
public EPAdministratorContext(EPRuntimeSPI runtimeSPI, EPServicesContext services, ConfigurationOperations configurationOperations, SelectClauseStreamSelectorEnum defaultStreamSelector) {
this.runtimeSPI = runtimeSPI;
this.configurationOperations = configurationOperations;
this.defaultStreamSelector = defaultStreamSelector;
this.services = services;
}
开发者ID:espertechinc,项目名称:esper,代码行数:15,代码来源:EPAdministratorContext.java
示例16: getConfigurationOperations
import com.espertech.esper.client.ConfigurationOperations; //导入依赖的package包/类
/**
* Returns configuration.
*
* @return configuration
*/
public ConfigurationOperations getConfigurationOperations() {
return configurationOperations;
}
开发者ID:espertechinc,项目名称:esper,代码行数:9,代码来源:EPAdministratorContext.java
注:本文中的com.espertech.esper.client.ConfigurationOperations类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论