Examples of NewContext()


Examples of org.apache.cayenne.configuration.rop.client.ClientRuntime.newContext()

        properties.put(Constants.ROP_SERVICE_USERNAME_PROPERTY, "cayenne-user");
        properties.put(Constants.ROP_SERVICE_PASSWORD_PROPERTY, "secret");

        ClientRuntime runtime = new ClientRuntime(properties);

        ObjectContext context = runtime.newContext();

        newObjectsTutorial(context);
        selectTutorial(context);
        deleteTutorial(context);
    }
View Full Code Here

Examples of org.apache.cayenne.configuration.server.ServerRuntime.newContext()

        // starting Cayenne
        ServerRuntime cayenneRuntime = new ServerRuntime("cayenne-project.xml");

        // getting a hold of ObjectContext
        ObjectContext context = cayenneRuntime.newContext();

        newObjectsTutorial(context);
        selectTutorial(context);
        deleteTutorial(context);
    }
View Full Code Here

Examples of org.apache.commons.scxml.Evaluator.newContext()

            throw new InvokerException(se.getMessage(), se.getCause());
        }
        Evaluator eval = parentSCInstance.getEvaluator();
        executor = new SCXMLExecutor(eval,
            new SimpleDispatcher(), new SimpleErrorReporter());
        Context rootCtx = eval.newContext(null);
        for (Iterator iter = params.entrySet().iterator(); iter.hasNext();) {
            Map.Entry entry = (Map.Entry) iter.next();
            rootCtx.setLocal((String) entry.getKey(), entry.getValue());
        }
        executor.setRootContext(rootCtx);
View Full Code Here

Examples of org.apache.commons.scxml.Evaluator.newContext()

            throw new InvokerException(se.getMessage(), se.getCause());
        }
        Evaluator eval = parentSCInstance.getEvaluator();
        executor = new SCXMLExecutor(eval,
            new SimpleDispatcher(), new SimpleErrorReporter());
        Context rootCtx = eval.newContext(null);
        for (Iterator iter = params.entrySet().iterator(); iter.hasNext();) {
            Map.Entry entry = (Map.Entry) iter.next();
            rootCtx.setLocal((String) entry.getKey(), entry.getValue());
        }
        executor.setRootContext(rootCtx);
View Full Code Here

Examples of org.apache.commons.scxml.env.jexl.JexlEvaluator.newContext()

    }

    public static SCXMLExecutor getExecutor(SCXML scxml,
            SCXMLSemantics semantics) {
        Evaluator evaluator = new JexlEvaluator();
        Context context = evaluator.newContext(null);
        EventDispatcher ed = new SimpleDispatcher();
        Tracer trc = new Tracer();
        return getExecutor(context, evaluator, scxml, ed, trc, semantics);
    }
View Full Code Here

Examples of org.apache.commons.scxml.env.jexl.JexlEvaluator.newContext()

    }

    public static SCXMLExecutor getExecutor(SCXML scxml,
            SCXMLSemantics semantics) {
        Evaluator evaluator = new JexlEvaluator();
        Context context = evaluator.newContext(null);
        EventDispatcher ed = new SimpleDispatcher();
        Tracer trc = new Tracer();
        return getExecutor(context, evaluator, scxml, ed, trc, semantics);
    }
View Full Code Here

Examples of org.apache.tajo.engine.function.builtin.AvgLong.newContext()

      tuples[i-1] = new VTuple(1);
      tuples[i-1].put(0, DatumFactory.createInt4(i));
    }

    AvgLong avg = new AvgLong();
    FunctionContext ctx = avg.newContext();
    for (int i = 1; i <= 5; i++) {
      avg.eval(ctx, tuples[i-1]);
    }

    assertTrue(15 / 5 == avg.terminate(ctx).asFloat8());
View Full Code Here

Examples of org.apache.tajo.engine.function.builtin.AvgLong.newContext()

    assertTrue(15 / 5 == avg.terminate(ctx).asFloat8());


    Tuple [] tuples2 = new Tuple[10];

    FunctionContext ctx2 = avg.newContext();
    for (int i = 1; i <= 10; i++) {
      tuples2[i-1] = new VTuple(1);
      tuples2[i-1].put(0, DatumFactory.createInt4(i));
      avg.eval(ctx2, tuples2[i-1]);
    }
View Full Code Here

Examples of org.exist.xquery.XQuery.newContext()

                //try and get a pre-compiled query from the pool
                compiled = xqPool.borrowCompiledXQuery(broker, source);

                if(compiled == null) {
                    context = xquery.newContext(AccessContext.REST); //TODO should probably have its own AccessContext.SCHEDULER
                } else {
                    context = compiled.getContext();
                }

                //TODO: don't hardcode this?
View Full Code Here

Examples of org.exist.xquery.XQuery.newContext()

            final Source source = getQuerySource(broker, scriptURI, script);
            if(source == null) {return;}

            final XQuery xquery = broker.getXQueryService();
            final XQueryContext context = xquery.newContext(AccessContext.XMLDB);

            final CompiledXQuery compiled = xquery.compile(context, source);

//            Sequence result = xquery.execute(compiled, subject.getName());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.