本文整理汇总了Java中com.vaadin.shared.ui.ui.Transport类的典型用法代码示例。如果您正苦于以下问题:Java Transport类的具体用法?Java Transport怎么用?Java Transport使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Transport类属于com.vaadin.shared.ui.ui包,在下文中一共展示了Transport类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: configPush
import com.vaadin.shared.ui.ui.Transport; //导入依赖的package包/类
/**
* Configuration du push
*/
private void configPush() {
if (pushTransportMode!=null && pushTransportMode.equals(Transport.LONG_POLLING.getIdentifier())){
getPushConfiguration().setTransport(Transport.LONG_POLLING);
}else if (pushTransportMode!=null && pushTransportMode.equals(Transport.WEBSOCKET_XHR.getIdentifier())){
getPushConfiguration().setTransport(Transport.WEBSOCKET_XHR);
}else{
getPushConfiguration().setTransport(Transport.WEBSOCKET);
}
}
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:13,代码来源:MainUI.java
示例2: getPushTransport
import com.vaadin.shared.ui.ui.Transport; //导入依赖的package包/类
@Override
public Transport getPushTransport(UICreateEvent event) {
WebConfig webConfig = configuration.getConfig(WebConfig.class);
if (webConfig.getUsePushLongPolling()) {
return Transport.LONG_POLLING;
}
return super.getPushTransport(event);
}
开发者ID:cuba-platform,项目名称:cuba,代码行数:11,代码来源:CubaUIProvider.java
示例3: clearAndReinitializeSession
import com.vaadin.shared.ui.ui.Transport; //导入依赖的package包/类
/**
* Clears the session of all attributes except some internal Vaadin attributes and reinitializes it. If Websocket
* Push is used, the session will never be reinitialized since this throws errors on at least
* Tomcat 8.
*/
protected void clearAndReinitializeSession() {
final VaadinRequest currentRequest = VaadinService.getCurrentRequest();
final UI currentUI = UI.getCurrent();
if (currentUI != null) {
final Transport transport = currentUI.getPushConfiguration().getTransport();
if (Transport.WEBSOCKET.equals(transport) || Transport.WEBSOCKET_XHR.equals(transport)) {
LOGGER.warn(
"Clearing and reinitializing the session is currently not supported when using Websocket Push.");
return;
}
}
if (currentRequest != null) {
LOGGER.debug("Clearing the session");
final WrappedSession session = currentRequest.getWrappedSession();
final String serviceName = VaadinService.getCurrent().getServiceName();
final Set<String> attributesToSpare = new HashSet<String>();
attributesToSpare.add(serviceName + ".lock");
attributesToSpare.add(VaadinSession.class.getName() + "." + serviceName);
for (String s : currentRequest.getWrappedSession().getAttributeNames()) {
if (!attributesToSpare.contains(s)) {
LOGGER.trace("Removing attribute {} from session", s);
session.removeAttribute(s);
}
}
LOGGER.debug("Reinitializing the session {}", session.getId());
VaadinService.reinitializeSession(currentRequest);
LOGGER.debug("Session reinitialized, new ID is {}",
VaadinService.getCurrentRequest().getWrappedSession().getId());
} else {
LOGGER
.warn("No VaadinRequest bound to current thread, could NOT clear/reinitialize the session after login");
}
}
开发者ID:peholmst,项目名称:vaadin4spring,代码行数:39,代码来源:DefaultVaadinManagedSecurity.java
注:本文中的com.vaadin.shared.ui.ui.Transport类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论