+
+ protected void parseActivationSpec(XMLStreamReader reader,
JMSBindingDefinition jmsBinding) {
+ String name = reader.getAttributeValue(null, "name");
+ if (name != null && name.length() > 0) {
+ jmsBinding.setActivationSpecName(name);
+ } else {
+ throw new RuntimeException("missing ActivationSpec
name");
+ }
+ }
+
I noticed we are throwing RuntimeException in some of the loaders.
I'm not sure if this is for expediency, but we should be throwing
"strongly typed" subclasses of LoaderException. This will allow the
loading infrastructure to catch the exception and take appropriate
action, for example, adding context information with the line and
column number and re-thrown. We have exception formatters in place
which will format the context information when a monitor event is
fired in response to the exception (e.g. in SCATestCase)
An example of this is in CompositeLoader:
throw new InvalidWireException("Source not found", sourceName.toString
());
InvalidWireException is a subclass of LoaderException. When it is
thrown, the hierarchy of composite names will be added as well as the
line and column number of the <wire> entry. Specifying the source
name as the identifier will make I18N easier.
Other parts of the runtime behave in the same way, e.g. the builders,
so this pattern can be followed throughout the extensions.
Jim
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]