private CommandExecutor buildCommandService(Long sessionId,
KieBase kbase,
KieSessionConfiguration conf,
Environment env) {
try {
Class< ? extends CommandExecutor> serviceClass = getCommandServiceClass();
Constructor< ? extends CommandExecutor> constructor = serviceClass.getConstructor( Long.class,
KieBase.class,
KieSessionConfiguration.class,
Environment.class );
return constructor.newInstance( sessionId,
kbase,
conf,
env );
} catch ( SecurityException e ) {
throw new IllegalStateException( e );
} catch ( NoSuchMethodException e ) {
throw new IllegalStateException( e );
} catch ( IllegalArgumentException e ) {
throw new IllegalStateException( e );
} catch ( InstantiationException e ) {
throw new IllegalStateException( e );
} catch ( IllegalAccessException e ) {
throw new IllegalStateException( e );
} catch ( InvocationTargetException e ) {
throw new IllegalStateException( e );
}
}