com.smhumayun.mi_plus
Class MIFactory

java.lang.Object
  extended by com.smhumayun.mi_plus.MIFactory

public final class MIFactory
extends Object

Factory for creating objects that supports MI

Since:
1.0
Author:
smhumayun

Constructor Summary
MIFactory()
          Constructor which initializes this factory instance with a default MIObjectInMemoryCache and a default MIMethodResolverImpl
MIFactory(List<String> packagesToScan)
          Constructor which initializes this factory instance with a default MIObjectInMemoryCache and a default MIMethodResolverImpl; and scans given packagesToScan to find and process classes annotated with MISupport annotation
MIFactory(MIMethodResolver miMethodResolver)
          Constructor which initializes this factory instance with given miMethodResolver and a default MIObjectInMemoryCache
MIFactory(MIMethodResolver miMethodResolver, List<String> packagesToScan)
          Constructor which initializes this factory instance with given miMethodResolver and a default MIObjectInMemoryCache; and scans given packagesToScan to find and process classes annotated with MISupport annotation
MIFactory(MIObjectCache miObjectCache)
          Constructor which initializes this factory instance with given miObjectCache and a default MIMethodResolverImpl
MIFactory(MIObjectCache miObjectCache, List<String> packagesToScan)
          Constructor which initializes this factory instance with given miObjectCache and a default MIMethodResolverImpl; and scans given packagesToScan to find and process classes annotated with MISupport annotation
MIFactory(MIObjectCache miObjectCache, MIMethodResolver miMethodResolver)
          Constructor which initializes this factory instance with given miObjectCache and miMethodResolver objects
MIFactory(MIObjectCache miObjectCache, MIMethodResolver miMethodResolver, List<String> packagesToScan)
          Constructor which initializes this factory instance with given miObjectCache and , miMethodResolver objects; and scans given packagesToScan to find and process classes annotated with MISupport annotation
 
Method Summary
 MIMethodResolver getMiMethodResolver()
          Get method resolver
 MIObjectCache getMiObjectCache()
          Get MIObjectCache
 Object newInstance(Class clazz)
          Factory method to create new instances of MI Container classes that are annotated with MISupport annotation
 void setMiMethodResolver(MIMethodResolver miMethodResolver)
          Set method resolver
 void setMiObjectCache(MIObjectCache miObjectCache)
          Set MIObjectCache
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MIFactory

public MIFactory()
          throws MIException
Constructor which initializes this factory instance with a default MIObjectInMemoryCache and a default MIMethodResolverImpl

Throws:
MIException - MIException

MIFactory

public MIFactory(List<String> packagesToScan)
          throws MIException
Constructor which initializes this factory instance with a default MIObjectInMemoryCache and a default MIMethodResolverImpl; and scans given packagesToScan to find and process classes annotated with MISupport annotation

Parameters:
packagesToScan - list of packages to scan for MISupport annotation
Throws:
MIException - MIException

MIFactory

public MIFactory(MIObjectCache miObjectCache)
          throws MIException
Constructor which initializes this factory instance with given miObjectCache and a default MIMethodResolverImpl

Parameters:
miObjectCache - object cache implementation
Throws:
MIException - MIException

MIFactory

public MIFactory(MIObjectCache miObjectCache,
                 List<String> packagesToScan)
          throws MIException
Constructor which initializes this factory instance with given miObjectCache and a default MIMethodResolverImpl; and scans given packagesToScan to find and process classes annotated with MISupport annotation

Parameters:
miObjectCache - object cache implementation
packagesToScan - list of packages to scan for MISupport annotation
Throws:
MIException - MIException

MIFactory

public MIFactory(MIMethodResolver miMethodResolver)
          throws MIException
Constructor which initializes this factory instance with given miMethodResolver and a default MIObjectInMemoryCache

Parameters:
miMethodResolver - method resolver implementation
Throws:
MIException - MIException

MIFactory

public MIFactory(MIMethodResolver miMethodResolver,
                 List<String> packagesToScan)
          throws MIException
Constructor which initializes this factory instance with given miMethodResolver and a default MIObjectInMemoryCache; and scans given packagesToScan to find and process classes annotated with MISupport annotation

Parameters:
miMethodResolver - method resolver implementation
packagesToScan - list of packages to scan for MISupport annotation
Throws:
MIException - MIException

MIFactory

public MIFactory(MIObjectCache miObjectCache,
                 MIMethodResolver miMethodResolver)
          throws MIException
Constructor which initializes this factory instance with given miObjectCache and miMethodResolver objects

Parameters:
miObjectCache - object cache implementation
miMethodResolver - method resolver implementation
Throws:
MIException - MIException

MIFactory

public MIFactory(MIObjectCache miObjectCache,
                 MIMethodResolver miMethodResolver,
                 List<String> packagesToScan)
          throws MIException
Constructor which initializes this factory instance with given miObjectCache and , miMethodResolver objects; and scans given packagesToScan to find and process classes annotated with MISupport annotation

Parameters:
miObjectCache - object cache implementation
miMethodResolver - method resolver implementation
packagesToScan - list of packages to scan for MISupport annotation
Throws:
MIException - MIException
Method Detail

newInstance

public Object newInstance(Class clazz)
                   throws MIException
Factory method to create new instances of MI Container classes that are annotated with MISupport annotation

Parameters:
clazz - class to instantiate - MI Container class annotated with MISupport annotation
Returns:
an object that functionally supports MI
Throws:
MIException - MIException

getMiMethodResolver

public MIMethodResolver getMiMethodResolver()
Get method resolver

Returns:
method resolver
See Also:
com.smhumayun.mi_plus.MIMethodResolver}

setMiMethodResolver

public void setMiMethodResolver(MIMethodResolver miMethodResolver)
                         throws MIException
Set method resolver

Parameters:
miMethodResolver - method resolver
Throws:
MIException - MIException
See Also:
com.smhumayun.mi_plus.MIMethodResolver}

getMiObjectCache

public MIObjectCache getMiObjectCache()
Get MIObjectCache

Returns:
MIObjectCache

setMiObjectCache

public void setMiObjectCache(MIObjectCache miObjectCache)
                      throws MIException
Set MIObjectCache

Parameters:
miObjectCache - MIObjectCache
Throws:
MIException


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