当前位置: 首页>>代码示例>>Java>>正文


Java Reception类代码示例

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


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

示例1: observeAllEvents

import javax.enterprise.event.Reception; //导入依赖的package包/类
public void observeAllEvents(@Observes(notifyObserver = Reception.IF_EXISTS) Object event) {
    if (socialConfiguration.isSocialEnable()) {
        if (socialAdapters == null) {
            return;
        }
        for (Map.Entry<Class, SocialAdapter> entry : socialAdapters.entrySet()) {
            SocialAdapter adapter = entry.getValue();
            if (adapter.shouldInterceptThisEvent(event)) {
                SocialActivitiesEvent socialEvent = adapter.toSocial(event);
                socialActivitiesEvent.fire(socialEvent);
            }
        }
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:15,代码来源:SocialActivitiesEventObserver.java

示例2: getReception

import javax.enterprise.event.Reception; //导入依赖的package包/类
@Override
public Reception getReception() {
    return Reception.ALWAYS;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:5,代码来源:ForwardingObserverMethod.java

示例3: userLoggedIn

import javax.enterprise.event.Reception; //导入依赖的package包/类
public void userLoggedIn(@Observes(notifyObserver = Reception.IF_EXISTS) UserLoggedInEvent event) {
    AppUser user = userService.updateLastLogin(event.getUsername());
    
    if (user.getLastLogin() != null) {
        DateTime dtLastLogin = new DateTime(user.getLastLogin());
        DateTime dtCurrentLogin = new DateTime(user.getCurrentLogin());
        Duration duration = new Duration(dtLastLogin, dtCurrentLogin);
        String sinceLastLogin = "";
        if (duration.getStandardDays()>0) {
            long days = duration.getStandardDays();
            if (days == 1) {
                sinceLastLogin = days + " day";
            }
            else {
                sinceLastLogin = days + " days";
            }
        }
        else if (duration.getStandardHours()> 0) {
            long hours = duration.getStandardHours();
            if (hours == 1) {
                sinceLastLogin = hours + " hour";
            }
            else {
                sinceLastLogin = hours + " hours";
            }
        }
        else if (duration.getStandardMinutes() > 0) {
            long minutes = duration.getStandardMinutes();
            if (minutes == 1) {
                sinceLastLogin = minutes + " minute";
            }
            else {
                sinceLastLogin = minutes + " minutes";
            }
        }
        else {
            long seconds = duration.getStandardSeconds();
            if (seconds == 1) {
                sinceLastLogin = seconds + " second";
            }
            else {
                sinceLastLogin = seconds + " seconds";
            }
        }
        Notification.show("Welcome back " + event.getUsername() + " after " + sinceLastLogin + ".");
    }
    else {
        Notification.show("Welcome " + event.getUsername());
    }
    
    logger.info("User " + event.getUsername() + " logged in.");
    getNavigator().navigateTo(HomeView.id);
    appLayout.getAppHeader().setLoginName(SecurityUtils.getSubject().getPrincipal().toString());
    appLayout.getAppHeader().setVisible(isLoggedIn());
    
}
 
开发者ID:felixhusse,项目名称:bookery,代码行数:57,代码来源:App.java

示例4: observe

import javax.enterprise.event.Reception; //导入依赖的package包/类
public void observe(@Observes(notifyObserver = Reception.IF_EXISTS) @Modified JobQueue queueEvent) {
    rootNode = null;
}
 
开发者ID:intuit,项目名称:Tank,代码行数:4,代码来源:JobQueueManager.java

示例5: onMemberListChanged

import javax.enterprise.event.Reception; //导入依赖的package包/类
public void onMemberListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final Seat member) {
    retrieveAllSeats();
}
 
开发者ID:packt-wildfly,项目名称:packt-java-ee-7-code-samples,代码行数:4,代码来源:SeatProducer.java

示例6: onListChanged

import javax.enterprise.event.Reception; //导入依赖的package包/类
public void onListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final SeatType member) {
    retrieveAllSeatTypes();
}
 
开发者ID:packt-wildfly,项目名称:packt-java-ee-7-code-samples,代码行数:4,代码来源:SeatTypeProducer.java

示例7: onMemberListChanged

import javax.enterprise.event.Reception; //导入依赖的package包/类
public void onMemberListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final Seat member) {
    retrieveAllSeatsOrderedByName();
}
 
开发者ID:packt-wildfly,项目名称:packt-java-ee-7-code-samples,代码行数:4,代码来源:TheatreInfo.java

示例8: onCargoListChanged

import javax.enterprise.event.Reception; //导入依赖的package包/类
public void onCargoListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final Cargo cargo)
{
    retrieveAllCargosOrderedByName();
}
 
开发者ID:mcrose,项目名称:javaee6-mybatis,代码行数:5,代码来源:CargoListProducer.java

示例9: onMemberListChanged

import javax.enterprise.event.Reception; //导入依赖的package包/类
public void onMemberListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final Member member) {
    retrieveAllMembersOrderedByName();
}
 
开发者ID:mcrose,项目名称:javaee6-mybatis,代码行数:4,代码来源:MemberListProducer.java

示例10: onMemberListChanged

import javax.enterprise.event.Reception; //导入依赖的package包/类
public void onMemberListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final Member member) {
   retrieveAllMembersOrderedByName();
}
 
开发者ID:red-fox-mulder,项目名称:eap-6.1-quickstarts,代码行数:4,代码来源:MemberListProducer.java

示例11: onUserListChanged

import javax.enterprise.event.Reception; //导入依赖的package包/类
public void onUserListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final User user) {
	retrieveAllUsersOrderedByUsername();
}
 
开发者ID:SOM-Research,项目名称:emf-rest,代码行数:4,代码来源:UserListProducer.java

示例12: onUserListChanged

import javax.enterprise.event.Reception; //导入依赖的package包/类
public void onUserListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final Parameter validation) {
	init();
}
 
开发者ID:SOM-Research,项目名称:emf-rest,代码行数:4,代码来源:ResourceSaver.java


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