public static < T > DetachedStageRuntime < ? extends T > create ( StageBean bean , Stage . Info info , Stage . Context context , Class < T > klass ) { switch ( bean . getDefinition ( ) . getType ( ) ) { case PROCESSOR : return new DetachedStageRuntime . DetachedProcessor ( bean , info , context ) ; case TARGET : case EXECUTOR : return new DetachedStageRuntime . DetachedTarget ( bean , info , context ) ; default : throw new RuntimeException ( "Unsupported stage type: " + bean . getDefinition ( ) . getType ( ) ) ; } }
Create new instance of detached stage runtime .