|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cuba.wired.ddread.XmlReader cuba.wired.ddread.WiredJarReader
public class WiredJarReader
XML reader for the descriptor of a wired JAR module
Field Summary | |
---|---|
protected org.w3c.dom.Element |
jardd
|
static java.lang.String |
WIRED_DD_DIR
|
static java.lang.String |
WIRED_DD_FILE
|
Fields inherited from class cuba.wired.ddread.XmlReader |
---|
REVISION_ID |
Constructor Summary | |
---|---|
WiredJarReader(java.lang.String jarFileName)
Create a new WiredJarReader for the specified JAR file |
Method Summary | |
---|---|
protected void |
checkEnvironmentType(java.lang.Class interfaceType)
|
protected java.lang.Class |
getClass(org.w3c.dom.Node node,
java.lang.String key)
Get a Class by name from a descriptor node |
protected java.lang.Class |
getClass(java.lang.String className)
Get a Class by name from the system class loader |
protected ComponentRefMap |
getComponentRefs(org.w3c.dom.Node comp)
Collect a component's local references to other components |
protected EnvironmentRefMap |
getEnvironmentRefs(org.w3c.dom.Node comp)
Collect a component's local environment references |
protected ResourceRefMap |
getResourceRefs(org.w3c.dom.Node comp)
Collect a component's local references to external resources |
protected boolean |
getTransactionManagementType(org.w3c.dom.Node comp)
Check for type of transaction control of a component description. |
protected java.lang.Object |
parseEnvironmentValue(java.lang.String rawValue,
java.lang.Class resultType)
Make a value type out of a string representation, basically by applying the expected result type's static valueOf method (via Java reflection API). |
protected void |
registerComponent(org.w3c.dom.Node comp,
ComponentMap componentMap)
Collect a component's name, type, wired adapter, and references and register it in the passed component map |
void |
registerComponents(ComponentMap componentMap)
Collect all components from the module JAR file's descriptor and register them in the passed component map. |
Methods inherited from class cuba.wired.ddread.XmlReader |
---|
getAttribute, getChild, getChildNode, getElementName, getJarEntry, getMandatoryAttribute, getMandatoryChild, getMandatoryChildNode, getMandatoryFirstChildValue, getResource, getRootElement, getRootElement, getSystemResource, getURL, setXmlParser, setXmlParserType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String WIRED_DD_DIR
public static final java.lang.String WIRED_DD_FILE
protected org.w3c.dom.Element jardd
Constructor Detail |
---|
public WiredJarReader(java.lang.String jarFileName) throws InitException
jarFileName
- the name of the JAR file to read the descriptor from.
Must not by null.
InitException
- if the JAR file does not exist, if it is not valid,
if it doesn't contain a descriptor META-INF/wired-jar.xml or
if the descriptor could not be process as an XML file.Method Detail |
---|
protected java.lang.Class getClass(java.lang.String className) throws InitException
className
- the fully qualified class name. Must not be null.
Class
InitException
- if the class could not be loaded.protected java.lang.Class getClass(org.w3c.dom.Node node, java.lang.String key) throws InitException
node
- The parent element node for the class name retrievalkey
- The name of the direct child tag to retrieve the class name from
Class
InitException
- if the class could not be loadedprotected ComponentRefMap getComponentRefs(org.w3c.dom.Node comp) throws InitException
comp
- The node in the descriptor representing the component of interest
ComponentRefMap
holding the collected references
InitException
- if any of the referenced component interfaces
cannot be loaded from the system class loaderprotected ResourceRefMap getResourceRefs(org.w3c.dom.Node comp) throws InitException
comp
- The node in the descriptor representing the component of interest
ResourceRefMap
holding the collected references
InitException
- if any of the references refers to an unsupported
resource interface type. Currently the is only DataSource supported.protected void checkEnvironmentType(java.lang.Class interfaceType) throws InitException
InitException
protected java.lang.Object parseEnvironmentValue(java.lang.String rawValue, java.lang.Class resultType) throws InitException
rawValue
- the string value to make the object fromresultType
- the expected result value type
InitException
- if the resultType has no static valueOf() method, or
if it cannot be invoked successfully (especially non-suitable string value).protected EnvironmentRefMap getEnvironmentRefs(org.w3c.dom.Node comp) throws InitException
comp
- The node in the descriptor representing the component of interest
EnvironmentRefMap
holding the collected references
InitException
- if any of the references refers to an unsupported
value type or if the specified value is not suitable to construct an
object of the requested type. Currently there are the following types
supported:
protected boolean getTransactionManagementType(org.w3c.dom.Node comp) throws InitException
comp
- The node in the descriptor representing the component of interest
InitException
- if the transaction management attribute is missing
in the transaction tag of the componentprotected void registerComponent(org.w3c.dom.Node comp, ComponentMap componentMap) throws InitException
comp
- The node in the descriptor representing the component of interestcomponentMap
- The ComponentMap
to register the
component in.
InitException
- if the component's description is invalidpublic void registerComponents(ComponentMap componentMap) throws InitException
componentMap
- The ComponentMap
to register the
components in.
InitException
- if any of the components' descriptions is invalid
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |