org.atmosphere.cpr
Class AtmosphereResourceEventImpl

java.lang.Object
  extended by org.atmosphere.cpr.AtmosphereResourceEventImpl
All Implemented Interfaces:
AtmosphereResourceEvent

public class AtmosphereResourceEventImpl
extends Object
implements AtmosphereResourceEvent

AtmosphereResourceEvent implementation.

Author:
Jeanfrancois Arcand

Field Summary
protected  Object message
           
protected  AtmosphereResourceImpl resource
           
 
Constructor Summary
AtmosphereResourceEventImpl(AtmosphereResourceImpl resource)
           
AtmosphereResourceEventImpl(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
 Broadcaster broadcaster()
          Return the broadcaster associated with the AtmosphereResource this object contains.
 AtmosphereResourceEvent destroy()
           
 boolean equals(Object o)
           
 Object getMessage()
          Return the object that was passed to Broadcaster.broadcast(java.lang.Object).
 AtmosphereResource getResource()
          Return the AtmosphereResource associated with this event.
 int hashCode()
           
 boolean isCancelled()
          Return true when the remote client close the connection.
 boolean isClosedByApplication()
          Return true if the application closed the connection using AtmosphereResource.close().
 boolean isClosedByClient()
          Return true if the client closed the connection and send the Atmosphere close message.
 AtmosphereResourceEventImpl isClosedByClient(boolean isClosedByClient)
           
 boolean isResumedOnTimeout()
          Return true is the response gets resumed after a timeout.
 boolean isResuming()
          Return true if AtmosphereResource.resume() has been invoked.
 boolean isSuspended()
          Return true if AtmosphereResource.suspend() has been invoked and set to true.
protected  AtmosphereResourceEventImpl setCancelled(boolean isCancelled)
           
 AtmosphereResourceEventImpl setCloseByApplication(boolean b)
           
protected  AtmosphereResourceEventImpl setIsResumedOnTimeout(boolean isResumedOnTimeout)
           
 AtmosphereResourceEventImpl setMessage(Object message)
          Set an Object that can be retrieved with AtmosphereResourceEvent.getMessage().
 AtmosphereResourceEvent setThrowable(Throwable t)
           
 Throwable throwable()
          Return a Throwable if an unexpected exception occured.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

message

protected Object message

resource

protected AtmosphereResourceImpl resource
Constructor Detail

AtmosphereResourceEventImpl

public AtmosphereResourceEventImpl(AtmosphereResourceImpl resource)

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 Detail

isResuming

public boolean isResuming()
Description copied from interface: AtmosphereResourceEvent
Return true if AtmosphereResource.resume() has been invoked.

Specified by:
isResuming in interface AtmosphereResourceEvent
Returns:
true if AtmosphereResource.resume() has been invoked and set to true

isSuspended

public boolean isSuspended()
Description copied from interface: AtmosphereResourceEvent
Return true if AtmosphereResource.suspend() has been invoked and set to true.

Specified by:
isSuspended in interface AtmosphereResourceEvent
Returns:
true if AtmosphereResource.suspend() has been invoked and set to true

isClosedByClient

public boolean isClosedByClient()
Description copied from interface: AtmosphereResourceEvent
Return true if the client closed the connection and send the Atmosphere close message. You must use the OnDisconnectInterceptor in order to receive the proper value, and enableProtocol must be set to true on the client side (enabledProtocol is true by default).

Specified by:
isClosedByClient in interface AtmosphereResourceEvent
Returns:

isClosedByApplication

public boolean isClosedByApplication()
Description copied from interface: AtmosphereResourceEvent
Return true if the application closed the connection using AtmosphereResource.close().

Specified by:
isClosedByApplication in interface AtmosphereResourceEvent
Returns:
if the application.

setCloseByApplication

public AtmosphereResourceEventImpl setCloseByApplication(boolean b)

getMessage

public Object getMessage()
Description copied from interface: AtmosphereResourceEvent
Return the object that was passed to Broadcaster.broadcast(java.lang.Object).

Specified by:
getMessage in interface AtmosphereResourceEvent
Returns:
the object that was passed to Broadcaster.broadcast(java.lang.Object)

setMessage

public AtmosphereResourceEventImpl setMessage(Object message)
Description copied from interface: AtmosphereResourceEvent
Set an Object that can be retrieved with AtmosphereResourceEvent.getMessage(). Note that the value may be overridden when Broadcaster.broadcast(java.lang.Object) gets invoked.

Specified by:
setMessage in interface AtmosphereResourceEvent
Parameters:
message - an Object that can be retrieved with AtmosphereResourceEvent.getMessage().

isClosedByClient

public AtmosphereResourceEventImpl isClosedByClient(boolean isClosedByClient)

isResumedOnTimeout

public boolean isResumedOnTimeout()
Description copied from interface: AtmosphereResourceEvent
Return true is the response gets resumed after a timeout.

Specified by:
isResumedOnTimeout in interface AtmosphereResourceEvent
Returns:
true is the response gets resumed after a timeout.

isCancelled

public boolean isCancelled()
Description copied from interface: AtmosphereResourceEvent
Return true when the remote client close the connection.

Specified by:
isCancelled in interface AtmosphereResourceEvent
Returns:
true when the remote client close the connection.

setCancelled

protected AtmosphereResourceEventImpl setCancelled(boolean isCancelled)

setIsResumedOnTimeout

protected AtmosphereResourceEventImpl setIsResumedOnTimeout(boolean isResumedOnTimeout)

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

throwable

public Throwable throwable()
Description copied from interface: AtmosphereResourceEvent
Return a Throwable if an unexpected exception occured.

Specified by:
throwable in interface AtmosphereResourceEvent
Returns:
Throwable if an unexpected exception occured.

broadcaster

public Broadcaster broadcaster()
Description copied from interface: AtmosphereResourceEvent
Return the broadcaster associated with the AtmosphereResource this object contains.

Specified by:
broadcaster in interface AtmosphereResourceEvent

getResource

public AtmosphereResource getResource()
Description copied from interface: AtmosphereResourceEvent
Return the AtmosphereResource associated with this event.

Specified by:
getResource in interface AtmosphereResourceEvent
Returns:
AtmosphereResource

setThrowable

public AtmosphereResourceEvent setThrowable(Throwable t)

destroy

public AtmosphereResourceEvent destroy()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2014. All Rights Reserved.