Adobe 38000382 JRun Guide - Page 112

Strategies, Comments, Finding metadata classes

Page 112 highlights

Strategies This section provides some strategies to use when working with the XML metadata classes. Comments You cannot add comments to XML files using the XML metadata tools. However, the metadata methods preserve existing comments in the XML files. Finding metadata classes The metadata classes that you use to work with the XML files do not use a convention for naming. So you must find the name-appropriate class to instantiate. To find the appropriate metadata classes, use the JRun API Javadocs. The following table describes how common XML elements map to the JRun metadata objects: XML file web.xml jrun.xml application.xml XML element web-app servlet listener jrun-server service attribute application module Metadata object jrun.servlet.metadata.WebAppMetaData jrun.servlet.metadata.ServletMetaData jrun.servlet.metadata.ListenerMetaData jrunx.server.metadata.ServerMetaData jrunx.kernel.metadata.ServiceMetaData jrunx.kernel.metadata.AttributeMetaData jrun.ea.metadata.ApplicationMetaData jrun.ea.metadata.ModuleMetaData With the following subclasses: • ConnectorModuleMetaData • EJBModuleMetaData • JavaModuleMetaData • WebModuleMetaData For each subelement of the XML file, you must find the associated metadata object. For example, for the listener element in the web.xml file, the metadata object is ListenerMetaData. 98 Chapter 9 Editing XML Files

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116

98
Chapter 9
Editing XML Files
Strategies
This section provides some strategies to use when working with the XML metadata
classes.
Comments
You cannot add comments to XML files using the XML metadata tools. However, the
metadata methods preserve existing comments in the XML files.
Finding metadata classes
The metadata classes that you use to work with the XML files do not use a convention
for naming. So you must find the name-appropriate class to instantiate. To find the
appropriate metadata classes, use the JRun API Javadocs.
The following table describes how common XML elements map to the JRun metadata
objects:
For each subelement of the XML file, you must find the associated metadata object. For
example, for the
listener
element in the web.xml file, the metadata object is
ListenerMetaData
.
XML file
XML element
Metadata object
web.xml
web-app
jrun.servlet.metadata.WebAppMetaData
servlet
jrun.servlet.metadata.ServletMetaData
listener
jrun.servlet.metadata.ListenerMetaData
jrun.xml
jrun-server
jrunx.server.metadata.ServerMetaData
service
jrunx.kernel.metadata.ServiceMetaData
attribute
jrunx.kernel.metadata.AttributeMetaData
application.xml
application
jrun.ea.metadata.ApplicationMetaData
module
jrun.ea.metadata.ModuleMetaData
With the following subclasses:
ConnectorModuleMetaData
EJBModuleMetaData
JavaModuleMetaData
WebModuleMetaData