Package org.jasig.portal.utils.cache

Examples of org.jasig.portal.utils.cache.CacheKey


public class CachingStAXPipelineComponentTest {
    @Test
    public void testCacheMiss() {
        final MockHttpServletRequest mockReq = new MockHttpServletRequest();
        final MockHttpServletResponse mockRes = new MockHttpServletResponse();
        final CacheKey cacheKey = CacheKey.build("testCacheKey");
        final List<XMLEvent> eventBuffer = Collections.emptyList();
        final PipelineEventReader<XMLEventReader, XMLEvent> eventReader = new PipelineEventReaderImpl<XMLEventReader, XMLEvent>(new XMLEventBufferReader(eventBuffer.listIterator()));
       
        final Ehcache cache = createMock(Ehcache.class);
        final StAXPipelineComponent targetComponent = createMock(StAXPipelineComponent.class);
View Full Code Here


   
    @Test
    public void testCacheHit() {
        final MockHttpServletRequest mockReq = new MockHttpServletRequest();
        final MockHttpServletResponse mockRes = new MockHttpServletResponse();
        final CacheKey cacheKey = CacheKey.build("testCacheKey");
        final CachedEventReader<XMLEvent> eventReader = new CachedEventReader<XMLEvent>(Collections.EMPTY_LIST, Collections.EMPTY_MAP);
        final Element cacheElement = new Element(cacheKey, eventReader);
       
        final Ehcache cache = createMock(Ehcache.class);
        final StAXPipelineComponent targetComponent = createMock(StAXPipelineComponent.class);
View Full Code Here

public class CachingCharacterPipelineComponentTest {
    @Test
    public void testCacheMiss() {
        final MockHttpServletRequest mockReq = new MockHttpServletRequest();
        final MockHttpServletResponse mockRes = new MockHttpServletResponse();
        final CacheKey cacheKey = CacheKey.build("testCacheKey");
        final List<CharacterEvent> eventBuffer = Collections.emptyList();
        final PipelineEventReader<CharacterEventReader, CharacterEvent> eventReader = new PipelineEventReaderImpl<CharacterEventReader, CharacterEvent>(new CharacterEventBufferReader(eventBuffer.listIterator()));
       
        final Ehcache cache = createMock(Ehcache.class);
        final CharacterPipelineComponent targetComponent = createMock(CharacterPipelineComponent.class);
View Full Code Here

   
    @Test
    public void testCacheHit() {
        final MockHttpServletRequest mockReq = new MockHttpServletRequest();
        final MockHttpServletResponse mockRes = new MockHttpServletResponse();
        final CacheKey cacheKey = CacheKey.build("testCacheKey");
        final CachedEventReader<CharacterEvent> eventReader = new CachedEventReader<CharacterEvent>(Collections.EMPTY_LIST, Collections.EMPTY_MAP);
        final Element cacheElement = new Element(cacheKey, eventReader);
       
        final Ehcache cache = createMock(Ehcache.class);
        final CharacterPipelineComponent targetComponent = createMock(CharacterPipelineComponent.class);
View Full Code Here

   
    @Around("anyPublicMethod() && @annotation(requestCache)")
    public Object cacheRequest(ProceedingJoinPoint pjp, RequestCache requestCache) throws Throwable {
        final long start = System.nanoTime();
       
        final CacheKey cacheKey = createCacheKey(pjp, requestCache);
       
        final HttpServletRequest currentPortalRequest;
        try {
            currentPortalRequest = this.portalRequestUtils.getCurrentPortalRequest();
        }
View Full Code Here

        return pipelineEventReaderImpl;
    }

    @Override
    public CacheKey getCacheKey(HttpServletRequest request, HttpServletResponse response) {
        final CacheKey parentCacheKey = this.wrappedComponent.getCacheKey(request, response);
       
        final CacheKey transformerKey;
        if (transformerSource != null) {
            transformerKey = this.transformerSource.getCacheKey(request, response);
        }
        else {
            transformerKey = null;
        }
       
        final CacheKey transformerConfigurationKey;
        if (this.xsltParameterSource != null) {
            transformerConfigurationKey = this.xsltParameterSource.getCacheKey(request, response);
        }
        else {
            transformerConfigurationKey = null;
View Full Code Here

    @Override
    public CacheKey getCacheKey(HttpServletRequest request, HttpServletResponse response) {
        final CacheKeyBuilder cacheKeyBuilder = CacheKey.builder(this.getClass().getName());
       
        for (final TransformerConfigurationSource source : this.sources) {
            final CacheKey key = source.getCacheKey(request, response);
            cacheKeyBuilder.add(key);
        }
       
        return cacheKeyBuilder.build();
    }
View Full Code Here

    protected ClusterMutex getClusterMutexInternal(final String mutexName) {
        final TransactionOperations transactionOperations = this.getTransactionOperations();
        return transactionOperations.execute(new TransactionCallback<ClusterMutex>() {
            @Override
            public ClusterMutex doInTransaction(TransactionStatus status) {
                final CacheKey key = CacheKey.build(CLUSTER_MUTEX_SOURCE, mutexName);
                ClusterMutex clusterMutex = entityManagerCache.get(PERSISTENCE_UNIT_NAME, key);
                if (clusterMutex != null) {
                    return clusterMutex;
                }
               
View Full Code Here

    @AggrEventsTransactional
    @Override
    public EventSession getEventSession(PortalEvent event) {
        final String eventSessionId = event.getEventSessionId();
       
        final CacheKey key = CacheKey.build(EVENT_SESSION_CACHE_SOURCE, eventSessionId);
        EventSessionImpl eventSession = this.entityManagerCache.get(PERSISTENCE_UNIT_NAME, key);
        if (eventSession != null) {
            return eventSession;
        }
       
View Full Code Here

    }
   
    @OpenEntityManager(unitName = PERSISTENCE_UNIT_NAME)
    @Override
    public AggregatedGroupMapping getGroupMapping(final String groupService, final String groupName) {
        final CacheKey key = CacheKey.build(this.getClass().getName(), groupService, groupName);
       
        AggregatedGroupMapping groupMapping = this.entityManagerCache.get(BaseAggrEventsJpaDao.PERSISTENCE_UNIT_NAME, key);
        if (groupMapping != null) {
            return groupMapping;
        }
View Full Code Here

TOP

Related Classes of org.jasig.portal.utils.cache.CacheKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.