com.sun.hk2.component
Class ScopeInstanceImpl

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

public final class ScopeInstanceImpl
extends Object
implements ScopeInstance, PreDestroy

A particular instanciation of a Scope.

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

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

Field Summary
 String name
          Human readable scope instance name for debug assistance.
 
Constructor Summary
ScopeInstanceImpl(Map backend)
           
ScopeInstanceImpl(String name, Map backend)
           
 
Method Summary
<T> T
get(Provider<T> inhabitant)
           
 void preDestroy()
           
<T> T
put(Provider<T> inhabitant, T value)
           
 void release()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

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

Constructor Detail

ScopeInstanceImpl

public ScopeInstanceImpl(String name,
                         Map backend)

ScopeInstanceImpl

public ScopeInstanceImpl(Map backend)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

get

public <T> T get(Provider<T> inhabitant)
Specified by:
get in interface ScopeInstance

put

public <T> T put(Provider<T> inhabitant,
                 T value)
Specified by:
put in interface ScopeInstance

release

public void release()
Specified by:
release in interface ScopeInstance

preDestroy

public void preDestroy()
Specified by:
preDestroy in interface PreDestroy


Copyright © 2011 Oracle Corporation. All Rights Reserved.