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");
}
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());
}
}
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()]));
}
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());
}
}
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());
}
}
Aggregations