org.apache.tapestry.services.impl
Class SpecificationSourceImpl

java.lang.Object
  extended by org.apache.tapestry.services.impl.SpecificationSourceImpl
All Implemented Interfaces:
EventListener, ISpecificationSource, ReportStatusListener, ResetEventListener

public class SpecificationSourceImpl
extends Object
implements ISpecificationSource, ResetEventListener, ReportStatusListener

Default implementation of ISpecificationSource that expects to use the normal class loader to locate component specifications from within the classpath.

Caches specifications in memory forever, or until resetEventDidOccur() is invoked.

Author:
Howard Lewis Ship

Constructor Summary
SpecificationSourceImpl()
           
 
Method Summary
 INamespace getApplicationNamespace()
          Returns the INamespace for the application.
 IComponentSpecification getComponentSpecification(org.apache.hivemind.Resource resourceLocation)
          Gets a component specification.
 INamespace getFrameworkNamespace()
          Returns the INamespace for the framework itself.
 ILibrarySpecification getLibrarySpecification(org.apache.hivemind.Resource resourceLocation)
          Returns a LibrarySpecification with the given path.
 IComponentSpecification getPageSpecification(org.apache.hivemind.Resource resourceLocation)
          Retrieves a page specification, parsing it as necessary.
 void initializeService()
           
protected  ILibrarySpecification parseLibrarySpecification(org.apache.hivemind.Resource resource)
           
protected  IComponentSpecification parseSpecification(org.apache.hivemind.Resource resource, boolean asPage)
           
 void reportStatus(ReportStatusEvent event)
           
 void resetEventDidOccur()
          Clears the specification cache.
 void setAssetSource(AssetSource assetSource)
           
 void setClassResolver(org.apache.hivemind.ClassResolver resolver)
           
 void setParser(ISpecificationParser parser)
           
 void setServiceId(String serviceId)
           
 void setSpecification(IApplicationSpecification specification)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpecificationSourceImpl

public SpecificationSourceImpl()
Method Detail

reportStatus

public void reportStatus(ReportStatusEvent event)
Specified by:
reportStatus in interface ReportStatusListener

initializeService

public void initializeService()

resetEventDidOccur

public void resetEventDidOccur()
Clears the specification cache. This is used during debugging.

Specified by:
resetEventDidOccur in interface ResetEventListener

parseSpecification

protected IComponentSpecification parseSpecification(org.apache.hivemind.Resource resource,
                                                     boolean asPage)

parseLibrarySpecification

protected ILibrarySpecification parseLibrarySpecification(org.apache.hivemind.Resource resource)

getComponentSpecification

public IComponentSpecification getComponentSpecification(org.apache.hivemind.Resource resourceLocation)
Gets a component specification.

Specified by:
getComponentSpecification in interface ISpecificationSource
Parameters:
resourceLocation - the complete resource path to the specification.
Throws:
org.apache.hivemind.ApplicationRuntimeException - if the specification cannot be obtained.

getPageSpecification

public IComponentSpecification getPageSpecification(org.apache.hivemind.Resource resourceLocation)
Description copied from interface: ISpecificationSource
Retrieves a page specification, parsing it as necessary.

Specified by:
getPageSpecification in interface ISpecificationSource
Parameters:
resourceLocation - the location where the specification may be read from.

getLibrarySpecification

public ILibrarySpecification getLibrarySpecification(org.apache.hivemind.Resource resourceLocation)
Description copied from interface: ISpecificationSource
Returns a LibrarySpecification with the given path.

Specified by:
getLibrarySpecification in interface ISpecificationSource
Parameters:
resourceLocation - the resource path of the specification to return

getApplicationNamespace

public INamespace getApplicationNamespace()
Description copied from interface: ISpecificationSource
Returns the INamespace for the application.

Specified by:
getApplicationNamespace in interface ISpecificationSource

getFrameworkNamespace

public INamespace getFrameworkNamespace()
Description copied from interface: ISpecificationSource
Returns the INamespace for the framework itself.

Specified by:
getFrameworkNamespace in interface ISpecificationSource

setParser

public void setParser(ISpecificationParser parser)

setClassResolver

public void setClassResolver(org.apache.hivemind.ClassResolver resolver)

setSpecification

public void setSpecification(IApplicationSpecification specification)

setAssetSource

public void setAssetSource(AssetSource assetSource)

setServiceId

public void setServiceId(String serviceId)


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