作者:刘小飘168585 | 来源:互联网 | 2023-10-12 20:51
本文整理了Java中org.atmosphere.cpr.AtmosphereConfig.getBroadcasterFactory()方法的一些代码示例,展示了
本文整理了Java中org.atmosphere.cpr.AtmosphereConfig.getBroadcasterFactory()
方法的一些代码示例,展示了AtmosphereConfig.getBroadcasterFactory()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AtmosphereConfig.getBroadcasterFactory()
方法的具体详情如下:
包路径:org.atmosphere.cpr.AtmosphereConfig
类名称:AtmosphereConfig
方法名:getBroadcasterFactory
AtmosphereConfig.getBroadcasterFactory介绍
暂无
代码示例
代码示例来源:origin: org.atmosphere/atmosphere-guice
@Override
public BroadcasterFactory get() {
return config.getBroadcasterFactory();
}
});
代码示例来源:origin: Atmosphere/atmosphere-extensions
@Override
public BroadcasterFactory get() {
return config.getBroadcasterFactory();
}
});
代码示例来源:origin: org.atmosphere/atmosphere-jersey
@Override
public Object fromString(String topic) {
Broadcaster broadcaster;
try {
AtmosphereResource r =
(AtmosphereResource)
req.getAttribute(FrameworkConfig.ATMOSPHERE_RESOURCE);
BroadcasterFactory bp = r.getAtmosphereConfig().getBroadcasterFactory();
Class extends Broadcaster> c;
try {
c = (Class) Class.forName((String) req.getAttribute(ApplicationConfig.BROADCASTER_CLASS));
} catch (Throwable e) {
throw new IllegalStateException(e.getMessage());
}
broadcaster = bp.lookup(c, topic, true);
} catch (Throwable ex) {
throw new WebApplicationException(ex);
}
logger.trace("Injected Broadcaster {}", broadcaster);
req.setAttribute(AtmosphereFilter.INJECTED_BROADCASTER, broadcaster);
return broadcaster;
}
}
代码示例来源:origin: org.atmosphere/atmosphere-jersey
@Override
public BroadcasterFactory getValue() {
return getAtmosphereResource(AtmosphereResource.class, true).getAtmosphereConfig().getBroadcasterFactory();
}
};
代码示例来源:origin: org.atmosphere/atmosphere-jersey
BroadcasterFactory _get() {
return getAtmosphereResource(AtmosphereResource.class, true).getAtmosphereConfig().getBroadcasterFactory();
}
代码示例来源:origin: swagger-api/swagger-socket
@Override
public void configure(AtmosphereConfig config) {
heartbeat = config.getBroadcasterFactory().lookup(DefaultBroadcaster.class, "/swaggersocket.heartbeat");
if (heartbeat == null) {
heartbeat = config.getBroadcasterFactory().get(DefaultBroadcaster.class, "/swaggersocket.heartbeat");
}
lazywrite = config.getInitParameter("io.swagger.swaggersocket.protocol.lazywrite", false);
emptyentity = config.getInitParameter("io.swagger.swaggersocket.protocol.emptyentity", false);
String p = config.getInitParameter("io.swagger.swaggersocket.protocol.includedheaders");
if (p != null) {
includedheaders = Pattern.compile(p, Pattern.CASE_INSENSITIVE);
}
p = config.getInitParameter("io.swagger.swaggersocket.protocol.excludedheaders");
if (p != null) {
excludedheaders = Pattern.compile(p, Pattern.CASE_INSENSITIVE);
}
}
代码示例来源:origin: ManyDesigns/Portofino
@Ready
public void onReady(AtmosphereResource resource) throws Exception {
factory = resource.getAtmosphereConfig().getBroadcasterFactory();
resourceFactory = resource.getAtmosphereConfig().resourcesFactory();
notificatiOnService= (NotificationService)
resource.getAtmosphereConfig().getServletContext().getAttribute(AtmosphereModule.NOTIFICATION_SERVICE);
if(!notificationService.subscribe(topicName, resource)) {
logger.debug("Subscription to topic {} refused (resource: {})", topicName, resource);
close(resource);
}
}
代码示例来源:origin: org.atmosphere/atmosphere-jersey
BroadcasterFactory broadcasterFactory = r.getAtmosphereConfig().getBroadcasterFactory();
代码示例来源:origin: org.atmosphere/atmosphere-jersey
newBroadcaster = config.getBroadcasterFactory().lookup(broadcasterName, true);
newBroadcaster.setBroadcasterLifeCyclePolicy(BroadcasterLifeCyclePolicy.EMPTY_DESTROY);
throw new IllegalStateException(e.getMessage());
broadcaster = config.getBroadcasterFactory().lookup(c, topic, true);
throw new IllegalStateException(e.getMessage());
r.setBroadcaster(config.getBroadcasterFactory().lookup(c, topic, true));
代码示例来源:origin: org.primefaces/primefaces
/**
* Creates channel (named {@link Broadcaster} in Atmosphere) based on the {@link org.atmosphere.cpr.AtmosphereRequest#getPathInfo()}
*
* @param resource An {@link AtmosphereResource}
* @return
*/
public boolean apply(AtmosphereResource resource) {
String pathInfo = resource.getRequest().getPathInfo();
BroadcasterFactory f = resource.getAtmosphereConfig().getBroadcasterFactory();
if (pathInfo == null) {
resource.setBroadcaster(f.lookup("/*"));
return true;
}
final Broadcaster b = f.lookup(pathInfo, true);
resource.setBroadcaster(b);
return true;
}
}