Search in sources :

Example 6 with DataAccessException

use of org.vcell.util.DataAccessException in project vcell by virtualcell.

the class ChomboSolverSpec method readVCMLRefinementRois.

private void readVCMLRefinementRois(CommentStringTokenizer tokens) throws DataAccessException {
    // BeginToken
    String token = tokens.nextToken();
    if (!token.equalsIgnoreCase(VCML.BeginBlock)) {
        throw new DataAccessException("unexpected token " + token + " expecting " + VCML.BeginBlock);
    }
    while (tokens.hasMoreTokens()) {
        token = tokens.nextToken();
        if (token.equalsIgnoreCase(VCML.RefinementRoi)) {
            RefinementRoi roi = new RefinementRoi(tokens);
            addRefinementRoi(roi);
        } else if (token.equalsIgnoreCase(VCML.EndBlock)) {
            return;
        } else {
            throw new DataAccessException("unexpected token in refinement levels " + token);
        }
    }
    throw new DataAccessException("unclosed refinement level block");
}
Also used : DataAccessException(org.vcell.util.DataAccessException)

Example 7 with DataAccessException

use of org.vcell.util.DataAccessException in project vcell by virtualcell.

the class RefinementRoi method readVCML.

private void readVCML(CommentStringTokenizer tokens) throws DataAccessException {
    try {
        String token = tokens.nextToken();
        if (token.equalsIgnoreCase(VCML.RefinementRoi)) {
            token = tokens.nextToken();
            if (!token.equalsIgnoreCase(VCML.BeginBlock)) {
                throw new DataAccessException("unexpected token " + token + " expecting " + VCML.BeginBlock);
            }
        }
        while (tokens.hasMoreTokens()) {
            token = tokens.nextToken();
            if (token.equalsIgnoreCase(VCML.EndBlock)) {
                break;
            } else if (token.equalsIgnoreCase(VCML.RefinementRoiType)) {
                token = tokens.nextToken();
                type = RoiType.valueOf(token);
            } else if (token.equalsIgnoreCase(VCML.Level)) {
                token = tokens.nextToken();
                level = Integer.parseInt(token);
            } else if (token.equalsIgnoreCase(VCML.TagsGrow)) {
            // backward compatible
            } else if (token.equalsIgnoreCase(VCML.ROIExpression)) {
                token = tokens.readToSemicolon();
                try {
                    setRoiExpression(token);
                } catch (ExpressionException e) {
                    System.err.println("Invalid " + VCML.ROIExpression + ": " + token);
                }
            } else {
                throw new DataAccessException("unexpected identifier " + token);
            }
        }
    } catch (Throwable e) {
        e.printStackTrace(System.out);
        throw new DataAccessException("line #" + (tokens.lineIndex() + 1) + " Exception: " + e.getMessage());
    }
}
Also used : DataAccessException(org.vcell.util.DataAccessException) ExpressionException(cbit.vcell.parser.ExpressionException)

Example 8 with DataAccessException

use of org.vcell.util.DataAccessException in project vcell by virtualcell.

the class FluxReaction method setReactionParticipantsFromDatabase.

@Override
public void setReactionParticipantsFromDatabase(Model model, ReactionParticipant[] reactionParticipants) throws DataAccessException, PropertyVetoException {
    ArrayList<ReactionParticipant> participants = new ArrayList<ReactionParticipant>();
    Membrane membrane = (Membrane) getStructure();
    for (ReactionParticipant participant : reactionParticipants) {
        if (participant instanceof FluxReaction.Flux) {
            // replace "Flux" objects with Reactants and Products.
            FluxReaction.Flux flux = (FluxReaction.Flux) participant;
            Structure structure = flux.getStructure();
            if (model.getStructureTopology() != null) {
                if (model.getStructureTopology().getInsideFeature(membrane) == structure) {
                    Product product = new Product(null, this);
                    product.setSpeciesContext(flux.getSpeciesContext());
                    participants.add(product);
                } else if (model.getStructureTopology().getOutsideFeature(membrane) == structure) {
                    Reactant reactant = new Reactant(null, this);
                    reactant.setSpeciesContext(flux.getSpeciesContext());
                    participants.add(reactant);
                } else {
                    throw new DataAccessException("unable to translate Flux reaction \"" + getName() + "\" saved prior to version 5.3, can't reconcile structure topology");
                }
            } else {
                throw new DataAccessException("unable to translate Flux reaction \"" + getName() + "\" saved prior to version 5.3, has no structure topology");
            }
        } else {
            participants.add(participant);
        }
    }
    setReactionParticipants(participants.toArray(new ReactionParticipant[participants.size()]));
}
Also used : ArrayList(java.util.ArrayList) DataAccessException(org.vcell.util.DataAccessException)

Example 9 with DataAccessException

use of org.vcell.util.DataAccessException in project vcell by virtualcell.

the class LocalUserMetaDbServerMessaging method getSimulationStatus.

/**
 * Insert the method's description here.
 * Creation date: (9/1/2004 11:27:01 AM)
 * @return cbit.vcell.solver.SolverResultSetInfo
 * @param simKey cbit.sql.KeyValue
 * @throws RemoteException
 */
public SimulationStatusPersistent getSimulationStatus(org.vcell.util.document.KeyValue simulationKey) throws DataAccessException, ObjectNotFoundException {
    try {
        log.print("LocalUserMetaDbServerMessaging.getSimulationStatus(key=" + simulationKey + ")");
        SimulationStatusPersistent simulationStatus = dbServerProxy.getSimulationStatus(simulationKey);
        return simulationStatus;
    } catch (DataAccessException e) {
        log.exception(e);
        throw e;
    } catch (Throwable e) {
        log.exception(e);
        throw new DataAccessException(e.getMessage());
    }
}
Also used : SimulationStatusPersistent(cbit.vcell.server.SimulationStatusPersistent) DataAccessException(org.vcell.util.DataAccessException)

Example 10 with DataAccessException

use of org.vcell.util.DataAccessException in project vcell by virtualcell.

the class LocalUserMetaDbServerMessaging method getVCImageXML.

/**
 * getVersionInfo method comment.
 * @throws RemoteException
 */
public BigString getVCImageXML(KeyValue imageKey) throws DataAccessException, ObjectNotFoundException {
    try {
        log.print("LocalUserMetaDbServerMessaging.getSimulationXML(imageKey=" + imageKey + ")");
        BigString xml = dbServerProxy.getVCImageXML(imageKey);
        return xml;
    } catch (DataAccessException e) {
        log.exception(e);
        throw e;
    } catch (Throwable e) {
        log.exception(e);
        throw new DataAccessException(e.getMessage());
    }
}
Also used : BigString(org.vcell.util.BigString) DataAccessException(org.vcell.util.DataAccessException)

Aggregations

DataAccessException (org.vcell.util.DataAccessException)345 KeyValue (org.vcell.util.document.KeyValue)82 XmlParseException (cbit.vcell.xml.XmlParseException)80 ExpressionException (cbit.vcell.parser.ExpressionException)78 ObjectNotFoundException (org.vcell.util.ObjectNotFoundException)71 SQLException (java.sql.SQLException)67 IOException (java.io.IOException)60 MathException (cbit.vcell.math.MathException)59 RemoteProxyException (cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException)46 BigString (org.vcell.util.BigString)45 User (org.vcell.util.document.User)42 FileNotFoundException (java.io.FileNotFoundException)38 ResultSet (java.sql.ResultSet)38 PropertyVetoException (java.beans.PropertyVetoException)37 File (java.io.File)34 PermissionException (org.vcell.util.PermissionException)34 Statement (java.sql.Statement)33 ExpressionBindingException (cbit.vcell.parser.ExpressionBindingException)32 BioModelInfo (org.vcell.util.document.BioModelInfo)29 Vector (java.util.Vector)26