org.milyn.scribe.invoker
Class DaoInvokerFactory

java.lang.Object
  extended by org.milyn.scribe.invoker.DaoInvokerFactory

public class DaoInvokerFactory
extends java.lang.Object

Manages the creation of DaoInvokers

Author:
maurice.zeijen@smies.com

Field Summary
static java.lang.String REPOSITORY_KEY
           
 
Method Summary
 DaoInvoker create(java.lang.Object dao, ObjectStore objectStore)
          Creates a DaoInvoker depending on the DAO object.
static DaoInvokerFactory getInstance()
          Returns the DaoInvokerFactory instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REPOSITORY_KEY

public static final java.lang.String REPOSITORY_KEY
Method Detail

getInstance

public static final DaoInvokerFactory getInstance()
Returns the DaoInvokerFactory instance

Returns:
the DaoInvokerFactory instance

create

public DaoInvoker create(java.lang.Object dao,
                         ObjectStore objectStore)
Creates a DaoInvoker depending on the DAO object. If the DAO object is a instance of Dao, MappingDao, Queryable, Locator or Flushable then a InterfaceDaoInvoker is created and returned. If the DAO class is annotated with the Dao annotation then a AnnotatedDaoInvoker is created and returned. If neither is the case then a IllegalArgumentException exception is thrown.

Parameters:
dao - The DAO for which the invoker instantiated
objectStore - An object store for caching and retrieving a cached AnnotatedDaoRuntimeInfoFactory object.
Returns:
the DaoInvoker for the specified DAO
Throws:
java.lang.IllegalArgumentException - if the DAO object doesn't match for a InterfaceDaoInvoker or AnnotatedDaoInvoker.


Copyright © 2011. All Rights Reserved.