Package org.atmosphere.util
Class Utils
java.lang.Object
org.atmosphere.util.Utils
Utils class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanstatic booleancloseMessage(HttpServletRequest request) static booleangetInheritedPrivateFields(Class<?> type) getInheritedPrivateMethod(Class<?> type) static voidinject(Object object, Class<?> clazz, AtmosphereConfig config) static voidinject(Object object, Class<?> clazz, AtmosphereResource r) static voidstatic ObjectManages the invocation of the given method on the specified 'proxied' instance.static booleanstatic StringpathInfo(AtmosphereRequest request) static booleanstatic booleanproperProtocol(HttpServletRequest request) static booleanstatic booleanrawWebSocket(HttpServletRequest request) static booleanrequestScopedInjection(AtmosphereConfig config, Object o) Inject custom object.static booleanstatic booleanstatic StringThe name of the transport a resource's client is connected with, for reports (admin, MCP, tracing, logs).static booleanstatic booleanwebSocketEnabled(HttpServletRequest request) static booleanstatic booleanstatic AtmosphereResource
-
Constructor Details
-
Utils
public Utils()
-
-
Method Details
-
webSocketEnabled
-
rawWebSocket
-
firefoxWebSocketEnabled
-
twoConnectionsTransport
-
webSocketQueryStringPresentOrNull
-
transportName
The name of the transport a resource's client is connected with, for reports (admin, MCP, tracing, logs). It isAtmosphereResource.transport()'s name, except for a WebTransport session: it is bridged onto the WebSocket processor and runs withAtmosphereResource.TRANSPORT.WEBSOCKETsemantics, sotransport()saysWEBSOCKETwhile the client is on HTTP/3. Such a resource carriesFrameworkConfig.WEBTRANSPORT_SESSIONand is reported asWEBTRANSPORT.- Parameters:
r- the resource- Returns:
- the upper-case transport name,
UNDEFINEDwhen unknown
-
resumableTransport
-
pollableTransport
-
pushMessage
-
atmosphereProtocol
-
webSocketMessage
-
properProtocol
-
websocketResource
-
closeMessage
-
invoke
Manages the invocation of the given method on the specified 'proxied' instance. Logs any invocation failure.
- Parameters:
proxiedInstance- the instancem- the method to invoke that belongs to the instanceo- the optional parameter- Returns:
- the result of the invocation
-
inject
- Throws:
IllegalAccessException
-
inject
public static void inject(Object object, Class<?> clazz, AtmosphereResource r) throws IllegalAccessException - Throws:
IllegalAccessException
-
inject
public static void inject(Object object, Class<?> clazz, AtmosphereConfig config) throws IllegalAccessException - Throws:
IllegalAccessException
-
getInheritedPrivateFields
-
getInheritedPrivateMethod
-
requestScopedInjection
-
requestScopedInjection
Inject custom object. This method is mostly for external framework. -
pathInfo
-
isRunningTest
public static boolean isRunningTest()
-