I'd like to understand this better before I look into the code see if it's
possible (and how much work it is) to provide these two APIs.
I will use the ejb references as example. Currently we rely on the runtime
xml files to do the jndi mapping, and what we want to achieve here is to do this
mapping through gui.
Say I have an ejb with ejb name "FooBean" and it has a physical jndi name
called "ejb/FooBean". And a web component is referencing this ejb using the ref
name "foo". So in today's implementation:
1. In the sun-ejb-jar.xml we need to have something like this which maps this
ejb name to the jndi name:
2. And in the sun-web.xml, we need to map the ejb ref name "foo" to the same
jndi name "ejb/FooBean".
So in your proposal below, we no longer need the information in sun-web.xml.
The first deployment API will return the ejb reference, with the ref name "foo"
and type "ejb-ref". And the gui will provide the "ejb/FooBean" for the user to
select. Once user selects the "ejb/FooBean", the gui will return the mapping
"foo->ejb/FooBean" through the second deployment API. Then deployment code add
this information to the runtime.
Is this understanding correct? If so, I have some questions/comments
a. How does the gui gets all the physical jndi names (or what you called
server references), which in this case "ejb/FooBean"? Before the deployment
happens, there is no name binding happen yet. So you will also need to get this
from deployment code?
b. This mapping funtionality that gui is providing is just letting user
select from the existing jndi names, not to enter new ones, right? If that's the
case, the original archive still needs to include some of the mapping, in this
case, the information in the sun-ejb-jar.xml.
I remember deploytool has some functionality like this, but that happens at
the packaging time. Doing it at deployment time is much harder, it means round
trips between deployment code and gui code, and also change of the timing of
doing things. We will need to parse the deployment descriptors prior to actual
deployment in order to provide such information to gui. And then need to save
the information passed back from gui for deployment descriptor post processing.