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 ReportStatusListener
public void initializeService()
public void resetEventDidOccur()
resetEventDidOccur
in interface ResetEventListener
protected 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 ISpecificationSource
resourcePath
- 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)
ISpecificationSource
getPageSpecification
in interface ISpecificationSource
resourceLocation
- the location where the specification may be read from.public ILibrarySpecification getLibrarySpecification(org.apache.hivemind.Resource resourceLocation)
ISpecificationSource
LibrarySpecification
with the given path.getLibrarySpecification
in interface ISpecificationSource
resourceLocation
- the resource path of the specification to returnpublic INamespace getApplicationNamespace()
ISpecificationSource
INamespace
for the application.getApplicationNamespace
in interface ISpecificationSource
public INamespace getFrameworkNamespace()
ISpecificationSource
INamespace
for the framework itself.getFrameworkNamespace
in interface ISpecificationSource
public 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)