shocks.framework.meta.repository
Class CentralMetadataRepositoryLoader
java.lang.Object
shocks.framework.meta.repository.CentralMetadataRepositoryLoader
- public class CentralMetadataRepositoryLoader
- extends java.lang.Object
Parses xml file and binds the contents into Metadata bean (MDBean) objects,
which are then submitted to the Repository for later retrieval.
Unlike the other, simpler MetadataFactory, the JMXRepositoryLoader makes
use of a repository stored in the MBeanServer. Because it allows multiple
application modules in different web archives to share workflow metadata
(and even Actions), it needs to take extra precautions while validating the
content and structure of the Metadata. In particular, it must ensure that
there are not namespace issues with the MDBeans between application modules.
Because the metadata for different applications is stored in separate
repositories in the MBeanServer, there should be no namespace conflict
between applications. However, there could be namespace issues between
different modules within the same application.
What this means is that a developer could deploy an application module web
archive which contained in its workflow descriptor a duplicate action
entry, new instructions for a old action or even a newer version of an
existing action class.
In order to alter the behavior of an existant workflow system, the metadata
from the newer descriptor needs to be able to override the metadata from
the original descriptor. The key to this lies in versioning. If each
element in the workflow descriptor bears a version number, it should allow
the repository to manage the addition of new metadata resources by comparing
their version numbers, allowing newer versions to replace the older versions
and barring older or equivalent versions from overriding newer versions.
If we're cautious when we build this, we might be able to label and keep the
older versions, allowing the developer to roll back the application to a
prior functional state.
Invalid metadata should result in a fatal error at loadtime which must be
logged and presented to the developer.
Method Summary |
static void |
load(javax.servlet.ServletContext ctx,
org.dom4j.Document document)
Process the incoming document, break it up by element type and
forward it to the element processing methods. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CentralMetadataRepositoryLoader
public CentralMetadataRepositoryLoader()
load
public static void load(javax.servlet.ServletContext ctx,
org.dom4j.Document document)
- Process the incoming document, break it up by element type and
forward it to the element processing methods. Once the metadata is
bound into the DataSource components and validated, load each component
into the MetadataRepository.
- Parameters:
ctx
- ServletContext referencedocument
- XML Document