/** * INTERNAL: * EclipseLink exceptions should only be thrown by EclipseLink. */ public static StaticWeaveException missingSource() { Object[] args = { null }; StaticWeaveException missingSourceException = new StaticWeaveException(ExceptionMessageGenerator.buildMessage(StaticWeaveException.class, EXCEPTION_NO_SOURCE_SPECIFIED, args)); missingSourceException.setResourceName(null); missingSourceException.setErrorCode(EXCEPTION_NO_SOURCE_SPECIFIED); return missingSourceException; }
/** * INTERNAL: * EclipseLink exceptions should only be thrown by EclipseLink. */ protected StaticWeaveException(String message, Throwable internalException) { super(message); setInternalException(internalException); }
/** * Verify the value of attributes. * @throws BuildException */ private void verifyOptions() throws BuildException { if (source==null) { throw StaticWeaveException.missingSource(); } if (target==null) { throw StaticWeaveException.missingTarget(); } }
/** * 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; }
throw StaticWeaveException.missingSource(); throw StaticWeaveException.weaveInplaceForJar(source.toString());
public void setLogLevel(String logLevel) { if (logLevel.equalsIgnoreCase("OFF") || logLevel.equalsIgnoreCase("SEVERE") || logLevel.equalsIgnoreCase("WARNING") || logLevel.equalsIgnoreCase("INFO") || logLevel.equalsIgnoreCase("CONFIG") || logLevel.equalsIgnoreCase("FINE") || logLevel.equalsIgnoreCase("FINER") || logLevel.equalsIgnoreCase("FINEST") || logLevel.equalsIgnoreCase("ALL")) { this.logLevel = AbstractSessionLog.translateStringToLoggingLevel(logLevel.toUpperCase()); } else{ throw StaticWeaveException.illegalLoggingLevel(logLevel); } }
throw StaticWeaveException.exceptionOpeningArchive(inputArchiveURL,e); } finally { if (archive != null) {
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); } }
/** * INTERNAL: * EclipseLink exceptions should only be thrown by EclipseLink. */ public static StaticWeaveException illegalLoggingLevel(String loggingLevel) { Object[] args = { loggingLevel }; StaticWeaveException loadingException = new StaticWeaveException(ExceptionMessageGenerator.buildMessage(StaticWeaveException.class, EXCEPTION_FOR_ILLEGALE_LOGGING_LEVEL, args)); loadingException.setResourceName(loggingLevel); loadingException.setErrorCode(EXCEPTION_FOR_ILLEGALE_LOGGING_LEVEL); return loadingException; }
/** * INTERNAL: * EclipseLink exceptions should only be thrown by EclipseLink. */ protected StaticWeaveException(String message, Throwable internalException) { super(message); setInternalException(internalException); }
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); } } }
throw StaticWeaveException.missingSource(); throw StaticWeaveException.missingTarget();
/** * INTERNAL: * EclipseLink exceptions should only be thrown by EclipseLink. */ public static StaticWeaveException missingSource() { Object[] args = { null }; StaticWeaveException missingSourceException = new StaticWeaveException(ExceptionMessageGenerator.buildMessage(StaticWeaveException.class, EXCEPTION_NO_SOURCE_SPECIFIED, args)); missingSourceException.setResourceName(null); missingSourceException.setErrorCode(EXCEPTION_NO_SOURCE_SPECIFIED); return missingSourceException; }
/** * INTERNAL: * EclipseLink exceptions should only be thrown by EclipseLink. */ protected StaticWeaveException(String message, Throwable internalException) { super(message); setInternalException(internalException); }
/** * 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); } } }
public static StaticWeaveException exceptionPerformWeaving(Exception cause, Object sourceJar) { Object[] args = { sourceJar }; StaticWeaveException loadingException = new StaticWeaveException(ExceptionMessageGenerator.buildMessage(StaticWeaveException.class, EXCEPTION_WEAVING, args), cause); loadingException.setResourceName(null); loadingException.setErrorCode(EXCEPTION_WEAVING); return loadingException; }
/** * INTERNAL: * EclipseLink exceptions should only be thrown by EclipseLink. */ public static StaticWeaveException openLoggingFileException(String LoggingFile,Exception cause) { Object[] args = { LoggingFile }; StaticWeaveException loadingException = new StaticWeaveException(ExceptionMessageGenerator.buildMessage(StaticWeaveException.class, EXCEPTION_OPEN_LOGGING_FILE, args), cause); loadingException.setResourceName(LoggingFile); loadingException.setErrorCode(EXCEPTION_OPEN_LOGGING_FILE); return loadingException; }
public static StaticWeaveException exceptionPerformWeaving(Exception cause, Object sourceJar) { Object[] args = { sourceJar }; StaticWeaveException loadingException = new StaticWeaveException(ExceptionMessageGenerator.buildMessage(StaticWeaveException.class, EXCEPTION_WEAVING, args), cause); loadingException.setResourceName(null); loadingException.setErrorCode(EXCEPTION_WEAVING); return loadingException; }
/** * INTERNAL: * EclipseLink exceptions should only be thrown by EclipseLink. */ public static StaticWeaveException missingSource() { Object[] args = { null }; StaticWeaveException missingSourceException = new StaticWeaveException(ExceptionMessageGenerator.buildMessage(StaticWeaveException.class, EXCEPTION_NO_SOURCE_SPECIFIED, args)); missingSourceException.setResourceName(null); missingSourceException.setErrorCode(EXCEPTION_NO_SOURCE_SPECIFIED); return missingSourceException; }
/** * INTERNAL: * EclipseLink exceptions should only be thrown by EclipseLink. */ public static StaticWeaveException weaveInplaceForJar(String filePath) { Object[] args = { filePath }; StaticWeaveException loadingException = new StaticWeaveException(ExceptionMessageGenerator.buildMessage(StaticWeaveException.class, EXCEPTION_NO_SUPPORT_WEAVING_INPLACE_FOR_JAR, args)); loadingException.setResourceName(filePath); loadingException.setErrorCode(EXCEPTION_NO_SUPPORT_WEAVING_INPLACE_FOR_JAR); return loadingException; }