Search in sources :

Example 1 with Variable

use of org.exist.xquery.Variable in project exist by eXist-db.

the class DebuggeeImpl method joint.

public boolean joint(CompiledXQuery compiledXQuery) {
    synchronized (this) {
        IoSession session = connection.connect();
        if (session == null)
            return false;
        // link debugger session & script
        DebuggeeJointImpl joint = new DebuggeeJointImpl();
        joint.setCompiledScript(compiledXQuery);
        XQueryContext context = compiledXQuery.getContext();
        context.setDebuggeeJoint(joint);
        String idesession = "";
        if (context.isVarDeclared(Debuggee.SESSION)) {
            try {
                Variable var = context.resolveVariable(Debuggee.SESSION);
                idesession = var.getValue().toString();
            } catch (XPathException e) {
            }
        }
        String idekey = "";
        if (context.isVarDeclared(Debuggee.IDEKEY)) {
            try {
                Variable var = context.resolveVariable(Debuggee.IDEKEY);
                idekey = var.getValue().toString();
            } catch (XPathException e) {
            }
        }
        joint.continuation(new Init(session, idesession, idekey));
        return true;
    }
}
Also used : Init(org.exist.debuggee.dbgp.packets.Init) Variable(org.exist.xquery.Variable) XPathException(org.exist.xquery.XPathException) XQueryContext(org.exist.xquery.XQueryContext) IoSession(org.apache.mina.core.session.IoSession)

Example 2 with Variable

use of org.exist.xquery.Variable in project exist by eXist-db.

the class ContextGet method getPropertiesString.

private String getPropertiesString() {
    if (variables == null)
        // XXX: error?
        return "";
    StringBuilder properties = new StringBuilder();
    XQueryContext ctx = getJoint().getContext();
    for (Variable variable : variables.values()) {
        properties.append(PropertyGet.getPropertyString(variable, ctx));
    }
    return properties.toString();
}
Also used : Variable(org.exist.xquery.Variable) XQueryContext(org.exist.xquery.XQueryContext)

Aggregations

Variable (org.exist.xquery.Variable)2 XQueryContext (org.exist.xquery.XQueryContext)2 IoSession (org.apache.mina.core.session.IoSession)1 Init (org.exist.debuggee.dbgp.packets.Init)1 XPathException (org.exist.xquery.XPathException)1