private static Broadcaster lookupDefaultBroadcaster()
{
BroadcasterFactory factory = BroadcasterFactory.getDefault();
if (factory == null)
{
throw new WicketRuntimeException(
"There is no Atmosphere BroadcasterFactory configured. Did you include the "
+ "atmosphere.xml configuration file and configured AtmosphereServlet?");
}
Collection<Broadcaster> allBroadcasters = factory.lookupAll();
if (allBroadcasters.isEmpty())
{
throw new WicketRuntimeException(
"The Atmosphere BroadcasterFactory has no Broadcasters, "
+ "something is wrong with your Atmosphere configuration.");
}
return allBroadcasters.iterator().next();
}