本文整理汇总了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);
}
}
}
}
示例2: getReception
import javax.enterprise.event.Reception; //导入依赖的package包/类
@Override
public Reception getReception() {
return Reception.ALWAYS;
}
示例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());
}
示例4: observe
import javax.enterprise.event.Reception; //导入依赖的package包/类
public void observe(@Observes(notifyObserver = Reception.IF_EXISTS) @Modified JobQueue queueEvent) {
rootNode = null;
}
示例5: onMemberListChanged
import javax.enterprise.event.Reception; //导入依赖的package包/类
public void onMemberListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final Seat member) {
retrieveAllSeats();
}
示例6: onListChanged
import javax.enterprise.event.Reception; //导入依赖的package包/类
public void onListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final SeatType member) {
retrieveAllSeatTypes();
}
示例7: onMemberListChanged
import javax.enterprise.event.Reception; //导入依赖的package包/类
public void onMemberListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final Seat member) {
retrieveAllSeatsOrderedByName();
}
示例8: onCargoListChanged
import javax.enterprise.event.Reception; //导入依赖的package包/类
public void onCargoListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final Cargo cargo)
{
retrieveAllCargosOrderedByName();
}
示例9: onMemberListChanged
import javax.enterprise.event.Reception; //导入依赖的package包/类
public void onMemberListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final Member member) {
retrieveAllMembersOrderedByName();
}
示例10: onMemberListChanged
import javax.enterprise.event.Reception; //导入依赖的package包/类
public void onMemberListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final Member member) {
retrieveAllMembersOrderedByName();
}
示例11: onUserListChanged
import javax.enterprise.event.Reception; //导入依赖的package包/类
public void onUserListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final User user) {
retrieveAllUsersOrderedByUsername();
}
示例12: onUserListChanged
import javax.enterprise.event.Reception; //导入依赖的package包/类
public void onUserListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final Parameter validation) {
init();
}