com.sun.hk2.component
Class CompanionSeed.Registerer<T>

java.lang.Object
  extended by com.sun.hk2.component.CompanionSeed.Registerer<T>
All Implemented Interfaces:
CageBuilder<T>
Enclosing class:
CompanionSeed

public static final class CompanionSeed.Registerer<T>
extends java.lang.Object
implements CageBuilder<T>

When CompanionSeed enters habitat, look for existing inhabitants and make sure all of them get its corresponding companions from this new seed.

Normal CageBuilders register themselves as components, but this one is defined in HK2 so we have to get in by a special means.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jvnet.hk2.component.CageBuilder
CageBuilder.Registerer<T>
 
Constructor Summary
CompanionSeed.Registerer(Habitat habitat)
           
 
Method Summary
static Inhabitant<?> createCompanion(Habitat habitat, Inhabitant<?> lead, Inhabitant<?> seed)
          Creates a companion inhabitant from the inhabitant of a CompanionSeed, to be associated with a lead component.
 void onEntered(Inhabitant<T> i)
          Called when an Inhabitant is entered into habitat.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompanionSeed.Registerer

public CompanionSeed.Registerer(Habitat habitat)
Method Detail

onEntered

public void onEntered(Inhabitant<T> i)
Description copied from interface: CageBuilder
Called when an Inhabitant is entered into habitat.

Specified by:
onEntered in interface CageBuilder<T>

createCompanion

public static Inhabitant<?> createCompanion(Habitat habitat,
                                            Inhabitant<?> lead,
                                            Inhabitant<?> seed)
Creates a companion inhabitant from the inhabitant of a CompanionSeed, to be associated with a lead component.



Copyright © 2011 Oracle Corporation. All Rights Reserved.