/** * @param initClassName a class name of a class that implements {@link ServiceKernelInit) and that will be created * and given a chance to redefine the service implementations in this kernel. */ protected void redefineServicesWithClass( String initClassName ) { try { Class<?> aClass = getClass().forName( initClassName ); ServiceKernelInit init = (ServiceKernelInit)aClass.newInstance(); init.init( this ); } catch( ClassNotFoundException e ) { try { Class<?> aClass = Thread.currentThread().getContextClassLoader().loadClass( initClassName ); ServiceKernelInit init = (ServiceKernelInit)aClass.newInstance(); init.init( this ); } catch (Exception e1) { e1.printStackTrace(); throw new RuntimeException( e1 ); } } catch (Exception e1) { throw new RuntimeException( e1 ); } }
/** * @param initClassName a class name of a class that implements {@link ServiceKernelInit) and that will be created * and given a chance to redefine the service implementations in this kernel. */ protected void redefineServicesWithClass( String initClassName ) { try { Class<?> aClass = getClass().forName( initClassName ); ServiceKernelInit init = (ServiceKernelInit)aClass.newInstance(); init.init( this ); } catch( ClassNotFoundException e ) { try { Class<?> aClass = Thread.currentThread().getContextClassLoader().loadClass( initClassName ); ServiceKernelInit init = (ServiceKernelInit)aClass.newInstance(); init.init( this ); } catch (Exception e1) { e1.printStackTrace(); throw new RuntimeException( e1 ); } } catch (Exception e1) { throw new RuntimeException( e1 ); } finally { ILanguageLevel.Util.reset(); } }