[JBoss Microcontainer Development] - Re: Supporting qualifiers in MC
by kabir.khan@jboss.com
"kabir.khan(a)jboss.com" wrote : Following our Skype chat I have had a quick look at Supply/Demand and how to support qualifiers. We could do something like:
|
| *As you mentioned add a enum type to Supply/DemandMetaData so we can see which supplies/demands are qualifiers.
|
| *SearchClassContextDependencyItem is used when injecting BY_CLASS. This could be expanded to take qualifiers into account when searching for the bean to inject. Maybe rather than expanding SearchClassContextDependencyItem.resolve() and AbstractInjectionValueMetaData.getValue(), we should add another method to AbstractKernelController to take qualifiers into account?
| -Initially the Demands/qualifiers will be for the whole bean (coarse-grained), but should somehow (I've not looked how yet) be expanded so we can qualify a particular injection point (fine-grained).
| -For the coarse-grained model, what do we do if the following bean has the demand qualifier @Test
|
| | class Bean
| | {
| | @Inject Something field;
| | }
| |
| And there is a bean in the controller of type Something, but it does not supply @Test? I think coarse-grained needs to work slightly differently from fine-grained. Fine-grained needs a bean with all the qualifiers specified at the injection point. Coarse-grained needs a bean with as many as possible of the qualifiers specified at bean level.
|
| When looking into this, I noticed that AbstractInjectionValueMetaData takes the LookupStrategy into account when searching for the context, while the SearchClassContextDependencyItem does not appear to do so.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266113#4266113
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266113
16 years, 4 months
[JBoss Microcontainer Development] - Supporting qualifiers in MC
by kabir.khan@jboss.com
Following our Skype chat I have had a quick look at Supply/Demand and how to support qualifiers. We could do something like:
*As you mentioned add a enum type to Supply/DemandMetaData so we can see which types are qualifiers.
*SearchClassContextDependencyItem is used when injecting BY_CLASS. This could be expanded to take qualifiers into account when searching for the bean to inject. Maybe rather than expanding SearchClassContextDependencyItem.resolve() and AbstractInjectionValueMetaData.getValue(), we should add another method to AbstractKernelController to take qualifiers into account?
-Initially the Demands/qualifiers will be for the whole bean (coarse-grained), but should somehow (I've not looked how yet) be expanded so we can qualify a particular injection point (fine-grained).
-For the coarse-grained model, what do we do if the following bean has the demand qualifier @Test
| class Bean
| {
| @Inject Something field;
| }
|
And there is a bean in the controller of type Something, but it does not supply @Test? I think coarse-grained needs to work slightly differently from fine-grained. Fine-grained needs a bean with all the qualifiers specified at the injection point. Coarse-grained needs a bean with as many as possible of the qualifiers specified at bean level.
When looking into this, I noticed that AbstractInjectionValueMetaData takes the LookupStrategy into account when searching for the context, while the SearchClassContextDependencyItem does not appear to do so.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266112#4266112
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266112
16 years, 4 months
[JBoss OSGi Development] - Re: Service integration with MC
by alesj
"adrian(a)jboss.org" wrote :
| In MC terms that is getTarget() for get. But we don't currently invoke an ungetTarget() at "uninjection" so that needs doing.
This is tricker than it looks like, as we don't have just plain configuration injection.
Ctor and properties injection have natural undeploy / uninjection.
I could also somehow squeeze in create, start and installs.
But what to do with stop, destroy and uninstalls?
| try {
| uninstallMethod.invoke(target, VMD::get)
| } finally {
| VDM::unget
| }
|
whereas service could still hold onto the ref - which might be an issue if that ref is ServiceFactory,
as ServiceFactory::unget could modify the actual created service.
Leave it to the expense of the user? :-)
Should we also do unget on the callbacks, or a callback doesn't really have proper usage
if it's not "backed-up" by uncallback (which will actually take care of unget)?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266096#4266096
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266096
16 years, 4 months
[JBoss AS Development] - JBoss and the "em dash" character
by Thez
Hope this is the correct forum to post this.
I've a JSP that I use to print out contents of txt files. I ran into trouble with some files which when opened cause JBoss to truncate the output of the JSP page, even though the page is executed to the end. I debugged this and found the following.
The files are saved as UTF8, and contain the "em dash" character, U+2014 (8212) unicode, or & mdash; in html (without the space, it seems these forums can't handle the character either). The UTF8 byte sequence is "E2 80 94".
Now, when I read the file contents with BufferedReader (InputStreamReader opened with UTF8), line by line, and print the lines out, the output is truncated to the first line containing the character, and nothing after that is printed.
Is this a bug or a 'feature' ? Seems very strange behavior.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266081#4266081
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266081
16 years, 4 months