@@ -0,0 +1,744 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public%0D%0A * License, v. 2.0. If a copy of the MPL was not distributed with this%0D%0A * file, You can obtain one at http://mozilla.org/MPL/2.0/. */%0D%0Apackage org.ocelotds.security;%0D%0A%0D%0Aimport java.security.Principal;%0D%0Aimport javax.enterprise.inject.Alternative;%0D%0Aimport org.ocelotds.Constants;%0D%0Aimport org.ocelotds.i18n.ThreadLocalContextHolder;%0D%0A%0D%0A/**%0D%0A *%0D%0A * @author hhfrancois%0D%0A */%0D%0A@Alternative%0D%0Apublic class OcelotPrincipal implements Principal %7B%0D%0A%0D%0A%09@Override%0D%0A%09public String getName() %7B%0D%0A%09%09String name = Constants.ANONYMOUS;%0D%0A%09%09Principal p = (Principal) ThreadLocalContextHolder.get(Constants.PRINCIPAL);%0D%0A%09%09if (null != p) %7B%0D%0A%09%09%09name = p.getName();%0D%0A%09%09%7D%0D%0A%09%09return name;%0D%0A%09%7D%0D%0A%0D%0A%7D%0D%0A

create Principal Implementation based on TheadLocal