Package org.xsocket

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



    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


        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


        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

      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

      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

      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 = EXECUTIONMODE_UNSYNCHRONIZED;
               
            } 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

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.