public class SpecificationSourceImpl extends java.lang.Object implements ISpecificationSource, ResetEventListener, ReportStatusListener
ISpecificationSource that expects to use the normal class
loader to locate component specifications from within the classpath.
Caches specifications in memory forever, or until #resetDidOccur() is invoked.
| Constructor and Description |
|---|
SpecificationSourceImpl() |
| Modifier and Type | Method and Description |
|---|---|
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(java.lang.String serviceId) |
void |
setSpecification(IApplicationSpecification specification) |
public SpecificationSourceImpl()
public void reportStatus(ReportStatusEvent event)
reportStatus in interface ReportStatusListenerpublic void initializeService()
public void resetEventDidOccur()
resetEventDidOccur in interface ResetEventListenerprotected IComponentSpecification parseSpecification(org.apache.hivemind.Resource resource, boolean asPage)
protected ILibrarySpecification parseLibrarySpecification(org.apache.hivemind.Resource resource)
public IComponentSpecification getComponentSpecification(org.apache.hivemind.Resource resourceLocation)
getComponentSpecification in interface ISpecificationSourceresourcePath - the complete resource path to the specification.org.apache.hivemind.ApplicationRuntimeException - if the specification cannot be obtained.public IComponentSpecification getPageSpecification(org.apache.hivemind.Resource resourceLocation)
ISpecificationSourcegetPageSpecification in interface ISpecificationSourceresourceLocation - the location where the specification may be read from.public ILibrarySpecification getLibrarySpecification(org.apache.hivemind.Resource resourceLocation)
ISpecificationSourceLibrarySpecification with the given path.getLibrarySpecification in interface ISpecificationSourceresourceLocation - the resource path of the specification to returnpublic INamespace getApplicationNamespace()
ISpecificationSourceINamespace for the application.getApplicationNamespace in interface ISpecificationSourcepublic INamespace getFrameworkNamespace()
ISpecificationSourceINamespace for the framework itself.getFrameworkNamespace in interface ISpecificationSourcepublic void setParser(ISpecificationParser parser)
public void setClassResolver(org.apache.hivemind.ClassResolver resolver)
public void setSpecification(IApplicationSpecification specification)
public void setAssetSource(AssetSource assetSource)
public void setServiceId(java.lang.String serviceId)