/** * Convert the path element into the URL which further pass into * the classloader. */ private URL[] getURLs(){ Vector pathElements = getPathElement(); URL[] urls = new URL[pathElements.size()]; for(int i=0;i<pathElements.size();i++){ try { urls[i] = (new File((String)pathElements.get(i))).toURI().toURL(); } catch (MalformedURLException e) { throw StaticWeaveException.exceptionPerformWeaving(e, pathElements.get(i)); } } return urls; }
public static void main(String[] argv) { StaticWeave staticweaver = new StaticWeave(argv); try { // Verify the command line arguments staticweaver.processCommandLine(); staticweaver.start(); } catch (Exception e) { throw StaticWeaveException.exceptionPerformWeaving(e, argv); } }
public static void main(String[] argv) { EclipseLinkCustomizer.initTransientCompatibleAnnotations(); StaticWeave staticWeaver = new StaticWeave(argv); try { staticWeaver.processCommandLine(); staticWeaver.start(); } catch (Exception e) { throw StaticWeaveException.exceptionPerformWeaving(e, argv); } } }
/** * Invoke weaving process. */ private void start() { try { StaticWeaveProcessor weave = new StaticWeaveProcessor(source, target); URL[] urls = getURLs(); if (urls!=null) { URLClassLoader classLoader = new URLClassLoader(getURLs(), Thread.currentThread().getContextClassLoader()); weave.setClassLoader(classLoader); } if (persistenceinfo!=null) { weave.setPersistenceInfo(persistenceinfo); } if (persistencexml!=null){ weave.setPersistenceXMLLocation(persistencexml); } if (logWriter!=null) { weave.setLog(logWriter); } weave.setLogLevel(this.logLevel); weave.performWeaving(); } catch (Exception e) { AbstractSessionLog.getLog().logThrowable(AbstractSessionLog.SEVERE, AbstractSessionLog.WEAVER, e); throw StaticWeaveException.exceptionPerformWeaving(e, source); } } }