com.sun.hk2.component
Class CompanionSeed.Registerer

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

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

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
 
Constructor Summary
CompanionSeed.Registerer(Habitat habitat)
           
 
Method Summary
static LazyInhabitant 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<?> 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<?> i)
Description copied from interface: CageBuilder
Called when an Inhabitant is entered into habitat.

Specified by:
onEntered in interface CageBuilder

createCompanion

public static LazyInhabitant 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 © 2009 Sun Microsystems, Inc.. All Rights Reserved.