
org.ow2.bonita.env.binding.RuntimeDbSessionBinding Maven / Gradle / Ivy
package org.ow2.bonita.env.binding;
import org.ow2.bonita.env.EnvConstants;
import org.ow2.bonita.env.descriptor.RuntimeDbSessionDescriptor;
import org.ow2.bonita.pvm.internal.wire.xml.WireParser;
import org.ow2.bonita.util.ExceptionManager;
import org.ow2.bonita.util.xml.Parse;
import org.ow2.bonita.util.xml.Parser;
import org.ow2.bonita.util.xml.TagBinding;
import org.w3c.dom.Element;
/**
*
* @author Marc Blachon, Guillaume Porcher, Charles Souillard, Miguel Valdes, Pierre Vigneras
*/
public class RuntimeDbSessionBinding extends TagBinding {
public RuntimeDbSessionBinding() {
super(EnvConstants.RUNTIME_DB_SESSION_TAG, null, WireParser.CATEGORY_DESCRIPTOR);
}
public Object parse(Element element, Parse parse, Parser parser) {
RuntimeDbSessionDescriptor descriptor = new RuntimeDbSessionDescriptor();
if (element.hasAttribute("session")) {
descriptor.setSessionName(element.getAttribute("session"));
} else {
String message = ExceptionManager.getInstance().getFullMessage(
"bse_RDSB_1", EnvConstants.RUNTIME_DB_SESSION_TAG);
throw new RuntimeException(message);
}
if (element.hasAttribute("name")) {
descriptor.setName(element.getAttribute("name"));
} else {
String message = ExceptionManager.getInstance().getFullMessage(
"bse_RDSB_2", EnvConstants.RUNTIME_DB_SESSION_TAG);
throw new RuntimeException(message);
}
return descriptor;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy