-
1. Re: Field injection tests
starksm64 Mar 20, 2008 1:34 PM (in response to alesj)Field/method injection of beans from a custom BeanFactory using a bounded pool with both successful injection, and failure due to no pooled instances available.
-
2. Re: Field injection tests
alesj Mar 20, 2008 2:07 PM (in response to alesj)"scott.stark@jboss.org" wrote:
Field/method injection of beans from a custom BeanFactory using a bounded pool with both successful injection, and failure due to no pooled instances available.
Can you write this down in API or xml? -
3. Re: Field injection tests
alesj Mar 20, 2008 2:45 PM (in response to alesj)"alesj" wrote:
"scott.stark@jboss.org" wrote:
Field/method injection of beans from a custom BeanFactory using a bounded pool with both successful injection, and failure due to no pooled instances available.
Can you write this down in API or xml?
Or any kind of pseudo code, so that I get a better feel for what you're looking for. -
4. Re: Field injection tests
starksm64 Mar 20, 2008 5:09 PM (in response to alesj)Its the xml I showed in this beanfactory extensions thread:
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=132158
I checked in a test org.jboss.test.kernel.deployment.support.container.TestPooledBeanFactory with a simple bounded queue pool that is prefilled on first use.
The disconnect between the xml and any current psuedo code is that there is a one to one association between the bean metadata/xml and the instances upon which injection happens.
To exercise the pool exhaustion scenario, you have to create multiple instances of Bean2Type, injecting multiple instances of Bean1Type. This behavior is not part of the current mc core. The test needs to wire things up at the metadata level and then call the org.jboss.test.kernel.deployment.support.container.BeanContainer.getBean() multiple times to create the Bean2Type instances which should have new Bean1Type instances injected. -
5. Re: Field injection tests
adrian.brock Mar 20, 2008 5:22 PM (in response to alesj)I don't know what you are trying to do?
The pool is not supposed to be part of the MC.
As both Carlo and I said on the ejb3 list, all that is required is that the
BeanFactory gets injected into the pool which ejb3 will implement.
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=131424&postdays=0&postorder=asc&start=10
in many different ways. -
6. Re: Field injection tests
starksm64 Mar 20, 2008 5:29 PM (in response to alesj)Yes, I saw that. I'm just combining the pool with a custom bean factory to setup test usages to validate where the separation between the containers and the mc dependency layer is going to be.
I'll separate the pool in the support classes to mirror that usage as a starting point. -
7. Re: Field injection tests
starksm64 Mar 20, 2008 5:42 PM (in response to alesj)See the updated org.jboss.test.kernel.deployment.support.container.* classes with BeanContainer, BeanPool, etc. I'll work on an example testcase around these as I have to get some things straight anyway.
-
8. Re: Field injection tests
adrian.brock Mar 20, 2008 5:51 PM (in response to alesj)Scott, can you leave this until after I do the Beta11 release tomorrow?
-
9. Re: Field injection tests
alesj Mar 20, 2008 5:54 PM (in response to alesj)"scott.stark@jboss.org" wrote:
See the updated org.jboss.test.kernel.deployment.support.container.* classes with BeanContainer, BeanPool, etc.
This BeanPool class looks pretty broken:public synchronized T createBean() throws Throwable { if(pool.size() == 0) { // Fill the pool for(int n = 0; n < pool.size(); n ++) { T bean = (T) factory.createBean(); pool.put(bean); } } return pool.take(); }
The pool field is never instantiated - unless you're gonna do field injection.
And you have an if on size == 0, and then you iterate till size - which is 0.
OK, I know it's a test class. :-) -
10. Re: Field injection tests
starksm64 Mar 20, 2008 5:58 PM (in response to alesj)"adrian@jboss.org" wrote:
Scott, can you leave this until after I do the Beta11 release tomorrow?
Sure. -
11. Re: Field injection tests
starksm64 Mar 20, 2008 6:00 PM (in response to alesj)Its just a sketch of what I want to wire up at this point. It will be in shape by tomorrow. I'll just email it to you when I done for the night.
-
12. Re: Field injection tests
alesj Mar 20, 2008 6:07 PM (in response to alesj)"scott.stark@jboss.org" wrote:
I'll just email it to you when I done for the night.
Or you can just commit it, since it will no longer be 'Adrian's tomorrow' when you turn in for the night. :-)