org.apache.shindig.gadgets
Class DefaultGadgetSpecFactory

java.lang.Object
  extended by org.apache.shindig.gadgets.AbstractSpecFactory<GadgetSpec>
      extended by org.apache.shindig.gadgets.DefaultGadgetSpecFactory
All Implemented Interfaces:
GadgetSpecFactory

public class DefaultGadgetSpecFactory
extends AbstractSpecFactory<GadgetSpec>
implements GadgetSpecFactory

Default implementation of a gadget spec factory.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.shindig.gadgets.AbstractSpecFactory
AbstractSpecFactory.Query, AbstractSpecFactory.SpecRetrievalFailedException
 
Field Summary
static String CACHE_NAME
           
static String RAW_GADGETSPEC_XML_PARAM_NAME
           
 
Constructor Summary
DefaultGadgetSpecFactory(ExecutorService executor, RequestPipeline pipeline, CacheProvider cacheProvider, long refresh)
           
 
Method Summary
 GadgetSpec getGadgetSpec(GadgetContext context)
          Return a gadget spec for a context
protected  GadgetSpec parse(String content, AbstractSpecFactory.Query query)
          Parse and return a new spec object from the network.
 
Methods inherited from class org.apache.shindig.gadgets.AbstractSpecFactory
fetchFromNetwork, getSpec
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CACHE_NAME

public static final String CACHE_NAME
See Also:
Constant Field Values

RAW_GADGETSPEC_XML_PARAM_NAME

public static final String RAW_GADGETSPEC_XML_PARAM_NAME
See Also:
Constant Field Values
Constructor Detail

DefaultGadgetSpecFactory

@Inject
public DefaultGadgetSpecFactory(ExecutorService executor,
                                       RequestPipeline pipeline,
                                       CacheProvider cacheProvider,
                                       long refresh)
Method Detail

getGadgetSpec

public GadgetSpec getGadgetSpec(GadgetContext context)
                         throws GadgetException
Description copied from interface: GadgetSpecFactory
Return a gadget spec for a context

Specified by:
getGadgetSpec in interface GadgetSpecFactory
Throws:
GadgetException

parse

protected GadgetSpec parse(String content,
                           AbstractSpecFactory.Query query)
                    throws XmlException,
                           GadgetException
Description copied from class: AbstractSpecFactory
Parse and return a new spec object from the network.

Specified by:
parse in class AbstractSpecFactory<GadgetSpec>
Parameters:
content - the content located at specUri
query - same as was passed AbstractSpecFactory.getSpec(Query)
Throws:
XmlException
GadgetException


Copyright © 2007-2012. All Rights Reserved.