本文整理汇总了Java中com.espertech.esper.client.EPStatementException类的典型用法代码示例。如果您正苦于以下问题:Java EPStatementException类的具体用法?Java EPStatementException怎么用?Java EPStatementException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EPStatementException类属于com.espertech.esper.client包,在下文中一共展示了EPStatementException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: runAssertionInvalid
import com.espertech.esper.client.EPStatementException; //导入依赖的package包/类
private void runAssertionInvalid(EPServiceProvider epService) {
String exceptionText = getSyntaxExceptionPattern(epService, EVENT_NUM + "(doublePrimitive='ss'");
assertEquals("Incorrect syntax near end-of-input expecting a closing parenthesis ')' but found end-of-input at line 1 column 77, please check the filter specification within the pattern expression [" + SupportBean_N.class.getName() + "(doublePrimitive='ss']", exceptionText);
epService.getEPAdministrator().getConfiguration().addEventType("SupportBean", SupportBean.class);
epService.getEPAdministrator().createEPL("select * from pattern[(not a=SupportBean) -> SupportBean(theString=a.theString)]");
// test invalid subselect
epService.getEPAdministrator().createEPL("create window WaitWindow#keepall as (waitTime int)");
epService.getEPAdministrator().createEPL("insert into WaitWindow select intPrimitive as waitTime from SupportBean");
epService.getEPRuntime().sendEvent(new SupportBean("E1", 100));
try {
epService.getEPAdministrator().createPattern("timer:interval((select waitTime from WaitWindow))");
fail();
} catch (EPStatementException ex) {
assertEquals("Subselects are not allowed within pattern observer parameters, please consider using a variable instead [timer:interval((select waitTime from WaitWindow))]",
ex.getMessage());
}
epService.getEPAdministrator().destroyAllStatements();
}
开发者ID:espertechinc,项目名称:esper,代码行数:23,代码来源:ExecPatternInvalid.java
示例2: runAssertionPriorStreamAndVariable
import com.espertech.esper.client.EPStatementException; //导入依赖的package包/类
private void runAssertionPriorStreamAndVariable(EPServiceProvider epService) {
tryAssertionPriorStreamAndVariable(epService, "1");
// try variable
epService.getEPAdministrator().createEPL("create constant variable int NUM_PRIOR = 1");
tryAssertionPriorStreamAndVariable(epService, "NUM_PRIOR");
// must be a constant-value expression
epService.getEPAdministrator().createEPL("create variable int NUM_PRIOR_NONCONST = 1");
try {
tryAssertionPriorStreamAndVariable(epService, "NUM_PRIOR_NONCONST");
fail();
} catch (EPStatementException ex) {
SupportMessageAssertUtil.assertMessage(ex, "Error starting statement: Failed to validate select-clause expression 'prior(NUM_PRIOR_NONCONST,s0)': Prior function requires a constant-value integer-typed index expression as the first parameter");
}
}
开发者ID:espertechinc,项目名称:esper,代码行数:17,代码来源:ExecExprPrior.java
示例3: compileAnnotations
import com.espertech.esper.client.EPStatementException; //导入依赖的package包/类
/**
* Compile annotation objects from descriptors.
* @param annotationSpec spec for annotations
* @param engineImportService engine imports
* @param eplStatement statement expression
* @return annotations
*/
public static Annotation[] compileAnnotations(List<AnnotationDesc> annotationSpec, EngineImportService engineImportService, String eplStatement)
{
Annotation[] annotations;
try
{
annotations = AnnotationUtil.compileAnnotations(annotationSpec, engineImportService);
}
catch (AnnotationException e)
{
throw new EPStatementException("Failed to process statement annotations: " + e.getMessage(), e, eplStatement);
}
catch (RuntimeException ex)
{
String message = "Unexpected exception compiling annotations in statement, please consult the log file and report the exception: " + ex.getMessage();
log.error(message, ex);
throw new EPStatementException(message, ex, eplStatement);
}
return annotations;
}
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:27,代码来源:AnnotationUtil.java
示例4: executeInternal
import com.espertech.esper.client.EPStatementException; //导入依赖的package包/类
private EPOnDemandQueryResult executeInternal(ContextPartitionSelector[] contextPartitionSelectors) {
try
{
EPPreparedQueryResult result = executeMethod.execute(contextPartitionSelectors);
return new EPQueryResultImpl(result);
}
catch (EPStatementException ex)
{
throw ex;
}
catch (Throwable t)
{
String message = "Error executing statement: " + t.getMessage();
log.error("Error executing on-demand statement '" + epl + "': " + t.getMessage(), t);
throw new EPStatementException(message, epl);
}
}
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:18,代码来源:EPPreparedQueryImpl.java
示例5: testConfig
import com.espertech.esper.client.EPStatementException; //导入依赖的package包/类
public void testConfig() throws Exception {
Configuration config = SupportConfigFactory.getConfiguration();
config.getEngineDefaults().getScripts().setDefaultDialect("dummy");
config.addEventType(SupportBean.class);
EPServiceProvider engine = EPServiceProviderManager.getDefaultProvider(config);
engine.initialize();
try {
engine.getEPAdministrator().createEPL("expression abc [10] select * from SupportBean");
fail();
}
catch (EPStatementException ex) {
assertEquals("Failed to obtain script engine for dialect 'dummy' for script 'abc' [expression abc [10] select * from SupportBean]", ex.getMessage());
}
}
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:17,代码来源:TestScriptExpressionConfiguration.java
示例6: start
import com.espertech.esper.client.EPStatementException; //导入依赖的package包/类
@Override
public Boolean start(final String name)
{
try {
final EPStatement sttm = epAdministrator.getStatement(name);
if (sttm == null) {
return false;
}
if (sttm.isStarted()) {
return true;
}
logger.info("Starting statement : " + name);
sttm.start();
return true;
} catch (EPStatementException e) {
logger.info(e.getMessage());
return false;
}
}
开发者ID:interruptus,项目名称:interruptus,代码行数:24,代码来源:StatementConfiguration.java
示例7: stop
import com.espertech.esper.client.EPStatementException; //导入依赖的package包/类
@Override
public Boolean stop(final String name)
{
try {
final EPStatement epStatement = epAdministrator.getStatement(name);
if (epStatement == null) {
return false;
}
if (epStatement.isStopped()) {
return true;
}
logger.info("Stoping statement : " + name);
epStatement.stop();
return true;
} catch (EPStatementException e) {
logger.info(e.getMessage());
return false;
}
}
开发者ID:interruptus,项目名称:interruptus,代码行数:24,代码来源:StatementConfiguration.java
示例8: remove
import com.espertech.esper.client.EPStatementException; //导入依赖的package包/类
@Override
public Boolean remove(final String name)
{
try {
final EPStatement epStatement = epAdministrator.getStatement(name);
if (epStatement != null) {
logger.info("Removing statement : " + name);
epStatement.destroy();
}
return true;
} catch (EPStatementException e) {
logger.info(e.getMessage());
return false;
}
}
开发者ID:interruptus,项目名称:interruptus,代码行数:19,代码来源:StatementConfiguration.java
示例9: tryInvalidCreate
import com.espertech.esper.client.EPStatementException; //导入依赖的package包/类
public static void tryInvalidCreate(EPServiceProvider epService, String epl, String message) {
try {
epService.getEPAdministrator().createEPL(epl);
Assert.fail();
} catch (EPStatementException ex) {
assertException(message, ex.getMessage());
}
}
开发者ID:espertechinc,项目名称:esper,代码行数:9,代码来源:SupportDataFlowAssertionUtil.java
示例10: tryInvalidExact
import com.espertech.esper.client.EPStatementException; //导入依赖的package包/类
public void tryInvalidExact(EPServiceProvider epService, String expression, String message) {
try {
epService.getEPAdministrator().createEPL(expression);
fail();
} catch (EPStatementException ex) {
assertEquals(message, ex.getMessage());
}
}
开发者ID:espertechinc,项目名称:esper,代码行数:9,代码来源:ExecScriptExpression.java
示例11: tryInvalidContains
import com.espertech.esper.client.EPStatementException; //导入依赖的package包/类
public void tryInvalidContains(EPServiceProvider epService, String expression, String part) {
try {
epService.getEPAdministrator().createEPL(expression);
fail();
} catch (EPStatementException ex) {
assertTrue("Message not containing text '" + part + "' : " + ex.getMessage(), ex.getMessage().contains(part));
}
}
开发者ID:espertechinc,项目名称:esper,代码行数:9,代码来源:ExecScriptExpression.java
示例12: run
import com.espertech.esper.client.EPStatementException; //导入依赖的package包/类
public void run(EPServiceProvider epService) throws Exception {
try {
epService.getEPAdministrator().createEPL("expression abc [10] select * from SupportBean");
fail();
} catch (EPStatementException ex) {
assertEquals("Failed to obtain script engine for dialect 'dummy' for script 'abc' [expression abc [10] select * from SupportBean]", ex.getMessage());
}
}
开发者ID:espertechinc,项目名称:esper,代码行数:9,代码来源:ExecScriptExpressionConfiguration.java
示例13: getStatementExceptionPattern
import com.espertech.esper.client.EPStatementException; //导入依赖的package包/类
private EPStatementException getStatementExceptionPattern(EPServiceProvider epService, String expression, boolean isLogException) throws Exception {
try {
epService.getEPAdministrator().createPattern(expression);
fail();
} catch (EPStatementSyntaxException es) {
throw es;
} catch (EPStatementException ex) {
// Expected exception
if (isLogException) {
log.debug(".getSyntaxExceptionPattern pattern=" + expression, ex);
}
return ex;
}
throw new IllegalStateException();
}
开发者ID:espertechinc,项目名称:esper,代码行数:16,代码来源:ExecPatternInvalid.java
示例14: runAssertionInvalid
import com.espertech.esper.client.EPStatementException; //导入依赖的package包/类
private void runAssertionInvalid(EPServiceProvider epService) {
// same context twice
String eplCreateCtx = "create context NineToFive as start (0, 9, *, *, *) end (0, 17, *, *, *)";
EPStatement stmtContext = epService.getEPAdministrator().createEPL(eplCreateCtx);
tryInvalid(epService, eplCreateCtx, "Error starting statement: Context by name 'NineToFive' already exists [");
// still in use
epService.getEPAdministrator().createEPL("context NineToFive select * from SupportBean");
stmtContext.destroy();
tryInvalid(epService, eplCreateCtx, "Error starting statement: Context by name 'NineToFive' is still referenced by statements and may not be changed");
// not found
tryInvalid(epService, "context EightToSix select * from SupportBean", "Error starting statement: Context by name 'EightToSix' has not been declared [");
// test update: update is not allowed as it is processed out-of-context by runtime
epService.getEPAdministrator().createEPL("insert into ABCStream select * from SupportBean");
epService.getEPAdministrator().createEPL("@Name('context') create context SegmentedByAString partition by theString from SupportBean");
try {
epService.getEPAdministrator().createEPL("context SegmentedByAString update istream ABCStream set intPrimitive = (select id from SupportBean_S0#lastevent) where intPrimitive < 0");
fail();
} catch (EPStatementException ex) {
assertEquals("Error starting statement: Update IStream is not supported in conjunction with a context [context SegmentedByAString update istream ABCStream set intPrimitive = (select id from SupportBean_S0#lastevent) where intPrimitive < 0]", ex.getMessage());
}
// context declaration for create-context
epService.getEPAdministrator().createEPL("create context ABC start @now end after 5 seconds");
tryInvalid(epService, "context ABC create context DEF start @now end after 5 seconds",
"Error starting statement: A create-context statement cannot itself be associated to a context, please declare a nested context instead [context ABC create context DEF start @now end after 5 seconds]");
epService.getEPAdministrator().destroyAllStatements();
}
开发者ID:espertechinc,项目名称:esper,代码行数:32,代码来源:ExecContextLifecycle.java
示例15: runAssertionInvalid
import com.espertech.esper.client.EPStatementException; //导入依赖的package包/类
private void runAssertionInvalid(EPServiceProvider epService) {
try {
String stmtText = "select intArr = all (select intPrimitive from SupportBean#keepall) as r1 from ArrayBean";
epService.getEPAdministrator().createEPL(stmtText);
fail();
} catch (EPStatementException ex) {
assertEquals("Error starting statement: Failed to validate select-clause expression subquery number 1 querying SupportBean: Collection or array comparison is not allowed for the IN, ANY, SOME or ALL keywords [select intArr = all (select intPrimitive from SupportBean#keepall) as r1 from ArrayBean]", ex.getMessage());
}
}
开发者ID:espertechinc,项目名称:esper,代码行数:10,代码来源:ExecSubselectAllAnySomeExpr.java
示例16: runAssertionInvalid
import com.espertech.esper.client.EPStatementException; //导入依赖的package包/类
private void runAssertionInvalid(EPServiceProvider epService) {
epService.getEPAdministrator().getConfiguration().addEventType("SupportBean", SupportBean.class);
epService.getEPAdministrator().getConfiguration().addEventType("ArrayBean", SupportBeanArrayCollMap.class);
try {
String stmtText = "select " +
"intArr in (select intPrimitive from SupportBean#keepall) as r1 from ArrayBean";
epService.getEPAdministrator().createEPL(stmtText);
fail();
} catch (EPStatementException ex) {
assertEquals("Error starting statement: Failed to validate select-clause expression subquery number 1 querying SupportBean: Collection or array comparison is not allowed for the IN, ANY, SOME or ALL keywords [select intArr in (select intPrimitive from SupportBean#keepall) as r1 from ArrayBean]", ex.getMessage());
}
}
开发者ID:espertechinc,项目名称:esper,代码行数:13,代码来源:ExecSubselectIn.java
示例17: runAssertionInvalid
import com.espertech.esper.client.EPStatementException; //导入依赖的package包/类
private void runAssertionInvalid(EPServiceProvider epService) {
if (SupportConfigFactory.skipTest(ExecClientPatternGuardPlugIn.class)) {
return;
}
try {
String stmtText = "select * from pattern [every " + SupportBean.class.getName() +
" where namespace:name(10)]";
epService.getEPAdministrator().createEPL(stmtText);
fail();
} catch (EPStatementException ex) {
SupportMessageAssertUtil.assertMessage(ex, "Failed to resolve pattern guard '" + SupportBean.class.getName() + " where namespace:name(10)': Error casting guard factory instance to com.espertech.esper.pattern.guard.GuardFactory interface for guard 'name'");
}
}
开发者ID:espertechinc,项目名称:esper,代码行数:15,代码来源:ExecClientPatternGuardPlugIn.java
示例18: run
import com.espertech.esper.client.EPStatementException; //导入依赖的package包/类
public void run(EPServiceProvider epService) throws Exception {
try {
epService.getEPAdministrator().createEPL("select element1 from TestXMLSchemaType#length(100)");
fail();
} catch (EPStatementException ex) {
assertEquals("Error starting statement: Failed to validate select-clause expression 'element1': Property named 'element1' is not valid in any stream [select element1 from TestXMLSchemaType#length(100)]", ex.getMessage());
}
}
开发者ID:espertechinc,项目名称:esper,代码行数:9,代码来源:ExecEventXMLSchemaInvalid.java
示例19: tryInvalidCompile
import com.espertech.esper.client.EPStatementException; //导入依赖的package包/类
private void tryInvalidCompile(EPServiceProvider epService, String epl, String message) {
try {
epService.getEPAdministrator().createEPL(epl, UuidGenerator.generate());
fail();
} catch (EPStatementException ex) {
assertException(message, ex.getMessage());
}
}
开发者ID:espertechinc,项目名称:esper,代码行数:9,代码来源:ExecDataflowAPICreateStartStopDestroy.java
示例20: assertFailCreate
import com.espertech.esper.client.EPStatementException; //导入依赖的package包/类
private void assertFailCreate(EPServiceProvider epService, String create) {
try {
epService.getEPAdministrator().createEPL(create);
fail();
} catch (EPStatementException ex) {
// expected
}
}
开发者ID:espertechinc,项目名称:esper,代码行数:9,代码来源:ExecTableLifecycle.java
注:本文中的com.espertech.esper.client.EPStatementException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论