public Object construct(WireContext wireContext) { return wireContext.getClassLoader(); }
@Override public void apply(final Object target, final WireContext wireContext) { final Configuration configuration = (Configuration) target; configuration.addResource(resource, wireContext.getClassLoader()); }
@Override public Object construct(final WireContext wireContext) { // instantiation of the configuration Configuration configuration = null; if (className != null) { final ClassLoader classLoader = wireContext.getClassLoader(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("instantiating hibernate configation class " + className); } final Class<?> configurationClass = ReflectUtil.loadClass(classLoader, className); configuration = (Configuration) ReflectUtil.newInstance(configurationClass); } else { if (LOG.isLoggable(Level.FINE)) { LOG.fine("instantiating default hibernate configation"); } configuration = new Configuration(); } return configuration; }
@Override public void apply(final Object target, final WireContext wireContext) { final Configuration configuration = (Configuration) target; try { final Class<?> persistentClass = wireContext.getClassLoader().loadClass(className); configuration.addClass(persistentClass); } catch (final Exception e) { final String message = ExceptionManager.getInstance().getFullMessage("bp_HCD_2", className); throw new BonitaRuntimeException(message, e); } }
final InputStream inputStream = wireContext.getClassLoader().getResourceAsStream(resource); if (inputStream == null) { throw new RuntimeException("resource " + resource + " doesn't exist");
/** * loads the class from the class loader of the specified WireContext. * * @throws WireException * if the class could not be loaded. */ public Object construct(WireContext wireContext) { ClassLoader classLoader = wireContext.getClassLoader(); try { return ReflectUtil.loadClass(classLoader, text); } catch (BonitaRuntimeException e) { Throwable cause = e.getCause(); String message = ExceptionManager.getInstance().getFullMessage( "bp_CD_1", text, cause.getMessage()); throw new WireException(message, cause); } }
try { final ClassLoader classLoader = wireContext.getClassLoader(); final Class<?> clazz = ReflectUtil.loadClass(classLoader, className); object = clazz.newInstance();
@Override public Environment openEnvironment() { final PvmEnvironment environment = new PvmEnvironment(this); if (LOG.isLoggable(Level.FINE)) { LOG.fine("opening " + environment); } // set the classloader final ClassLoader classLoader = environmentFactoryCtxWireContext.getClassLoader(); if (classLoader != null) { environment.setClassLoader(classLoader); } // add the environment-factory context environment.addContext(environmentFactoryCtxWireContext); // add the environment block context final WireContext environmentContext = new WireContext(environmentCtxWireDefinition, Context.CONTEXTNAME_ENVIRONMENT, true); // add the environment block context to the environment environment.addContext(environmentContext); try { // finish the creation of the environment wire context environmentContext.create(); } catch (final RuntimeException e) { // On exception, pop environment Environment.popEnvironment(); throw e; } // if all went well, return the created environment return environment; }
ClassLoader classLoader = wireContext.getClassLoader(); clazz = ReflectUtil.loadClass(classLoader, className); } catch (Exception e) {