I found a problem, the following is my attempt to example what I came across, this problem occured because _instance is set after the constructor e.t.c. of the bean has executed.
(this code probably wont compile as i am typeing it from my head)..
@EBean(scope="singleton")
class DatabaseHelper
{
}
@EBean(scope="singleton")
class Worker1
{
@Bean
DatabaseHelper database;
}
@EBean(scope="singleton")
class Worker2
{
@Bean
DatabaseHelper database;
@Bean
Worker1 worker1;
}
@Bean(activity/fragment/whatever)
class someotherclass
{
@Bean
Worker2 worker2;
}
In this case, worker2 creates a database helper and worker1
worker1 will also create a new databasehelper..
If _instance was set in the constructor to "this", then we would only get one instance of databasehelper.
I had a go at making the changes myself, but after making the change, i couldnt compile the source through some error unleated to where i had made changes.
I found a problem, the following is my attempt to example what I came across, this problem occured because _instance is set after the constructor e.t.c. of the bean has executed.
(this code probably wont compile as i am typeing it from my head)..
In this case, worker2 creates a database helper and worker1
worker1 will also create a new databasehelper..
If _instance was set in the constructor to "this", then we would only get one instance of databasehelper.
I had a go at making the changes myself, but after making the change, i couldnt compile the source through some error unleated to where i had made changes.