JBoss Modular Service Kernel API 1.0.0.Beta6

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.
ConstructedValue(Value<Constructor<T>> constructorValue, List<? extends Value<?>> parameters)
          Deprecated. Will be removed before 1.0.0.GA
 
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

@Deprecated
public ConstructedValue(Value<Constructor<T>> constructorValue,
                                   List<? extends Value<?>> parameters)
Deprecated. Will be removed before 1.0.0.GA

Construct a new instance.

Parameters:
constructorValue - the constructor to use
parameters - the parameters to pass to the constructor

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.Beta6

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