You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Jim Marino <jm...@myromatours.com> on 2007/01/05 12:32:22 UTC
Fwd: svn commit: r492958
> +
> + 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: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: svn commit: r492958
Posted by Jim Marino <jm...@myromatours.com>.
On Jan 5, 2007, at 3:35 AM, ant elder wrote:
> I understand that Jim, I'm still actively working on this code.
>
O.K. sure np. I wasn't sure if people new about the formatters.
Jim
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: svn commit: r492958
Posted by ant elder <an...@gmail.com>.
I understand that Jim, I'm still actively working on this code.
...ant
On 1/5/07, Jim Marino <jm...@myromatours.com> wrote:
>
>
>
> > +
> > + 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: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>