Class Utils


  • public final class Utils
    extends java.lang.Object
    Utils class.
    Author:
    Jeanfrancois Arcand
    • Constructor Detail

      • Utils

        public Utils()
    • Method Detail

      • webSocketEnabled

        public static boolean webSocketEnabled​(javax.servlet.http.HttpServletRequest request)
      • rawWebSocket

        public static boolean rawWebSocket​(javax.servlet.http.HttpServletRequest request)
      • firefoxWebSocketEnabled

        public static boolean firefoxWebSocketEnabled​(javax.servlet.http.HttpServletRequest request)
      • webSocketQueryStringPresentOrNull

        public static boolean webSocketQueryStringPresentOrNull​(javax.servlet.http.HttpServletRequest request)
      • atmosphereProtocol

        public static boolean atmosphereProtocol​(AtmosphereRequest r)
      • properProtocol

        public static boolean properProtocol​(javax.servlet.http.HttpServletRequest request)
      • closeMessage

        public static boolean closeMessage​(javax.servlet.http.HttpServletRequest request)
      • invoke

        public static java.lang.Object invoke​(java.lang.Object proxiedInstance,
                                              java.lang.reflect.Method m,
                                              java.lang.Object o)

        Manages the invocation of the given method on the specified 'proxied' instance. Logs any invocation failure.

        Parameters:
        proxiedInstance - the instance
        m - the method to invoke that belongs to the instance
        o - the optional parameter
        Returns:
        the result of the invocation
      • inject

        public static void inject​(AtmosphereResource r)
                           throws java.lang.IllegalAccessException
        Throws:
        java.lang.IllegalAccessException
      • inject

        public static void inject​(java.lang.Object object,
                                  java.lang.Class<?> clazz,
                                  AtmosphereResource r)
                           throws java.lang.IllegalAccessException
        Throws:
        java.lang.IllegalAccessException
      • inject

        public static void inject​(java.lang.Object object,
                                  java.lang.Class<?> clazz,
                                  AtmosphereConfig config)
                           throws java.lang.IllegalAccessException
        Throws:
        java.lang.IllegalAccessException
      • getInheritedPrivateFields

        public static java.util.Set<java.lang.reflect.Field> getInheritedPrivateFields​(java.lang.Class<?> type)
      • getInheritedPrivateMethod

        public static java.util.Set<java.lang.reflect.Method> getInheritedPrivateMethod​(java.lang.Class<?> type)
      • requestScopedInjection

        public static boolean requestScopedInjection​(AtmosphereConfig config,
                                                     java.lang.Object o)
        Inject custom object. This method is mostly for external framework.
      • isRunningTest

        public static boolean isRunningTest()