Examples of Execution


Examples of org.teiid.translator.Execution

          this.translatedCommand = factory.translate(command);
 
          RuntimeMetadata rmd = new RuntimeMetadataImpl(queryMetadata);
         
          // Create the execution based on mode
          final Execution exec = connector.createExecution(this.translatedCommand, this.securityContext, rmd, (unwrapped == null) ? this.connection:unwrapped);
          if (this.translatedCommand instanceof Call) {
            this.execution = Assertion.isInstanceOf(exec, ProcedureExecution.class, "Call Executions are expected to be ProcedureExecutions"); //$NON-NLS-1$
            StoredProcedure proc = (StoredProcedure)command;
            if (proc.returnParameters()) {
              this.procedureBatchHandler = new ProcedureBatchHandler((Call)this.translatedCommand, (ProcedureExecution)exec);
            }
          } else if (this.translatedCommand instanceof QueryExpression){
            this.execution = Assertion.isInstanceOf(exec, ResultSetExecution.class, "QueryExpression Executions are expected to be ResultSetExecutions"); //$NON-NLS-1$
          } else {
            Assertion.isInstanceOf(exec, UpdateExecution.class, "Update Executions are expected to be UpdateExecutions"); //$NON-NLS-1$
            this.execution = new ResultSetExecution() {
              private int[] results;
              private int index;
             
              @Override
              public void cancel() throws TranslatorException {
                exec.cancel();
              }
              @Override
              public void close() {
                exec.close();
              }
              @Override
              public void execute() throws TranslatorException {
                exec.execute();
              }
              @Override
              public List<?> next() throws TranslatorException,
                  DataNotAvailableException {
                if (results == null) {
View Full Code Here

Examples of org.xsocket.Execution

    Boolean isMutlithreaded = bodyDataExecutionModeCache.get(bodyHandler.getClass());
   
    if (isMutlithreaded == null) {
      int mode = IBodyDataHandler.DEFAULT_EXECUTION_MODE;
     
      Execution execution = bodyHandler.getClass().getAnnotation(Execution.class);
      if (execution != null) {
        mode = execution.value();
      }
     
      try {
        Method meth = bodyHandler.getClass().getMethod("onData", new Class[] { NonBlockingBodyDataSource.class });
        execution = meth.getAnnotation(Execution.class);
        if (execution != null) {
          mode = execution.value();
        }
       
      } catch (NoSuchMethodException nsme) {
        if (LOG.isLoggable(Level.FINE)) {
          LOG.fine("shouldn't occure because body handler has to have such a method " + nsme.toString());
View Full Code Here

Examples of org.xsocket.Execution

      isDoHeadInvokeOnMessage = isOnRequestInvokeOnMessageReceived(clazz, "doHead", isInvokeOnMessageDefault);
    }
   
   
    private boolean isMethodMultithreaded(Class<HttpRequestHandler> clazz, String methodname, boolean dflt) {
      Execution execution = clazz.getAnnotation(Execution.class);
      if (execution != null) {
        return (execution.value() == Execution.MULTITHREADED);
      }

      try {
        Method meth = clazz.getMethod(methodname, new Class[] { IHttpExchange.class });
        execution = meth.getAnnotation(Execution.class);
        if (execution != null) {
          return (execution.value() == Execution.MULTITHREADED);
        }

      } catch (NoSuchMethodException nsme) {
        if (LOG.isLoggable(Level.FINE)) {
          LOG.fine("shouldn't occure because body handler has to have such a method " + nsme.toString());
View Full Code Here

Examples of org.xsocket.Execution

    Boolean isMutlithreaded = bodyCompleteListenerExecutionModeCache.get(completeListener.getClass());
    
    if (isMutlithreaded == null) {
      int mode = IBodyDataHandler.DEFAULT_EXECUTION_MODE;
     
      Execution execution = completeListener.getClass().getAnnotation(Execution.class);
      if (execution != null) {
        mode = execution.value();
      }
     
      try {
        Method meth = completeListener.getClass().getMethod("onComplete", new Class[] { });
        execution = meth.getAnnotation(Execution.class);
        if (execution != null) {
          mode = execution.value();
        }
       
      } catch (NoSuchMethodException nsme) {
        if (LOG.isLoggable(Level.FINE)) {
          LOG.fine("shouldn't occure because body handler has to have such a method " + nsme.toString());
View Full Code Here

Examples of org.xsocket.Execution

    Boolean isMultithreaded = requestTimeoutHandlerExecutionModeCache.get(clazz);
    
    if (isMultithreaded == null) {
      int mode = IHttpRequestTimeoutHandler.DEFAULT_EXECUTION_MODE;
     
      Execution execution = clazz.getAnnotation(Execution.class);
      if (execution != null) {
        mode = execution.value();
      }
     
      try {
        Method meth = clazz.getMethod("onRequestTimeout", new Class[] { IHttpConnection.class });
        execution = meth.getAnnotation(Execution.class);
        if (execution != null) {
          mode = execution.value();
        }
       
      } catch (NoSuchMethodException nsme) {
        if (LOG.isLoggable(Level.FINE)) {
          LOG.fine("shouldn't occure because request timeout handlerr has to have such a method " + nsme.toString());
View Full Code Here

Examples of org.xsocket.Execution

    Boolean isMutlithreaded = bodyCloseListenerExecutionModeCache.get(closeListener.getClass());
    
    if (isMutlithreaded == null) {
      int mode = IBodyDataHandler.DEFAULT_EXECUTION_MODE;
     
      Execution execution = closeListener.getClass().getAnnotation(Execution.class);
      if (execution != null) {
        mode = execution.value();
      }
     
      try {
        Method meth = closeListener.getClass().getMethod("onClose", new Class[] { });
        execution = meth.getAnnotation(Execution.class);
        if (execution != null) {
          mode = execution.value();
        }
       
      } catch (NoSuchMethodException nsme) {
        if (LOG.isLoggable(Level.FINE)) {
          LOG.fine("shouldn't occure because body handler has to have such a method " + nsme.toString());
View Full Code Here

Examples of org.xsocket.Execution

   * @param clazz   the handler class
   * @param dflt    the default value
   * @return true, if multi threaded
   */
    public static boolean isHandlerMultithreaded(Class<? extends Object> clazz, boolean dflt) {
        Execution execution = clazz.getAnnotation(Execution.class);
        if (execution != null) {
            if(execution.value() == Execution.NONTHREADED) {
                return false;
               
            } else {
                return true;
            }
View Full Code Here

Examples of org.xsocket.Execution

     */
    @SuppressWarnings("unchecked")
    public static boolean isMethodMultithreaded(Class clazz, String methodname, boolean dflt, Class... paramClass) {
        try {
            Method meth = clazz.getMethod(methodname, paramClass);
            Execution execution = meth.getAnnotation(Execution.class);
            if (execution != null) {
                if(execution.value() == Execution.NONTHREADED) {
                    return false;
                } else {
                    return true;
                }
            } else {
View Full Code Here

Examples of org.xsocket.Execution


    static boolean isOnConnectMultithreaded(Class<IHttpRequestHandler> serverHandlerClass) {
      int mode = IHttpRequestHandler.DEFAULT_EXECUTION_MODE;

      Execution execution = serverHandlerClass.getAnnotation(Execution.class);
      if (execution != null) {
        mode = execution.value();
        return (mode == Execution.MULTITHREADED);
      }

      try {
        Method meth = serverHandlerClass.getMethod("onConnect", new Class[] { IHttpConnection.class });
        execution = meth.getAnnotation(Execution.class);
        if (execution != null) {
          mode = execution.value();
        }

      } catch (NoSuchMethodException nsme) {
        if (LOG.isLoggable(Level.FINE)) {
          LOG.fine("shouldn't occure because body handler has to have such a method " + nsme.toString());
View Full Code Here

Examples of org.xsocket.Execution


    static boolean isOnDisconnectMultithreaded(Class<IHttpRequestHandler> serverHandlerClass) {
      int mode = IHttpRequestHandler.DEFAULT_EXECUTION_MODE;

      Execution execution = serverHandlerClass.getAnnotation(Execution.class);
      if (execution != null) {
        mode = execution.value();
        return (mode == Execution.MULTITHREADED);
      }

      try {
        Method meth = serverHandlerClass.getMethod("onDisconnect", new Class[] { IHttpConnection.class });
        execution = meth.getAnnotation(Execution.class);
        if (execution != null) {
          mode = execution.value();
        }

      } catch (NoSuchMethodException nsme) {
        if (LOG.isLoggable(Level.FINE)) {
          LOG.fine("shouldn't occure because body handler has to have such a method " + nsme.toString());
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.