Package org.milyn.scribe.reflection

Examples of org.milyn.scribe.reflection.AnnotatedDaoRuntimeInfoFactory


  /**
   * @param attributestore
   * @return
   */
  private AnnotatedDaoRuntimeInfoFactory getAnnotatedDAORuntimeInfoRepository(final ObjectStore objectStore) {
    AnnotatedDaoRuntimeInfoFactory repository = (AnnotatedDaoRuntimeInfoFactory) objectStore.get(REPOSITORY_KEY);

    if(repository == null) {
      repository = new AnnotatedDaoRuntimeInfoFactory();

      objectStore.set(REPOSITORY_KEY, repository);
    }
    return repository;
  }
View Full Code Here


      final AnnotatedClass annotatedClass =  AnnotationManager.getAnnotatedClass(dao.getClass());

      if(annotatedClass.isAnnotationPresent(org.milyn.scribe.annotation.Dao.class)) {

        final AnnotatedDaoRuntimeInfoFactory repository = getAnnotatedDAORuntimeInfoRepository(objectStore);

        return new AnnotatedDaoInvoker(dao, repository.create(dao.getClass()));

      } else {
        throw new IllegalArgumentException("The DAO object doesn't implement any of the DAO interfaces " +
            "or is annotated with the [" + org.milyn.scribe.annotation.Dao.class.getName() + "] annotation");
      }
View Full Code Here

public class AnnotatedDaoRuntimeInfoFactoryTest {


  public void test_create() {

    AnnotatedDaoRuntimeInfoFactory factory = new AnnotatedDaoRuntimeInfoFactory();
    AnnotatedDaoRuntimeInfo runtimeInfo = factory.create(FullAnnotatedDao.class);

    assertNotNull(runtimeInfo);

    AnnotatedDaoRuntimeInfo runtimeInfo2 = factory.create(FullAnnotatedDao.class);

    assertSame(runtimeInfo, runtimeInfo2);

    AnnotatedDaoRuntimeInfo runtimeInfo3 = factory.create(MinimumAnnotatedDao.class);

    assertNotSame(runtimeInfo, runtimeInfo3);
  }
View Full Code Here

TOP

Related Classes of org.milyn.scribe.reflection.AnnotatedDaoRuntimeInfoFactory

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.