Examples of ObjectHolder


Examples of org.apache.accumulo.examples.wikisearch.parser.QueryParser.ObjectHolder

    return null;
  }
 
  public Object visit(ASTNENode node, Object data) {
    StringBuilder fieldName = new StringBuilder();
    ObjectHolder value = new ObjectHolder();
    // Process both sides of this node.
    Object left = node.jjtGetChild(0).jjtAccept(this, data);
    Object right = node.jjtGetChild(1).jjtAccept(this, data);
    // Ignore functions in the query
    if (left instanceof FunctionResult || right instanceof FunctionResult)
      return null;
    decodeResults(left, right, fieldName, value);
    // We need to check to see if we are in a NOT context. If so,
    // then we need to reverse the negation.
    boolean negated = true;
    if (null != data && data instanceof EvaluationContext) {
      EvaluationContext ctx = (EvaluationContext) data;
      if (ctx.inNotContext)
        negated = !negated;
    }
    QueryTerm term = new QueryTerm(negated, JexlOperatorConstants.getOperator(node.getClass()), value.getObject());
    this.currentNode.getTerms().put(fieldName.toString(), term);
    return null;
  }
View Full Code Here

Examples of org.apache.accumulo.examples.wikisearch.parser.QueryParser.ObjectHolder

    return null;
  }
 
  public Object visit(ASTLTNode node, Object data) {
    StringBuilder fieldName = new StringBuilder();
    ObjectHolder value = new ObjectHolder();
    // Process both sides of this node.
    Object left = node.jjtGetChild(0).jjtAccept(this, data);
    Object right = node.jjtGetChild(1).jjtAccept(this, data);
    // Ignore functions in the query
    if (left instanceof FunctionResult || right instanceof FunctionResult)
      return null;
    decodeResults(left, right, fieldName, value);
    // We need to check to see if we are in a NOT context. If so,
    // then we need to reverse the negation.
    boolean negated = false;
    if (null != data && data instanceof EvaluationContext) {
      EvaluationContext ctx = (EvaluationContext) data;
      if (ctx.inNotContext)
        negated = !negated;
    }
    QueryTerm term = new QueryTerm(negated, JexlOperatorConstants.getOperator(node.getClass()), value.getObject());
    this.currentNode.getTerms().put(fieldName.toString(), term);
    return null;
  }
View Full Code Here

Examples of org.apache.accumulo.examples.wikisearch.parser.QueryParser.ObjectHolder

    return null;
  }
 
  public Object visit(ASTGTNode node, Object data) {
    StringBuilder fieldName = new StringBuilder();
    ObjectHolder value = new ObjectHolder();
    // Process both sides of this node.
    Object left = node.jjtGetChild(0).jjtAccept(this, data);
    Object right = node.jjtGetChild(1).jjtAccept(this, data);
    // Ignore functions in the query
    if (left instanceof FunctionResult || right instanceof FunctionResult)
      return null;
    decodeResults(left, right, fieldName, value);
    // We need to check to see if we are in a NOT context. If so,
    // then we need to reverse the negation.
    boolean negated = false;
    if (null != data && data instanceof EvaluationContext) {
      EvaluationContext ctx = (EvaluationContext) data;
      if (ctx.inNotContext)
        negated = !negated;
    }
    QueryTerm term = new QueryTerm(negated, JexlOperatorConstants.getOperator(node.getClass()), value.getObject());
    this.currentNode.getTerms().put(fieldName.toString(), term);
    return null;
  }
View Full Code Here

Examples of org.apache.accumulo.examples.wikisearch.parser.QueryParser.ObjectHolder

    return null;
  }
 
  public Object visit(ASTLENode node, Object data) {
    StringBuilder fieldName = new StringBuilder();
    ObjectHolder value = new ObjectHolder();
    // Process both sides of this node.
    Object left = node.jjtGetChild(0).jjtAccept(this, data);
    Object right = node.jjtGetChild(1).jjtAccept(this, data);
    // Ignore functions in the query
    if (left instanceof FunctionResult || right instanceof FunctionResult)
      return null;
    decodeResults(left, right, fieldName, value);
    // We need to check to see if we are in a NOT context. If so,
    // then we need to reverse the negation.
    boolean negated = false;
    if (null != data && data instanceof EvaluationContext) {
      EvaluationContext ctx = (EvaluationContext) data;
      if (ctx.inNotContext)
        negated = !negated;
    }
    QueryTerm term = new QueryTerm(negated, JexlOperatorConstants.getOperator(node.getClass()), value.getObject());
    this.currentNode.getTerms().put(fieldName.toString(), term);
    return null;
  }
View Full Code Here

Examples of org.apache.accumulo.examples.wikisearch.parser.QueryParser.ObjectHolder

    return null;
  }
 
  public Object visit(ASTGENode node, Object data) {
    StringBuilder fieldName = new StringBuilder();
    ObjectHolder value = new ObjectHolder();
    // Process both sides of this node.
    Object left = node.jjtGetChild(0).jjtAccept(this, data);
    Object right = node.jjtGetChild(1).jjtAccept(this, data);
    // Ignore functions in the query
    if (left instanceof FunctionResult || right instanceof FunctionResult)
      return null;
    decodeResults(left, right, fieldName, value);
    // We need to check to see if we are in a NOT context. If so,
    // then we need to reverse the negation.
    boolean negated = false;
    if (null != data && data instanceof EvaluationContext) {
      EvaluationContext ctx = (EvaluationContext) data;
      if (ctx.inNotContext)
        negated = !negated;
    }
    QueryTerm term = new QueryTerm(negated, JexlOperatorConstants.getOperator(node.getClass()), value.getObject());
    this.currentNode.getTerms().put(fieldName.toString(), term);
    return null;
  }
View Full Code Here

Examples of org.apache.accumulo.examples.wikisearch.parser.QueryParser.ObjectHolder

    return null;
  }
 
  public Object visit(ASTERNode node, Object data) {
    StringBuilder fieldName = new StringBuilder();
    ObjectHolder value = new ObjectHolder();
    // Process both sides of this node.
    Object left = node.jjtGetChild(0).jjtAccept(this, data);
    Object right = node.jjtGetChild(1).jjtAccept(this, data);
    // Ignore functions in the query
    if (left instanceof FunctionResult || right instanceof FunctionResult)
      return null;
    decodeResults(left, right, fieldName, value);
    // We need to check to see if we are in a NOT context. If so,
    // then we need to reverse the negation.
    boolean negated = false;
    if (null != data && data instanceof EvaluationContext) {
      EvaluationContext ctx = (EvaluationContext) data;
      if (ctx.inNotContext)
        negated = !negated;
    }
    QueryTerm term = new QueryTerm(negated, JexlOperatorConstants.getOperator(node.getClass()), value.getObject());
    this.currentNode.getTerms().put(fieldName.toString(), term);
    return null;
  }
View Full Code Here

Examples of org.apache.accumulo.examples.wikisearch.parser.QueryParser.ObjectHolder

    return null;
  }
 
  public Object visit(ASTNRNode node, Object data) {
    StringBuilder fieldName = new StringBuilder();
    ObjectHolder value = new ObjectHolder();
    // Process both sides of this node.
    Object left = node.jjtGetChild(0).jjtAccept(this, data);
    Object right = node.jjtGetChild(1).jjtAccept(this, data);
    // Ignore functions in the query
    if (left instanceof FunctionResult || right instanceof FunctionResult)
      return null;
    decodeResults(left, right, fieldName, value);
    // We need to check to see if we are in a NOT context. If so,
    // then we need to reverse the negation.
    boolean negated = true;
    if (null != data && data instanceof EvaluationContext) {
      EvaluationContext ctx = (EvaluationContext) data;
      if (ctx.inNotContext)
        negated = !negated;
    }
    QueryTerm term = new QueryTerm(negated, "!~", value.getObject());
    this.currentNode.getTerms().put(fieldName.toString(), term);
    return null;
  }
View Full Code Here

Examples of org.apache.geronimo.genesis.util.ObjectHolder

            java.createArg().setValue("-userExtensions");
            java.createArg().setFile(userExtentionsFile);
        }

        // Holds any exception that was thrown during startup
        final ObjectHolder errorHolder = new ObjectHolder();

        // Start the server int a seperate thread
        Thread t = new Thread("Selenium Server Runner") {
            public void run() {
                try {
                    java.execute();
                }
                catch (Exception e) {
                    errorHolder.set(e);

                    //
                    // NOTE: Don't log here, as when the JVM exists an exception will get thrown by Ant
                    //       but that should be fine.
                    //
                }
            }
        };
        t.start();

        log.debug("Waiting for Selenium server...");

        // Verify server started
        URL url = new URL("http://localhost:" + port + "/selenium-server");
        boolean started = false;
        while (!started) {
            if (errorHolder.isSet()) {
                throw new MojoExecutionException("Failed to start Selenium server", (Throwable)errorHolder.get());
            }

            log.debug("Trying connection to: " + url);

            try {
View Full Code Here

Examples of org.apache.geronimo.genesis.util.ObjectHolder

            java.createArg().setValue("-userExtensions");
            java.createArg().setFile(userExtentionsFile);
        }

        // Holds any exception that was thrown during startup
        final ObjectHolder errorHolder = new ObjectHolder();

        // Start the server int a seperate thread
        Thread t = new Thread("Selenium Server Runner") {
            public void run() {
                try {
                    java.execute();
                }
                catch (Exception e) {
                    errorHolder.set(e);

                    //
                    // NOTE: Don't log here, as when the JVM exists an exception will get thrown by Ant
                    //       but that should be fine.
                    //
                }
            }
        };
        t.start();

        log.debug("Waiting for Selenium server...");

        // Verify server started
        URL url = new URL("http://localhost:" + port + "/selenium-server");
        boolean started = false;
        while (!started) {
            if (errorHolder.isSet()) {
                throw new MojoExecutionException("Failed to start Selenium server", (Throwable)errorHolder.get());
            }

            log.debug("Trying connection to: " + url);

            try {
View Full Code Here

Examples of org.apache.geronimo.genesis.util.ObjectHolder

           
            java.setOutput(file);
        }

        // Holds any exception that was thrown during startup
        final ObjectHolder errorHolder = new ObjectHolder();

        // Start the server int a seperate thread
        Thread t = new Thread("Geronimo Server Runner") {
            public void run() {
                try {
                    java.execute();
                }
                catch (Exception e) {
                    errorHolder.set(e);

                    //
                    // NOTE: Don't log here, as when the JVM exists an exception will get thrown by Ant
                    //       but that should be fine.
                    //
                }
            }
        };
        t.start();

        log.debug("Waiting for Geronimo server...");

        // Setup a callback to time out verification
        final ObjectHolder verifyTimedOut = new ObjectHolder();

        TimerTask timeoutTask = new TimerTask() {
            public void run() {
                verifyTimedOut.set(Boolean.TRUE);
            }
        };

        if (verifyTimeout > 0) {
            log.debug("Starting verify timeout task; triggers in: " + verifyTimeout + "s");
            timer.schedule(timeoutTask, verifyTimeout * 1000);
        }

        // Verify server started
        ServerProxy server = new ServerProxy(hostname, port, username, password);
        boolean started = false;
        while (!started) {
            if (verifyTimedOut.isSet()) {
                throw new MojoExecutionException("Unable to verify if the server was started in the given time");
            }

            if (errorHolder.isSet()) {
                throw new MojoExecutionException("Failed to start Geronimo server", (Throwable)errorHolder.get());
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.