JBoss Modular Service Kernel API 1.0.0.CR2

org.jboss.msc.value
Class ConstructedValue<T>

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

public final class ConstructedValue<T>
extends Object
implements Value<T>

A value which is created on demand from a constructor. Each call to getValue() will create a new instance, so if the same instance should be returned, this should be used in conjunction with CachedValue.

Author:
David M. Lloyd

Constructor Summary
ConstructedValue(Constructor<T> constructor, List<? extends Value<?>> parameters)
          Construct a new instance.
 
Method Summary
 T getValue()
          Get the actual value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstructedValue

public ConstructedValue(Constructor<T> constructor,
                        List<? extends Value<?>> parameters)
Construct a new instance.

Parameters:
constructor - the constructor to use
parameters - the parameters to pass to the constructor
Method Detail

getValue

public T getValue()
           throws IllegalStateException
Get the actual value.

Specified by:
getValue in interface Value<T>
Returns:
the actual value
Throws:
IllegalStateException - if the value is time-sensitive and the current state does not allow retrieval.

JBoss Modular Service Kernel API 1.0.0.CR2

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