@@ -0,0 +1,798 @@
+/* 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.spring;%0D%0A%0D%0Aimport java.security.Principal;%0D%0Aimport org.ocelotds.Constants;%0D%0Aimport org.ocelotds.context.ThreadLocalContextHolder;%0D%0Aimport org.springframework.context.annotation.Bean;%0D%0Aimport org.springframework.context.annotation.Configuration;%0D%0Aimport org.springframework.context.annotation.Scope;%0D%0A%0D%0A/**%0D%0A *%0D%0A * @author hhfrancois%0D%0A */%0D%0A@Configuration%0D%0Apublic class ApplicationContextConfig %7B%0D%0A%0D%0A%09@Bean%0D%0A%09@Scope(value = %22prototype%22)%0D%0A%09public Principal principal() %7B%0D%0A%09%09Principal p = (Principal) ThreadLocalContextHolder.get(Constants.PRINCIPAL);%0D%0A%09%09return p;%0D%0A%09%7D%0D%0A%7D%0D%0A

create bean Principal (prototype)