1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
diff -ru sisu-inject-bootstrap.orig/org.eclipse.sisu.inject/src/org/eclipse/sisu/bean/BeanScheduler.java sisu-inject-bootstrap/org.eclipse.sisu.inject/src/org/eclipse/sisu/bean/BeanScheduler.java
--- sisu-inject-bootstrap.orig/org.eclipse.sisu.inject/src/org/eclipse/sisu/bean/BeanScheduler.java 2014-07-22 20:36:53.223380900 -0400
+++ sisu-inject-bootstrap/org.eclipse.sisu.inject/src/org/eclipse/sisu/bean/BeanScheduler.java 2014-07-24 12:34:51.562456309 -0400
@@ -29,23 +29,7 @@
static
{
- Object activator;
- try
- {
- // extra check in case we have both old and new versions of guice overlapping on the runtime classpath
- Binder.class.getMethod( "bindListener", Matcher.class, com.google.inject.spi.ProvisionListener[].class );
-
- activator = new Activator();
- }
- catch ( final Exception e )
- {
- activator = null;
- }
- catch ( final LinkageError e )
- {
- activator = null;
- }
- ACTIVATOR = activator;
+ ACTIVATOR = null;
}
// ----------------------------------------------------------------------
@@ -60,10 +44,6 @@
{
public void configure( final Binder binder )
{
- if ( null != ACTIVATOR )
- {
- binder.bindListener( Matchers.any(), (com.google.inject.spi.ProvisionListener) ACTIVATOR );
- }
}
};
@@ -84,21 +64,6 @@
*/
public final void schedule( final Object bean )
{
- if ( null != ACTIVATOR )
- {
- final Object[] holder = getPendingHolder();
- final Object pending = holder[0];
- if ( pending == PLACEHOLDER )
- {
- holder[0] = new Pending( bean );
- return; // will be activated later
- }
- else if ( pending instanceof Pending )
- {
- ( (Pending) pending ).add( bean );
- return; // will be activated later
- }
- }
activate( bean ); // no ProvisionListener, so activate immediately
}
@@ -157,34 +122,4 @@
}
}
}
-
- /**
- * Listens to provisioning events in order to determine safe activation points.
- */
- static final class Activator
- implements com.google.inject.spi.ProvisionListener
- {
- public <T> void onProvision( final ProvisionInvocation<T> pi )
- {
- final Object[] holder = getPendingHolder();
- if ( null == holder[0] )
- {
- final Object pending;
- holder[0] = PLACEHOLDER;
- try
- {
- pi.provision(); // may involve nested calls/cycles
- }
- finally
- {
- pending = holder[0];
- holder[0] = null;
- }
- if ( pending instanceof Pending )
- {
- ( (Pending) pending ).activate();
- }
- }
- }
- }
}
|