org.primefaces.push
Class PushContextImpl

java.lang.Object
  extended by org.atmosphere.cpr.AsyncSupportListenerAdapter
      extended by org.primefaces.push.PushContextImpl
All Implemented Interfaces:
org.atmosphere.cpr.AsyncSupportListener, PushContext

public class PushContextImpl
extends org.atmosphere.cpr.AsyncSupportListenerAdapter
implements PushContext


Constructor Summary
PushContextImpl()
           
 
Method Summary
 PushContext addListener(PushContextListener p)
          Add an event listener.
<T> Future<T>
delay(String channel, T t, int time, TimeUnit unit)
          Delay the push operation until the time expires.
 void onClose(org.atmosphere.cpr.AtmosphereRequest request, org.atmosphere.cpr.AtmosphereResponse response)
           
 void onDestroyed(org.atmosphere.cpr.AtmosphereRequest request, org.atmosphere.cpr.AtmosphereResponse response)
           
 void onResume(org.atmosphere.cpr.AtmosphereRequest request, org.atmosphere.cpr.AtmosphereResponse response)
           
 void onSuspend(org.atmosphere.cpr.AtmosphereRequest request, org.atmosphere.cpr.AtmosphereResponse response)
           
 void onTimeout(org.atmosphere.cpr.AtmosphereRequest request, org.atmosphere.cpr.AtmosphereResponse response)
           
<T> Future<T>
push(String channel, T t)
          Push message to the one or more channel of communication.
 PushContext removeListener(PushContextListener p)
          Remove a event listener.
<T> Future<T>
schedule(String channel, T t, int time, TimeUnit unit)
          Schedule a period push operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PushContextImpl

public PushContextImpl()
Method Detail

push

public <T> Future<T> push(String channel,
                          T t)
Description copied from interface: PushContext
Push message to the one or more channel of communication.

Specified by:
push in interface PushContext
Type Parameters:
T - The type of the message
Parameters:
channel - a channel of communication.
t - a message
Returns:
a Future that can be used to block until the push completes

schedule

public <T> Future<T> schedule(String channel,
                              T t,
                              int time,
                              TimeUnit unit)
Description copied from interface: PushContext
Schedule a period push operation.

Specified by:
schedule in interface PushContext
Type Parameters:
T - The type of the message
Parameters:
channel - a channel of communication.
t - a message
time - the time
unit - the @TimeUnit
Returns:
a Future that can used to cancel the periodic push

delay

public <T> Future<T> delay(String channel,
                           T t,
                           int time,
                           TimeUnit unit)
Description copied from interface: PushContext
Delay the push operation until the time expires.

Specified by:
delay in interface PushContext
Type Parameters:
T - The type of the message
Parameters:
channel - a channel of communication.
t - a message
time - the time
unit - the @TimeUnit
Returns:
a Future that can used to cancel the delayed push

addListener

public PushContext addListener(PushContextListener p)
Description copied from interface: PushContext
Add an event listener.

Specified by:
addListener in interface PushContext
Parameters:
p - PushContextListener
Returns:
this

removeListener

public PushContext removeListener(PushContextListener p)
Description copied from interface: PushContext
Remove a event listener.

Specified by:
removeListener in interface PushContext
Parameters:
p - PushContextListener
Returns:
this

onTimeout

public void onTimeout(org.atmosphere.cpr.AtmosphereRequest request,
                      org.atmosphere.cpr.AtmosphereResponse response)
Specified by:
onTimeout in interface org.atmosphere.cpr.AsyncSupportListener
Overrides:
onTimeout in class org.atmosphere.cpr.AsyncSupportListenerAdapter

onClose

public void onClose(org.atmosphere.cpr.AtmosphereRequest request,
                    org.atmosphere.cpr.AtmosphereResponse response)
Specified by:
onClose in interface org.atmosphere.cpr.AsyncSupportListener
Overrides:
onClose in class org.atmosphere.cpr.AsyncSupportListenerAdapter

onResume

public void onResume(org.atmosphere.cpr.AtmosphereRequest request,
                     org.atmosphere.cpr.AtmosphereResponse response)
Specified by:
onResume in interface org.atmosphere.cpr.AsyncSupportListener
Overrides:
onResume in class org.atmosphere.cpr.AsyncSupportListenerAdapter

onDestroyed

public void onDestroyed(org.atmosphere.cpr.AtmosphereRequest request,
                        org.atmosphere.cpr.AtmosphereResponse response)
Specified by:
onDestroyed in interface org.atmosphere.cpr.AsyncSupportListener
Overrides:
onDestroyed in class org.atmosphere.cpr.AsyncSupportListenerAdapter

onSuspend

public void onSuspend(org.atmosphere.cpr.AtmosphereRequest request,
                      org.atmosphere.cpr.AtmosphereResponse response)
Specified by:
onSuspend in interface org.atmosphere.cpr.AsyncSupportListener
Overrides:
onSuspend in class org.atmosphere.cpr.AsyncSupportListenerAdapter


Copyright © 2013. All rights reserved.