Author: limpbizkit
Date: Thu Oct 23 00:59:09 2008
New Revision: 648
Modified:
trunk/extensions/privatemodules/src/com/google/inject/privatemodules/PrivateModule.java
Log:
More docs for PrivateModules...
Modified:
trunk/extensions/privatemodules/src/com/google/inject/privatemodules/PrivateModule.java
==============================================================================
---
trunk/extensions/privatemodules/src/com/google/inject/privatemodules/PrivateModule.java
(original)
+++
trunk/extensions/privatemodules/src/com/google/inject/privatemodules/PrivateModule.java
Thu Oct 23 00:59:09 2008
@@ -81,9 +81,24 @@
* }
* </pre>
*
- * <p>Private modules are implemented with [EMAIL PROTECTED]
Injector#createChildInjector(Module[]) parent
- * injectors}. Types that inject an [EMAIL PROTECTED] Injector} will be
provided with
the child injector. This
- * injector includes private bindings that are not available from the
parent injector.
+ * <p>Private modules inherit type converters, scopes, and interceptors
from their containing
+ * modules. They can be nested within standard modules and within other
private modules using
+ * [EMAIL PROTECTED] Binder#install install()}.
+ *
+ * <p>Private modules are implemented on top of [EMAIL PROTECTED]
Injector#createChildInjector(Module[]) parent
+ * injectors}. Just-in-time bindings may be created in the parent
injector, sharing them with all
+ * other modules. When bindings are shared:
+ * <ul>
+ * <li>Scoped instances are shared across modules. For example, if
[EMAIL PROTECTED] FooImpl} is a shared
+ * singleton, the other modules get the same instance.</li>
+ * <li>Bindings that inject the [EMAIL PROTECTED] Injector} get the parent
injector. It will not be able
+ * to [EMAIL PROTECTED] Injector#getInstance(Key) get injections} bound
in the
private module.</li>
+ * </ul>
+ * Just-in-time bindings will not be shared if they have dependencies in
the private module. To
+ * prevent it from being shared, write an explicit binding:
+ * <pre>
+ * bind(FooImpl.class);
+ * </pre>
*
* @author [EMAIL PROTECTED] (Jesse Wilson)
*/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"google-guice-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-guice-dev?hl=en
-~----------~----~----~----~------~----~------~--~---