roboguice.inject
Class ContextScope

java.lang.Object
  extended by roboguice.inject.ContextScope
All Implemented Interfaces:
com.google.inject.Scope

public class ContextScope
extends Object
implements com.google.inject.Scope

Author:
Mike Burton

Nested Class Summary
static class ContextScope.WeakActiveStack<T>
          A circular stack like structure of weak references.
 
Field Summary
protected  ThreadLocal<ContextScope.WeakActiveStack<android.content.Context>> contextStack
           
protected  ArrayList<roboguice.inject.PreferenceMembersInjector<?>> preferencesForInjection
           
protected  WeakHashMap<android.content.Context,Map<com.google.inject.Key<?>,WeakReference<Object>>> values
           
protected  ArrayList<roboguice.inject.ViewMembersInjector<?>> viewsForInjection
           
 
Constructor Summary
ContextScope(RoboApplication app)
           
 
Method Summary
 void dispose(android.content.Context context)
           
protected  void ensureContextStack()
           
 void enter(android.content.Context context)
           
 void exit(android.content.Context context)
           
protected
<T> Map<com.google.inject.Key<?>,WeakReference<Object>>
getScopedObjectMap(com.google.inject.Key<T> key)
           
 void injectPreferenceViews()
           
 void injectViews()
           
 void registerPreferenceForInjection(roboguice.inject.PreferenceMembersInjector<?> injector)
           
 void registerViewForInjection(roboguice.inject.ViewMembersInjector<?> injector)
           
<T> com.google.inject.Provider<T>
scope(com.google.inject.Key<T> key, com.google.inject.Provider<T> unscoped)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.inject.Scope
toString
 

Field Detail

values

protected WeakHashMap<android.content.Context,Map<com.google.inject.Key<?>,WeakReference<Object>>> values

contextStack

protected ThreadLocal<ContextScope.WeakActiveStack<android.content.Context>> contextStack

viewsForInjection

protected ArrayList<roboguice.inject.ViewMembersInjector<?>> viewsForInjection

preferencesForInjection

protected ArrayList<roboguice.inject.PreferenceMembersInjector<?>> preferencesForInjection
Constructor Detail

ContextScope

public ContextScope(RoboApplication app)
Method Detail

registerViewForInjection

public void registerViewForInjection(roboguice.inject.ViewMembersInjector<?> injector)

registerPreferenceForInjection

public void registerPreferenceForInjection(roboguice.inject.PreferenceMembersInjector<?> injector)

injectViews

public void injectViews()

injectPreferenceViews

public void injectPreferenceViews()

enter

public void enter(android.content.Context context)

exit

public void exit(android.content.Context context)

dispose

public void dispose(android.content.Context context)

scope

public <T> com.google.inject.Provider<T> scope(com.google.inject.Key<T> key,
                                               com.google.inject.Provider<T> unscoped)
Specified by:
scope in interface com.google.inject.Scope

ensureContextStack

protected void ensureContextStack()

getScopedObjectMap

protected <T> Map<com.google.inject.Key<?>,WeakReference<Object>> getScopedObjectMap(com.google.inject.Key<T> key)


Copyright © 2011. All Rights Reserved.