Package org.xsocket

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


                executionMode = -1;
               
            } else {
                executionMode = IBodyDataHandler.DEFAULT_EXECUTION_MODE;
                           
                Execution execution = bodyDataHandler.getClass().getAnnotation(Execution.class);
                if (execution != null) {
                    executionMode = execution.value();
                }
                       
                try {
                    Method meth = bodyDataHandler.getClass().getMethod("onData", new Class[] { NonBlockingBodyDataSource.class });
                    execution = meth.getAnnotation(Execution.class);
                    if (execution != null) {
                        executionMode = 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

        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

     * @param clazz   the handler class
     * @param dflt    the default value
     * @return true, if multi threaded
     */
    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

     */
    @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

                executionMode = -1;
               
            } else {
                executionMode = IBodyDataHandler.DEFAULT_EXECUTION_MODE;
                           
                Execution execution = bodyDataHandler.getClass().getAnnotation(Execution.class);
                if (execution != null) {
                    executionMode = execution.value();
                }
                       
                try {
                    Method meth = bodyDataHandler.getClass().getMethod("onData", new Class[] { NonBlockingBodyDataSource.class });
                    execution = meth.getAnnotation(Execution.class);
                    if (execution != null) {
                        executionMode = 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

    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

    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

   * @param clazz   the handler class
   * @param dflt    the default value
   * @return true, if multi threaded
   */
    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

     */
    @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

TOP

Related Classes of org.xsocket.Execution

Copyright © 2018 www.massapicom. 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.