Silk DI 0.6


se.jbee.inject.util
Class Scoped

Object
  extended by se.jbee.inject.util.Scoped

public class Scoped
extends Object

Utility as a factory to create/use Scopes.

Author:
Jan Bernitt (jan@jbee.se)

Nested Class Summary
static interface Scoped.KeyDeduction
           
 
Field Summary
static Scope APPLICATION
          Asks the Injectable once per binding.
static Scope DEPENDENCY
           
static Scope DEPENDENCY_INSTANCE
           
static Scoped.KeyDeduction DEPENDENCY_INSTANCE_KEY
           
static Scope DEPENDENCY_TYPE
           
static Scoped.KeyDeduction DEPENDENCY_TYPE_KEY
           
static Scope INJECTION
          Often called the 'default' or 'prototype'-scope.
static Scope TARGET_INSTANCE
           
static Scoped.KeyDeduction TARGET_INSTANCE_KEY
           
static Scoped.KeyDeduction TARGETED_DEPENDENCY_TYPE_KEY
           
static Scope THREAD
          Asks the Injectable once per thread per binding which is understand commonly as a usual 'per-thread' singleton.
 
Constructor Summary
Scoped()
           
 
Method Summary
static Repository asSnapshot(Repository src, Repository dest)
           
static Scope uniqueBy(Scoped.KeyDeduction keyDeduction)
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEPENDENCY_TYPE_KEY

public static final Scoped.KeyDeduction DEPENDENCY_TYPE_KEY

DEPENDENCY_INSTANCE_KEY

public static final Scoped.KeyDeduction DEPENDENCY_INSTANCE_KEY

TARGET_INSTANCE_KEY

public static final Scoped.KeyDeduction TARGET_INSTANCE_KEY

TARGETED_DEPENDENCY_TYPE_KEY

public static final Scoped.KeyDeduction TARGETED_DEPENDENCY_TYPE_KEY

INJECTION

public static final Scope INJECTION
Often called the 'default' or 'prototype'-scope. Asks the Injectable once per injection.


APPLICATION

public static final Scope APPLICATION
Asks the Injectable once per binding. Thereby instances become singletons local to the application.


THREAD

public static final Scope THREAD
Asks the Injectable once per thread per binding which is understand commonly as a usual 'per-thread' singleton.


DEPENDENCY_TYPE

public static final Scope DEPENDENCY_TYPE

DEPENDENCY_INSTANCE

public static final Scope DEPENDENCY_INSTANCE

TARGET_INSTANCE

public static final Scope TARGET_INSTANCE

DEPENDENCY

public static final Scope DEPENDENCY
Constructor Detail

Scoped

public Scoped()
Method Detail

uniqueBy

public static Scope uniqueBy(Scoped.KeyDeduction keyDeduction)

asSnapshot

public static Repository asSnapshot(Repository src,
                                    Repository dest)

Silk DI 0.6