JBoss Modular Service Kernel API 1.0.0.CR2

org.jboss.msc.inject
Class SetMethodInjector<T>

java.lang.Object
  extended by org.jboss.msc.inject.SetMethodInjector<T>
Type Parameters:
T - the value type
All Implemented Interfaces:
Injector<T>

public final class SetMethodInjector<T>
extends Object
implements Injector<T>

An injector which calls a setter method.

Author:
David M. Lloyd

Constructor Summary
SetMethodInjector(Value<?> target, Method method)
          Construct a new instance.
 
Method Summary
static
<T> Injector<T>
create(Value<?> target, Method method)
          Construct a new instance.
 void inject(T value)
          Inject the given value.
 void uninject()
          Uninject the given value (in other words, cancel or undo a previous injection).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SetMethodInjector

public SetMethodInjector(Value<?> target,
                         Method method)
Construct a new instance.

Parameters:
target - the object upon which the method is to be called
method - the method to invoke
Method Detail

create

public static <T> Injector<T> create(Value<?> target,
                                     Method method)
Construct a new instance.

Parameters:
target - the object upon which the method is to be called
method - the method to invoke
Returns:
the new instance

inject

public void inject(T value)
Inject the given value.

Specified by:
inject in interface Injector<T>
Parameters:
value - the value

uninject

public void uninject()
Uninject the given value (in other words, cancel or undo a previous injection). Only called after inject() has been called.

Specified by:
uninject in interface Injector<T>

JBoss Modular Service Kernel API 1.0.0.CR2

Copyright © 2011 JBoss, a division of Red Hat, Inc.