com.sun.hk2.component
Class ScopeInstance

java.lang.Object
  extended by com.sun.hk2.component.ScopeInstance
All Implemented Interfaces:
PreDestroy

public final class ScopeInstance
extends java.lang.Object
implements PreDestroy

A particular instanciation of a Scope.

For example, for the "request scope", an instance of ScopeInstance is created for each request.

Author:
Kohsuke Kawaguchi
See Also:
Scope.current()

Field Summary
 java.lang.String name
          Human readable scope instance name for debug assistance.
 
Constructor Summary
ScopeInstance(java.util.Map backend)
           
ScopeInstance(java.lang.String name, java.util.Map backend)
           
 
Method Summary
<T> T
get(Inhabitant<T> inhabitant)
           
 void preDestroy()
          The component is about to be removed from commission
<T> T
put(Inhabitant<T> inhabitant, T value)
           
 void release()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public final java.lang.String name
Human readable scope instance name for debug assistance.

Constructor Detail

ScopeInstance

public ScopeInstance(java.lang.String name,
                     java.util.Map backend)

ScopeInstance

public ScopeInstance(java.util.Map backend)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

get

public <T> T get(Inhabitant<T> inhabitant)

put

public <T> T put(Inhabitant<T> inhabitant,
                 T value)

release

public void release()

preDestroy

public void preDestroy()
Description copied from interface: PreDestroy
The component is about to be removed from commission

Specified by:
preDestroy in interface PreDestroy


Copyright © 2011 Oracle Corporation. All Rights Reserved.