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.getName() and Broadcaster.getScope()

Author:
Jeanfrancois Arcand

Nested Class Summary
static class BroadcasterLookup.OutOfScopeException
           
 
Constructor Summary
BroadcasterLookup()
           
 
Method Summary
 boolean add(Broadcaster b)
          Add a Broadcaster to the list.
 Broadcaster lookup(String name)
          Lookup a Broadcaster instance using Broadcaster.getName().
 boolean remove(Broadcaster b)
          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 final Broadcaster lookup(String name)
                         throws BroadcasterLookup.OutOfScopeException
Lookup a Broadcaster instance using Broadcaster.getName().

Parameters:
name - The Broadcaster's name.
Returns:
a Broadcaster, or null if not found.
Throws:
org.atmosphere.cpr.BroadcasterLookup.OutOfScopeException
BroadcasterLookup.OutOfScopeException

add

public final boolean add(Broadcaster b)
Add a Broadcaster to the list.

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

remove

public final boolean remove(Broadcaster b)
Remove a Broadcaster to the list.

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


Copyright © 2009 SUN Microsystems. All Rights Reserved.