MOB-412: Decouple thread local authentication methods from AuthenticationComponent into new AuthenticationContext super-interface. The AuthenticationContext is a delegate of AbstractAuthenticationComponent and can be accessed directly by low-level classes (e.g. schema bootstrap) before the authentication subsystem is available.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13721 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Dave Ward
2009-03-23 14:01:29 +00:00
parent 9cf5e4a004
commit aaea96e07c
2 changed files with 202 additions and 202 deletions

View File

@@ -85,7 +85,7 @@
<property name="tenantAdminService" ref="tenantAdminService"/>
<property name="transactionService" ref="transactionComponent"/>
<property name="authenticationComponent" ref="authenticationComponent"/>
<property name="authenticationContext" ref="authenticationContext"/>
<property name="configDataCache" ref="globalConfigCache"/>

View File

@@ -35,7 +35,7 @@ import javax.transaction.UserTransaction;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.repo.cache.InternalEhCacheManagerFactoryBean;
import org.alfresco.repo.security.authentication.AuthenticationComponent;
import org.alfresco.repo.security.authentication.AuthenticationContext;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
@@ -86,8 +86,8 @@ public class ContextListener implements ServletContextListener, HttpSessionListe
NodeService nodeService = registry.getNodeService();
SearchService searchService = registry.getSearchService();
NamespaceService namespaceService = registry.getNamespaceService();
AuthenticationComponent authenticationComponent = (AuthenticationComponent) ctx
.getBean("authenticationComponent");
AuthenticationContext authenticationContext = (AuthenticationContext) ctx
.getBean("authenticationContext");
// repo bootstrap code for our client
UserTransaction tx = null;
@@ -96,7 +96,7 @@ public class ContextListener implements ServletContextListener, HttpSessionListe
{
tx = transactionService.getUserTransaction();
tx.begin();
authenticationComponent.setCurrentUser(authenticationComponent.getSystemUserName());
authenticationContext.setSystemUserAsCurrentUser();
// get and setup the initial store ref and root path from config
StoreRef storeRef = Repository.getStoreRef(servletContext);
@@ -130,7 +130,7 @@ public class ContextListener implements ServletContextListener, HttpSessionListe
{
try
{
authenticationComponent.clearCurrentSecurityContext();
authenticationContext.clearCurrentSecurityContext();
}
catch (Exception ex) {}
}