Apache Tuscany SCA Kernel Sub-Project

org.apache.tuscany.spi.loader
Interface Loader

All Known Subinterfaces:
LoaderRegistry

public interface Loader

System service for loading physical artifacts that represent SCDL configurations and creating the model objects that represent them.

Version:
$Rev: 441893 $ $Date: 2006-09-09 20:41:09 -0700 (Sat, 09 Sep 2006) $

Method Summary
<MO extends ModelObject>
MO
load(CompositeComponent parent, URL url, Class<MO> type, DeploymentContext deploymentContext)
          Load a model object from a specified location.
 ModelObject load(CompositeComponent parent, javax.xml.stream.XMLStreamReader reader, DeploymentContext deploymentContext)
          Parse the supplied XML stream, dispatching to the appropriate registered loader for each element encountered in the stream.
<I extends Implementation<?>>
void
loadComponentType(CompositeComponent parent, I implementation, DeploymentContext deploymentContext)
          Load the component type definition for a given implementation.
 

Method Detail

load

ModelObject load(CompositeComponent parent,
                 javax.xml.stream.XMLStreamReader reader,
                 DeploymentContext deploymentContext)
                 throws javax.xml.stream.XMLStreamException,
                        LoaderException
Parse the supplied XML stream, dispatching to the appropriate registered loader for each element encountered in the stream.

This method must be called with the XML cursor positioned on a START_ELEMENT event. When this method returns, the stream will be positioned on the corresponding END_ELEMENT event.

Parameters:
parent -
reader - the XML stream to parse
deploymentContext - the current deployment context
Returns:
the model object obtained by parsing the current element on the stream
Throws:
javax.xml.stream.XMLStreamException - if there was a problem reading the stream
LoaderException

load

<MO extends ModelObject> MO load(CompositeComponent parent,
                                 URL url,
                                 Class<MO> type,
                                 DeploymentContext deploymentContext)
                            throws LoaderException
Load a model object from a specified location.

Parameters:
parent -
url - the location of an XML document to be loaded
type - the type of ModelObject that is expected to be in the document
deploymentContext - the current deployment context
Returns:
the model ojbect loaded from the document
Throws:
LoaderException - if there was a problem loading the document

loadComponentType

<I extends Implementation<?>> void loadComponentType(CompositeComponent parent,
                                                     I implementation,
                                                     DeploymentContext deploymentContext)
                       throws LoaderException
Load the component type definition for a given implementation. How the component type information is located is defined by the implementation specification. It may include loading from an XML sidefile, introspection of some artifact related to the implementation, some combination of those techniques or any other implementation-defined mechanism.

Parameters:
parent - the parent composite
implementation - the implementation whose component type should be loaded
deploymentContext - the current deployment context
Throws:
LoaderException - if there was a problem loading the component type definition

Apache Tuscany SCA Kernel Sub-Project

-