Sub-Profiles ProfileService changes
emuckenhuber Jan 13, 2009 8:34 AMI've committed a initial prototype on sub-profiles in AS trunk, based on different comments i could gather on this topic.
The most important changes are to the ProfileService and Profile spi itself. Where ProfileService got a register and activate method for a profile and the Profile got a list of DependencyItems:
public interface ProfileService { // .... public void registerProfile(Profile profile) public void activateProfile(ProfileKey key) public void releaseProfile(ProfileKey key) public void unregisterProfile(Profile profile) } public interface Profile { // .... Collection<DependencyItem> getDependencies(); }
The full interfaces can be found here:
http://anonsvn.jboss.org/repos/jbossas/projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/ProfileService.java
http://anonsvn.jboss.org/repos/jbossas/projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/Profile.java
One other major change was that i dropped the DeploymentPhase from the profileservice.spi.* interfaces.
I think this is not needed anymore, as the relationships and order when profiles are getting installed should be based on the dependency information of the profile.
Based on that i've created a simple profile factory which does basically the same as the current profile service,
just that there are now 3 active profiles (bootstrap, deployers, $serverName).
The profileService itself uses a scoped mc controller to install/uninstall the profiles in the correct order,
this is also not really finished, but seems to work for now ;)
http://anonsvn.jboss.org/repos/jbossas/trunk/system/src/main/org/jboss/system/server/profileservice/repository/StaticProfileFactory.java
and the beans.xml: http://anonsvn.jboss.org/repos/jbossas/trunk/server/src/etc/conf/default/bootstrap/profile-service.xml
Furthermore i did a simple prototype for xml configuration, based on Adrian's examples in a different thread.
So this could for example look like the files in the 2 folders here:
http://anonsvn.jboss.org/repos/jbossas/trunk/system/src/resources/parsing-tests/
and a simple factory: http://anonsvn.jboss.org/repos/jbossas/trunk/system/src/main/org/jboss/system/server/profileservice/repository/XmlProfileFactory.java
So basically a sub-profile is just a dependency on a different profile. But the main question for me is - from where should e.g. ejb-runtime know that it depends on ejb-deployers?
At the moment i just add some dependencies based on the ordering in the xml, which is not really sophisticated :)
There should only be one single test case failure in the profileservice tests, this is because of a changed behavior of the ManagementView,
but i would like to discuss ManagementView and DeploymentManager in a different thread later on.
Not sure if the clustering tests are using the HASingleton, because i also had to remove the DeploymentPhase there, but it could maybe work - haven't tried that yet.
I don't consider the spi as done and there are still some things to do, but i think this is at least a good start for further discussions on that.
So any ideas / comments / criticism? :)