use of lucee.runtime.exp.PageRuntimeException in project Lucee by lucee.
the class XMLDocumentStruct method setStrictErrorChecking.
// used only with java 7, do not set @Override
public void setStrictErrorChecking(boolean arg0) {
// dynamic load to support jre 1.4 and 1.5
try {
Method m = doc.getClass().getMethod("setStrictErrorChecking", new Class[] { boolean.class });
m.invoke(doc, new Object[] { Caster.toBoolean(arg0) });
} catch (Exception e) {
throw new PageRuntimeException(Caster.toPageException(e));
}
}
use of lucee.runtime.exp.PageRuntimeException in project Lucee by lucee.
the class XMLElementStruct method setIdAttribute.
// used only with java 7, do not set @Override
public void setIdAttribute(String name, boolean isId) throws DOMException {
// dynamic load to support jre 1.4 and 1.5
try {
Method m = element.getClass().getMethod("setIdAttribute", new Class[] { name.getClass(), boolean.class });
m.invoke(element, new Object[] { name, Caster.toBoolean(isId) });
} catch (Exception e) {
throw new PageRuntimeException(Caster.toPageException(e));
}
}
use of lucee.runtime.exp.PageRuntimeException in project Lucee by lucee.
the class XMLElementStruct method setIdAttributeNS.
// used only with java 7, do not set @Override
public void setIdAttributeNS(String namespaceURI, String localName, boolean isId) throws DOMException {
// dynamic load to support jre 1.4 and 1.5
try {
Method m = element.getClass().getMethod("setIdAttributeNS", new Class[] { namespaceURI.getClass(), localName.getClass(), boolean.class });
m.invoke(element, new Object[] { namespaceURI, localName, Caster.toBoolean(isId) });
} catch (Exception e) {
throw new PageRuntimeException(Caster.toPageException(e));
}
}
use of lucee.runtime.exp.PageRuntimeException in project Lucee by lucee.
the class RHExtension method toBundleDefinitions.
public static BundleDefinition[] toBundleDefinitions(String strBundles) {
if (StringUtil.isEmpty(strBundles, true))
return EMPTY_BD;
String[] arrStrs = toArray(strBundles);
BundleDefinition[] arrBDs;
if (!ArrayUtil.isEmpty(arrStrs)) {
arrBDs = new BundleDefinition[arrStrs.length];
int index;
for (int i = 0; i < arrStrs.length; i++) {
index = arrStrs[i].indexOf(':');
if (index == -1)
arrBDs[i] = new BundleDefinition(arrStrs[i].trim());
else {
try {
arrBDs[i] = new BundleDefinition(arrStrs[i].substring(0, index).trim(), arrStrs[i].substring(index + 1).trim());
} catch (BundleException e) {
// should not happen
throw new PageRuntimeException(e);
}
}
}
} else
arrBDs = EMPTY_BD;
return arrBDs;
}
use of lucee.runtime.exp.PageRuntimeException in project Lucee by lucee.
the class DatasourceManagerImpl method rollback.
@Override
public void rollback() throws DatabaseException {
if (autoCommit || transConns.size() == 0)
return;
Iterator<DatasourceConnection> it = this.transConns.values().iterator();
DatasourceConnection dc = null;
Pair<DatasourceConnection, Exception> pair = null;
while (it.hasNext()) {
dc = it.next();
try {
dc.getConnection().rollback();
} catch (Exception e) {
// we only keep the first exception
if (pair == null) {
pair = new Pair<DatasourceConnection, Exception>(dc, e);
}
}
}
if (pair != null) {
if (pair.getValue() instanceof SQLException) {
throw new DatabaseException((SQLException) pair.getValue(), pair.getName());
}
throw new PageRuntimeException(pair.getValue());
}
}
Aggregations