We're updating the issue view to help you get more done. 

Create ConfigurationFactory and merge notions of Configuration and ContainerConfiguration

Description

Extact from emails sent by Vincent to Cargo dev mailing list:

"
This leads me to believe that we need to have a Container.getConfigurationFactory() which will return a XXXConfiguration instance where XXX is the container's name. Users will also be able to write (same as for WAR):

Configuration config = new Tomcat5xConfiguration(...);

In addition, this allows us to offers one new API (I was initially not too happy about it but I think it's good now): the Configuration.configure() API. So users, who are interested in setting up a configuration directory will be able to do so. We would simply need to add a Configuration.isConfigured() additional API that we would check during container startup to ensure the config is there (and if not, call configure()).

So for end users, this would mean transforming:

Configuration configuration = new StandaloneConfiguration("someid");
container.setConfiguration(configuration);

into:

Configuration configuration = container.getConfigurationFactory()
.createStandaloneConfiguration("someid");
container.setConfiguration(configuration);

or

container.setConfiguration(new Tomcat5xStandaloneConfiguration("someid"));

Users would also be able to write:

Configuration configuration = container.getConfigurationFactory()
.createStandaloneConfiguration("someid");
configuration.configure();

[do some stuff here with the installed configuration. What, I don't know]

container.setConfiguration(configuration);
container.start();

ahah.....

This raises another interesting question: The configuration.configure() above would not install any deployable if they are added after in the container...

So 2 questions:

1/ Is it a good idea to expose the configure() method?

2/ Maybe the container.addDeployable() should actually be linked to the Configuration instead? For static deployments at least, what about hot deployments?
"

Status

Assignee

Vincent Massol

Reporter

Vincent Massol

Fix versions

Affects versions

0.3

Priority

Major