Package org.atmosphere.cpr
Class AtmosphereResourceEventImpl
java.lang.Object
org.atmosphere.cpr.AtmosphereResourceEventImpl
- All Implemented Interfaces:
AtmosphereResourceEvent
- Direct Known Subclasses:
HeartbeatAtmosphereResourceEvent
AtmosphereResourceEvent implementation.- Author:
- Jeanfrancois Arcand
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAtmosphereResourceEventImpl(AtmosphereResourceImpl resource, boolean isCancelled, boolean isResumedOnTimeout) AtmosphereResourceEventImpl(AtmosphereResourceImpl resource, boolean isCancelled, boolean isResumedOnTimeout, boolean isClosedByClient, Throwable throwable) AtmosphereResourceEventImpl(AtmosphereResourceImpl resource, boolean isCancelled, boolean isResumedOnTimeout, Throwable throwable) -
Method Summary
Modifier and TypeMethodDescriptionReturn the broadcaster associated with theAtmosphereResourcethis object contains.destroy()booleanReturn the object that was passed toBroadcaster.broadcast(java.lang.Object).Return theAtmosphereResourceassociated with this event.inthashCode()booleanReturn true when the remote client close the connection.booleanReturn true if the application closed the connection usingAtmosphereResource.close().booleanReturn true if the client closed the connection and send the Atmosphere close message.isClosedByClient(boolean isClosedByClient) booleanReturn true is the response gets resumed after a timeout.booleanReturn true ifAtmosphereResource.resume()has been invoked.booleanReturn true ifAtmosphereResource.suspend()has been invoked and set to true.setCancelled(boolean isCancelled) setCloseByApplication(boolean b) protected AtmosphereResourceEventImplsetIsResumedOnTimeout(boolean isResumedOnTimeout) setMessage(Object message) Set an Object that can be retrieved withAtmosphereResourceEvent.getMessage().Return aThrowableif an unexpected exception occured.toString()
-
Field Details
-
message
-
resource
-
-
Constructor Details
-
AtmosphereResourceEventImpl
-
AtmosphereResourceEventImpl
public AtmosphereResourceEventImpl(AtmosphereResourceImpl resource, boolean isCancelled, boolean isResumedOnTimeout) -
AtmosphereResourceEventImpl
public AtmosphereResourceEventImpl(AtmosphereResourceImpl resource, boolean isCancelled, boolean isResumedOnTimeout, Throwable throwable) -
AtmosphereResourceEventImpl
public AtmosphereResourceEventImpl(AtmosphereResourceImpl resource, boolean isCancelled, boolean isResumedOnTimeout, boolean isClosedByClient, Throwable throwable)
-
-
Method Details
-
isResuming
public boolean isResuming()Description copied from interface:AtmosphereResourceEventReturn true ifAtmosphereResource.resume()has been invoked.- Specified by:
isResumingin interfaceAtmosphereResourceEvent- Returns:
- true if
AtmosphereResource.resume()has been invoked and set to true
-
isSuspended
public boolean isSuspended()Description copied from interface:AtmosphereResourceEventReturn true ifAtmosphereResource.suspend()has been invoked and set to true.- Specified by:
isSuspendedin interfaceAtmosphereResourceEvent- Returns:
- true if
AtmosphereResource.suspend()has been invoked and set to true
-
isClosedByClient
public boolean isClosedByClient()Description copied from interface:AtmosphereResourceEventReturn true if the client closed the connection and send the Atmosphere close message. You must use theOnDisconnectInterceptorin order to receive the proper value, and atmosphereProtocol must be set to true on the client side (enabledProtocol is true by default).- Specified by:
isClosedByClientin interfaceAtmosphereResourceEvent- Returns:
-
isClosedByApplication
public boolean isClosedByApplication()Description copied from interface:AtmosphereResourceEventReturn true if the application closed the connection usingAtmosphereResource.close().- Specified by:
isClosedByApplicationin interfaceAtmosphereResourceEvent- Returns:
- if the application.
-
setCloseByApplication
-
getMessage
Description copied from interface:AtmosphereResourceEventReturn the object that was passed toBroadcaster.broadcast(java.lang.Object).- Specified by:
getMessagein interfaceAtmosphereResourceEvent- Returns:
- the object that was passed to
Broadcaster.broadcast(java.lang.Object)
-
setMessage
Description copied from interface:AtmosphereResourceEventSet an Object that can be retrieved withAtmosphereResourceEvent.getMessage(). Note that the value may be overridden whenBroadcaster.broadcast(java.lang.Object)gets invoked.- Specified by:
setMessagein interfaceAtmosphereResourceEvent- Parameters:
message- an Object that can be retrieved withAtmosphereResourceEvent.getMessage().
-
isClosedByClient
-
isResumedOnTimeout
public boolean isResumedOnTimeout()Description copied from interface:AtmosphereResourceEventReturn true is the response gets resumed after a timeout.- Specified by:
isResumedOnTimeoutin interfaceAtmosphereResourceEvent- Returns:
- true is the response gets resumed after a timeout.
-
isCancelled
public boolean isCancelled()Description copied from interface:AtmosphereResourceEventReturn true when the remote client close the connection.- Specified by:
isCancelledin interfaceAtmosphereResourceEvent- Returns:
- true when the remote client close the connection.
-
setCancelled
-
setIsResumedOnTimeout
-
equals
-
hashCode
public int hashCode() -
throwable
Description copied from interface:AtmosphereResourceEventReturn aThrowableif an unexpected exception occured.- Specified by:
throwablein interfaceAtmosphereResourceEvent- Returns:
Throwableif an unexpected exception occured.
-
broadcaster
Description copied from interface:AtmosphereResourceEventReturn the broadcaster associated with theAtmosphereResourcethis object contains.- Specified by:
broadcasterin interfaceAtmosphereResourceEvent
-
getResource
Description copied from interface:AtmosphereResourceEventReturn theAtmosphereResourceassociated with this event.- Specified by:
getResourcein interfaceAtmosphereResourceEvent- Returns:
AtmosphereResource
-
setThrowable
-
destroy
-
toString
-