| <!DOCTYPE html> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <html> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| |
| <meta name="description" content="Javadoc API documentation for org.eclipse.sisu.inject." /> |
| |
| <!-- <link rel="shortcut icon" type="image/x-icon" href="../../../../favicon.ico" /> --> |
| <title> |
| |
| org.eclipse.sisu.space |
| |
| |
| | org.eclipse.sisu.inject |
| |
| </title> |
| <link href="../../../../../assets/doclava-developer-docs.css" rel="stylesheet" type="text/css" /> |
| <link href="../../../../../assets/customizations.css" rel="stylesheet" type="text/css" /> |
| <script src="../../../../../assets/search_autocomplete.js" type="text/javascript"></script> |
| <script src="../../../../../assets/jquery-resizable.min.js" type="text/javascript"></script> |
| <script src="../../../../../assets/doclava-developer-docs.js" type="text/javascript"></script> |
| <script src="../../../../../assets/prettify.js" type="text/javascript"></script> |
| <script type="text/javascript"> |
| setToRoot("../../../../", "../../../../../assets/"); |
| </script> |
| <script src="../../../../../assets/doclava-developer-reference.js" type="text/javascript"></script> |
| <script src="../../../../../assets/navtree_data.js" type="text/javascript"></script> |
| <script src="../../../../../assets/customizations.js" type="text/javascript"></script> |
| <noscript> |
| <style type="text/css"> |
| html,body{overflow:auto;} |
| #body-content{position:relative; top:0;} |
| #doc-content{overflow:visible;border-left:3px solid #666;} |
| #side-nav{padding:0;} |
| #side-nav .toggle-list ul {display:block;} |
| #resize-packages-nav{border-bottom:3px solid #666;} |
| </style> |
| </noscript> |
| </head> |
| |
| <body class=""> |
| |
| <div id="header"> |
| <div id="headerLeft"> |
| |
| <span id="masthead-title">org.eclipse.sisu.inject</span> |
| |
| </div> |
| <div id="headerRight"> |
| |
| <div id="search" > |
| <div id="searchForm"> |
| <form accept-charset="utf-8" class="gsc-search-box" |
| onsubmit="return submit_search()"> |
| <table class="gsc-search-box" cellpadding="0" cellspacing="0"><tbody> |
| <tr> |
| <td class="gsc-input"> |
| <input id="search_autocomplete" class="gsc-input" type="text" size="33" autocomplete="off" |
| title="search developer docs" name="q" |
| value="search developer docs" |
| onFocus="search_focus_changed(this, true)" |
| onBlur="search_focus_changed(this, false)" |
| onkeydown="return search_changed(event, true, '../../../../')" |
| onkeyup="return search_changed(event, false, '../../../../')" /> |
| <div id="search_filtered_div" class="no-display"> |
| <table id="search_filtered" cellspacing=0> |
| </table> |
| </div> |
| </td> |
| <td class="gsc-search-button"> |
| <input type="submit" value="Search" title="search" id="search-button" class="gsc-search-button" /> |
| </td> |
| <td class="gsc-clear-button"> |
| <div title="clear results" class="gsc-clear-button"> </div> |
| </td> |
| </tr></tbody> |
| </table> |
| </form> |
| </div><!-- searchForm --> |
| </div><!-- search --> |
| |
| </div> |
| </div><!-- header --> |
| |
| |
| <div class="g-section g-tpl-240" id="body-content"> |
| <div class="g-unit g-first side-nav-resizable" id="side-nav"> |
| <div id="swapper"> |
| <div id="nav-panels"> |
| <div id="resize-packages-nav"> |
| <div id="packages-nav"> |
| <div id="index-links"> |
| <a href="../../../../packages.html" >Package Index</a> | |
| <a href="../../../../classes.html" >Class Index</a> |
| </div> |
| <ul> |
| |
| <li class="api apilevel-"> |
| <a href="../../../../org/eclipse/sisu/package-summary.html">org.eclipse.sisu</a></li> |
| <li class="api apilevel-"> |
| <a href="../../../../org/eclipse/sisu/bean/package-summary.html">org.eclipse.sisu.bean</a></li> |
| <li class="api apilevel-"> |
| <a href="../../../../org/eclipse/sisu/inject/package-summary.html">org.eclipse.sisu.inject</a></li> |
| <li class="api apilevel-"> |
| <a href="../../../../org/eclipse/sisu/launch/package-summary.html">org.eclipse.sisu.launch</a></li> |
| <li class="api apilevel-"> |
| <a href="../../../../org/eclipse/sisu/osgi/package-summary.html">org.eclipse.sisu.osgi</a></li> |
| <li class="selected api apilevel-"> |
| <a href="../../../../org/eclipse/sisu/space/package-summary.html">org.eclipse.sisu.space</a></li> |
| <li class="api apilevel-"> |
| <a href="../../../../org/eclipse/sisu/wire/package-summary.html">org.eclipse.sisu.wire</a></li> |
| <li class="api apilevel-"> |
| <a href="../../../../org/sonatype/inject/package-summary.html">org.sonatype.inject</a></li> |
| </ul><br/> |
| </div> <!-- end packages --> |
| </div> <!-- end resize-packages --> |
| <div id="classes-nav"> |
| <ul> |
| |
| <li><h2>Interfaces</h2> |
| <ul> |
| <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/space/AnnotationVisitor.html">AnnotationVisitor</a></li> |
| <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/space/ClassFinder.html">ClassFinder</a></li> |
| <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/space/ClassSpace.html">ClassSpace</a></li> |
| <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/space/ClassVisitor.html">ClassVisitor</a></li> |
| <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/space/QualifiedTypeListener.html">QualifiedTypeListener</a></li> |
| <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/space/SpaceModule.Strategy.html">SpaceModule.Strategy</a></li> |
| <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/space/SpaceVisitor.html">SpaceVisitor</a></li> |
| </ul> |
| </li> |
| |
| <li><h2>Classes</h2> |
| <ul> |
| <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/space/BundleClassSpace.html">BundleClassSpace</a></li> |
| <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/space/CloningClassSpace.html">CloningClassSpace</a></li> |
| <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/space/DefaultClassFinder.html">DefaultClassFinder</a></li> |
| <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/space/IndexedClassFinder.html">IndexedClassFinder</a></li> |
| <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/space/LoadedClass.html">LoadedClass</a><T></li> |
| <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/space/QualifiedTypeBinder.html">QualifiedTypeBinder</a></li> |
| <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/space/QualifiedTypeVisitor.html">QualifiedTypeVisitor</a></li> |
| <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/space/SisuIndex.html">SisuIndex</a></li> |
| <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/space/SisuIndexAPT6.html">SisuIndexAPT6</a></li> |
| <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/space/SpaceModule.html">SpaceModule</a></li> |
| <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/space/SpaceScanner.html">SpaceScanner</a></li> |
| <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/space/Streams.html">Streams</a></li> |
| <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/space/URLClassSpace.html">URLClassSpace</a></li> |
| </ul> |
| </li> |
| |
| |
| <li><h2>Enums</h2> |
| <ul> |
| <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/space/BeanScanning.html">BeanScanning</a></li> |
| </ul> |
| </li> |
| |
| |
| </ul><br/> |
| </div><!-- end classes --> |
| </div><!-- end nav-panels --> |
| <div id="nav-tree" style="display:none"> |
| <div id="index-links"> |
| <a href="../../../../packages.html" >Package Index</a> | |
| <a href="../../../../classes.html" >Class Index</a> |
| </div> |
| </div><!-- end nav-tree --> |
| </div><!-- end swapper --> |
| </div> <!-- end side-nav --> |
| <script> |
| if (!isMobile) { |
| <!-- $("<a href='#' id='nav-swap' onclick='swapNav();return false;' style='font-size:10px;line-height:9px;margin-left:1em;text-decoration:none;'><span id='tree-link'>Use Tree Navigation</span><span id='panel-link' style='display:none'>Use Panel Navigation</span></a>").appendTo("#side-nav"); --> |
| chooseDefaultNav(); |
| if ($("#nav-tree").is(':visible')) { |
| init_default_navtree("../../../../"); |
| } else { |
| addLoadEvent(function() { |
| scrollIntoView("packages-nav"); |
| scrollIntoView("classes-nav"); |
| }); |
| } |
| $("#swapper").css({borderBottom:"2px solid #aaa"}); |
| } else { |
| swapNav(); // tree view should be used on mobile |
| } |
| </script> |
| |
| |
| |
| <div class="g-unit" id="doc-content"> |
| |
| <div id="api-info-block"> |
| <div class="api-level"> |
| |
| |
| |
| |
| |
| |
| </div> |
| </div> |
| |
| <div id="jd-header"> |
| package |
| <h1>org.eclipse.sisu.space</h1> |
| </div><!-- end header --> |
| |
| <div id="naMessage"></div> |
| |
| <div id="jd-content" class="api apilevel-"> |
| |
| |
| <div class="jd-descr"> |
| Customizable scanning of bean implementations. |
| <p><p> |
| The <code><a href="../../../../org/eclipse/sisu/space/SpaceModule.html">SpaceModule</a></code> should be given a <code><a href="../../../../org/eclipse/sisu/space/ClassSpace.html">ClassSpace</a></code> representing the classes and resources to scan: |
| |
| <pre> |
| Guice.createInjector( new SpaceModule( new URLClassSpace( classloader ) ) );</pre> |
| |
| Reduce scanning time by using an <code><a href="../../../../org/eclipse/sisu/space/SisuIndex.html">index</a></code> or provide your own <code><a href="../../../../org/eclipse/sisu/space/ClassFinder.html">ClassFinder</a></code> approach: |
| <p><p> |
| <pre> |
| Guice.createInjector( new SpaceModule( new URLClassSpace( classloader ), BeanScanning.INDEX ) );</pre> |
| <hr> |
| The default visitor strategy is to use <code><a href="../../../../org/eclipse/sisu/space/QualifiedTypeVisitor.html">QualifiedTypeVisitor</a></code> with <code><a href="../../../../org/eclipse/sisu/space/QualifiedTypeBinder.html">QualifiedTypeBinder</a></code> to find types annotated with <code>@Named</code> or other <code>@Qualifier</code>s and bind them as follows: |
| |
| <h4>Components</h4> |
| Any qualified components are bound using a special "wildcard" key that the <code><a href="../../../../org/eclipse/sisu/inject/BeanLocator.html">BeanLocator</a></code> uses to check type compatibility at lookup time: |
| <p>(This avoids the need to walk the type hierarchy and register bindings for each and every super-type, turning the injector graph to spaghetti.) |
| <p><p> |
| <pre> |
| @Named("example") public class MyTypeImpl implements MyType { |
| // ... |
| }</pre> |
| If you use an empty <code>@Named</code> or a different <code>@Qualifier</code> annotation then Sisu will pick a canonical name based on the implementation type. |
| |
| <p><p> |
| Sometimes you need explicit typed bindings for external integration; you can list the types in a <code>@Typed</code> annotation or leave it empty to use the declared interfaces: |
| <p><p> |
| <pre> |
| @Named @Typed public class MyTypeImpl implements MyType { |
| // ... |
| }</pre> |
| |
| Default implementations can be indicated by using "default" as a binding name: |
| <p><p> |
| <pre> |
| @Named("default") public class MyTypeImpl implements MyType { |
| // ... |
| }</pre> |
| |
| or by starting the implementation name with "Default": |
| <p><p> |
| <pre> |
| @Named public class DefaultMyType implements MyType { |
| // ... |
| }</pre> |
| |
| Default components are bound without a qualifier and have a higher ranking than non-default components. |
| |
| <h4>Providers</h4> |
| Any qualified providers are bound using the same binding heuristics as components: |
| <p><p> |
| <pre> |
| @Named public class MyProvider implements Provider<MyType> { |
| public MyType get() { |
| // ... |
| } |
| }</pre> |
| Use <code>@Singleton</code> to scope the provided binding(s) as a singleton: |
| <p><p> |
| <pre> |
| @Named @Singleton public class MyProvider implements Provider<MyType> { |
| public MyType get() { |
| // ... |
| } |
| }</pre> |
| Note: this is different to the normal Guice behaviour where singleton only applies to the provider itself. |
| |
| <h4>Modules</h4> |
| Any qualified modules are are installed using the current binder: |
| <p><p> |
| <pre> |
| @Named public class MyModule extends AbstractModule { |
| @Override protected void configure() { |
| // ... |
| } |
| }</pre> |
| |
| <h4>Mediators</h4> |
| Any qualified <code><a href="../../../../org/eclipse/sisu/Mediator.html">Mediator</a></code>s are registered with the <code><a href="../../../../org/eclipse/sisu/inject/BeanLocator.html">BeanLocator</a></code>: |
| <p><p> |
| <pre> |
| @Named public class MyMediator implements Mediator<Named, MyType, MyWatcher> { |
| public void add( BeanEntry<Named, MyType> entry, MyWatcher watcher ) throws Exception { |
| // ... |
| } |
| |
| public void remove( BeanEntry<Named, MyType> entry, MyWatcher watcher ) throws Exception { |
| // ... |
| } |
| }</pre> |
| |
| </div> |
| |
| |
| |
| |
| |
| |
| <h2>Interfaces</h2> |
| <div class="jd-sumtable"> |
| |
| <table class="jd-sumtable-expando"> |
| <tr class="alt-color api apilevel-" > |
| <td class="jd-linkcol"><a href="../../../../org/eclipse/sisu/space/AnnotationVisitor.html">AnnotationVisitor</a></td> |
| <td class="jd-descrcol" width="100%">Something that can visit annotation declarations. </td> |
| </tr> |
| <tr class=" api apilevel-" > |
| <td class="jd-linkcol"><a href="../../../../org/eclipse/sisu/space/ClassFinder.html">ClassFinder</a></td> |
| <td class="jd-descrcol" width="100%">Finds (and optionally filters) Class resources from <code><a href="../../../../org/eclipse/sisu/space/ClassSpace.html">ClassSpace</a></code>s. </td> |
| </tr> |
| <tr class="alt-color api apilevel-" > |
| <td class="jd-linkcol"><a href="../../../../org/eclipse/sisu/space/ClassSpace.html">ClassSpace</a></td> |
| <td class="jd-descrcol" width="100%">Represents an abstract collection of related classes and resources. </td> |
| </tr> |
| <tr class=" api apilevel-" > |
| <td class="jd-linkcol"><a href="../../../../org/eclipse/sisu/space/ClassVisitor.html">ClassVisitor</a></td> |
| <td class="jd-descrcol" width="100%">Something that can visit class definitions. </td> |
| </tr> |
| <tr class="alt-color api apilevel-" > |
| <td class="jd-linkcol"><a href="../../../../org/eclipse/sisu/space/QualifiedTypeListener.html">QualifiedTypeListener</a></td> |
| <td class="jd-descrcol" width="100%">Listens for types annotated with Qualifier annotations. </td> |
| </tr> |
| <tr class=" api apilevel-" > |
| <td class="jd-linkcol"><a href="../../../../org/eclipse/sisu/space/SpaceModule.Strategy.html">SpaceModule.Strategy</a></td> |
| <td class="jd-descrcol" width="100%">Visitor strategy. </td> |
| </tr> |
| <tr class="alt-color api apilevel-" > |
| <td class="jd-linkcol"><a href="../../../../org/eclipse/sisu/space/SpaceVisitor.html">SpaceVisitor</a></td> |
| <td class="jd-descrcol" width="100%">Something that can visit <code><a href="../../../../org/eclipse/sisu/space/ClassSpace.html">ClassSpace</a></code>s. </td> |
| </tr> |
| </table> |
| </div> |
| |
| |
| |
| |
| <h2>Classes</h2> |
| <div class="jd-sumtable"> |
| |
| <table class="jd-sumtable-expando"> |
| <tr class="alt-color api apilevel-" > |
| <td class="jd-linkcol"><a href="../../../../org/eclipse/sisu/space/BundleClassSpace.html">BundleClassSpace</a></td> |
| <td class="jd-descrcol" width="100%"><code><a href="../../../../org/eclipse/sisu/space/ClassSpace.html">ClassSpace</a></code> backed by a strongly-referenced Bundle. </td> |
| </tr> |
| <tr class=" api apilevel-" > |
| <td class="jd-linkcol"><a href="../../../../org/eclipse/sisu/space/CloningClassSpace.html">CloningClassSpace</a></td> |
| <td class="jd-descrcol" width="100%"><code><a href="../../../../org/eclipse/sisu/space/ClassSpace.html">ClassSpace</a></code> that can create multiple (deferred) copies of the same implementation type. </td> |
| </tr> |
| <tr class="alt-color api apilevel-" > |
| <td class="jd-linkcol"><a href="../../../../org/eclipse/sisu/space/DefaultClassFinder.html">DefaultClassFinder</a></td> |
| <td class="jd-descrcol" width="100%"><code><a href="../../../../org/eclipse/sisu/space/ClassFinder.html">ClassFinder</a></code> that finds Class resources under a given package name. </td> |
| </tr> |
| <tr class=" api apilevel-" > |
| <td class="jd-linkcol"><a href="../../../../org/eclipse/sisu/space/IndexedClassFinder.html">IndexedClassFinder</a></td> |
| <td class="jd-descrcol" width="100%"><code><a href="../../../../org/eclipse/sisu/space/ClassFinder.html">ClassFinder</a></code> that finds Class resources listed in the named index. </td> |
| </tr> |
| <tr class="alt-color api apilevel-" > |
| <td class="jd-linkcol"><a href="../../../../org/eclipse/sisu/space/LoadedClass.html">LoadedClass</a><T></td> |
| <td class="jd-descrcol" width="100%">Pseudo <code><a href="../../../../org/eclipse/sisu/inject/DeferredClass.html">DeferredClass</a></code> backed by an already loaded Class. </td> |
| </tr> |
| <tr class=" api apilevel-" > |
| <td class="jd-linkcol"><a href="../../../../org/eclipse/sisu/space/QualifiedTypeBinder.html">QualifiedTypeBinder</a></td> |
| <td class="jd-descrcol" width="100%"><code><a href="../../../../org/eclipse/sisu/space/QualifiedTypeListener.html">QualifiedTypeListener</a></code> that installs Modules, registers <code><a href="../../../../org/eclipse/sisu/Mediator.html">Mediator</a></code>s, and binds types. </td> |
| </tr> |
| <tr class="alt-color api apilevel-" > |
| <td class="jd-linkcol"><a href="../../../../org/eclipse/sisu/space/QualifiedTypeVisitor.html">QualifiedTypeVisitor</a></td> |
| <td class="jd-descrcol" width="100%"><code><a href="../../../../org/eclipse/sisu/space/SpaceVisitor.html">SpaceVisitor</a></code> that reports types annotated with Qualifier annotations. </td> |
| </tr> |
| <tr class=" api apilevel-" > |
| <td class="jd-linkcol"><a href="../../../../org/eclipse/sisu/space/SisuIndex.html">SisuIndex</a></td> |
| <td class="jd-descrcol" width="100%">Command-line utility that generates a qualified class index for a space-separated list of JARs. </td> |
| </tr> |
| <tr class="alt-color api apilevel-" > |
| <td class="jd-linkcol"><a href="../../../../org/eclipse/sisu/space/SisuIndexAPT6.html">SisuIndexAPT6</a></td> |
| <td class="jd-descrcol" width="100%">Java 6 Annotation Processor that generates a qualified class index for the current build. </td> |
| </tr> |
| <tr class=" api apilevel-" > |
| <td class="jd-linkcol"><a href="../../../../org/eclipse/sisu/space/SpaceModule.html">SpaceModule</a></td> |
| <td class="jd-descrcol" width="100%">Guice Module that automatically binds types annotated with Qualifier annotations. </td> |
| </tr> |
| <tr class="alt-color api apilevel-" > |
| <td class="jd-linkcol"><a href="../../../../org/eclipse/sisu/space/SpaceScanner.html">SpaceScanner</a></td> |
| <td class="jd-descrcol" width="100%">Makes a <code><a href="../../../../org/eclipse/sisu/space/SpaceVisitor.html">SpaceVisitor</a></code> visit a <code><a href="../../../../org/eclipse/sisu/space/ClassSpace.html">ClassSpace</a></code>; can be directed by an optional <code><a href="../../../../org/eclipse/sisu/space/ClassFinder.html">ClassFinder</a></code>. </td> |
| </tr> |
| <tr class=" api apilevel-" > |
| <td class="jd-linkcol"><a href="../../../../org/eclipse/sisu/space/Streams.html">Streams</a></td> |
| <td class="jd-descrcol" width="100%">Utility methods for dealing with streams. </td> |
| </tr> |
| <tr class="alt-color api apilevel-" > |
| <td class="jd-linkcol"><a href="../../../../org/eclipse/sisu/space/URLClassSpace.html">URLClassSpace</a></td> |
| <td class="jd-descrcol" width="100%"><code><a href="../../../../org/eclipse/sisu/space/ClassSpace.html">ClassSpace</a></code> backed by a strongly-referenced ClassLoader and a URL class path. </td> |
| </tr> |
| </table> |
| </div> |
| |
| |
| |
| |
| |
| |
| |
| <h2>Enums</h2> |
| <div class="jd-sumtable"> |
| |
| <table class="jd-sumtable-expando"> |
| <tr class="alt-color api apilevel-" > |
| <td class="jd-linkcol"><a href="../../../../org/eclipse/sisu/space/BeanScanning.html">BeanScanning</a></td> |
| <td class="jd-descrcol" width="100%">Common techniques for discovering bean implementations. </td> |
| </tr> |
| </table> |
| </div> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <div id="footer"> |
| Generated by <a href="http://code.google.com/p/doclava/">Doclava</a>. |
| </div> <!-- end footer --> |
| |
| </div><!-- end jd-content --> |
| </div><!-- doc-content --> |
| |
| </div> <!-- end body-content --> |
| |
| <script type="text/javascript"> |
| init(); /* initialize doclava-developer-docs.js */ |
| </script> |
| |
| </body> |
| </html> |