List of usage examples for org.apache.wicket.util.lang Objects isEqual
public static boolean isEqual(final Object object1, final Object object2)
equals()
sense. From source file:com.github.javawithmarcus.wicket.cdi.ConversationExpiryChecker.java
License:Apache License
@Override public void onBeforeRender(Component component) { if (component instanceof Page || RequestCycle.get().find(AjaxRequestTarget.class) != null) { Page page = component.getPage(); String cid = container.getConversationMarker(page); if (cid != null && !Objects.isEqual(container.getCurrentConversation().getId(), cid)) { logger.info("Conversation {} has expired for {}", cid, page); throw new ConversationExpiredException(null, cid, page, RequestCycle.get().getActiveRequestHandler()); }// ww w .j ava2 s . c om } }
From source file:com.github.javawithmarcus.wicket.cdi.ConversationPropagator.java
License:Apache License
@Override public void onRequestHandlerResolved(RequestCycle cycle, IRequestHandler handler) { Conversation conversation = getConversation(); logger.debug("In onRequestHandlerResolved id = {}", conversation.getId()); String cid = cycle.getRequest().getRequestParameters().getParameterValue(CID_ATTR).toString(); Page page = getPage(handler);//from ww w.j av a2s .c o m if (page == null) { return; } if (cid == null) { cid = page.getMetaData(CID_KEY); } if (cid != null && !conversation.isTransient() && !Objects.isEqual(conversation.getId(), cid)) { logger.info("Conversation {} has expired for {}", cid, page); throw new ConversationExpiredException(null, cid, page, handler); } activateConversationIfNeeded(page, cycle, handler, cid); }