1 package org.jbpm.security.authenticator; 2 3 import java.util.LinkedList ; 4 5 11 public class JbpmDefaultAuthenticator implements Authenticator { 12 13 static ThreadLocal authenticatedActorIdStack = new ThreadLocal (); 14 15 public static void pushAuthenticatedActorId(String actorId) { 16 LinkedList stack = (LinkedList ) authenticatedActorIdStack.get(); 17 if (stack==null) { 18 stack = new LinkedList (); 19 authenticatedActorIdStack.set(stack); 20 } 21 stack.addFirst(actorId); 22 } 23 24 public String getAuthenticatedActorId() { 25 String authenticatedActorId = null; 26 LinkedList stack = (LinkedList ) authenticatedActorIdStack.get(); 27 if ( (stack!=null) 28 && (!stack.isEmpty()) 29 ) { 30 authenticatedActorId = (String ) stack.getFirst(); 31 } 32 return authenticatedActorId; 33 } 34 35 public static void popAuthenticatedActorId() { 36 LinkedList stack = (LinkedList ) authenticatedActorIdStack.get(); 37 stack.removeFirst(); 38 } 39 } 40 | Popular Tags |