Package org.uengine.kernel

Examples of org.uengine.kernel.UEngineException


    //TODO: need to be cached
   
    PreparedStatement pstmt = null;
    Connection con = getConnectionFactory().getConnection();
    try{
      if(con == null) throw new UEngineException("Connection is null");
     
      pstmt = con.prepareStatement(getActualSqlStmt(getStatement()));
   
      lateBindProperties(getStatement(), pstmt);
      rowSet = new CachedRowSet();
//      ResultSet rs = pstmt.executeQuery();
//      rs.next();
      rowSet.populate(pstmt.executeQuery());
      rowSet.beforeFirst();
     
      isDirty = false;
     
    }catch(Exception e){
      throw new UEngineException("Error when to try sql [" + getStatement() + "] ", e);
    }finally{
      try{pstmt.close();}catch(Exception e){}
      if ( !isConnective ) {
        checkOkToCloseConnection();
        try{con.close();}catch(Exception e){}
View Full Code Here


  }
 
  private void checkOkToCloseConnection() throws Exception{
    if(getConnectionFactory() instanceof ProcessTransactionContext){
      ProcessManagerBean pm = ((ProcessTransactionContext)getConnectionFactory()).getProcessManager();
      if(!pm.isManagedTransaction()) throw new UEngineException("This thread tries to close any of connection in uEngine-managed transaction.");
    }
  }
View Full Code Here

      } else {
        int[] btc = new int[0];
        return btc;
      }
    }catch(Exception e){
      throw new UEngineException("Error when to try sql [" + getStatement() + "] ", e);
     
    }finally{
      try{pstmtForBatch.close();}catch(Exception e){}
      if ( !isConnective ) {
        checkOkToCloseConnection();
View Full Code Here

 
  public void createUpdateSql() throws Exception{
    final StringBuffer sql_SetPairs = new StringBuffer();

    if(getTableName()==null || getKeyField()==null)
      throw new UEngineException("Although Update query is set to be build automatically, the table name or key field is not set.");
   
    if(rowSet==null){
     
      ForLoop loopForCacheKeys = new ForLoop(){
        String sep = "";
View Full Code Here

      lateBindProperties(getStatement(), pstmt);
      int rowAffected = pstmt.executeUpdate();
     
      return rowAffected;
    }catch(Exception e){
      throw new UEngineException("Error when to try sql [" + getStatement() + "] ", e);
    }finally{
      try{pstmt.close();}catch(Exception e){}
      if ( !isConnective ) {
        checkOkToCloseConnection();
        try{con.close();}catch(Exception e){}
View Full Code Here

        }
      }
    }
   
    if(method == null)
      throw new UEngineException("No such operation ["+ operationName +"] or mismatch with the parameters to Web Service invoke.");
   
    Object[] actualParameters = new Object[method.getParameterTypes().length];   
    for(int i=0; i<actualParameters.length; i++){
      if(parameters!=null && parameters.length > i){
System.out.println("  parameter[" + i + "] = " + parameters[i]);
View Full Code Here

           
            //review: messagedefinition need a field, which contains parameter type in Class
            out.print( sep + getActualTypeName(type) + " " + vars[i].getArgument());
            sep = ", ";
          }catch(Exception e){
            throw new UEngineException("Can't resolve type information of message '" + messageName + "', property '" + vars[i].getArgument()+"'");
          }
        }
      }else if(var!=null){       
        out.print(", " + getActualTypeName(var.getType()) + " " + var.getName());
      }
     
      out.print(") throws java.rmi.RemoteException");
     
      if(isInterface){
        out.println(";");
      }else{
        out.println("{");
        out.println("    try{");
       
        if(bCustomizedStarter ){
          out.println("      String instanceId = _startAndSendMessage(new Object[]{\"" + proc.getName() + "\", \"" + messageName +"\"");
        }else
          out.print  ("      _sendMessage(new Object[]{instanceId, \"" + messageName +"\"");
       
        if(vars!=null){
          for(int i=0; i<vars.length; i++){
            try{
              ProcessVariable pvd = vars[i].getVariable();
              Class type = null;
              if(pvd!=null){
                type = pvd.getType();
              }else{
                type = (Class)vars[i].getType();
              }
           
              out.print(", " + convert2Object(type, vars[i].getArgument().getText()));
             
            }catch(Exception e){
              throw new UEngineException("Can't resolve type information of message '" + messageName + "', property '" + vars[i].getArgument()+"'");
            }
          }
        }else{
          if(var!=null)
            out.print(", " + convert2Object(var.getType(), var.getName()))
View Full Code Here

      Method stubGetterMethod = svcLocatorCls.getMethod("get" + portType, new Class[]{java.net.URL.class});
      Object stub = stubGetterMethod.invoke(svcLocator, new Object[]{new java.net.URL(endpoint)});
   
      return stub;
    }catch(java.net.MalformedURLException e){
      throw new UEngineException("Malformed endpoint URI:" + endpoint, e);
    }catch(ClassNotFoundException cne){
      throw new UEngineException("There's no stub class:" + clsName, cne);
    }catch(NoSuchMethodException nsme){
      throw new UEngineException("Wrong portType:" + portType, nsme);
    }catch(Exception ex){
      throw new UEngineException("Exception occurred during ws-invocation", ex);
    }
  }
View Full Code Here

      }finally{
        if(bw!=null)
          try{bw.close();}catch(Exception e){};
      }
    } catch (Exception e) {
      throw new UEngineException("Error when to save filter: " + e.getMessage(), e);
    }
  }
View Full Code Here

       
        return (UpdateListFilterList)GlobalContext.deserialize(fis, UpdateListFilterList.class);
      }

    }catch(Exception e){
      throw new UEngineException("Error when to load filter: " + e.getMessage(), e);
   
   
    return new UpdateListFilterList();
  }
View Full Code Here

TOP

Related Classes of org.uengine.kernel.UEngineException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.