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


Java EPStatement.isStarted方法代码示例

本文整理汇总了Java中com.espertech.esper.client.EPStatement.isStarted方法的典型用法代码示例。如果您正苦于以下问题:Java EPStatement.isStarted方法的具体用法?Java EPStatement.isStarted怎么用?Java EPStatement.isStarted使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.espertech.esper.client.EPStatement的用法示例。


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

示例1: handleGetAllEvents

import com.espertech.esper.client.EPStatement; //导入方法依赖的package包/类
protected List<Object> handleGetAllEvents(String strategyName, String ruleName) {

		EPStatement statement = getServiceProvider(strategyName).getEPAdministrator().getStatement(ruleName);
		List<Object> list = new ArrayList<Object>();
		if (statement != null && statement.isStarted()) {
			SafeIterator<EventBean> it = statement.safeIterator();
			try {
				while (it.hasNext()) {
					EventBean bean = it.next();
					Object underlaying = bean.getUnderlying();
					list.add(underlaying);
				}
			} finally {
				it.close();
			}
		}
		return list;
	}
 
开发者ID:curtiszimmerman,项目名称:AlgoTrader,代码行数:19,代码来源:RuleServiceImpl.java

示例2: handleGetAllEventsProperty

import com.espertech.esper.client.EPStatement; //导入方法依赖的package包/类
protected List<Object> handleGetAllEventsProperty(String strategyName, String ruleName, String property) throws Exception {

		EPStatement statement = getServiceProvider(strategyName).getEPAdministrator().getStatement(ruleName);
		List<Object> list = new ArrayList<Object>();
		if (statement != null && statement.isStarted()) {
			SafeIterator<EventBean> it = statement.safeIterator();
			try {
				while (it.hasNext()) {
					EventBean bean = it.next();
					Object underlaying = bean.get(property);
					list.add(underlaying);
				}
			} finally {
				it.close();
			}
		}
		return list;
	}
 
开发者ID:curtiszimmerman,项目名称:AlgoTrader,代码行数:19,代码来源:RuleServiceImpl.java

示例3: handleUndeployRule

import com.espertech.esper.client.EPStatement; //导入方法依赖的package包/类
protected void handleUndeployRule(String strategyName, String ruleName) throws Exception {

		// destroy the statement
		EPStatement statement = getServiceProvider(strategyName).getEPAdministrator().getStatement(ruleName);

		if (statement != null && statement.isStarted()) {
			statement.destroy();
			logger.debug("undeployed rule " + ruleName);
		}
	}
 
开发者ID:curtiszimmerman,项目名称:AlgoTrader,代码行数:11,代码来源:RuleServiceImpl.java

示例4: handleUndeployRuleByTarget

import com.espertech.esper.client.EPStatement; //导入方法依赖的package包/类
protected void handleUndeployRuleByTarget(String strategyName, String ruleName, int targetId) throws Exception {

		if (hasServiceProvider(strategyName)) {
			EPStatement statement = getServiceProvider(strategyName).getEPAdministrator().getStatement(ruleName);
			if (statement != null && statement.isStarted() && statement.getText().contains(String.valueOf(targetId))) {
				statement.destroy();
				logger.debug("undeployed rule " + ruleName);
			}
		}
	}
 
开发者ID:curtiszimmerman,项目名称:AlgoTrader,代码行数:11,代码来源:RuleServiceImpl.java

示例5: handleGetLastEvent

import com.espertech.esper.client.EPStatement; //导入方法依赖的package包/类
protected Object handleGetLastEvent(String strategyName, String ruleName) {

		EPStatement statement = getServiceProvider(strategyName).getEPAdministrator().getStatement(ruleName);
		if (statement != null && statement.isStarted()) {
			SafeIterator<EventBean> it = statement.safeIterator();
			try {
				if (it.hasNext()) {
					return it.next().getUnderlying();
				}
			} finally {
				it.close();
			}
		}
		return null;
	}
 
开发者ID:curtiszimmerman,项目名称:AlgoTrader,代码行数:16,代码来源:RuleServiceImpl.java

示例6: handleGetLastEventProperty

import com.espertech.esper.client.EPStatement; //导入方法依赖的package包/类
protected Object handleGetLastEventProperty(String strategyName, String ruleName, String property) throws Exception {

		EPStatement statement = getServiceProvider(strategyName).getEPAdministrator().getStatement(ruleName);
		if (statement != null && statement.isStarted()) {
			SafeIterator<EventBean> it = statement.safeIterator();
			try {
				return it.next().get(property);
			} finally {
				it.close();
			}
		}
		return null;
	}
 
开发者ID:curtiszimmerman,项目名称:AlgoTrader,代码行数:14,代码来源:RuleServiceImpl.java

示例7: handleDeployRule

import com.espertech.esper.client.EPStatement; //导入方法依赖的package包/类
protected void handleDeployRule(String strategyName, String moduleName, String ruleName, Integer targetId) throws Exception {

		EPAdministrator administrator = getServiceProvider(strategyName).getEPAdministrator();

		// do nothing if the statement already exists
		EPStatement oldStatement = administrator.getStatement(ruleName);
		if (oldStatement != null && oldStatement.isStarted()) {
			return;
		}

		// read the statement from the module
		EPDeploymentAdmin deployAdmin = administrator.getDeploymentAdmin();
		Module module = deployAdmin.read("module-" + moduleName + ".epl");
		List<ModuleItem> items = module.getItems();

		// go through all statements in the module
		EPStatement newStatement = null;
		items: for (ModuleItem item : items) {
			String exp = item.getExpression();

			// get the ObjectModel for the statement
			EPStatementObjectModel model;
			EPPreparedStatementImpl prepared = null;
			if (exp.contains("?")) {
				prepared = (EPPreparedStatementImpl) administrator.prepareEPL(exp);
				model = prepared.getModel();
			} else {
				model = administrator.compileEPL(exp);
			}

			// go through all annotations and check if the statement has the 'name' 'ruleName'
			List<AnnotationPart> annotationParts = model.getAnnotations();
			for (AnnotationPart annotationPart : annotationParts) {
				if (annotationPart.getName().equals("Name")) {
					for (AnnotationAttribute attribute : annotationPart.getAttributes()) {
						if (attribute.getValue().equals(ruleName)) {

							// create the statement
							newStatement = administrator.createEPL(model.toEPL());

							// check if the statement is elgible, other destory it righ away
							processAnnotations(strategyName, newStatement);

							// break iterating over the statements
							break items;
						}
					}
				}
			}
		}

		if (newStatement == null) {
			logger.warn("statement " + ruleName + " was not found");
		} else {
			logger.debug("deployed rule " + newStatement.getName() + " on service provider: " + strategyName);
		}
	}
 
开发者ID:curtiszimmerman,项目名称:AlgoTrader,代码行数:58,代码来源:RuleServiceImpl.java

示例8: handleIsDeployed

import com.espertech.esper.client.EPStatement; //导入方法依赖的package包/类
protected boolean handleIsDeployed(String strategyName, String ruleName) throws Exception {

		EPStatement statement = getServiceProvider(strategyName).getEPAdministrator().getStatement(ruleName);

		return statement != null && statement.isStarted();
	}
 
开发者ID:curtiszimmerman,项目名称:AlgoTrader,代码行数:7,代码来源:RuleServiceImpl.java


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