org.atmosphere.util
Class BroadcasterLookup

java.lang.Object
  extended by org.atmosphere.util.BroadcasterLookup

public class BroadcasterLookup
extends Object

A class that can be used to lookup Broadcaster based on the returned value of Broadcaster.getID() and Broadcaster.getScope()

Author:
Jeanfrancois Arcand

Constructor Summary
BroadcasterLookup()
           
 
Method Summary
static boolean add(Broadcaster b, Object id)
          Add a Broadcaster to the list.
static Broadcaster build(Class<? extends Broadcaster> c, Object id)
          Create a new instance of Broadcaster and store it for
static void destroy()
          Shutdown all Broadcaster
static Broadcaster lookup(Class<? extends Broadcaster> c, Object id)
          Lookup a Broadcaster instance using Broadcaster.getID() or ID used when invoking {@link BroadcasterLookup#build(java.lang.Class, java.lang.Object));
static boolean remove(Broadcaster b, Object id)
          Remove a Broadcaster to the list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BroadcasterLookup

public BroadcasterLookup()
Method Detail

lookup

public static final Broadcaster lookup(Class<? extends Broadcaster> c,
                                       Object id)
Lookup a Broadcaster instance using Broadcaster.getID() or ID used when invoking {@link BroadcasterLookup#build(java.lang.Class, java.lang.Object));

Parameters:
id - The Broadcaster's unique ID, or name.
Returns:
a Broadcaster, or null if not found.

add

public static final boolean add(Broadcaster b,
                                Object id)
Add a Broadcaster to the list.

Parameters:
b - a Broadcaster
Returns:
false if a with the same name Broadcaster was already stored

remove

public static final boolean remove(Broadcaster b,
                                   Object id)
Remove a Broadcaster to the list.

Parameters:
b - a Broadcaster
Returns:
false if wasn't present, or Broadcaster

build

public static final Broadcaster build(Class<? extends Broadcaster> c,
                                      Object id)
Create a new instance of Broadcaster and store it for

Parameters:
c - The Broadcaster class instance.
id - The unique ID used to retrieve Broadcaster
Returns:
a new instance of Broadcaster

destroy

public static final void destroy()
Shutdown all Broadcaster



Copyright © 2010 SUN Microsystems. All Rights Reserved.