private static void addSourceChain ( PathChain sourceChain ) { try { Class sourceClass = Class . forName ( sourceChain . getSource ( ) ) ; EndpointSource source = ( EndpointSource ) sourceClass . newInstance ( ) ; for ( EndpointSource . Endpoint endpoint : source . listEndpoints ( ) ) { PathChain sourcedPath = new PathChain ( ) ; sourcedPath . setPath ( endpoint . getPath ( ) ) ; sourcedPath . setMethod ( endpoint . getMethod ( ) ) ; sourcedPath . setExec ( sourceChain . getExec ( ) ) ; sourcedPath . validate ( sourceChain . getSource ( ) ) ; addPathChain ( sourcedPath ) ; } } catch ( Exception e ) { logger . error ( "Failed to inject handler.yml paths from: " + sourceChain ) ; if ( e instanceof RuntimeException ) { throw ( RuntimeException ) e ; } else { throw new RuntimeException ( e ) ; } } }
Add PathChains crated from the EndpointSource given in sourceChain