Package org.atmosphere.cpr

Examples of org.atmosphere.cpr.Broadcaster


     * @param areaName
     *            The name of the area
     * @return The Broadcaster for the specified area
     */
    public static Broadcaster getBroadcasterForArea(String areaName) {
        Broadcaster bc = BroadcasterFactory.getDefault().lookup(areaName);
        if (bc == null) {
            bc = BroadcasterFactory.getDefault().get();
            bc.setID(areaName);
            bc.getBroadcasterConfig().addFilter(new BroadcastDelimiter());
            BroadcasterFactory.getDefault().add(bc, bc.getID());
        }
        return bc;
    }
View Full Code Here


     *            The data to send in the push
     */
    public static void push(String areaName, String data) {
//        System.out.println("=== INFO === Pushing data:\n \t " + data
//                + "\n to area " + areaName);
        Broadcaster bc = getBroadcasterForArea(areaName);
        bc.broadcast(data);
    }
View Full Code Here

    }

    public Object addingService(ServiceReference serviceReference) {
        String mapping = (String) serviceReference.getProperty(AtmosphereService.MAPPING);
        List<AtmosphereInterceptor> interceptors = (List<AtmosphereInterceptor>) serviceReference.getProperty(AtmosphereService.INTERCEPTORS);
        Broadcaster broadcaster = (Broadcaster) serviceReference.getProperty(AtmosphereService.BROADCASTER);
        AtmosphereHandler handler =  (AtmosphereHandler) context.getService(serviceReference);


        if (interceptors != null && broadcaster != null){
            atmo.addAtmosphereHandler(mapping,handler,broadcaster,interceptors);
View Full Code Here

TOP

Related Classes of org.atmosphere.cpr.Broadcaster

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.