@Inherited@Target(value=TYPE)@Retention(value=RUNTIME)public @interface State
Marks the state object.
State objects naturally encapsulate the state on which benchmark is working on. The
Scope of state object defines to which extent it is shared among the worker threads.
State objects are usually injected into
Benchmark methods as arguments, and JMH takes care of their instantiation and sharing. State objects may also be injected into
TearDown methods of other
State objects to get the staged initialization. In that case, the dependency graph between the
State-s should be directed acyclic graph.
State objects may be inherited: you can place
State on a super class and use subclasses as states.
Copyright © 2012-2015 Oracle. All Rights Reserved.