org.primefaces.push
Interface PushRule
- All Known Implementing Classes:
- DefaultPushRule
public interface PushRule
A PushRule configure the Atmosphere Framework behavior. By default, the DefaultPushRule
is used to creates
channel of communication based on the value of the request's pathInfo.
PushRule can be implemented to customize the behavior of Atmosphere and to create channel (named Broadcaster
)
on the fly. For example, the following PushRule will create a single Channel of communication. All invocation of
PushContext.push(String, Object)
will be shared to all connected browser
boolean apply(AtmosphereResource resource) {
Broadcaster all = BroadcasterFactory.getDefault().lookup("/*", true);
resource.setBroadcaster(all);
return true;
}
For more information on how to manipulate the Atmosphere's object, see
https://github.com/Atmosphere/atmosphere/wiki/Understanding-BroadcasterBroadcaster
AtmosphereResource
Method Summary |
boolean |
apply(org.atmosphere.cpr.AtmosphereResource resource)
Configure an AtmosphereResource and creates channel of communication on the fly. |
apply
boolean apply(org.atmosphere.cpr.AtmosphereResource resource)
- Configure an
AtmosphereResource
and creates channel of communication on the fly.
- Parameters:
resource
- an AtmosphereResource
- Returns:
- true if other rule can be invoked, false if this rule terminate the process.
Copyright © 2013. All Rights Reserved.