flashcache
Class QuoteLoader

java.lang.Object
  extended by flashcache.QuoteLoader
All Implemented Interfaces:
CacheCallback, CacheLoader

public class QuoteLoader
extends Object
implements CacheLoader

This class implements a CacheLoader used by the Quote program to search for quotes in other caches and, failing that, to pull quotes from the NASDAQ FlashQuote web site.

When a CacheLoader is associated with a Region, GemFire will use it to load requested objects when there is a cache-miss.

Since:
2.0
Author:
GemStone Systems, Inc.

Constructor Summary
QuoteLoader()
           
 
Method Summary
 void close()
          This method would clean up any database connections or other external resources.
 Object load(LoaderHelper helper)
          this method is invoked by GemFire when there is a cache miss
(package private)  String loadSnapshot(String symbol)
          this method is invoked by the load() method when the requested quote isn't in the cache system and must be loaded from the NASDAQ web site
static void main(String[] args)
          This is a test driver - this loads a quote without looking in the GemFire cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuoteLoader

public QuoteLoader()
Method Detail

load

public Object load(LoaderHelper helper)
this method is invoked by GemFire when there is a cache miss

Specified by:
load in interface CacheLoader

loadSnapshot

String loadSnapshot(String symbol)
this method is invoked by the load() method when the requested quote isn't in the cache system and must be loaded from the NASDAQ web site


close

public void close()
This method would clean up any database connections or other external resources.

Specified by:
close in interface CacheCallback

main

public static void main(String[] args)
This is a test driver - this loads a quote without looking in the GemFire cache.

The class Quote uses GemFire to cache quotes.



Copyright © 2002-2008 GemStone Systems, Inc. All Rights Reserved.