19 package org.turro.elephant.context;
21 import java.util.Iterator;
22 import java.util.Objects;
23 import java.util.concurrent.BlockingDeque;
24 import java.util.concurrent.LinkedBlockingDeque;
54 return history.
back();
58 public void add(String path) {
59 String last = HISTORY.peekLast();
60 if(!Objects.equals(last, path)) {
61 if(!HISTORY.offerLast(path)) {
63 HISTORY.offerLast(path);
69 return HISTORY.pollLast();
73 return HISTORY.peekLast();
77 if(HISTORY.size() > 1) {
78 Iterator<String> it = HISTORY.descendingIterator();
82 return HISTORY.peekLast();
87 private final BlockingDeque<String> HISTORY =
new LinkedBlockingDeque<>(50);
102 private static final String HISTORY_CONTEXT =
"EL_HIS_CTX";
static String get(IConstructor constructor)
static History getInstance(IConstructor constructor)
static String peek(IConstructor constructor)
static String back(IConstructor constructor)
static String peekBack(IConstructor constructor)
static void add(IConstructor constructor, String path)
void setSessionAttribute(String key, Object value)
Object getSessionAttribute(String key)