Java 类net.sf.ehcache.loader.CacheLoader 实例源码

项目:c2mon    文件:SubEquipmentCacheImpl.java   
@Autowired
public SubEquipmentCacheImpl(final ClusterCache clusterCache,
                             @Qualifier("subEquipmentEhcache") final Ehcache ehcache,
                             @Qualifier("subEquipmentEhcacheLoader") final CacheLoader cacheLoader,
                             @Qualifier("subEquipmentCacheLoader") final C2monCacheLoader c2monCacheLoader,
                             @Qualifier("subEquipmentDAO") final SimpleCacheLoaderDAO<SubEquipment> cacheLoaderDAO,
                             final ControlTagCache controlCache,
                             final EquipmentCache equipmentCache,
                             final CacheProperties properties) {

  super(clusterCache, ehcache, cacheLoader, c2monCacheLoader, cacheLoaderDAO, properties);
  this.controlCache = controlCache;
  this.equipmentCache = equipmentCache;
}
项目:c2mon    文件:ControlTagCacheImpl.java   
@Autowired
public ControlTagCacheImpl(@Qualifier("clusterCache") final ClusterCache clusterCache,
                           @Qualifier("controlTagEhcache") final Ehcache ehcache,
                           @Qualifier("controlTagEhcacheLoader") final CacheLoader cacheLoader,
                           @Qualifier("controlTagCacheLoader") final C2monCacheLoader c2monCacheLoader,
                           @Qualifier("controlTagLoaderDAO") final SimpleCacheLoaderDAO<ControlTag> cacheLoaderDAO,
                           final CacheProperties properties) {
  super(clusterCache, ehcache, cacheLoader, c2monCacheLoader, cacheLoaderDAO, properties);
}
项目:c2mon    文件:DeviceCacheImpl.java   
@Autowired
public DeviceCacheImpl(@Qualifier("clusterCache") final ClusterCache clusterCache,
                       @Qualifier("deviceEhcache") final Ehcache ehcache,
                       @Qualifier("deviceEhcacheLoader") final CacheLoader cacheLoader,
                       @Qualifier("deviceCacheLoader") final C2monCacheLoader c2monCacheLoader,
                       @Qualifier("deviceDAO") final SimpleCacheLoaderDAO<Device> cacheLoaderDAO,
                       final CacheProperties properties) {
  super(clusterCache, ehcache, cacheLoader, c2monCacheLoader, cacheLoaderDAO, properties);
}
项目:c2mon    文件:DeviceClassCacheImpl.java   
@Autowired
public DeviceClassCacheImpl(final ClusterCache clusterCache,
                            @Qualifier("deviceClassEhcache") final Ehcache ehcache,
                            @Qualifier("deviceClassEhcacheLoader") final CacheLoader cacheLoader,
                            @Qualifier("deviceClassCacheLoader") final C2monCacheLoader c2monCacheLoader,
                            @Qualifier("deviceClassDAO") final SimpleCacheLoaderDAO<DeviceClass> cacheLoaderDAO,
                            final CacheProperties properties) {
  super(clusterCache, ehcache, cacheLoader, c2monCacheLoader, cacheLoaderDAO, properties);
}
项目:c2mon    文件:CommFaultTagCacheImpl.java   
@Autowired
public CommFaultTagCacheImpl(final ClusterCache clusterCache,
                             @Qualifier("commFaultTagEhcache") final Ehcache ehcache,
                             @Qualifier("commFaultTagEhcacheLoader") final CacheLoader cacheLoader,
                             @Qualifier("commFaultTagCacheLoader") final C2monCacheLoader c2monCacheLoader,
                             @Qualifier("commFaultTagDAO") final SimpleCacheLoaderDAO<CommFaultTag> cacheLoaderDAO,
                             final CacheProperties properties) {
  super(clusterCache, ehcache, cacheLoader, c2monCacheLoader, cacheLoaderDAO, properties);
}
项目:c2mon    文件:AbstractTagCache.java   
/**
 * Constructor.
 */
public AbstractTagCache(final ClusterCache clusterCache,
                        final Ehcache ehcache,
                        final CacheLoader cacheLoader,
                        final C2monCacheLoader c2monCacheLoader,
                        final SimpleCacheLoaderDAO<T> cacheLoaderDAO,
                        final CacheProperties properties) {
  super(clusterCache, ehcache, cacheLoader, c2monCacheLoader, cacheLoaderDAO, properties);
  listenersWithSupervision = new ArrayList<>();
  listenerLock = new ReentrantReadWriteLock();
}
项目:c2mon    文件:EquipmentCacheImpl.java   
@Autowired
public EquipmentCacheImpl(final ClusterCache clusterCache,
                          @Qualifier("equipmentEhcache") final Ehcache ehcache,
                          @Qualifier("equipmentEhcacheLoader") final CacheLoader cacheLoader,
                          @Qualifier("equipmentCacheLoader") final C2monCacheLoader c2monCacheLoader,
                          @Qualifier("equipmentDAO") final SimpleCacheLoaderDAO<Equipment> cacheLoaderDAO,
                          final ControlTagCache controlCache,
                          final CacheProperties properties) {

  super(clusterCache, ehcache, cacheLoader, c2monCacheLoader, cacheLoaderDAO, properties);
  this.controlCache = controlCache;
}
项目:c2mon    文件:AlarmCacheImpl.java   
@Autowired
public AlarmCacheImpl(@Qualifier("clusterCache") final ClusterCache clusterCache,
                      @Qualifier("alarmEhcache") final Ehcache ehcache,
                      @Qualifier("alarmEhcacheLoader") final CacheLoader cacheLoader,
                      @Qualifier("alarmCacheLoader") final C2monCacheLoader c2monCacheLoader,
                      @Qualifier("alarmLoaderDAO") final AlarmLoaderDAO cacheLoaderDAO,
                      final CacheProperties properties) {
  super(clusterCache, ehcache, cacheLoader, c2monCacheLoader, cacheLoaderDAO, properties);
}
项目:c2mon    文件:RuleTagCacheImpl.java   
@Autowired
public RuleTagCacheImpl(@Qualifier("clusterCache") final ClusterCache clusterCache,
                        @Qualifier("ruleTagEhcache") final Ehcache ehcache,
                        @Qualifier("ruleTagEhcacheLoader") final CacheLoader cacheLoader,
                        @Qualifier("ruleTagCacheLoader") final C2monCacheLoader c2monCacheLoader,
                        @Qualifier("ruleTagLoaderDAO") final SimpleCacheLoaderDAO<RuleTag> cacheLoaderDAO,
                        @Qualifier("dataTagCache") final DataTagCache dataTagCache,
                        final CacheProperties properties) {
  super(clusterCache, ehcache, cacheLoader, c2monCacheLoader, cacheLoaderDAO, properties);
  this.dataTagCache = dataTagCache;
}
项目:c2mon    文件:DataTagCacheImpl.java   
@Autowired
public DataTagCacheImpl(@Qualifier("clusterCache") final ClusterCache clusterCache,
                        @Qualifier("dataTagEhcache") final Ehcache ehcache,
                        @Qualifier("dataTagEhcacheLoader") final CacheLoader cacheLoader,
                        @Qualifier("dataTagCacheLoader") final C2monCacheLoader c2monCacheLoader,
                        @Qualifier("dataTagLoaderDAO") final SimpleCacheLoaderDAO<DataTag> cacheLoaderDAO,
                        final CacheProperties properties) {
  super(clusterCache, ehcache, cacheLoader, c2monCacheLoader, cacheLoaderDAO, properties);
}
项目:c2mon    文件:ProcessCacheImpl.java   
@Autowired
public ProcessCacheImpl(final ClusterCache clusterCache,
                        @Qualifier("processEhcache") final Ehcache ehcache,
                        @Qualifier("processEhcacheLoader") final CacheLoader cacheLoader,
                        @Qualifier("processCacheLoader") final C2monCacheLoader c2monCacheLoader,
                        @Qualifier("processDAO") final SimpleCacheLoaderDAO<Process> cacheLoaderDAO,
                        @Qualifier("controlTagCache") final ControlTagCache controlCache,
                        final CacheProperties properties) {

  super(clusterCache, ehcache, cacheLoader, c2monCacheLoader, cacheLoaderDAO, properties);
  this.processDAO = (ProcessDAO) cacheLoaderDAO;
  this.controlCache = controlCache;
}
项目:c2mon    文件:AbstractCache.java   
public AbstractCache(final ClusterCache clusterCache,
                     final Ehcache cache,
                     final CacheLoader cacheLoader,
                     final C2monCacheLoader c2monCacheLoader,
                     final SimpleCacheLoaderDAO<T> cacheLoaderDAO,
                     final CacheProperties properties) {
  super();
  this.clusterCache = clusterCache;
  this.cache = cache;
  this.cacheLoader = cacheLoader;
  this.c2monCacheLoader = c2monCacheLoader;
  this.cacheLoaderDAO = cacheLoaderDAO;
  this.properties = properties;
}
项目:c2mon    文件:AliveTimerCacheImpl.java   
@Autowired
public AliveTimerCacheImpl(final ClusterCache clusterCache,
                           @Qualifier("aliveTimerEhcache") final Ehcache ehcache,
                           @Qualifier("aliveTimerEhcacheLoader") final CacheLoader cacheLoader,
                           @Qualifier("aliveTimerCacheLoader") final C2monCacheLoader c2monCacheLoader,
                           @Qualifier("aliveTimerDAO") final SimpleCacheLoaderDAO<AliveTimer> cacheLoaderDAO,
                           final CacheProperties properties) {
  super(clusterCache, ehcache, cacheLoader, c2monCacheLoader, cacheLoaderDAO, properties);
}
项目:c2mon    文件:CommandTagCacheImpl.java   
@Autowired
public CommandTagCacheImpl(final ClusterCache clusterCache,
                           @Qualifier("commandTagEhcache") final Ehcache ehcache,
                           @Qualifier("commandTagEhcacheLoader") final CacheLoader cacheLoader,
                           @Qualifier("commandTagCacheLoader") final C2monCacheLoader c2monCacheLoader,
                           @Qualifier("commandTagDAO") final SimpleCacheLoaderDAO<CommandTag> cacheLoaderDAO,
                           final CacheProperties properties) {
  super(clusterCache, ehcache, cacheLoader, c2monCacheLoader, cacheLoaderDAO, properties);
}
项目:c2mon    文件:DataTagCacheRegistrationTest.java   
@Before
public void init() {
  clusterCache = mockControl.createMock(ClusterCache.class);
  cache = mockControl.createMock(Cache.class);
  cacheLoader = mockControl.createMock(CacheLoader.class);
  c2monCacheLoader = mockControl.createMock(C2monCacheLoader.class);
  cacheLoaderDAO = mockControl.createMock(CacheLoaderDAO.class);
  supervisionAppender = mockControl.createMock(SupervisionAppender.class);
  registeredEventListeners = new RegisteredEventListeners(cache);
  dataTagCache = new DataTagCacheImpl(clusterCache, cache, cacheLoader, c2monCacheLoader, cacheLoaderDAO, new CacheProperties());
}
项目:CAM    文件:CamCacheLoaderFactory.java   
@Override
public CacheLoader createCacheLoader(Ehcache cache, Properties properties) {
    CamFactory camFactory = FactoryHelper.factory();
    PersistentDao persistentDao = null;
    if(camFactory!=null){
        persistentDao = camFactory.getPersistentDao();
    }
    return new CamCacheLoader(persistentDao);
}
项目:c2mon    文件:EhcacheLoaderImpl.java   
@Override
public CacheLoader clone(Ehcache arg0) throws CloneNotSupportedException {
  // TODO Auto-generated method stub
  return null;
}
项目:c2mon    文件:AbstractCache.java   
protected CacheLoader getCacheLoader() {
  return cacheLoader;
}
项目:Camel    文件:CacheRegistryRefTest.java   
@Test
public void testConfig() throws Exception {
    producerTemplate.send(new Processor() {
        public void process(Exchange exchange) throws Exception {
            exchange.setProperty(Exchange.CHARSET_NAME, "UTF-8");
            Message in = exchange.getIn();
            in.setHeader(CacheConstants.CACHE_OPERATION, CacheConstants.CACHE_OPERATION_ADD);
            in.setHeader(CacheConstants.CACHE_KEY, "greeting");
            in.setBody("Hello World");
        }
    });

    CacheManager cm = cacheEndpoint.getCacheManagerFactory().getInstance();
    Cache cache = cm.getCache(cacheEndpoint.getConfig().getCacheName());
    Set<CacheEventListener> ehcacheEventListners = cache.getCacheEventNotificationService().getCacheEventListeners();
    List<CacheLoader> cacheLoaders = cache.getRegisteredCacheLoaders();
    CacheEventListenerRegistry configuredEventRegistry = cacheEndpoint.getConfig().getEventListenerRegistry();
    CacheLoaderRegistry configuredLoaderRegistry = cacheEndpoint.getConfig().getCacheLoaderRegistry();

    //Test if CacheEventListenerRegistry was referenced correctly
    assertEquals("CacheEventListenerRegistry size", 1, configuredEventRegistry.size());

    //Expecting 1 loader to be configured via spring
    assertEquals("configuredLoaderRegistry size", 1, configuredLoaderRegistry.size());

    //Expecting 1 listener added by us: TestCacheEventListener
    assertEquals("Number of registered listeners", 1, ehcacheEventListners.size());

    assertEquals("Number of registered loaders", 1, cacheLoaders.size());


    //Is our TestCacheEventListener really invoked?
    int puts = 0;
    for (Object listener : ehcacheEventListners) {
        if (listener instanceof TestCacheEventListener) {
            puts = ((TestCacheEventListener)listener).getNumberOfPuts();
            break;
        }
    }
    assertEquals("TestCacheEventListener put invocations", 1, puts);

    //Is cache loader initialized by ehcache
    assertEquals("loader initialized", cacheLoaders.get(0).getStatus(), Status.STATUS_ALIVE);
}
项目:Camel    文件:CacheRegistryRefTest.java   
@Override
public CacheLoader clone(Ehcache arg0) throws CloneNotSupportedException {
    return null;
}
项目:ehcache-extensions    文件:CacheFailoverDecorator.java   
@Override
public final void registerCacheLoader(CacheLoader cacheLoader) {
    throw new UnsupportedOperationException("Cache is read-only...operation not supported");
}
项目:ehcache-extensions    文件:EhcacheDelegateAdapter.java   
@Override
public List<CacheLoader> getRegisteredCacheLoaders() {
    init();
    return super.getRegisteredCacheLoaders();
}
项目:ehcache-extensions    文件:EhcacheDelegateAdapter.java   
@Override
public Element getWithLoader(Object key, CacheLoader loader,
        Object loaderArgument) throws CacheException {
    init();
    return super.getWithLoader(key, loader, loaderArgument);
}
项目:ehcache-extensions    文件:EhcacheDelegateAdapter.java   
@Override
public void registerCacheLoader(CacheLoader cacheLoader) {
    init();
    super.registerCacheLoader(cacheLoader);
}
项目:ehcache-extensions    文件:EhcacheDelegateAdapter.java   
@Override
public void unregisterCacheLoader(CacheLoader cacheLoader) {
    init();
    super.unregisterCacheLoader(cacheLoader);
}
项目:ehcache-extensions    文件:EhcacheDelegatedDecoratorAdapter.java   
@Override
public List<CacheLoader> getRegisteredCacheLoaders() {
    init();
    return super.getRegisteredCacheLoaders();
}
项目:ehcache-extensions    文件:EhcacheDelegatedDecoratorAdapter.java   
@Override
public Element getWithLoader(Object key, CacheLoader loader,
        Object loaderArgument) throws CacheException {
    init();
    return super.getWithLoader(key, loader, loaderArgument);
}
项目:ehcache-extensions    文件:EhcacheDelegatedDecoratorAdapter.java   
@Override
public void registerCacheLoader(CacheLoader cacheLoader) {
    init();
    super.registerCacheLoader(cacheLoader);
}
项目:ehcache-extensions    文件:EhcacheDelegatedDecoratorAdapter.java   
@Override
public void unregisterCacheLoader(CacheLoader cacheLoader) {
    init();
    super.unregisterCacheLoader(cacheLoader);
}
项目:ehcache-extensions    文件:CachePartitionDecorator.java   
@Override
public final void registerCacheLoader(CacheLoader cacheLoader) {
    throw new UnsupportedOperationException("Cache is read-only...operation not supported");
}
项目:CAM    文件:CamCacheLoader.java   
@Override
public CacheLoader clone(Ehcache cache) throws CloneNotSupportedException {
    return null;
}