com.sun.hk2.component
Class ScopeInstanceImpl

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

public final class ScopeInstanceImpl
extends java.lang.Object
implements org.glassfish.hk2.ScopeInstance, org.glassfish.hk2.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
 java.lang.String name
          Human readable scope instance name for debug assistance.
 
Constructor Summary
ScopeInstanceImpl(java.util.Map backend)
           
ScopeInstanceImpl(java.lang.String name, java.util.Map backend)
           
 
Method Summary
<T> T
get(org.glassfish.hk2.Provider<T> inhabitant)
           
 void preDestroy()
           
<T> T
put(org.glassfish.hk2.Provider<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

ScopeInstanceImpl

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

ScopeInstanceImpl

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

toString

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

get

public <T> T get(org.glassfish.hk2.Provider<T> inhabitant)
Specified by:
get in interface org.glassfish.hk2.ScopeInstance

put

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

release

public void release()
Specified by:
release in interface org.glassfish.hk2.ScopeInstance

preDestroy

public void preDestroy()
Specified by:
preDestroy in interface org.glassfish.hk2.PreDestroy


Copyright © 2011 Oracle Corporation. All Rights Reserved.