org.apache.lucene.gdata.server.registry
Class ProvidedServiceConfig

java.lang.Object
  extended by org.apache.lucene.gdata.server.registry.ProvidedServiceConfig
All Implemented Interfaces:
ProvidedService, ScopeVisitor

public class ProvidedServiceConfig
extends Object
implements ProvidedService, ScopeVisitor

Standard implementation of ProvidedService to be used inside the GDataServerRegistry

ExtensionProfiles are used to generate and parse xml by the gdata api. For that case all methods are synchronized. This will slow down the application when performing lots of xml generation concurrently. For that case the extensionProfile for a specific service will be pooled and reused.

Author:
Simon Willnauer

Field Summary
protected  ThreadLocal<com.google.gdata.data.ExtensionProfile> extProfThreadLocal
           
 
Constructor Summary
ProvidedServiceConfig()
          Default constructor to instantiate via reflection
 
Method Summary
 void destroy()
          releases all dependencies and resources
 Class getEntryType()
           
 com.google.gdata.data.ExtensionProfile getExtensionProfile()
           
 Class getFeedType()
           
 IndexSchema getIndexSchema()
           
 String getName()
           
 int getPoolSize()
           
 Templates getTransformTemplate()
           
 void setEntryType(Class entryType)
           
 void setExtensionProfile(com.google.gdata.data.ExtensionProfile extensionProfil)
           
<E extends com.google.gdata.data.ExtensionProfile>
void
setExtensionProfileClass(Class<E> extensionProfileClass)
          TODO add comment
 void setFeedType(Class feedType)
           
 void setIndexSchema(IndexSchema indexSchema)
           
 void setName(String serviceName)
           
 void setPoolSize(int poolSize)
           
 void setXsltStylesheet(String filename)
          Sets and creates the preview transformer xslt template to provide a html formate for feeds and entries.
 void visiteDestroy()
          Visites the destory of the scope
 void visiteInitialize()
          Visites the initialization of the scope
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

extProfThreadLocal

protected final ThreadLocal<com.google.gdata.data.ExtensionProfile> extProfThreadLocal
Constructor Detail

ProvidedServiceConfig

public ProvidedServiceConfig()
Default constructor to instantiate via reflection

Method Detail

getPoolSize

public int getPoolSize()
Returns:
Returns the poolSize.

setPoolSize

public void setPoolSize(int poolSize)
Parameters:
poolSize - The poolSize to set.

getFeedType

public Class getFeedType()
Specified by:
getFeedType in interface ProvidedService
Returns:
Returns the feedType.
See Also:
ProvidedService.getFeedType()

setFeedType

public void setFeedType(Class feedType)
Parameters:
feedType - The feedType to set.

getExtensionProfile

public com.google.gdata.data.ExtensionProfile getExtensionProfile()
Specified by:
getExtensionProfile in interface ProvidedService
Returns:
- the extension profile for this feed
See Also:
ProvidedService.getExtensionProfile()

setExtensionProfile

public void setExtensionProfile(com.google.gdata.data.ExtensionProfile extensionProfil)
Parameters:
extensionProfil - - the extension profile for this feed configuration

setExtensionProfileClass

public <E extends com.google.gdata.data.ExtensionProfile> void setExtensionProfileClass(Class<E> extensionProfileClass)
                              throws InstantiationException,
                                     IllegalAccessException
TODO add comment

Type Parameters:
E -
Parameters:
extensionProfileClass -
Throws:
InstantiationException
IllegalAccessException

getEntryType

public Class getEntryType()
Specified by:
getEntryType in interface ProvidedService
Returns:
the entry Type configured for this Service
See Also:
ProvidedService.getEntryType()

setEntryType

public void setEntryType(Class entryType)
Parameters:
entryType -

getName

public String getName()
Specified by:
getName in interface ProvidedService
Returns:
- the service name
See Also:
ProvidedService.getName()

setName

public void setName(String serviceName)
Parameters:
serviceName -

destroy

public void destroy()
Description copied from interface: ProvidedService
releases all dependencies and resources

Specified by:
destroy in interface ProvidedService
See Also:
ProvidedService.destroy()

visiteInitialize

public void visiteInitialize()
Description copied from interface: ScopeVisitor
Visites the initialization of the scope

Specified by:
visiteInitialize in interface ScopeVisitor
See Also:
ScopeVisitor.visiteInitialize()

visiteDestroy

public void visiteDestroy()
Description copied from interface: ScopeVisitor
Visites the destory of the scope

Specified by:
visiteDestroy in interface ScopeVisitor
See Also:
ScopeVisitor.visiteDestroy()

getIndexSchema

public IndexSchema getIndexSchema()
Specified by:
getIndexSchema in interface ProvidedService
Returns:
Returns the indexSchema.

setIndexSchema

public void setIndexSchema(IndexSchema indexSchema)
Parameters:
indexSchema - The indexSchema to set.

getTransformTemplate

public Templates getTransformTemplate()
Specified by:
getTransformTemplate in interface ProvidedService
Returns:
the compiled xslt stylesheet to transform the feed / entry for preview
See Also:
ProvidedService.getTransformTemplate()

setXsltStylesheet

public void setXsltStylesheet(String filename)
Sets and creates the preview transformer xslt template to provide a html formate for feeds and entries. The given file name must be available in the classpath.

Parameters:
filename - - the name of the file in the classpath


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.