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 final boolean webSocketEnabled​(javax.servlet.http.HttpServletRequest request)
      • rawWebSocket

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

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

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

        public static final boolean atmosphereProtocol​(AtmosphereRequest r)
      • webSocketMessage

        public static final boolean webSocketMessage​(AtmosphereResource r)
      • properProtocol

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

        public static final 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 final void inject​(AtmosphereResource r)
                                 throws java.lang.IllegalAccessException
        Throws:
        java.lang.IllegalAccessException
      • inject

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

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

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

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

        public static final boolean requestScopedInjection​(AtmosphereConfig config,
                                                           java.lang.Object o)
        Inject custom object. This method is mostly for external framework.
        Parameters:
        config -
        o -
        Returns: