private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery
|
IOC = inversion of control |
Jetty.xml IOC/DI has long been available even before spring sprung
(springframework)
Almost anything you can do programmatically can be done on jetty.xml, so long as it
does not require loops.
The entire functionality is covered by two classes:
1. org.mortbay.xml.XmlConfiguration
2. org.mortbay.xml.XmlParser
Attributes
id
This simply means that you want to reference an object for later use.
Jetty persists the object in a java.util.HashMap<String,Object>
Most common use cases:
class
The value is the fully qualified class name of an object.
Used in three tags:
1. #Configure
2. #New
3. #Call
name
Generally used to specify the name of the property/method of an object.
Also used to specify the name of a System property
Used on the ff tags:
1. #Set
2. #Get
3. #Call
4. #SystemProperty
type
Used to specify the type of an #Array tag.
The value is the fully qualified class name of an object.
Used only in one tag:
1. #Array
default
Used to specify the default value of a System property if it does not exist.
Used only in one tag:
1. #SystemProperty
Tags
Configure
The root tag.
The value of the "class" attribute is the target for configuration.
New
Equivalent to the "new" in java.
Instantiates an object.
Set
Sets an object property. One argument
Used in conjunction with #Configure, #New, #Ref, #Call.
Get
Returns the object's property.
The object I'm referring to the wrapper tag.
E.g #Configure, #Ref, #New ... examples below
Call
Calls an object method.
The method could be an instance method or a static method.
Arg
An argument of a method or a constructor.
Used in conjunction with #New and #Call.
SystemProperty
Gets the value of a system property.
Array
An object array.
Item
An element of an array.
Used only in conjuction with #Array