com.trendmicro.grid.acl.ds.jpa
Class AbstractFetcher<K,T,R extends com.trendmicro.grid.acl.ds.Repository>

java.lang.Object
  extended by com.trendmicro.grid.acl.ds.jpa.AbstractFetcher<K,T,R>
All Implemented Interfaces:
com.trendmicro.grid.acl.ds.SelectorAware
Direct Known Subclasses:
JpaFileDetailsFetcher, JpaSourceDomainFetcher, JpaSourceFetcher

public abstract class AbstractFetcher<K,T,R extends com.trendmicro.grid.acl.ds.Repository>
extends Object
implements com.trendmicro.grid.acl.ds.SelectorAware

Is a base to classes that implement fetching inside a JPA context using another repository through the repository selector.

Version:
1.0
Author:
juergen_kellerer, 2010-06-01

Field Summary
protected  String incompatibleRepositoryKey
           
protected  com.trendmicro.grid.acl.ds.RepositorySelector<R> selector
           
 
Constructor Summary
protected AbstractFetcher(Class<R> repositoryClass)
           
 
Method Summary
 T fetch(K key)
           
protected abstract  Object fetch(R repository, K key)
           
protected abstract  R getFallbackRepository()
           
 void refreshSelectors(com.trendmicro.grid.acl.ds.RepositorySelectorsRepository selectorsRepository)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

incompatibleRepositoryKey

protected String incompatibleRepositoryKey

selector

protected com.trendmicro.grid.acl.ds.RepositorySelector<R extends com.trendmicro.grid.acl.ds.Repository> selector
Constructor Detail

AbstractFetcher

protected AbstractFetcher(Class<R> repositoryClass)
Method Detail

getFallbackRepository

protected abstract R getFallbackRepository()

refreshSelectors

public void refreshSelectors(com.trendmicro.grid.acl.ds.RepositorySelectorsRepository selectorsRepository)

Specified by:
refreshSelectors in interface com.trendmicro.grid.acl.ds.SelectorAware

fetch

public T fetch(K key)

fetch

protected abstract Object fetch(R repository,
                                K key)