mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Reorganized AVMContext convenience class for accessing various singletons
into AVMDAOs for accessing AVM DAO singletons and RawServices for accessing uninstrumented versions of some services. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3980 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
122
source/java/org/alfresco/repo/avm/util/RawServices.java
Normal file
122
source/java/org/alfresco/repo/avm/util/RawServices.java
Normal file
@@ -0,0 +1,122 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package org.alfresco.repo.avm.util;
|
||||
|
||||
import org.alfresco.repo.content.ContentStore;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.repository.ContentService;
|
||||
import org.alfresco.service.cmr.repository.MimetypeService;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
|
||||
/**
|
||||
* Simple access to Raw versions of service singletons.
|
||||
* @author britt
|
||||
*/
|
||||
public class RawServices implements ApplicationContextAware
|
||||
{
|
||||
/**
|
||||
* The instance of RawServices
|
||||
*/
|
||||
private static RawServices fgInstance;
|
||||
|
||||
/**
|
||||
* The Application Context.
|
||||
*/
|
||||
private ApplicationContext fContext;
|
||||
|
||||
/**
|
||||
* The AuthenticationComponent.
|
||||
*/
|
||||
private AuthenticationComponent fAuthenticationComponent;
|
||||
|
||||
/**
|
||||
* The Content Service.
|
||||
*/
|
||||
private ContentService fContentService;
|
||||
|
||||
/**
|
||||
* The Mimetype Service.
|
||||
*/
|
||||
private MimetypeService fMimetypeService;
|
||||
|
||||
/**
|
||||
* The Dictionary Service.
|
||||
*/
|
||||
private DictionaryService fDictionaryService;
|
||||
|
||||
/**
|
||||
* The Content Store.
|
||||
*/
|
||||
private ContentStore fContentStore;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public RawServices()
|
||||
{
|
||||
fgInstance = this;
|
||||
}
|
||||
|
||||
public static RawServices Instance()
|
||||
{
|
||||
return fgInstance;
|
||||
}
|
||||
|
||||
public void setApplicationContext(ApplicationContext applicationContext)
|
||||
{
|
||||
fContext = applicationContext;
|
||||
}
|
||||
|
||||
public AuthenticationComponent getAuthenticationComponent()
|
||||
{
|
||||
if (fAuthenticationComponent == null)
|
||||
{
|
||||
fAuthenticationComponent =
|
||||
(AuthenticationComponent)fContext.getBean("authenticationComponent");
|
||||
}
|
||||
return fAuthenticationComponent;
|
||||
}
|
||||
|
||||
public ContentService getContentService()
|
||||
{
|
||||
if (fContentService == null)
|
||||
{
|
||||
fContentService =
|
||||
(ContentService)fContext.getBean("contentService");
|
||||
}
|
||||
return fContentService;
|
||||
}
|
||||
|
||||
public MimetypeService getMimetypeService()
|
||||
{
|
||||
if (fMimetypeService == null)
|
||||
{
|
||||
fMimetypeService =
|
||||
(MimetypeService)fContext.getBean("mimetypeService");
|
||||
}
|
||||
return fMimetypeService;
|
||||
}
|
||||
|
||||
public DictionaryService getDictionaryService()
|
||||
{
|
||||
if (fDictionaryService == null)
|
||||
{
|
||||
fDictionaryService =
|
||||
(DictionaryService)fContext.getBean("dictionaryService");
|
||||
}
|
||||
return fDictionaryService;
|
||||
}
|
||||
|
||||
public ContentStore getContentStore()
|
||||
{
|
||||
if (fContentStore == null)
|
||||
{
|
||||
fContentStore =
|
||||
(ContentStore)fContext.getBean("fileContentStore");
|
||||
}
|
||||
return fContentStore;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user