Revision: 1404
Author: sberlin
Date: Sat Nov 20 19:49:33 2010
Log: Edited wiki page ExtensionSPI through web user interface.
http://code.google.com/p/google-guice/source/detail?r=1404

Modified:
 /wiki/ExtensionSPI.wiki

=======================================
--- /wiki/ExtensionSPI.wiki     Sat Nov 20 19:48:18 2010
+++ /wiki/ExtensionSPI.wiki     Sat Nov 20 19:49:33 2010
@@ -5,7 +5,7 @@

 _New in Guice 3.0_

-In Guice 2.0 we expanded our SPI to expose rich details about modules and injectors. The elements API can inspect, extend and even rewrite Guice configuration. It's an essential tool used by GIN, Modules.override(), Grapher, Guiceberry's controllable injection, and others. In Guice 3.0 we expanded the SPI to include extensions! Extensions such as Multibinder, Assisted Inject, Servlets and others can expose their details through programmatic inspection. +In Guice 2.0 we expanded our SPI to [InspectingModules expose rich details about modules and injectors]. The elements API can inspect, extend and even rewrite Guice configuration. It's an essential tool used by GIN, Modules.override(), Grapher, Guiceberry's controllable injection, and others. In Guice 3.0 we expanded the SPI to include extensions! Extensions such as Multibinder, Assisted Inject, Servlets and others can expose their details through programmatic inspection.

 ==How Extensions Participate==
An extension author needs to do two things. First it must create a subinterface of `BindingTargetVisitor` that is specific to its extension. For example, the servlet extension has `ServletModuleTargetVisitor`, and the Multibinder extension has `MultibindingsTargetVisitor`. The extension must also bind the extension's provider instance to a `ProviderWithExtensionVisitor`. The implementation of acceptExtensionVisitor must do an instanceof check on the `BindingTargetVisitor` and call the appropriate visit method. If the visitor is an instance of the extension's visitor, it must visit the appropriate extension method, otherwise it must visit the normal `ProviderInstanceBinding`.

--
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.

Reply via email to