class EsperStatement implements EsperStatementOperations {

	public <T> T concurrentSafeQueryForObject(ParameterizedEsperRowMapper<T> rm) {
		LOG.info("Concurrent safe query for object being executed");

		if (epStatement.isStopped() || epStatement.isDestroyed()) {
			LOG
					.error("Concurrent safe query for object was attempted when the statement was stopped or destroyed");
			throw new EsperStatementInvalidStateException(
					"Attempted to execute a concurrent safe query for object when esper statement resource had state of "
							+ epStatement.getState());
		}

		SafeIterator<EventBean> safeIter = this.epStatement.safeIterator();

		T result = null;
		try {
			// Only retrieve the last result
			while (safeIter.hasNext()) {
				EventBean event = safeIter.next();
				if (!safeIter.hasNext()) {
					result = rm.mapRow(event);
				}

			}
		} finally {
			safeIter.close();
		}

		LOG.info("Concurrent safe query for object was completed");
		return result;
	}

	public  EsperStatement(String epl);
	public  EsperStatement(String id, String epl);

}