[JBoss AS Development] - Re: Graceful Shutdown
by emuckenhuber
Hmm graceful shutdown should not be part of the MC bean lifecycle, as it would then always shutdown in a graceful manner. This should be an optional way to shutdown AS - triggered with a different signal or management action.
Additionally with the graceful shutdown there will most likely be a timeout which then is going just stop AS. This does not seem to fit very well with MC lifecycle actions, since we would basically need to interrupt a action during a state transition (pre_stop -> stop).
I see the problem with the order of calling the graceful shutdown and agree that we should try to leverage existing dependencies. Thinking about that i'm not really sure if using bean dependencies would make sense though.
Using MC bean dependencies would mean that the jboss.web somehow needs to have a dependency on EJB3, which does not really make sense - since the bean itself does not need this dependency.
Maybe one thing which might be worth looking at is if we can use Profile dependencies for that. Since we are going to have something like optional dependencies as well, to better control the boot sequence. At least at the point where a profile would describe something like a service/container - this set of dependencies could make more sense.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4267282#4267282
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4267282
14 years, 5 months
[JBoss Microcontainer Development] - Re: Supporting qualifiers in MC
by kabir.khan@jboss.com
Following Ales's suggestions what I now have is:
Qualifier metadata is implemented as RelatedClassMetaData, where the qualifier objects are stored in RCMD.getEnabled(). To pick out the RCMDs that specify qualifiers I use 'RCMB#SUPPLIED_QUALIFIER' as the classname, and 'RCMB#WANTED_QUALIFIER' as the classname for wanted qualifiers specified at bean level.
Following the population of the metadata and beaninfo in PreInstallAction (and in InstallAction if beaninfo was null) I populate the MDR with sets of qualifiers from the metadata. These are stored in the INSTANCE level metadata under 'RCMB#SUPPLIED_QUALIFIER' and 'RCMB#WANTED_QUALIFIER' respectively.
The search algorithm works much the same as before. ClassAndQualifierKey queries for all the beans implementing a class, and then narrows it down depending on the wanted qualifiers and the required qualifiers.
Before I commit, I want to add some xml configuration of qualifiers. I propose
| <bean name="bean1" class="SomeBean">
| <qualifier>a</qualifier>
| </bean>
| <bean name="bean2"class="SomeBean">
| <qualifier>a</qualifier>
| </qualifier>b</qualifier>
| </bean>
| <bean name="bean3" class="OtherBean">
| <qualifier type="default">a</qualifier>
| </bean>
|
Meaning that the bean1 supplies qualifier 'a', bean2 supplies qualifiers 'a', 'b' and bean3 uses 'a' by default when looking for other beans to inject into it. So when injecting SomeBean instances into bean3, bean1 will be chosen.
Next, I want to look at somehow supporting fine-grained qualifiers injection. If we have two instances of
| class Bean{}
|
where instance 1 supplies qualifier 'A' and instance 2 supplies qualifier 'B' and we have
| class Target
| {
| Bean a;
|
| Bean b;
|
| @Constructor
| Target(@Inject Bean a)
| {
| this.a = a;
| }
|
| @Inject
| void setB()
| {
| this.b = b;
| }
| }
|
It should be possible to specify qualifiers for injected parameters and properties, so that in this example we can say the constructor wants the Bean with qualifier 'A' while the setter wants the Bean with the qualifier 'B'. I'll see if I can use/expand AbstractInjectionValueMetaData to use qualifiers.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4267275#4267275
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4267275
14 years, 5 months
[JBoss OSGi Development] - Re: Incompatible framework dependencies
by thomas.diesler@jboss.com
After a long discussion with Ales, we decided to cut the Beta5 release from a framework branch that uses compatible dependencies
The location of that branch is as you might guess
https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/...
This effectively renders the reactor/framework stale with respect to the overall jbosgi/trunk build.
Perhaps, at this point I should explain again what a "reactor project" is ...
It is the home of fast moving jbosgi projects that want to participate in the overall jbosgi build and be part of the framework and container independent test matrix. Reactor projects are part of the installer and are QAed by the Hudson environment on different frameworks and target containers.
Reactor projects cannot introduce dependencies that are not available in the supported target containers. Eventually, every reactor project will start its own lifecycle in jboss-osgi/projects when it becomes stable enough. Every project you see in jboss-osgi/projects (there are currently a little under 20 of them) has once started in the reactor and was an integral part of the jbosgi build.
It seems that framework has crossed that bridge of introducing incompatible dependencies and needs to have a trunk version which is independent of the overall jbosgi build. A framework/trunk version also seems to be needed to make fast progress.
The situation now is that framework still uses the reactor svn location, but is not part of the reactor build.
As a consequence, I suggest to move framework to its natural location again (i.e. projects/runtime/framework/trunk) since its life as reactor project has ended.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4267255#4267255
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4267255
14 years, 5 months