com.smhumayun.mi_plus.impl
Class MIObjectInMemoryCache

java.lang.Object
  extended by com.smhumayun.mi_plus.impl.MIObjectInMemoryCache
All Implemented Interfaces:
MIObjectCache

public final class MIObjectInMemoryCache
extends Object
implements MIObjectCache

HashMap based In-Memory cache implementation of MIObjectCache

Since:
1.0
Author:
smhumayun

Constructor Summary
MIObjectInMemoryCache()
           
 
Method Summary
 void cacheComposedObjects(Class miContainerClass, LinkedHashMap<Class,Object> composedObjects)
          Cache given composedObjects against given miContainerClass - access underlying cache in a synchronized, multi thread-safe way
 void cacheMiContainerProxy(Class miContainerClass, Object miContainerProxyObj)
          Cache given miContainerProxy object against given miContainerClass
 LinkedHashMap<Class,Object> getCachedComposedObjects(Class miContainerClass)
          Get cached Composed Objects against given miContainerClass - access underlying cache in a synchronized, multi thread-safe way
 Object getCachedMiContainerProxy(Class miContainerClass)
          Get cached MI Container Proxy object against given miContainerClass
 boolean isValidated(Class classToValidate)
          Returns true of the classToValidate has already been validated
 void validated(Class validatedClass)
          Cache this validatedClass and mark it as validated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MIObjectInMemoryCache

public MIObjectInMemoryCache()
Method Detail

getCachedMiContainerProxy

public Object getCachedMiContainerProxy(Class miContainerClass)
                                 throws MIException
Get cached MI Container Proxy object against given miContainerClass

Specified by:
getCachedMiContainerProxy in interface MIObjectCache
Parameters:
miContainerClass - MI Container class
Returns:
cached MI Container Proxy object against given miContainerClass
Throws:
MIException - MIException

cacheMiContainerProxy

public void cacheMiContainerProxy(Class miContainerClass,
                                  Object miContainerProxyObj)
                           throws MIException
Cache given miContainerProxy object against given miContainerClass

Specified by:
cacheMiContainerProxy in interface MIObjectCache
Parameters:
miContainerClass - MI Container class
miContainerProxyObj - MI Container Proxy object to cache
Throws:
MIException - MIException

getCachedComposedObjects

public LinkedHashMap<Class,Object> getCachedComposedObjects(Class miContainerClass)
                                                     throws MIException
Get cached Composed Objects against given miContainerClass - access underlying cache in a synchronized, multi thread-safe way

Specified by:
getCachedComposedObjects in interface MIObjectCache
Parameters:
miContainerClass - MI Container class
Returns:
cached Composed Objects against given miContainerClass
Throws:
MIException - MIException

cacheComposedObjects

public void cacheComposedObjects(Class miContainerClass,
                                 LinkedHashMap<Class,Object> composedObjects)
                          throws MIException
Cache given composedObjects against given miContainerClass - access underlying cache in a synchronized, multi thread-safe way

Specified by:
cacheComposedObjects in interface MIObjectCache
Parameters:
miContainerClass - MI Container class
composedObjects - composed objects to cache
Throws:
MIException - MIException

isValidated

public boolean isValidated(Class classToValidate)
                    throws MIException
Returns true of the classToValidate has already been validated

Specified by:
isValidated in interface MIObjectCache
Parameters:
classToValidate - class to
Returns:
true if validates, false otherwise
Throws:
MIException - MIException

validated

public void validated(Class validatedClass)
               throws MIException
Cache this validatedClass and mark it as validated

Specified by:
validated in interface MIObjectCache
Parameters:
validatedClass - validated class to cache
Throws:
MIException - MIException


Copyright © 2013–2015 Syed Muhammad Humayun - smhumayun@gmail.com. All rights reserved.