private static void buildBolts ( ExecutionContext context ) throws ClassNotFoundException , IllegalAccessException , InstantiationException , NoSuchMethodException , InvocationTargetException { for ( BoltDef def : context . getTopologyDef ( ) . getBolts ( ) ) { Class clazz = Class . forName ( def . getClassName ( ) ) ; Object bolt = buildObject ( def , context ) ; context . addBolt ( def . getId ( ) , bolt ) ; } }
Given a list of bolt definitions build a map of Storm bolts with the bolt definition id as the key . Attempt to coerce the given constructor arguments to a matching bolt constructor as much as possible .