vipx / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
0 stars 0 forks source link

Add protected method in PrivateModule for binding provision listeners #748

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
As we already expose a protected method for binding a type listener.

See https://github.com/sonatype/sisu-guice/pull/3 for the patch contributed by 
https://github.com/picpoc

Original issue reported on code.google.com by mccu...@gmail.com on 12 May 2013 at 7:47

GoogleCodeExporter commented 9 years ago
From f63208ee46bbb9e569cb404b7abbb1d78c7101d6 Mon Sep 17 00:00:00 2001
From: "..." <ghislain.touratier@gmail.com>
Date: Fri, 10 May 2013 03:08:58 +0200
Subject: [PATCH] Added ProvisionListener in PrivateModule

---
 core/src/com/google/inject/PrivateModule.java | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/core/src/com/google/inject/PrivateModule.java 
b/core/src/com/google/inject/PrivateModule.java
index fcc7933..cf93f1c 100644
--- a/core/src/com/google/inject/PrivateModule.java
+++ b/core/src/com/google/inject/PrivateModule.java
@@ -24,6 +24,7 @@
 import com.google.inject.binder.LinkedBindingBuilder;
 import com.google.inject.matcher.Matcher;
 import com.google.inject.spi.Message;
+import com.google.inject.spi.ProvisionListener;
 import com.google.inject.spi.TypeConverter;
 import com.google.inject.spi.TypeListener;

@@ -293,4 +294,12 @@ protected void bindListener(Matcher<? super 
TypeLiteral<?>> typeMatcher,
       TypeListener listener) {
     binder().bindListener(typeMatcher, listener);
   }
+  
+  /**
+   * @see Binder#bindListener(Matcher, ProvisionListener...)
+   */
+  protected void bindListener(Matcher<? super Binding<?>> bindingMatcher,
+      ProvisionListener... listeners) {
+    binder().bindListener(bindingMatcher, listeners);
+  }
 }
-- 
1.8.1.6

Original comment by mccu...@gmail.com on 12 May 2013 at 7:52

GoogleCodeExporter commented 9 years ago

Original comment by sberlin on 6 Dec 2013 at 10:52