> From: Stephen McConnell [mailto:[EMAIL PROTECTED]
>
> Leo Sutic wrote:
>
> >
> >
> >>From: Berin Loritsch [mailto:[EMAIL PROTECTED]
> >>
> >>In this case, Phoenix would be able to recognize the
> >>components as requiring functionality it can't deliver, and
> >>then refuse to deploy it. This addresses both Stephen's and
> >>my concerns.
> >>
> >>
> >
> >Wait wait wait wait wait...
> >
> >If a tag has to be explicitely recognized by all containers,
> i.e. the
> >container must do this:
> >
> > if (tag.equals ("lifecycle")) {
> > fail ("I don't support that tag.");
> > }
> >
> >instead of just defaulting:
> >
> > if (!supportedTags.contains (tag)) {
> > fail ("I don't support that tag.");
> > }
> >
> >Then it should be in the avalon namespace.
> >
>
> Exactly.
But is it so?
I think this is even more of a problem than what the thread was about.
As it is now, each container has its own javadoc-tags to XML-descriptor
tool.
This is wrong, because each tool only looks at the tags of interest
to itself, so of course if a class has a tag that the generator
has never heard about it simply *cannot* warn or halt. For example,
if the tag @ejbType is encountered, what should the task do, unless
it has explicitely been told what to do?
Fail? Why? ejbType has *no* effect on avalon components.
Warn? Why? It has no effect?
Remain silent? How does it know that ejbType doesn't have any effect?
The point is that we at generation time *have no clue* about what
tags are important and which aren't.
Even if the stage and extension tags were in the avalon namespace, if
the xml-descriptor generation task doesn't recognize them, it doesn't
matter if the container recognizes them.
The only solution I see is this:
1. Have a xdoclet task that converts javadoc tags to XML. All tags.
2. Save this xml descriptor next to the class file in the jar. For
example, org/leo/MyComponent.class and org/leo/MyComponent.xml
3. Provide an API to access the XML descriptor. For example:
Attributes getAttributes (Method m);
Attributes getAttributes (Class c);
Attributes getAttributes (Field f);
Attributes attrs = getAttributes (componentClass);
StageDescriptor sd = (StageDescriptor) attrs.getAttribute
("avalon.stage");
...
// Check that all tags in the avalon namespace for this class
// is supported
Iterator iter = attrs.getKeys ("avalon").iterator ();
while (iter.hasNext ()) assert (supportedTags.contains
(iter.next ()));
// Check that all tags in the x-avalon namespace for this class
// is supported
Iterator iter = attrs.getKeys ("x-avalon").iterator ();
while (iter.hasNext ()) assert (supportedXTags.contains
(iter.next ()));
This enables me to run *one* task to get the javadoc tags and their
information. Then the container gets to extract whatever tags it
cares about.
/LS
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]