protected synchronized EPStatementDesc createStoppedAssignName(StatementSpecRaw statementSpec,String expression,boolean isPattern,String optStatementName,int statementId,Map<String,Object> optAdditionalContext,Object userObject,EPIsolationUnitServices isolationUnitServices,EPStatementObjectModel optionalModel){
  boolean nameProvided=false;
  String statementName="stmt_" + Integer.toString(statementId);
  Annotation[] annotations=AnnotationUtil.compileAnnotations(statementSpec.getAnnotations(),services.getEngineImportService(),expression);
  if (optStatementName == null) {
    if (annotations != null && annotations.length != 0) {
      for (      Annotation annotation : annotations) {
        if (annotation instanceof Name) {
          Name name=(Name)annotation;
          if (name.value() != null) {
            optStatementName=name.value();
          }
        }
      }
    }
  }
  if (optStatementName != null) {
    optStatementName=optStatementName.trim();
    statementName=getUniqueStatementName(optStatementName,statementId);
    nameProvided=true;
  }
  if (statementSpec.getFireAndForgetSpec() != null) {
    throw new EPStatementException("Provided EPL expression is an on-demand query expression (not a continuous query), please use the runtime executeQuery API instead",expression);
  }
  return createStopped(statementSpec,annotations,expression,isPattern,statementName,nameProvided,statementId,optAdditionalContext,userObject,isolationUnitServices,false,optionalModel);
}

protected synchronized EPStatementDesc createStoppedAssignName ( StatementSpecRaw statementSpec , String expression , boolean isPattern , String optStatementName , int statementId , Map < String , Object > optAdditionalContext , Object userObject , EPIsolationUnitServices isolationUnitServices , EPStatementObjectModel optionalModel ) { boolean nameProvided = false ; String statementName = "stmt_" + Integer . toString ( statementId ) ; Annotation [ ] annotations = AnnotationUtil . compileAnnotations ( statementSpec . getAnnotations ( ) , services . getEngineImportService ( ) , expression ) ; if ( optStatementName == null ) { if ( annotations != null && annotations . length != 0 ) { for ( Annotation annotation : annotations ) { if ( annotation instanceof Name ) { Name name = ( Name ) annotation ; if ( name . value ( ) != null ) { optStatementName = name . value ( ) ; } } } } } if ( optStatementName != null ) { optStatementName = optStatementName . trim ( ) ; statementName = getUniqueStatementName ( optStatementName , statementId ) ; nameProvided = true ; } if ( statementSpec . getFireAndForgetSpec ( ) != null ) { throw new EPStatementException ( "Provided EPL expression is an on-demand query expression (not a continuous query), please use the runtime executeQuery API instead" , expression ) ; } return createStopped ( statementSpec , annotations , expression , isPattern , statementName , nameProvided , statementId , optAdditionalContext , userObject , isolationUnitServices , false , optionalModel ) ; }
creates and starts statement .
