Examples of MException


Examples of de.mhus.lib.MException

    if (con == null) {
      try {
        myCon = pool.getConnection();
        con = myCon;
      } catch (Throwable t) {
        throw new MException(t);
      }
    }
   
    if (registryName == null) {
      Class<?> clazz = schema.findClassForObject(object,this);
      if (clazz == null)
        throw new MException("class definition not found for object",object.getClass().getCanonicalName());
      registryName = clazz.getCanonicalName();
    }
    Table c = cIndex.get(registryName);
    if (c == null)
      throw new MException("class definition not found in schema",registryName);
   
    try {
      // prepare object
      schema.doPreRemove(c,object,con,this);
     
      //save object
      c.removeObject(con,object);
     
      schema.doPostRemove(c,object,con,this);

    } catch (Throwable t) {
      throw new MException(registryName,t);
    }
   
    if (myCon != null) {
      try {
        myCon.commit();
      } catch (Throwable t) {
        throw new MException(t);
      }
      myCon.close();
    }
   
  }
View Full Code Here

Examples of de.mhus.lib.MException

    return cIndex.get(registryName);
  }
 
  public Object createSchemaObject(String registryName) throws Exception {
    Table table = cIndex.get(registryName);
    if (table == null) throw new MException("class definition not found in schema",registryName);
    return schema.createObject(table.getClazz(), table.getRegistryName(), null, this);
  }
View Full Code Here

Examples of de.mhus.lib.MException

    this.activator = activator;
  }
 
  public DbPool getPool(String name) throws Exception {
   
    if (bundle == null) throw new MException("Bundle already closed");

    synchronized (bundle) {
      DbPool pool = bundle.get(name);
      if (pool == null) {
        IConfig poolCon = config.getConfig(name);
        if (poolCon != null) {
          pool = new DbPool(poolCon, activator);
          bundle.put(name, pool);
        } else {
          throw new MException("pool config not found",name);
        }
      }
      return pool;
    }
  }
View Full Code Here

Examples of de.mhus.lib.MException


  @Override
  public void updateInstance(InstanceInfo info) throws Exception {
    BpmInstance instance = getInstance(info.getId());
    if (instance == null) throw new MException("instance not found", info.getId());
    if (!instance.getWorkflow().getName().equals(info.getWorkflowName()))
      throw new MException("wrong workflow",info.getId(),info.getWorkflowName(),instance.getWorkflow().getName());
    String[] activities = info.getActivities();
    if (activities.length == 1) {
      ((JBpmInstance)instance).setActivity(activities[0]);
    }
    //TODO remove other keys first
View Full Code Here

Examples of de.mhus.lib.MException

      return sqlParser;
   
    if (DbConnection.LANGUAGE_COMMON.equals(language))
      return commonParser;
   
    throw new MException(this,"language not supported", language);
  }
View Full Code Here

Examples of de.mhus.lib.MException

  private StackTraceElement[] createStackTrace;


  public void commit() throws Exception {
    log().t(poolId,id,"commit");
    if (closed) throw new MException(poolId,id,"Connection not valid");
    connection.commit();
  }
View Full Code Here

Examples of de.mhus.lib.MException

    if (closed) throw new MException(poolId,id,"Connection not valid");
    connection.commit();
  }

  public boolean isReadOnly() throws Exception {
    if (closed) throw new MException(poolId,id,"Connection not valid");
    return connection.isReadOnly();
  }
View Full Code Here

Examples of de.mhus.lib.MException

    id = MSingleton.instance().nextUniqueId();
  }
 
  public DbStatement getStatement(String name) throws MException {
    synchronized (this) {
      if (closed) throw new MException("Connection not valid");
     
      String[] query = provider.getQuery(name);
      if (query == null) return null;
      return new JdbcStatement(this, query[1],query[0]);
    }
View Full Code Here

Examples of de.mhus.lib.MException

    }
  }
   
  public DbStatement createStatement(String sql, String language) throws MException {
    synchronized (this) {
      if (closed) throw new MException("Connection not valid");
     
      return new JdbcStatement(this, sql, language);
    }
  }
View Full Code Here

Examples of de.mhus.lib.MException

      FileOutputStream os = new FileOutputStream(file);
      MXml.trim(element);
      MXml.saveXml(element, os);
      os.close();
    } catch (Exception e) {
      throw new MException(e);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.