All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.primefaces.push.PushRule Maven / Gradle / Ivy

There is a newer version: 14.0.0-RC2
Show newest version
package org.primefaces.push;

import org.atmosphere.cpr.AtmosphereResource;

import java.util.List;

/**
 * A PushRule configure the Atmosphere Framework behavior. By default, the {@link 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 {@link org.atmosphere.cpr.Broadcaster}) * on the fly. For example, the following PushRule will create a single Channel of communication. All invocation of * {@link 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 * */ public interface PushRule { /** * Configure an {@link AtmosphereResource} and creates channel of communication on the fly. * @param resource an {@link AtmosphereResource} * @return true if other rule can be invoked, false if this rule terminate the process. */ boolean apply(AtmosphereResource resource); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy