• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java EventBus类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.vaadin.spring.events.EventBus的典型用法代码示例。如果您正苦于以下问题:Java EventBus类的具体用法?Java EventBus怎么用?Java EventBus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EventBus类属于org.vaadin.spring.events包,在下文中一共展示了EventBus类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: UploadHandler

import org.vaadin.spring.events.EventBus; //导入依赖的package包/类
UploadHandler(final String fileName, final long fileSize, final UploadLayout view, final long maxSize,
        final Upload upload, final String mimeType, final SoftwareModule selectedSw,
        final SoftwareModuleManagement softwareManagement) {
    super();
    this.aborted = false;
    this.fileName = fileName;
    this.fileSize = fileSize;
    this.view = view;
    this.maxSize = maxSize;
    this.upload = upload;
    this.mimeType = mimeType;
    this.selectedSw = selectedSw;
    this.i18n = SpringContextHelper.getBean(VaadinMessageSource.class);
    this.eventBus = SpringContextHelper.getBean(EventBus.UIEventBus.class);
    this.artifactUploadState = SpringContextHelper.getBean(ArtifactUploadState.class);
    this.softwareModuleManagement = softwareManagement;
    eventBus.subscribe(this);
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:19,代码来源:UploadHandler.java


示例2: invokeAwareInterfaces

import org.vaadin.spring.events.EventBus; //导入依赖的package包/类
private void invokeAwareInterfaces(Object bean) {
    if (bean instanceof EventBusAware) {

        if (bean instanceof EventBusAware.ApplicationEventBusAware) {
            ((EventBusAware.ApplicationEventBusAware) bean).setApplicationEventBus(this.applicationContext.getBean(EventBus.ApplicationEventBus.class));
        }
        if (bean instanceof EventBusAware.SessionEventBusAware) {
            ((EventBusAware.SessionEventBusAware) bean).setSessionEventBus(this.applicationContext.getBean(EventBus.SessionEventBus.class));
        }
        if (bean instanceof EventBusAware.UIEventBusAware) {
            ((EventBusAware.UIEventBusAware) bean).setUIEventBus(this.applicationContext.getBean(EventBus.UIEventBus.class));
        }
        if (bean instanceof EventBusAware.ViewEventBusAware) {
            ((EventBusAware.ViewEventBusAware) bean).setViewEventBus(this.applicationContext.getBean(EventBus.ViewEventBus.class));
        }

    }
}
 
开发者ID:peholmst,项目名称:vaadin4spring,代码行数:19,代码来源:VaadinEventBusAwareProcessor.java


示例3: ScopedEventBus

import org.vaadin.spring.events.EventBus; //导入依赖的package包/类
/**
 * @param scope          the scope of the events that this event bus handles.
 * @param parentEventBus the parent event bus to use, may be {@code null};
 */
public ScopedEventBus(EventScope scope, EventBus parentEventBus) {
    eventScope = scope;
    this.parentEventBus = parentEventBus;
    if (parentEventBus != null) {
        if (AopUtils.isJdkDynamicProxy(parentEventBus)) {
            logger.debug("Parent event bus [{}] is proxied, trying to get the real EventBus instance",
                    parentEventBus);
            try {
                this.parentEventBus = (EventBus) ((Advised) parentEventBus).getTargetSource().getTarget();
            } catch (Exception e) {
                logger.error("Could not get target EventBus from proxy", e);
                throw new RuntimeException("Could not get parent event bus", e);
            }
        }
        logger.debug("Using parent event bus [{}]", this.parentEventBus);
        this.parentEventBus.subscribe(parentListener);
    }
}
 
开发者ID:peholmst,项目名称:vaadin4spring,代码行数:23,代码来源:ScopedEventBus.java


示例4: AbstractNotificationView

import org.vaadin.spring.events.EventBus; //导入依赖的package包/类
/**
 * Constructor.
 * 
 * @param eventBus
 *            the ui event bus
 * @param notificationUnreadButton
 *            the notificationUnreadButton
 */
public AbstractNotificationView(final EventBus.UIEventBus eventBus,
        final NotificationUnreadButton notificationUnreadButton) {
    this.eventBus = eventBus;
    this.notificationUnreadButton = notificationUnreadButton;
    this.viewUnreadNotifcations = new AtomicInteger(0);
    skipUiEventsCache = CacheBuilder.newBuilder().expireAfterAccess(10, SECONDS).build();
    eventBus.subscribe(this);
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:17,代码来源:AbstractNotificationView.java


示例5: Presenter

import org.vaadin.spring.events.EventBus; //导入依赖的package包/类
/**
 * The constructor automatically subscribes to event bus events.
 *
 * @param view <em>View</em>
 * @param eventBus Vaadin even bus
 */
public Presenter(T view, EventBus eventBus) {
    Assert.notNull(view);
    Assert.notNull(eventBus);
    this.view = view;
    this.eventBus = eventBus;
    eventBus.subscribe(this);
}
 
开发者ID:peholmst,项目名称:vaadin4spring,代码行数:14,代码来源:Presenter.java


示例6: testOnApplicationEvent

import org.vaadin.spring.events.EventBus; //导入依赖的package包/类
@Test
public void testOnApplicationEvent() {
    ApplicationEvent event = new ApplicationEvent(this) {

        private static final long serialVersionUID = 7475015652750718692L;

        @Override
        public Object getSource() {
            return "mySource";
        }
    };
    EventBus eventBus = mock(EventBus.class);
    new ApplicationContextEventBroker(eventBus).onApplicationEvent(event);
    verify(eventBus).publish("mySource", event);
}
 
开发者ID:peholmst,项目名称:vaadin4spring,代码行数:16,代码来源:ApplicationContextEventBrokerTest.java


示例7: doDefault

import org.vaadin.spring.events.EventBus; //导入依赖的package包/类
public static void doDefault(ErrorEvent event) {
    Throwable t = event.getThrowable();
    if (t instanceof SocketException) {
        // Most likely client browser closed socket
        getLogger().info(
                "SocketException in CommunicationManager."
                        + " Most likely client (browser) closed socket.");
        return;
    }

    t = findRelevantThrowable(t);
    
    /*
     * Handle SpringSecurity 
     */
    if (t instanceof AccessDeniedException) {
    	
    	EventBus eventBus = SpringApplicationContext.getEventBus();
    	eventBus.publish(EventScope.UI, eventBus, new AccessDeniedEvent(t));
    	
    	getLogger().log(Level.FINE, "Access is denied", t);
    	return;
    }

    // Finds the original source of the error/exception
    AbstractComponent component = findAbstractComponent(event);
    if (component != null) {
        // Shows the error in AbstractComponent
        ErrorMessage errorMessage = AbstractErrorMessage
                .getErrorMessageForException(t);
        component.setComponentError(errorMessage);
    }

    // also print the error on console
    getLogger().log(Level.SEVERE, "", t);
}
 
开发者ID:markoradinovic,项目名称:Vaadin4Spring-MVP-Sample-SpringSecurity,代码行数:37,代码来源:SpringSecurityErrorHandler.java


示例8: SecuredNavigator

import org.vaadin.spring.events.EventBus; //导入依赖的package包/类
public SecuredNavigator(UI ui, ViewDisplay display, SpringViewProvider viewProvider, Security security, EventBus eventBus) {
	super(ui, display);		
	this.security = security;
	this.viewProvider = viewProvider;
	this.eventBus = eventBus;
	addProvider(this.viewProvider);
}
 
开发者ID:markoradinovic,项目名称:Vaadin4Spring-MVP-Sample-SpringSecurity,代码行数:8,代码来源:SecuredNavigator.java


示例9: getEventBus

import org.vaadin.spring.events.EventBus; //导入依赖的package包/类
/**
 * @return the eventBus
 */
public EventBus.UIEventBus getEventBus() {
    return eventBus;
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:7,代码来源:TargetBulkUpdateWindowLayout.java


示例10: getEventBus

import org.vaadin.spring.events.EventBus; //导入依赖的package包/类
public EventBus.UIEventBus getEventBus() {
    return eventBus;
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:4,代码来源:AbstractNotificationView.java


示例11: getEventBus

import org.vaadin.spring.events.EventBus; //导入依赖的package包/类
public EventBus getEventBus() {
    return eventBus;
}
 
开发者ID:peholmst,项目名称:vaadin4spring,代码行数:4,代码来源:Presenter.java


示例12: setUp

import org.vaadin.spring.events.EventBus; //导入依赖的package包/类
@Before
public void setUp() {
    fooView = new FooView();
    eventBus = mock(EventBus.class);
    presenter = new ExplicitPresenter(fooView, eventBus);
}
 
开发者ID:peholmst,项目名称:vaadin4spring,代码行数:7,代码来源:PresenterTest.java


示例13: AutowiredPresenter

import org.vaadin.spring.events.EventBus; //导入依赖的package包/类
@Autowired
public AutowiredPresenter(FooView view, EventBus.UIEventBus eventBus) {
    super(view, eventBus);
}
 
开发者ID:peholmst,项目名称:vaadin4spring,代码行数:5,代码来源:AutowiredPresenter.java


示例14: ExplicitPresenter

import org.vaadin.spring.events.EventBus; //导入依赖的package包/类
public ExplicitPresenter(FooView view, EventBus eventBus) {
    super(view, eventBus);
}
 
开发者ID:peholmst,项目名称:vaadin4spring,代码行数:4,代码来源:ExplicitPresenter.java


示例15: getEventBus

import org.vaadin.spring.events.EventBus; //导入依赖的package包/类
public EventBus getEventBus() {
    return this.eventBus;
}
 
开发者ID:peholmst,项目名称:vaadin4spring,代码行数:4,代码来源:Presenter.java


示例16: ApplicationContextEventBroker

import org.vaadin.spring.events.EventBus; //导入依赖的package包/类
public ApplicationContextEventBroker(EventBus eventBus) {
    this.eventBus = eventBus;
}
 
开发者ID:peholmst,项目名称:vaadin4spring,代码行数:4,代码来源:ApplicationContextEventBroker.java


示例17: EventBusListenerWrapper

import org.vaadin.spring.events.EventBus; //导入依赖的package包/类
public EventBusListenerWrapper(EventBus owningEventBus, EventBusListener<?> listenerTarget, String topic, boolean includingPropagatingEvents) {
    super(owningEventBus, listenerTarget, topic, includingPropagatingEvents);
    payloadType = GenericTypeResolver.resolveTypeArgument(listenerTarget.getClass(), EventBusListener.class);
    Assert.notNull(payloadType, "Could not resolve payload type");
}
 
开发者ID:peholmst,项目名称:vaadin4spring,代码行数:6,代码来源:EventBusListenerWrapper.java


示例18: AbstractListenerWrapper

import org.vaadin.spring.events.EventBus; //导入依赖的package包/类
public AbstractListenerWrapper(EventBus owningEventBus, Object listenerTarget, String topic, boolean includingPropagatingEvents) {
    this.owningEventBus = owningEventBus;
    this.topic = topic;
    this.listenerTarget = listenerTarget;
    this.includingPropagatingEvents = includingPropagatingEvents;
}
 
开发者ID:peholmst,项目名称:vaadin4spring,代码行数:7,代码来源:AbstractListenerWrapper.java


示例19: applicationEventBus

import org.vaadin.spring.events.EventBus; //导入依赖的package包/类
@Bean
EventBus.ApplicationEventBus applicationEventBus() {
    return new ScopedEventBus.DefaultApplicationEventBus();
}
 
开发者ID:peholmst,项目名称:vaadin4spring,代码行数:5,代码来源:EventBusConfiguration.java


示例20: proxiedSessionEventBus

import org.vaadin.spring.events.EventBus; //导入依赖的package包/类
@Bean
@Scope(value = VaadinSessionScope.VAADIN_SESSION_SCOPE_NAME, proxyMode = ScopedProxyMode.INTERFACES)
@EventBusProxy
EventBus.SessionEventBus proxiedSessionEventBus() {
    return sessionEventBus();
}
 
开发者ID:peholmst,项目名称:vaadin4spring,代码行数:7,代码来源:EventBusConfiguration.java



注:本文中的org.vaadin.spring.events.EventBus类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PluginService类代码示例发布时间:2022-05-23
下一篇:
Java TimerHandle类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap