Jevgeni Kabanov wrote on 09/10/11 11:54 AM:
> I meant exactly that the Java EE app uses the API to configure its
> environment in the container. Just as an idea, why not add a "Configurer"
> that runs before the app is deployed and sets up the environment (including
> both the standard parts of environment and the container-specific parts)
> against a standardized Java API with optional container-specific extensions.
> Most containers already have some internal API representation anyway, so this
> would not be too hard complicated to implement.
I think it would be a huge challenge to get agreement among all the app
server vendors on how to do this. There are so many issues, it's hard
to know where to start...
Do you want the Configurer to be able to select the JVM parameters? Sorry,
I'm not going to restart the server just for this app.
What happens if the deployment fails after the Configurer has run? Do you
undo whatever it did? How? What are the limits on what it can do?
If the app is being deployed to a cluster, where does the Configurer run?
On the admin server? On some instance of the cluster? On every instance
of the cluster? What if the cluster is not created until the application
is deployed?
What permissions do I need to have to run the Configurer? Can I change
anything in the app server for any other application? Am I somehow
constrained to only change things for my not-yet-deployed application?
Some of the later messages in this thread suggested that the application
would, for example, configure the server name and port number of the
DataSource that would be used by the application. Doesn't that just
amount to using the Java SE style of accessing these resources? Why
do you need to configure the server, just so you can ask the server what
you configured? Why don't you just access the resource directly?
Or, ask the server first, in case anyone wants to override your choice,
and if nothing is set access the resource directly?
Do we just need a "create DataSource" API that allows you to dynamically
create a DataSource and specify all the information you would specify in
an annotation?
As for the "development stage" proposals, I think there's a good idea there
that we should explore further. Perhaps some ability to specify which
resources (or resource configurations) should be used based on the "stage",
and some way for the stage to be selected at deployment time.