commons-jci-1.1-src/LICENSE.txt100644 0 0 26446 10210074062 13354 0ustar 0 0 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. commons-jci-1.1-src/NOTICE.txt100644 0 0 261 12102311744 13201 0ustar 0 0 Apache Commons JCI Copyright 2004-2011 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/). commons-jci-1.1-src/pom.xml100644 0 0 31375 12225251543 13054 0ustar 0 0 4.0.0 org.apache.commons commons-parent 32 pom org.apache.commons commons-jci 1.1 Apache Commons JCI Apache Commons JCI is a java compiler interface. It can be used to compile Java itself, or any other language that can be compiled to Java classes (e.g. groovy or javascript). It is well integrated with a FAM (FilesystemAlterationMonitor) that can be used with the JCI compiling/reloading classloader. All the currently supported compilers feature in-memory compilation. http://commons.apache.org/proper/commons-jci/ 2004 JIRA https://issues.apache.org/jira/browse/JCI fam core compilers/eclipse compilers/janino compilers/groovy compilers/rhino examples compiler-jsr199 compilers/jsr199 tcurdt Torsten Curdt tcurdt at apache.org ASF http://www.apache.org/ +1 Don Brown mrdon at apache.org ASF http://www.apache.org/ Joerk Heinicke joerg.heinicke at gmx.de Mark Proctor mproctor at codehaus.org scm:svn:http://svn.apache.org/repos/asf/commons/proper/jci/trunk/ scm:svn:https://svn.apache.org/repos/asf/commons/proper/jci/trunk/ http://svn.apache.org/viewvc/commons/proper/jci/trunk/ org.apache.maven.plugins maven-surefire-plugin org.apache.commons.logging.impl.SimpleLog error org.codehaus.mojo cobertura-maven-plugin 2.2 clean maven-assembly-plugin src/assembly/bin.xml src/assembly/src.xml gnu org.apache.maven.plugins maven-antrun-plugin jci-jar-manifest generate-sources run org.apache.maven.plugins maven-site-plugin ${commons.site-plugin.version} ${maven-site-plugin.skip} org.apache.maven.wagon wagon-ssh-external 1.0-beta-2 org.codehaus.mojo findbugs-maven-plugin 1.2 org.codehaus.mojo taglist-maven-plugin 2.2 TODO @todo FIXME @deprecated true org.apache.maven.plugins maven-surefire-report-plugin ${commons.surefire.version} true org.apache.maven.plugins maven-pmd-plugin 2.3 true org.apache.maven.plugins maven-jxr-plugin ${commons.jxr.version} true org.apache.maven.plugins maven-javadoc-plugin ${commons.javadoc.version} true org.codehaus.mojo cobertura-maven-plugin ${commons.cobertura.version} true false 1.5 1.5 jci JCI 12310650 1.1 RC1 commons-logging commons-logging 1.1.3 org.eclipse.jdt.core.compiler ecj 4.2.2 org.codehaus.groovy groovy-all 1.7.11 org.codehaus.janino janino 2.6.1 rhino js 1.7R2 commons-io commons-io 2.2 commons-cli commons-cli 1.2 javax.servlet servlet-api 2.5 asm asm 3.3.1 org.apache.commons commons-lang3 3.1 junit junit 4.11 commons-jci-1.1-src/README.txt100644 0 0 635 10631474317 13175 0ustar 0 0 In order to build commons-jci please use subversion to check it out via svn co http://svn.apache.org/repos/asf/jakarta/commons/proper/jci/trunk/ You need to have maven 2.0.x installed. All you need to do is to call mvn clean install Releases are done with mvn -Prelease release:prepare mvn -Prelease release:perform It is suggested to be using a ssh and gpg agent for the release process. commons-jci-1.1-src/TODO.txt100644 0 0 1520 12224753411 13012 0ustar 0 0 ORDER BY IMPORTANCE o simplify the maven build (right now uses custom modules and so on ... which always caused problems) o update the maven build (bring it in line with the latest commons pom, plugins etc o finish common configuration for some compilers o finish implementation of jsr199 compiler o removing of anonymous classes if parent class is being removed (could require interface changes) o ability to add (contents of) jars to the store ...and be able to remove them again o add exceptions to interfaces o move the reader/store interfaces to streams o documentation o dependency analysis for proper re-try after errors o maven plugin to compile with any of the compilers o compiler discovery via META-INF o new compiler implementations o jikes o pizza o jruby (maybe?) o jpython (maybe?) o c# (maybe?) commons-jci-1.1-src/core/src/ 40755 0 0 0 12060700110 13112 5ustar 0 0 commons-jci-1.1-src/core/src/main/ 40755 0 0 0 12060700110 14036 5ustar 0 0 commons-jci-1.1-src/core/src/main/java/ 40755 0 0 0 12060700110 14757 5ustar 0 0 commons-jci-1.1-src/core/src/main/java/org/ 40755 0 0 0 12060700110 15546 5ustar 0 0 commons-jci-1.1-src/core/src/main/java/org/apache/ 40755 0 0 0 12060700110 16767 5ustar 0 0 commons-jci-1.1-src/core/src/main/java/org/apache/commons/ 40755 0 0 0 12060700110 20442 5ustar 0 0 commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/ 40755 0 0 0 12224752676 21241 5ustar 0 0 commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/compilers/ 40755 0 0 0 12224752676 23236 5ustar 0 0 commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/listeners/ 40755 0 0 0 12224752676 23251 5ustar 0 0 commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/problems/ 40755 0 0 0 12224752676 23064 5ustar 0 0 commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/readers/ 40755 0 0 0 12224752676 22666 5ustar 0 0 commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/stores/ 40755 0 0 0 12224752676 22560 5ustar 0 0 commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/utils/ 40755 0 0 0 12224752676 22401 5ustar 0 0 commons-jci-1.1-src/core/src/main/resources/ 40755 0 0 0 12225261512 16063 5ustar 0 0 commons-jci-1.1-src/core/src/site/ 40755 0 0 0 12060700110 14056 5ustar 0 0 commons-jci-1.1-src/core/src/test/ 40755 0 0 0 12060700110 14071 5ustar 0 0 commons-jci-1.1-src/core/src/test/java/ 40755 0 0 0 12060700110 15012 5ustar 0 0 commons-jci-1.1-src/core/src/test/java/org/ 40755 0 0 0 12060700110 15601 5ustar 0 0 commons-jci-1.1-src/core/src/test/java/org/apache/ 40755 0 0 0 12060700110 17022 5ustar 0 0 commons-jci-1.1-src/core/src/test/java/org/apache/commons/ 40755 0 0 0 12060700110 20475 5ustar 0 0 commons-jci-1.1-src/core/src/test/java/org/apache/commons/jci/ 40755 0 0 0 12224752676 21274 5ustar 0 0 commons-jci-1.1-src/core/src/test/java/org/apache/commons/jci/classes/ 40755 0 0 0 12060700110 22677 5ustar 0 0 commons-jci-1.1-src/core/src/test/java/org/apache/commons/jci/compilers/ 40755 0 0 0 12224752676 23271 5ustar 0 0 commons-jci-1.1-src/core/src/test/java/org/apache/commons/jci/readers/ 40755 0 0 0 12060700110 22667 5ustar 0 0 commons-jci-1.1-src/core/src/test/java/org/apache/commons/jci/stores/ 40755 0 0 0 12224752676 22613 5ustar 0 0 commons-jci-1.1-src/core/src/test/resources/ 40755 0 0 0 12060700110 16103 5ustar 0 0 commons-jci-1.1-src/core/pom.xml100644 0 0 6534 12225250625 13763 0ustar 0 0 4.0.0 org.apache.commons commons-jci 1.1 commons-jci-core 1.1 Apache Commons JCI core Apache Commons JCI core interfaces and implementations. org.apache.commons commons-jci-fam ${project.version} commons-io commons-io commons-logging commons-logging asm asm test org.apache.commons commons-lang3 test junit junit test jci-core true org.apache.maven.plugins maven-jar-plugin test-jar maven-assembly-plugin true commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/compilers/AbstractJavaCompiler.java100644 0 0 4122 10613666121 30222 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.compilers; import org.apache.commons.jci.problems.CompilationProblemHandler; import org.apache.commons.jci.readers.ResourceReader; import org.apache.commons.jci.stores.ResourceStore; /** * Base class for compiler implementations. Provides just a few * convenience methods. * * @author tcurdt */ public abstract class AbstractJavaCompiler implements JavaCompiler { protected CompilationProblemHandler problemHandler; public void setCompilationProblemHandler( final CompilationProblemHandler pHandler ) { problemHandler = pHandler; } public CompilationResult compile( final String[] pClazzNames, final ResourceReader pReader, final ResourceStore pStore ) { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); if (classLoader == null) { classLoader = this.getClass().getClassLoader(); } return compile(pClazzNames, pReader, pStore, classLoader, createDefaultSettings()); } public CompilationResult compile( final String[] pClazzNames, final ResourceReader pReader, final ResourceStore pStore, final ClassLoader pClassLoader ) { return compile(pClazzNames, pReader, pStore, pClassLoader, createDefaultSettings()); } } commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/compilers/CompilationResult.java100644 0 0 4751 12204226200 27633 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.compilers; import java.util.ArrayList; import java.util.Collection; import org.apache.commons.jci.problems.CompilationProblem; /** * A CompilationResult represents the result of a compilation. * It includes errors (which failed the compilation) or warnings * (that can be ignored and do not affect the creation of the * class files) * * @author tcurdt */ public final class CompilationResult { private final CompilationProblem[] errors; private final CompilationProblem[] warnings; public CompilationResult( final CompilationProblem[] pProblems ) { final Collection errorsColl = new ArrayList(); final Collection warningsColl = new ArrayList(); for (CompilationProblem problem : pProblems) { if (problem.isError()) { errorsColl.add(problem); } else { warningsColl.add(problem); } } errors = new CompilationProblem[errorsColl.size()]; errorsColl.toArray(errors); warnings = new CompilationProblem[warningsColl.size()]; warningsColl.toArray(warnings); } public CompilationProblem[] getErrors() { final CompilationProblem[] res = new CompilationProblem[errors.length]; System.arraycopy(errors, 0, res, 0, res.length); return res; } public CompilationProblem[] getWarnings() { final CompilationProblem[] res = new CompilationProblem[warnings.length]; System.arraycopy(warnings, 0, res, 0, res.length); return res; } } commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/compilers/JavaCompiler.java100644 0 0 6642 10613666121 26547 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.compilers; import org.apache.commons.jci.problems.CompilationProblemHandler; import org.apache.commons.jci.readers.ResourceReader; import org.apache.commons.jci.stores.ResourceStore; /** * The general compiler interface. All compilers implementing * this interface should read the resources from the reader * and store the java class files into the ResourceStore. * * The actual compilation language does not matter. But the * contract is that the result of the compilation will be a * class file. * * If possible the compiler should notify the optional * CompilationProblemHandler as soon as a problem is found. * * @author tcurdt */ public interface JavaCompiler { /** * Set the the handler that gets the notification of an error * or warning as soon as this information is available from * the compiler. * Note: Some compilers might not support this feature. * * @param pHandler */ void setCompilationProblemHandler( final CompilationProblemHandler pHandler ); /** * factory method to create the underlying default settings */ JavaCompilerSettings createDefaultSettings(); /** * uses the default compiler settings and the current classloader */ CompilationResult compile( final String[] pResourcePaths, final ResourceReader pReader, final ResourceStore pStore ); /** * uses the default compiler settings */ CompilationResult compile( final String[] pResourcePaths, final ResourceReader pReader, final ResourceStore pStore, final ClassLoader pClassLoader ); /** * Compiles the java resources "some/path/to/MyJava.java" * read through the ResourceReader and then stores the resulting * classes in the ResourceStore under "some/path/to/MyJava.class". * Note: As these are resource path you always have to use "/" * * The result of the compilation run including detailed error * information is returned as CompilationResult. If you need to * get notified already during the compilation process you can * register a CompilationProblemHandler. * Note: Not all compilers might support this notification mechanism. * * @param pResourcePaths * @param pReader * @param pStore * @param pClassLoader * @param pSettings * @return always a CompilationResult */ CompilationResult compile( final String[] pResourcePaths, final ResourceReader pReader, final ResourceStore pStore, final ClassLoader pClassLoader, final JavaCompilerSettings pSettings ); } commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/compilers/JavaCompilerFactory.java100644 0 0 5721 12204235717 30075 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.compilers; import java.util.HashMap; import java.util.Map; import org.apache.commons.jci.utils.ConversionUtils; /** * Creates JavaCompilers * * TODO use META-INF discovery mechanism * * @author tcurdt */ public final class JavaCompilerFactory { /** * @deprecated will be remove after the next release, please create an instance yourself */ @Deprecated private static final JavaCompilerFactory INSTANCE = new JavaCompilerFactory(); private final Map> classCache = new HashMap>(); /** * @deprecated will be remove after the next release, please create an instance yourself */ @Deprecated public static JavaCompilerFactory getInstance() { return JavaCompilerFactory.INSTANCE; } /** * Tries to guess the class name by convention. So for compilers * following the naming convention * * org.apache.commons.jci.compilers.SomeJavaCompiler * * you can use the short-hands "some"/"Some"/"SOME". Otherwise * you have to provide the full class name. The compiler is * getting instanciated via (cached) reflection. * * @param pHint * @return JavaCompiler or null */ public JavaCompiler createCompiler(final String pHint) { final String className; if (pHint.indexOf('.') < 0) { className = "org.apache.commons.jci.compilers." + ConversionUtils.toJavaCasing(pHint) + "JavaCompiler"; } else { className = pHint; } Class clazz = classCache.get(className); if (clazz == null) { try { clazz = Class.forName(className); classCache.put(className, clazz); } catch (ClassNotFoundException e) { clazz = null; } } if (clazz == null) { return null; } try { return (JavaCompiler) clazz.newInstance(); } catch (Throwable t) { return null; } } } commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/compilers/JavaCompilerSettings.java100644 0 0 6276 12204235717 30274 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.compilers; /** * Most common denominator for JavaCompiler settings. * * If you need more specific settings you have to provide * the native compiler configurations to the compilers. * Writing of a custom factory is suggested. * * @author tcurdt */ public class JavaCompilerSettings { private String targetVersion = "1.4"; private String sourceVersion = "1.4"; private String sourceEncoding = "UTF-8"; private boolean warnings = false; private boolean deprecations = false; private boolean debug = false; /** @deprecated */ @Deprecated private boolean verbose = false; public JavaCompilerSettings() { } public JavaCompilerSettings( final JavaCompilerSettings pSettings ) { targetVersion = pSettings.targetVersion; sourceVersion = pSettings.sourceVersion; sourceEncoding = pSettings.sourceEncoding; warnings = pSettings.warnings; deprecations = pSettings.deprecations; debug = pSettings.debug; } public void setTargetVersion( final String pTargetVersion ) { targetVersion = pTargetVersion; } public String getTargetVersion() { return targetVersion; } public void setSourceVersion( final String pSourceVersion ) { sourceVersion = pSourceVersion; } public String getSourceVersion() { return sourceVersion; } public void setSourceEncoding( final String pSourceEncoding ) { sourceEncoding = pSourceEncoding; } public String getSourceEncoding() { return sourceEncoding; } public void setWarnings( final boolean pWarnings ) { warnings = pWarnings; } public boolean isWarnings() { return warnings; } public void setDeprecations( final boolean pDeprecations ) { deprecations = pDeprecations; } public boolean isDeprecations() { return deprecations; } public void setDebug( final boolean pDebug ) { debug = pDebug; } public boolean isDebug() { return debug; } /** @deprecated */ @Deprecated public void setVerbose( final boolean pVerbose ) { verbose = pVerbose; } /** @deprecated */ @Deprecated public boolean isVerbose() { return verbose; } } commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/compilers/package.html100644 0 0 1626 10627343175 25614 0ustar 0 0 Interfaces and abstract classes for the compiler abstraction itself. commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/listeners/CompilingListener.java100644 0 0 16031 12204234514 27641 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.listeners; import java.io.File; import java.util.ArrayList; import java.util.Collection; import org.apache.commons.jci.compilers.CompilationResult; import org.apache.commons.jci.compilers.JavaCompiler; import org.apache.commons.jci.compilers.JavaCompilerFactory; import org.apache.commons.jci.monitor.FilesystemAlterationObserver; import org.apache.commons.jci.problems.CompilationProblem; import org.apache.commons.jci.readers.FileResourceReader; import org.apache.commons.jci.readers.ResourceReader; import org.apache.commons.jci.stores.MemoryResourceStore; import org.apache.commons.jci.stores.ResourceStore; import org.apache.commons.jci.stores.TransactionalResourceStore; import org.apache.commons.jci.utils.ConversionUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * A CompilingListener is an improved version of the ReloadingListener. * It even compiles the classes from source before doing the reloading. * * @author tcurdt */ public class CompilingListener extends ReloadingListener { private final Log log = LogFactory.getLog(CompilingListener.class); private final JavaCompiler compiler; private final TransactionalResourceStore transactionalStore; private ResourceReader reader; private CompilationResult lastResult; public CompilingListener() { this(new JavaCompilerFactory().createCompiler("eclipse")); } public CompilingListener( final JavaCompiler pCompiler ) { this(pCompiler, new TransactionalResourceStore(new MemoryResourceStore())); } public CompilingListener( final JavaCompiler pCompiler, final TransactionalResourceStore pTransactionalStore ) { super(pTransactionalStore); compiler = pCompiler; transactionalStore = pTransactionalStore; lastResult = null; } public JavaCompiler getCompiler() { return compiler; } public String getSourceFileExtension() { return ".java"; } public ResourceReader getReader( final FilesystemAlterationObserver pObserver ) { return new FileResourceReader(pObserver.getRootDirectory()); } public String getSourceNameFromFile( final FilesystemAlterationObserver pObserver, final File pFile ) { return ConversionUtils.stripExtension(ConversionUtils.getResourceNameFromFileName(ConversionUtils.relative(pObserver.getRootDirectory(), pFile))) + getSourceFileExtension(); } @Override public ResourceStore getStore() { return transactionalStore; } public synchronized CompilationResult getCompilationResult() { return lastResult; } @Override public void onStart( final FilesystemAlterationObserver pObserver ) { super.onStart(pObserver); reader = getReader(pObserver); transactionalStore.onStart(); } public String[] getResourcesToCompile( final FilesystemAlterationObserver pObserver ) { final Collection created = getCreatedFiles(); final Collection changed = getChangedFiles(); final Collection resourceNames = new ArrayList(); for (File createdFile : created) { if (createdFile.getName().endsWith(getSourceFileExtension())) { resourceNames.add(getSourceNameFromFile(pObserver, createdFile)); } } for (File changedFile : changed) { if (changedFile.getName().endsWith(getSourceFileExtension())) { resourceNames.add(getSourceNameFromFile(pObserver, changedFile)); } } final String[] result = new String[resourceNames.size()]; resourceNames.toArray(result); return result; } @Override public boolean isReloadRequired( final FilesystemAlterationObserver pObserver ) { boolean reload = false; final Collection created = getCreatedFiles(); final Collection changed = getChangedFiles(); final Collection deleted = getDeletedFiles(); log.debug("created:" + created.size() + " changed:" + changed.size() + " deleted:" + deleted.size() + " resources"); if (deleted.size() > 0) { for (File deletedFile : deleted) { final String resourceName = ConversionUtils.getResourceNameFromFileName(ConversionUtils.relative(pObserver.getRootDirectory(), deletedFile)); if (resourceName.endsWith(getSourceFileExtension())) { // if source resource got removed delete the corresponding class transactionalStore.remove(ConversionUtils.stripExtension(resourceName) + ".class"); } else { // ordinary resource to be removed transactionalStore.remove(resourceName); } // FIXME: does not remove nested classes } reload = true; } final String[] resourcesToCompile = getResourcesToCompile(pObserver); if (resourcesToCompile.length > 0) { log.debug(resourcesToCompile.length + " classes to compile"); final CompilationResult result = compiler.compile(resourcesToCompile, reader, transactionalStore); synchronized(this) { lastResult = result; } final CompilationProblem[] errors = result.getErrors(); final CompilationProblem[] warnings = result.getWarnings(); log.debug(errors.length + " errors, " + warnings.length + " warnings"); if (errors.length > 0) { // FIXME: they need to be marked for re-compilation // and then added as compileables again for (int j = 0; j < resourcesToCompile.length; j++) { transactionalStore.remove(resourcesToCompile[j]); } } reload = true; } return reload; } } commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/listeners/FileChangeListener.java100644 0 0 4076 12204234514 27673 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.listeners; import java.io.File; import org.apache.commons.jci.monitor.FilesystemAlterationObserver; /** * The most simple implemenation of an FilesystemAlterationListener. * * @author tcurdt */ public class FileChangeListener extends AbstractFilesystemAlterationListener { private boolean changed; public boolean hasChanged() { return changed; } @Override public void onStart( final FilesystemAlterationObserver pObserver ) { changed = false; super.onStart(pObserver); } @Override public void onStop( final FilesystemAlterationObserver pObserver ) { super.onStop(pObserver); } @Override public void onFileChange( final File pFile ) { changed = true; } @Override public void onFileCreate( final File pFile ) { changed = true; } @Override public void onFileDelete( final File pFile ) { changed = true; } @Override public void onDirectoryChange( final File pDir ) { } @Override public void onDirectoryCreate( final File pDir ) { } @Override public void onDirectoryDelete( final File pDir ) { } } commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/listeners/package.html100644 0 0 1656 10627343175 25632 0ustar 0 0 Special FAM listeners for just collecting FAM statistics, to compilation or class reloading. commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/listeners/ReloadingListener.java100644 0 0 13267 12204234514 27634 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.listeners; import java.io.File; import java.io.FileInputStream; import java.util.Collection; import java.util.HashSet; import java.util.Set; import org.apache.commons.io.IOUtils; import org.apache.commons.jci.ReloadingClassLoader; import org.apache.commons.jci.monitor.FilesystemAlterationObserver; import org.apache.commons.jci.stores.MemoryResourceStore; import org.apache.commons.jci.stores.ResourceStore; import org.apache.commons.jci.stores.Transactional; import org.apache.commons.jci.utils.ConversionUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * This Listener waits for FAM events to trigger a reload of classes * or resources. * * @author tcurdt */ public class ReloadingListener extends AbstractFilesystemAlterationListener { private final Log log = LogFactory.getLog(ReloadingListener.class); private final Set notificationListeners = new HashSet(); private final ResourceStore store; public ReloadingListener() { this(new MemoryResourceStore()); } public ReloadingListener( final ResourceStore pStore ) { store = pStore; } public ResourceStore getStore() { return store; } public void addReloadNotificationListener( final ReloadNotificationListener pNotificationListener ) { notificationListeners.add(pNotificationListener); if (pNotificationListener instanceof ReloadingClassLoader) { ((ReloadingClassLoader)pNotificationListener).addResourceStore(store); } } public boolean isReloadRequired( final FilesystemAlterationObserver pObserver ) { boolean reload = false; final Collection created = getCreatedFiles(); final Collection changed = getChangedFiles(); final Collection deleted = getDeletedFiles(); log.debug("created:" + created.size() + " changed:" + changed.size() + " deleted:" + deleted.size() + " resources"); if (deleted.size() > 0) { for (File file : deleted) { final String resourceName = ConversionUtils.getResourceNameFromFileName(ConversionUtils.relative(pObserver.getRootDirectory(), file)); store.remove(resourceName); } reload = true; } if (created.size() > 0) { for (File file : created) { FileInputStream is = null; try { is = new FileInputStream(file); final byte[] bytes = IOUtils.toByteArray(is); final String resourceName = ConversionUtils.getResourceNameFromFileName(ConversionUtils.relative(pObserver.getRootDirectory(), file)); store.write(resourceName, bytes); } catch(final Exception e) { log.error("could not load " + file, e); } finally { IOUtils.closeQuietly(is); } } } if (changed.size() > 0) { for (File file : changed) { FileInputStream is = null; try { is = new FileInputStream(file); final byte[] bytes = IOUtils.toByteArray(is); final String resourceName = ConversionUtils.getResourceNameFromFileName(ConversionUtils.relative(pObserver.getRootDirectory(), file)); store.write(resourceName, bytes); } catch(final Exception e) { log.error("could not load " + file, e); } finally { IOUtils.closeQuietly(is); } } reload = true; } return reload; } @Override public void onStop( final FilesystemAlterationObserver pObserver ) { if (store instanceof Transactional) { ((Transactional)store).onStart(); } final boolean reload = isReloadRequired(pObserver); if (store instanceof Transactional) { ((Transactional)store).onStop(); } if (reload) { notifyReloadNotificationListeners(); } super.onStop(pObserver); } void notifyReloadNotificationListeners() { for (ReloadNotificationListener listener : notificationListeners) { log.debug("notifying listener " + listener); listener.handleNotification(); } } @Override public void onDirectoryCreate( final File pDir ) { } @Override public void onDirectoryChange( final File pDir ) { } @Override public void onDirectoryDelete( final File pDir ) { } } ././@LongLink100644 0 0 150 12225263274 10254 Lustar 0 0 commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/listeners/ReloadNotificationListener.javacommons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/listeners/ReloadNotificationListener.j100644 0 0 2051 10613666121 30767 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.listeners; /** * Classes implementing this interface can get notified by ReloadingListeners * * @author tcurdt */ public interface ReloadNotificationListener { void handleNotification(); } commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/package.html100644 0 0 1516 10627343175 23615 0ustar 0 0 commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/problems/CompilationProblem.java100644 0 0 3635 12204154473 27617 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.problems; /** * An abstract definition of a compilation problem * * @author tcurdt */ public interface CompilationProblem { /** * is the problem an error and compilation cannot continue * or just a warning and compilation can proceed * * @return true if the problem is an error */ boolean isError(); /** * name of the file where the problem occurred * * @return name of the file where the problem occurred */ String getFileName(); /** * position of where the problem starts in the source code * * @return position of where the problem starts in the source code */ int getStartLine(); int getStartColumn(); /** * position of where the problem stops in the source code * * @return position of where the problem stops in the source code */ int getEndLine(); int getEndColumn(); /** * the description of the problem * * @return the description of the problem */ String getMessage(); }././@LongLink100644 0 0 146 12225263274 10261 Lustar 0 0 commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/problems/CompilationProblemHandler.javacommons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/problems/CompilationProblemHandler.jav100644 0 0 2610 10613666121 30744 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.problems; /** * A CompilationProblemHandler gets access to a problem * as soon as the problem is available while the * CompilationResult only represents a summary at the * end. * The handler can be used to asynchronously update a * GUI or stop compilation by returning false (e.g. * when a maximum number of erros has been reached) * * NOTE: * has to be supported by the compiler implementation!! * * @author tcurdt */ public interface CompilationProblemHandler { boolean handle( final CompilationProblem pProblem ); } commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/problems/package.html100644 0 0 1563 10627343175 25442 0ustar 0 0 Compilation problems and related. commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/readers/FileResourceReader.java100644 0 0 4520 12204235717 27327 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.readers; import java.io.File; import java.util.ArrayList; import java.util.List; import org.apache.commons.io.FileUtils; /** * A simple file system based Reader implementation * * @author tcurdt */ public final class FileResourceReader implements ResourceReader { private final File root; public FileResourceReader( final File pRoot ) { root = pRoot; } public boolean isAvailable( final String pResourceName ) { return new File(root, pResourceName).exists(); } public byte[] getBytes( final String pResourceName ) { try { return FileUtils.readFileToString(new File(root, pResourceName), "UTF-8").getBytes(); } catch(Exception e) { return null; } } /** * @deprecated */ @Deprecated public String[] list() { final List files = new ArrayList(); list(root, files); return files.toArray(new String[files.size()]); } /** * @deprecated */ @Deprecated private void list( final File pFile, final List pFiles ) { if (pFile.isDirectory()) { final File[] directoryFiles = pFile.listFiles(); for (int i = 0; i < directoryFiles.length; i++) { list(directoryFiles[i], pFiles); } } else { pFiles.add(pFile.getAbsolutePath().substring(root.getAbsolutePath().length()+1)); } } } commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/readers/MemoryResourceReader.java100644 0 0 4075 12204235717 27725 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.readers; import java.util.Map; import java.util.HashMap; /** * A memory based reader to compile from memory * * @author tcurdt */ public class MemoryResourceReader implements ResourceReader { private Map resources = null; public boolean isAvailable( final String pResourceName ) { if (resources == null) { return false; } return resources.containsKey(pResourceName); } public void add( final String pResourceName, final byte[] pContent ) { if (resources == null) { resources = new HashMap(); } resources.put(pResourceName, pContent); } public void remove( final String pResourceName ) { if (resources != null) { resources.remove(pResourceName); } } public byte[] getBytes( final String pResourceName ) { return resources.get(pResourceName); } /** * @deprecated */ @Deprecated public String[] list() { if (resources == null) { return new String[0]; } return resources.keySet().toArray(new String[resources.size()]); } } commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/readers/package.html100644 0 0 1561 10627343175 25242 0ustar 0 0 Readers to read resources from. commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/readers/ResourceReader.java100644 0 0 2135 10613666121 26526 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.readers; /** * A ResourceReader provide acces to resource like e.g. source code * * @author tcurdt */ public interface ResourceReader { boolean isAvailable( final String pResourceName ); byte[] getBytes( final String pResourceName ); } commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/ReloadingClassLoader.java100644 0 0 11064 12204235540 26224 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci; import java.io.InputStream; import java.net.URL; import org.apache.commons.jci.listeners.ReloadNotificationListener; import org.apache.commons.jci.stores.ResourceStore; import org.apache.commons.jci.stores.ResourceStoreClassLoader; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * The ReloadingClassLoader uses a delegation mechansim to allow * classes to be reloaded. That means that loadClass calls may * return different results if the class was changed in the underlying * ResourceStore. * * @author tcurdt */ public class ReloadingClassLoader extends ClassLoader implements ReloadNotificationListener { private final Log log = LogFactory.getLog(ReloadingClassLoader.class); private final ClassLoader parent; private ResourceStore[] stores = new ResourceStore[0]; private ClassLoader delegate; public ReloadingClassLoader( final ClassLoader pParent ) { super(pParent); parent = pParent; delegate = new ResourceStoreClassLoader(parent, stores); } public boolean addResourceStore( final ResourceStore pStore ) { try { final int n = stores.length; final ResourceStore[] newStores = new ResourceStore[n + 1]; System.arraycopy(stores, 0, newStores, 1, n); newStores[0] = pStore; stores = newStores; delegate = new ResourceStoreClassLoader(parent, stores); return true; } catch ( final RuntimeException e ) { log.error("could not add resource store " + pStore); } return false; } public boolean removeResourceStore( final ResourceStore pStore ) { final int n = stores.length; int i = 0; // FIXME: this should be improved with a Map // find the pStore and index position with var i while ( ( i < n ) && ( stores[i] != pStore ) ) { i++; } // pStore was not found if ( i == n ) { return false; } // if stores length > 1 then array copy old values, else create new empty store final ResourceStore[] newStores = new ResourceStore[n - 1]; if (i > 0) { System.arraycopy(stores, 0, newStores, 0, i); } if (i < n - 1) { System.arraycopy(stores, i + 1, newStores, i, (n - i - 1)); } stores = newStores; delegate = new ResourceStoreClassLoader(parent, stores); return true; } public void handleNotification() { log.debug("reloading"); delegate = new ResourceStoreClassLoader(parent, stores); } @Override public void clearAssertionStatus() { delegate.clearAssertionStatus(); } @Override public URL getResource(String name) { return delegate.getResource(name); } @Override public InputStream getResourceAsStream(String name) { return delegate.getResourceAsStream(name); } @Override public Class loadClass(String name) throws ClassNotFoundException { return delegate.loadClass(name); } @Override public void setClassAssertionStatus(String className, boolean enabled) { delegate.setClassAssertionStatus(className, enabled); } @Override public void setDefaultAssertionStatus(boolean enabled) { delegate.setDefaultAssertionStatus(enabled); } @Override public void setPackageAssertionStatus(String packageName, boolean enabled) { delegate.setPackageAssertionStatus(packageName, enabled); } } commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/stores/FileResourceStore.java100644 0 0 6713 12207137163 27120 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.stores; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; import java.util.List; import org.apache.commons.io.IOUtils; /** * Stores the results on disk * * @author tcurdt */ public final class FileResourceStore implements ResourceStore { private final File root; public FileResourceStore( final File pFile ) { root = pFile; } public byte[] read( final String pResourceName ) { InputStream is = null; try { is = new FileInputStream(getFile(pResourceName)); final byte[] data = IOUtils.toByteArray(is); return data; } catch (Exception e) { return null; } finally { IOUtils.closeQuietly(is); } } public void write( final String pResourceName, final byte[] pData ) { OutputStream os = null; try { final File file = getFile(pResourceName); final File parent = file.getParentFile(); if (!parent.mkdirs() && !parent.isDirectory()) { throw new IOException("could not create" + parent); } os = new FileOutputStream(file); os.write(pData); } catch (Exception e) { // FIXME: now what? } finally { IOUtils.closeQuietly(os); } } public void remove( final String pResourceName ) { getFile(pResourceName).delete(); } private File getFile( final String pResourceName ) { final String fileName = pResourceName.replace('/', File.separatorChar); return new File(root, fileName); } /** * @deprecated */ @Deprecated public String[] list() { final List files = new ArrayList(); list(root, files); return files.toArray(new String[files.size()]); } /** * @deprecated */ @Deprecated private void list(final File pFile, final List pFiles) { if (pFile.isDirectory()) { final File[] directoryFiles = pFile.listFiles(); for (int i=0; i < directoryFiles.length; i++) { list(directoryFiles[i], pFiles); } } else { pFiles.add(pFile.getAbsolutePath().substring(root.getAbsolutePath().length()+1)); } } @Override public String toString() { return this.getClass().getName() + root.toString(); } } commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/stores/MemoryResourceStore.java100644 0 0 4523 12204453271 27504 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.stores; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * Store just in memory * * @author tcurdt */ public final class MemoryResourceStore implements ResourceStore { private final Log log = LogFactory.getLog(MemoryResourceStore.class); private final Map store = new HashMap(); public byte[] read( final String pResourceName ) { log.debug("reading resource " + pResourceName); return store.get(pResourceName); } public void write( final String pResourceName, final byte[] pData ) { log.debug("writing resource " + pResourceName + "(" + pData.length + ")"); store.put(pResourceName, pData); } public void remove( final String pResourceName ) { log.debug("removing resource " + pResourceName); store.remove(pResourceName); } /** * @deprecated */ @Deprecated public String[] list() { if (store == null) { return new String[0]; } final List names = new ArrayList(); for (String name : store.keySet()) { names.add(name); } return names.toArray(new String[store.size()]); } @Override public String toString() { return this.getClass().getName() + store.toString(); } } commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/stores/package.html100644 0 0 1575 10627343175 25141 0ustar 0 0 Stores to store the compilation results in. commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/stores/ResourceStore.java100644 0 0 2272 10660136044 26312 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.stores; /** * A Store is where the compilers are storing the results * * @author tcurdt */ public interface ResourceStore { void write( final String pResourceName, final byte[] pResourceData ); byte[] read( final String pResourceName ); //FIXME: return the result of the remove void remove( final String pResourceName ); } commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/stores/ResourceStoreClassLoader.java100644 0 0 6640 12204235540 30427 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.stores; import org.apache.commons.jci.utils.ConversionUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * A ClassLoader backed by an array of ResourceStores * * @author tcurdt */ public final class ResourceStoreClassLoader extends ClassLoader { private final Log log = LogFactory.getLog(ResourceStoreClassLoader.class); private final ResourceStore[] stores; public ResourceStoreClassLoader( final ClassLoader pParent, final ResourceStore[] pStores ) { super(pParent); stores = new ResourceStore[pStores.length]; System.arraycopy(pStores, 0, stores, 0, stores.length); } private Class fastFindClass(final String name) { if (stores != null) { for (ResourceStore store : stores) { final byte[] clazzBytes = store.read(ConversionUtils.convertClassToResourcePath(name)); if (clazzBytes != null) { log.debug(getId() + " found class: " + name + " (" + clazzBytes.length + " bytes)"); return defineClass(name, clazzBytes, 0, clazzBytes.length); } } } return null; } @Override protected synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException { // log.debug(getId() + " looking for: " + name); Class clazz = findLoadedClass(name); if (clazz == null) { clazz = fastFindClass(name); if (clazz == null) { final ClassLoader parent = getParent(); if (parent != null) { clazz = parent.loadClass(name); // log.debug(getId() + " delegating loading to parent: " + name); } else { throw new ClassNotFoundException(name); } } else { log.debug(getId() + " loaded from store: " + name); } } if (resolve) { resolveClass(clazz); } return clazz; } @Override protected Class findClass( final String name ) throws ClassNotFoundException { final Class clazz = fastFindClass(name); if (clazz == null) { throw new ClassNotFoundException(name); } return clazz; } private String getId() { return "" + this + "[" + this.getClass().getClassLoader() + "]"; } } commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/stores/Transactional.java100644 0 0 1761 10602276107 26313 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.stores; /** * Receive start/stop events * * @author tcurdt */ public interface Transactional { void onStart(); void onStop(); } ././@LongLink100644 0 0 145 12225263274 10260 Lustar 0 0 commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/stores/TransactionalResourceStore.javacommons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/stores/TransactionalResourceStore.java100644 0 0 3414 12204234514 31031 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.stores; /** * A TransactionalResourceStore get signals of the compilation process as a whole. * When it started and when the compiler finished. * * @author tcurdt */ public class TransactionalResourceStore implements ResourceStore, Transactional { private final ResourceStore store; public TransactionalResourceStore( final ResourceStore pStore ) { store = pStore; } public void onStart() { } public void onStop() { } public byte[] read( final String pResourceName ) { return store.read(pResourceName); } public void remove( final String pResourceName ) { store.remove(pResourceName); } public void write( final String pResourceName, final byte[] pResourceData ) { store.write(pResourceName, pResourceData); } @Override public String toString() { return store.toString(); } } commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/utils/ConversionUtils.java100644 0 0 6436 12204154473 26505 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.utils; import java.io.File; import java.util.Locale; /** * Mainly common path manipultation helper methods * NOT FOR USE OUTSIDE OF JCI * * @author tcurdt */ public final class ConversionUtils { /** * Please do not use - internal * org/my/Class.xxx -> org.my.Class */ public static String convertResourceToClassName( final String pResourceName ) { return ConversionUtils.stripExtension(pResourceName).replace('/', '.'); } /** * Please do not use - internal * org.my.Class -> org/my/Class.class */ public static String convertClassToResourcePath( final String pName ) { return pName.replace('.', '/') + ".class"; } /** * Please do not use - internal * org/my/Class.xxx -> org/my/Class */ public static String stripExtension( final String pResourceName ) { final int i = pResourceName.lastIndexOf('.'); if (i < 0) { return pResourceName; } final String withoutExtension = pResourceName.substring(0, i); return withoutExtension; } public static String toJavaCasing(final String pName) { final char[] name = pName.toLowerCase(Locale.US).toCharArray(); name[0] = Character.toUpperCase(name[0]); return new String(name); } /* public static String clazzName( final File base, final File file ) { final int rootLength = base.getAbsolutePath().length(); final String absFileName = file.getAbsolutePath(); final int p = absFileName.lastIndexOf('.'); final String relFileName = absFileName.substring(rootLength + 1, p); final String clazzName = relFileName.replace(File.separatorChar, '.'); return clazzName; } */ public static String relative( final File base, final File file ) { final int rootLength = base.getAbsolutePath().length(); final String absFileName = file.getAbsolutePath(); final String relFileName = absFileName.substring(rootLength + 1); return relFileName; } /** * a/b/c.java -> a/b/c.java * a\b\c.java -> a/b/c.java * @param pFileName * @return the converted name */ public static String getResourceNameFromFileName( final String pFileName ) { if ('/' == File.separatorChar) { return pFileName; } return pFileName.replace(File.separatorChar, '/'); } } commons-jci-1.1-src/core/src/main/java/org/apache/commons/jci/utils/package.html100644 0 0 1533 10627343175 24754 0ustar 0 0 Utilities commons-jci-1.1-src/core/src/main/resources/LICENSE.txt100644 0 0 26446 10607602354 20044 0ustar 0 0 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. commons-jci-1.1-src/core/src/main/resources/NOTICE.txt100644 0 0 270 12225261512 17661 0ustar 0 0 Apache Commons JCI - Core Copyright 2004-2013 The Apache Software Foundation This product includes software developed by The Apache Software Foundation (http://www.apache.org/). commons-jci-1.1-src/core/src/site/site.xml100644 0 0 2350 10653675705 15674 0ustar 0 0 Apache Commons JCI ROOT jci-logo-white.png http://commons.apache.org/jci/ commons-jci-1.1-src/core/src/test/java/org/apache/commons/jci/AbstractTestCase.java100644 0 0 7465 12207137163 25434 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci; import java.io.File; import java.io.FileOutputStream; import java.io.FileWriter; import java.io.IOException; import junit.framework.TestCase; import org.apache.commons.io.FileUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * * @author tcurdt */ public abstract class AbstractTestCase extends TestCase { private final Log log = LogFactory.getLog(AbstractTestCase.class); protected File directory; @Override protected void setUp() throws Exception { System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog"); directory = createTempDirectory(); assertTrue(directory.exists()); assertTrue(directory.isDirectory()); } protected File createDirectory( final String pName ) throws Exception { final File newDirectory = new File(directory, pName); assertTrue(newDirectory.mkdir()); assertTrue(newDirectory.exists()); assertTrue(newDirectory.isDirectory()); return newDirectory; } protected File writeFile( final String pName, final byte[] pData ) throws Exception { final File file = new File(directory, pName); final File parent = file.getParentFile(); if (!parent.mkdirs() && !parent.isDirectory()) { throw new IOException("could not create" + parent); } log.debug("writing file " + pName + " (" + pData.length + " bytes)"); final FileOutputStream os = new FileOutputStream(file); os.write(pData); os.close(); assertTrue(file.exists()); assertTrue(file.isFile()); return file; } protected File writeFile( final String pName, final String pText ) throws Exception { final File file = new File(directory, pName); final File parent = file.getParentFile(); if (!parent.mkdirs() && !parent.isDirectory()) { throw new IOException("could not create" + parent); } log.debug("writing " + file); final FileWriter writer = new FileWriter(file); writer.write(pText); writer.close(); assertTrue(file.exists()); assertTrue(file.isFile()); return file; } protected void delay() { try { Thread.sleep(1500); } catch (final InterruptedException e) { } } protected File createTempDirectory() throws IOException { final File tempFile = File.createTempFile("jci", null); if (!tempFile.delete()) { throw new IOException(); } if (!tempFile.mkdir()) { throw new IOException(); } return tempFile; } @Override protected void tearDown() throws Exception { FileUtils.deleteDirectory(directory); } } commons-jci-1.1-src/core/src/test/java/org/apache/commons/jci/classes/ExtendedDump.java100644 0 0 6122 11134670534 26247 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.classes; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.Label; import org.objectweb.asm.MethodVisitor; import org.objectweb.asm.Opcodes; public class ExtendedDump implements Opcodes { public static byte[] dump() throws Exception { ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS); MethodVisitor mv; cw.visit(V1_4, ACC_PUBLIC + ACC_SUPER, "jci/Extended", null, "jci/Simple", null); cw.visitSource("Extended.java", null); { mv = cw.visitMethod(ACC_PUBLIC, "", "()V", null, null); mv.visitCode(); Label l0 = new Label(); mv.visitLabel(l0); mv.visitLineNumber(3, l0); mv.visitVarInsn(ALOAD, 0); mv.visitMethodInsn(INVOKESPECIAL, "jci/Simple", "", "()V"); mv.visitInsn(RETURN); Label l1 = new Label(); mv.visitLabel(l1); mv.visitLocalVariable("this", "Ljci/Extended;", null, l0, l1, 0); mv.visitMaxs(1, 1); mv.visitEnd(); } { mv = cw.visitMethod(ACC_PUBLIC, "toString", "()Ljava/lang/String;", null, null); mv.visitCode(); Label l0 = new Label(); mv.visitLabel(l0); mv.visitLineNumber(6, l0); mv.visitTypeInsn(NEW, "java/lang/StringBuffer"); mv.visitInsn(DUP); mv.visitLdcInsn("Extended:"); mv.visitMethodInsn(INVOKESPECIAL, "java/lang/StringBuffer", "", "(Ljava/lang/String;)V"); mv.visitVarInsn(ALOAD, 0); mv.visitMethodInsn(INVOKESPECIAL, "jci/Simple", "toString", "()Ljava/lang/String;"); mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuffer", "append", "(Ljava/lang/String;)Ljava/lang/StringBuffer;"); mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuffer", "toString", "()Ljava/lang/String;"); mv.visitInsn(ARETURN); Label l1 = new Label(); mv.visitLabel(l1); mv.visitLocalVariable("this", "Ljci/Extended;", null, l0, l1, 0); mv.visitMaxs(3, 1); mv.visitEnd(); } cw.visitEnd(); return cw.toByteArray(); } } commons-jci-1.1-src/core/src/test/java/org/apache/commons/jci/classes/SimpleDump.java100644 0 0 5023 11134670534 25737 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.classes; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.Label; import org.objectweb.asm.MethodVisitor; import org.objectweb.asm.Opcodes; public class SimpleDump implements Opcodes { public static byte[] dump( final String to ) throws Exception { ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS); MethodVisitor mv; cw.visit(V1_4, ACC_PUBLIC + ACC_SUPER, "jci/Simple", null, "java/lang/Object", null); cw.visitSource("Simple.java", null); { mv = cw.visitMethod(ACC_PUBLIC, "", "()V", null, null); mv.visitCode(); Label l0 = new Label(); mv.visitLabel(l0); mv.visitLineNumber(3, l0); mv.visitVarInsn(ALOAD, 0); mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "", "()V"); mv.visitInsn(RETURN); Label l1 = new Label(); mv.visitLabel(l1); mv.visitLocalVariable("this", "Ljci/Simple;", null, l0, l1, 0); mv.visitMaxs(1, 1); mv.visitEnd(); } { mv = cw.visitMethod(ACC_PUBLIC, "toString", "()Ljava/lang/String;", null, null); mv.visitCode(); Label l0 = new Label(); mv.visitLabel(l0); mv.visitLineNumber(6, l0); mv.visitLdcInsn(to); mv.visitInsn(ARETURN); Label l1 = new Label(); mv.visitLabel(l1); mv.visitLocalVariable("this", "Ljci/Simple;", null, l0, l1, 0); mv.visitMaxs(1, 1); mv.visitEnd(); } cw.visitEnd(); return cw.toByteArray(); } } ././@LongLink100644 0 0 146 12225263274 10261 Lustar 0 0 commons-jci-1.1-src/core/src/test/java/org/apache/commons/jci/compilers/AbstractCompilerTestCase.javacommons-jci-1.1-src/core/src/test/java/org/apache/commons/jci/compilers/AbstractCompilerTestCase.jav100644 0 0 35045 12205113045 30765 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.compilers; import java.util.HashMap; import java.util.Map; import junit.framework.TestCase; import org.apache.commons.jci.problems.CompilationProblem; import org.apache.commons.jci.readers.ResourceReader; import org.apache.commons.jci.stores.MemoryResourceStore; /** * Providing convenience methods for JavaCompiler TestCases * * @author tcurdt */ public abstract class AbstractCompilerTestCase extends TestCase { public abstract JavaCompiler createJavaCompiler(); public abstract String getCompilerName(); public void testFactoryCreation() { final JavaCompiler factoryCompiler = new JavaCompilerFactory().createCompiler(getCompilerName()); assertNotNull(factoryCompiler); final JavaCompiler compiler = createJavaCompiler(); assertEquals(factoryCompiler.getClass().getName(), compiler.getClass().getName()); } public void testSimpleCompile() throws Exception { final JavaCompiler compiler = createJavaCompiler(); final ResourceReader reader = new ResourceReader() { final private Map sources = new HashMap() { private static final long serialVersionUID = 1L; { put("jci/Simple.java", ( "package jci;\n" + "public class Simple {\n" + " public String toString() {\n" + " return \"Simple\";\n" + " }\n" + "}").getBytes()); }}; public byte[] getBytes( final String pResourceName ) { return sources.get(pResourceName); } public boolean isAvailable( final String pResourceName ) { return sources.containsKey(pResourceName); } }; final MemoryResourceStore store = new MemoryResourceStore(); final CompilationResult result = compiler.compile( new String[] { "jci/Simple.java" }, reader, store); assertEquals(toString(result.getErrors()), 0, result.getErrors().length); assertEquals(toString(result.getWarnings()), 0, result.getWarnings().length); final byte[] clazzBytes = store.read("jci/Simple.class"); assertNotNull("jci/Simple.class is not null",clazzBytes); assertTrue("jci/Simple.class is not empty", clazzBytes.length > 0); } public void testExtendedCompile() throws Exception { final JavaCompiler compiler = createJavaCompiler(); final ResourceReader reader = new ResourceReader() { final private Map sources = new HashMap() { private static final long serialVersionUID = 1L; { put("jci/Simple.java", ( "package jci;\n" + "public class Simple {\n" + " public String toString() {\n" + " return \"Simple\";\n" + " }\n" + "}").getBytes()); put("jci/Extended.java", ( "package jci;\n" + "public class Extended extends Simple {\n" + " public String toString() {\n" + " return \"Extended\" + super.toString();\n" + " }\n" + "}").getBytes()); }}; public byte[] getBytes( final String pResourceName ) { return sources.get(pResourceName); } public boolean isAvailable( final String pResourceName ) { return sources.containsKey(pResourceName); } }; final MemoryResourceStore store = new MemoryResourceStore(); final CompilationResult result = compiler.compile( new String[] { "jci/Extended.java", "jci/Simple.java" }, reader, store); assertEquals(toString(result.getErrors()), 0, result.getErrors().length); assertEquals(toString(result.getWarnings()), 0, result.getWarnings().length); final byte[] clazzBytesSimple = store.read("jci/Simple.class"); assertNotNull("jci/Simple.class is not null", clazzBytesSimple); assertTrue("jci/Simple.class is not empty", clazzBytesSimple.length > 0); final byte[] clazzBytesExtended = store.read("jci/Extended.class"); assertNotNull("jci/Extended.class is not null", clazzBytesExtended); assertTrue("jci/Extended.class is not empty",clazzBytesExtended.length > 0); } public void testInternalClassCompile() throws Exception { final JavaCompiler compiler = createJavaCompiler(); final ResourceReader reader = new ResourceReader() { final private Map sources = new HashMap() { private static final long serialVersionUID = 1L; { put("jci/Simple.java", ( "package jci;\n" + "public class Simple {\n" + " private class Sub {\n" + " }\n" + " public String toString() {\n" + " new Sub();\n" + " return \"Simple\";\n" + " }\n" + "}").getBytes()); }}; public byte[] getBytes( final String pResourceName ) { return sources.get(pResourceName); } public boolean isAvailable( final String pResourceName ) { return sources.containsKey(pResourceName); } }; final MemoryResourceStore store = new MemoryResourceStore(); final CompilationResult result = compiler.compile( new String[] { "jci/Simple.java" }, reader, store); assertEquals(toString(result.getErrors()), 0, result.getErrors().length); assertEquals(toString(result.getWarnings()), 0, result.getWarnings().length); final byte[] clazzBytes = store.read("jci/Simple.class"); assertNotNull("jci/Simple.class is not null", clazzBytes); assertTrue("jci/Simple.class is not empty", clazzBytes.length > 0); final byte[] subClazzBytes = store.read("jci/Simple$Sub.class"); assertNotNull("jci/Simple$Sub.class is not null", subClazzBytes); assertTrue("jci/Simple$Sub.class is not empty", subClazzBytes.length > 0); } public void testUppercasePackageNameCompile() throws Exception { final JavaCompiler compiler = createJavaCompiler(); final ResourceReader reader = new ResourceReader() { final private Map sources = new HashMap() { private static final long serialVersionUID = 1L; { put("Jci/Simple.java", ( "package Jci;\n" + "public class Simple {\n" + " public String toString() {\n" + " return \"Simple\";\n" + " }\n" + "}").getBytes()); }}; public byte[] getBytes( final String pResourceName ) { return sources.get(pResourceName); } public boolean isAvailable( final String pResourceName ) { return sources.containsKey(pResourceName); } }; final MemoryResourceStore store = new MemoryResourceStore(); final CompilationResult result = compiler.compile( new String[] { "Jci/Simple.java" }, reader, store); assertEquals(toString(result.getErrors()), 0, result.getErrors().length); assertEquals(toString(result.getWarnings()), 0, result.getWarnings().length); final byte[] clazzBytes = store.read("Jci/Simple.class"); assertNotNull("Jci/Simple.class is not null", clazzBytes); assertTrue("Jci/Simple.class is not empty", clazzBytes.length > 0); } /* * https://issues.apache.org/jira/browse/JCI-53 */ public void testCrossReferenceCompilation() throws Exception { final String javaVersion = System.getProperty("java.version"); final JavaCompiler compiler = createJavaCompiler(); final ResourceReader reader = new ResourceReader() { final private Map sources = new HashMap() { private static final long serialVersionUID = 1L; { put("jci/Func1.java", ( "package jci;\n" + "import static jci.Func2.func2;" + "public class Func1 {\n" + " public static boolean func1() throws Exception {\n" + " return true;\n" + " }\n" + "}").getBytes()); put("jci/Func2.java", ( "package jci;\n" + "import static jci.Func1.func1;" + "public class Func2 {\n" + " public static boolean func2() throws Exception {\n" + " return true;\n" + " }\n" + "}").getBytes()); }}; public byte[] getBytes( final String pResourceName ) { return sources.get(pResourceName); } public boolean isAvailable( final String pResourceName ) { return sources.containsKey(pResourceName); } }; final JavaCompilerSettings settings = compiler.createDefaultSettings(); settings.setTargetVersion("1.5"); settings.setSourceVersion("1.5"); final MemoryResourceStore store = new MemoryResourceStore(); final CompilationResult result = compiler.compile( new String[] { "jci/Func1.java", "jci/Func2.java" }, reader, store, this.getClass().getClassLoader(), settings); assertEquals(toString(result.getErrors()), 0, result.getErrors().length); assertEquals(toString(result.getWarnings()), 0, result.getWarnings().length); final byte[] clazzBytesFunc1 = store.read("jci/Func1.class"); assertNotNull("jci/Func1.class is not null", clazzBytesFunc1); assertTrue("jci/Func1.class is not empty", clazzBytesFunc1.length > 0); final byte[] clazzBytesFunc2 = store.read("jci/Func2.class"); assertNotNull("jci/Func2.class is not null", clazzBytesFunc2); assertTrue("jci/Func2.class is not empty", clazzBytesFunc2.length > 0); } /* * https://issues.apache.org/jira/browse/JCI-59 */ public void testAdditionalTopLevelClassCompile() throws Exception { final JavaCompiler compiler = createJavaCompiler(); final ResourceReader reader = new ResourceReader() { final private Map sources = new HashMap() { private static final long serialVersionUID = 1L; { put("jci/Simple.java", ( "package jci;\n" + "public class Simple {\n" + " public String toString() {\n" + " return \"Simple\";\n" + " }\n" + "}\n" + "class AdditionalTopLevel {\n" + " public String toString() {\n" + " return \"AdditionalTopLevel\";\n" + " }\n" + "}").getBytes()); }}; public byte[] getBytes( final String pResourceName ) { return sources.get(pResourceName); } public boolean isAvailable( final String pResourceName ) { return sources.containsKey(pResourceName); } }; final MemoryResourceStore store = new MemoryResourceStore(); final CompilationResult result = compiler.compile( new String[] { "jci/Simple.java" }, reader, store); assertEquals("Unexpected errors(s): " + toString(result.getErrors()), 0, result.getErrors().length); final byte[] clazzBytes = store.read("jci/Simple.class"); assertNotNull("Expected to find jci/Simple.class", clazzBytes); assertTrue(clazzBytes.length > 0); final byte[] additionalTopLevelBytes = store.read("jci/AdditionalTopLevel.class"); assertNotNull("Expected to find jci/AdditionalTopLevel.class", additionalTopLevelBytes); assertTrue(additionalTopLevelBytes.length > 0); assertEquals("Unexpected warning(s): " + toString(result.getWarnings()), 0, result.getWarnings().length); } public final String toString( final CompilationProblem[] pProblems ) { final StringBuilder sb = new StringBuilder(); for (CompilationProblem problem : pProblems) { sb.append(problem.getMessage()).append(", "); } return sb.toString(); } } commons-jci-1.1-src/core/src/test/java/org/apache/commons/jci/CompilingClassLoaderTestCase.java100644 0 0 22115 12204234514 27727 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci; import java.io.File; import org.apache.commons.io.FileUtils; import org.apache.commons.jci.classes.ExtendedDump; import org.apache.commons.jci.classes.SimpleDump; import org.apache.commons.jci.compilers.CompilationResult; import org.apache.commons.jci.compilers.JavaCompiler; import org.apache.commons.jci.compilers.JavaCompilerSettings; import org.apache.commons.jci.listeners.CompilingListener; import org.apache.commons.jci.monitor.FilesystemAlterationMonitor; import org.apache.commons.jci.problems.CompilationProblem; import org.apache.commons.jci.problems.CompilationProblemHandler; import org.apache.commons.jci.readers.ResourceReader; import org.apache.commons.jci.stores.ResourceStore; import org.apache.commons.jci.utils.ConversionUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * * @author tcurdt */ public final class CompilingClassLoaderTestCase extends AbstractTestCase { private final Log log = LogFactory.getLog(CompilingClassLoaderTestCase.class); private ReloadingClassLoader classloader; private CompilingListener listener; private FilesystemAlterationMonitor fam; private final static class MockJavaCompiler implements JavaCompiler { private final Log log = LogFactory.getLog(MockJavaCompiler.class); public CompilationResult compile(String[] pResourcePaths, ResourceReader pReader, ResourceStore pStore, ClassLoader pClassLoader, JavaCompilerSettings pSettings ) { for (int i = 0; i < pResourcePaths.length; i++) { final String resourcePath = pResourcePaths[i]; final byte[] resourceContent = pReader.getBytes(resourcePath); log.debug("resource " + resourcePath + " = " + ((resourceContent!=null)?new String(resourceContent):null) ); final byte[] data; if ("jci/Simple.java".equals(resourcePath)) { try { data = SimpleDump.dump(new String(resourceContent)); } catch (Exception e) { throw new RuntimeException("cannot handle resource " + resourcePath, e); } } else if ("jci/Extended.java".equals(resourcePath)) { try { data = ExtendedDump.dump(); } catch (Exception e) { throw new RuntimeException("cannot handle resource " + resourcePath, e); } } else { throw new RuntimeException("cannot handle resource " + resourcePath); } log.debug("compiling " + resourcePath + " (" + data.length + ")"); pStore.write(ConversionUtils.stripExtension(resourcePath) + ".class", data); } return new CompilationResult(new CompilationProblem[0]); } public CompilationResult compile(String[] pResourcePaths, ResourceReader pReader, ResourceStore pStore, ClassLoader pClassLoader) { return compile(pResourcePaths, pReader, pStore, pClassLoader, null); } public CompilationResult compile(String[] pResourcePaths, ResourceReader pReader, ResourceStore pStore) { return compile(pResourcePaths, pReader, pStore, null); } public void setCompilationProblemHandler(CompilationProblemHandler pHandler) { } public JavaCompilerSettings createDefaultSettings() { return null; } } @Override protected void setUp() throws Exception { super.setUp(); classloader = new ReloadingClassLoader(this.getClass().getClassLoader()); listener = new CompilingListener(new MockJavaCompiler()); listener.addReloadNotificationListener(classloader); fam = new FilesystemAlterationMonitor(); fam.addListener(directory, listener); fam.start(); } private void initialCompile() throws Exception { log.debug("initial compile"); listener.waitForFirstCheck(); writeFile("jci/Simple.java", "Simple1"); writeFile("jci/Extended.java", "Extended"); log.debug("waiting for compile changes to get applied"); listener.waitForCheck(); log.debug("*** ready to test"); } public void testCreate() throws Exception { initialCompile(); log.debug("loading Simple"); final Object simple = classloader.loadClass("jci.Simple").newInstance(); assertEquals("Simple1", simple.toString()); log.debug("loading Extended"); final Object extended = classloader.loadClass("jci.Extended").newInstance(); assertEquals("Extended:Simple1", extended.toString()); } public void testChange() throws Exception { initialCompile(); final Object simple = classloader.loadClass("jci.Simple").newInstance(); assertEquals("Simple1", simple.toString()); final Object extended = classloader.loadClass("jci.Extended").newInstance(); assertEquals("Extended:Simple1", extended.toString()); delay(); writeFile("jci/Simple.java", "Simple2"); listener.waitForCheck(); final Object simple2 = classloader.loadClass("jci.Simple").newInstance(); assertEquals("Simple2", simple2.toString()); final Object newExtended = classloader.loadClass("jci.Extended").newInstance(); assertEquals("Extended:Simple2", newExtended.toString()); } public void testDelete() throws Exception { initialCompile(); final Object simple = classloader.loadClass("jci.Simple").newInstance(); assertEquals("Simple1", simple.toString()); final Object extended = classloader.loadClass("jci.Extended").newInstance(); assertEquals("Extended:Simple1", extended.toString()); listener.waitForCheck(); log.debug("deleting source file"); assertTrue(new File(directory, "jci/Extended.java").delete()); listener.waitForCheck(); log.debug("loading Simple"); final Object oldSimple = classloader.loadClass("jci.Simple").newInstance(); assertEquals("Simple1", oldSimple.toString()); log.debug("trying to loading Extended"); try { classloader.loadClass("jci.Extended").newInstance(); fail(); } catch(final ClassNotFoundException e) { assertEquals("jci.Extended", e.getMessage()); } log.debug("deleting whole directory"); FileUtils.deleteDirectory(new File(directory, "jci")); listener.waitForCheck(); log.debug("trying to loading Simple"); try { classloader.loadClass("jci.Simple").newInstance(); fail(); } catch(final ClassNotFoundException e) { assertEquals("jci.Simple", e.getMessage()); } } public void testDeleteDependency() throws Exception { initialCompile(); final Object simple = classloader.loadClass("jci.Simple").newInstance(); assertEquals("Simple1", simple.toString()); final Object extended = classloader.loadClass("jci.Extended").newInstance(); assertEquals("Extended:Simple1", extended.toString()); log.debug("deleting source file"); assertTrue(new File(directory, "jci/Simple.java").delete()); listener.waitForCheck(); log.debug("trying to load dependend class"); try { classloader.loadClass("jci.Extended").newInstance(); fail(); } catch(final NoClassDefFoundError e) { assertEquals("jci/Simple", e.getMessage()); } } @Override protected void tearDown() throws Exception { fam.removeListener(listener); fam.stop(); super.tearDown(); } } commons-jci-1.1-src/core/src/test/java/org/apache/commons/jci/readers/ResourceReaderTestCase.java100644 0 0 3650 10670640547 30227 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.readers; import org.apache.commons.jci.AbstractTestCase; /** * * @author tcurdt */ public final class ResourceReaderTestCase extends AbstractTestCase { public void testFileResourceReader() throws Exception { writeFile("test", "test"); checkRead(new FileResourceReader(directory)); } public void testMemoryResourceReader() throws Exception { final MemoryResourceReader reader = new MemoryResourceReader(); reader.add("test", "test".getBytes()); checkRead(reader); reader.remove(null); assertTrue(reader.isAvailable("test")); reader.remove("test"); assertFalse(reader.isAvailable("test")); } private void checkRead( final ResourceReader reader ) throws Exception { assertTrue(reader.isAvailable("test")); final byte[] content = reader.getBytes("test"); assertTrue(content != null); assertEquals("test", new String(content)); assertFalse(reader.isAvailable("bla")); assertTrue(reader.getBytes("bla") == null); } } ././@LongLink100644 0 0 146 12225263274 10261 Lustar 0 0 commons-jci-1.1-src/core/src/test/java/org/apache/commons/jci/ReloadingClassLoaderRemoveTestCase.javacommons-jci-1.1-src/core/src/test/java/org/apache/commons/jci/ReloadingClassLoaderRemoveTestCase.jav100644 0 0 26626 12204236020 30734 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci; import junit.framework.TestCase; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.commons.jci.classes.SimpleDump; import org.apache.commons.jci.stores.ResourceStore; import org.apache.commons.jci.stores.MemoryResourceStore; /** * Test ReloadingClassLoader's removeResourceStore({@link ResourceStore}) * method. */ public class ReloadingClassLoaderRemoveTestCase extends TestCase { private final Log log = LogFactory.getLog(ReloadingClassLoaderRemoveTestCase.class); private final byte[] clazzSimpleA; private MemoryResourceStore store1 = new MemoryResourceStore(); private MemoryResourceStore store2 = new MemoryResourceStore(); private MemoryResourceStore store3 = new MemoryResourceStore(); private MemoryResourceStore store4 = new MemoryResourceStore(); public ReloadingClassLoaderRemoveTestCase() throws Exception { clazzSimpleA = SimpleDump.dump("SimpleA"); assertTrue(clazzSimpleA.length > 0); } @Override protected void setUp() throws Exception { System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog"); } @Override protected void tearDown() throws Exception { } /** * Test trying to remove a ResourceStore from the ReloadingClassLoader * which can't be found - when the ClassLoader contains NO other ResourceStore. * * Bug: The While loop in the removeResourceStore() throws an ArrayOutOfBoundsException */ public void testRemoveStoreNotFoundClassLoaderNoStores() { ReloadingClassLoader loader = new ReloadingClassLoader(getClass().getClassLoader()); checkRemoveResourceStore("No ResourceStore", loader, store1, false); } /** * Test trying to remove a ResourceStore from the ReloadingClassLoader * which can't be found - when the ClassLoader DOES contain other ResourceStore. * * Bug: The While loop in the removeResourceStore() throws an ArrayOutOfBoundsException */ public void testRemoveStoreNotFoundClassLoaderHasStores() { ReloadingClassLoader loader = new ReloadingClassLoader(getClass().getClassLoader()); loader.addResourceStore(store1); loader.addResourceStore(store2); checkRemoveResourceStore("Has ResourceStore", loader, store3, false); } /** * Test trying to remove the first ResourceStore added * * Bug: ReloadingClassLoader addes ResourceStore at the start of the array. Removing the * first one added (last in array) causes the second System.arraycopy() statement to throw a * ArrayIndexOutOfBoundsException because the destination array position in the new smaller * array is too large. */ public void testRemoveStoresOne() { ReloadingClassLoader loader = new ReloadingClassLoader(getClass().getClassLoader()); loader.addResourceStore(store1); loader.addResourceStore(store2); loader.addResourceStore(store3); loader.addResourceStore(store4); checkRemoveResourceStore("One: Remove Store 1", loader, store1, true); checkRemoveResourceStore("One: Store 1 Not Found", loader, store1, false); checkRemoveResourceStore("One: Remove Store 2", loader, store2, true); checkRemoveResourceStore("One: Store 2 Not Found", loader, store2, false); checkRemoveResourceStore("One: Remove Store 3", loader, store3, true); checkRemoveResourceStore("One: Store 3 Not Found", loader, store3, false); checkRemoveResourceStore("One: Remove Store 4", loader, store4, true); checkRemoveResourceStore("One: Store 4 Not Found", loader, store4, false); } /** * Test trying to remove the second ResourceStore added * * Bug: ReloadingClassLoader addes ResourceStore at the start of the array. Removing the * first one added (last in array) causes the second System.arraycopy() statement to throw a * ArrayIndexOutOfBoundsException (??not sure why??) */ public void testRemoveStoresTwo() { ReloadingClassLoader loader = new ReloadingClassLoader(getClass().getClassLoader()); loader.addResourceStore(store1); loader.addResourceStore(store2); loader.addResourceStore(store3); loader.addResourceStore(store4); checkRemoveResourceStore("Two: Remove Store 2", loader, store2, true); checkRemoveResourceStore("Two: Store 2 Not Found", loader, store2, false); checkRemoveResourceStore("Two: Remove Store 4", loader, store4, true); checkRemoveResourceStore("Two: Store 4 Not Found", loader, store4, false); checkRemoveResourceStore("Two: Remove Store 3", loader, store3, true); checkRemoveResourceStore("Two: Store 3 Not Found", loader, store3, false); checkRemoveResourceStore("Two: Remove Store 1", loader, store1, true); checkRemoveResourceStore("Two: Store 1 Not Found", loader, store1, false); } /** * Test trying to remove the third ResourceStore added * * Bug: In this scenario the two System.arraycopy() statements don't copy the correct * ResourceStore - it creates a new array where the first resource store is null * and copies store3 and store2 to their same positions */ public void testRemoveStoresThree() { ReloadingClassLoader loader = new ReloadingClassLoader(getClass().getClassLoader()); loader.addResourceStore(store1); loader.addResourceStore(store2); loader.addResourceStore(store3); loader.addResourceStore(store4); checkRemoveResourceStore("Three: Remove Store 3", loader, store3, true); checkRemoveResourceStore("Three: Store 3 Not Found", loader, store3, false); checkRemoveResourceStore("Three: Remove Store 1", loader, store1, true); checkRemoveResourceStore("Three: Store 1 Not Found", loader, store1, false); checkRemoveResourceStore("Three: Remove Store 4", loader, store4, true); checkRemoveResourceStore("Three: Store 4 Not Found", loader, store4, false); checkRemoveResourceStore("Three: Remove Store 2", loader, store2, true); checkRemoveResourceStore("Three: Store 2 Not Found", loader, store2, false); } /** * Test trying to remove the fourth ResourceStore added * * Bug: ReloadingClassLoader addes ResourceStore at the start of the array. Removing the * last one added (first in array) causes the first System.arraycopy() statement to throw a * ArrayIndexOutOfBoundsException because the length to copy is -1 */ public void testRemoveStoresFour() { ReloadingClassLoader loader = new ReloadingClassLoader(getClass().getClassLoader()); loader.addResourceStore(store1); loader.addResourceStore(store2); loader.addResourceStore(store3); loader.addResourceStore(store4); checkRemoveResourceStore("Four: Remove Store 4", loader, store4, true); checkRemoveResourceStore("Four: Store 4 Not Found", loader, store4, false); checkRemoveResourceStore("Four: Remove Store 3", loader, store3, true); checkRemoveResourceStore("Four: Store 3 Not Found", loader, store3, false); checkRemoveResourceStore("Four: Remove Store 2", loader, store2, true); checkRemoveResourceStore("Four: Store 2 Not Found", loader, store2, false); checkRemoveResourceStore("Four: Remove Store 1", loader, store1, true); checkRemoveResourceStore("Four: Store 1 Not Found", loader, store1, false); } /** * Test that a class can't be loaded after the ResourceStore containing * it has been removed. * * Bug: When theres a single ResourceStore in the ClassLoader and its removed * a new "delegate" ClassLoader with the new ResourceStore array isn't being * created - which means that calling loadClass() still returns the classes * from the removed ResourceStore rather than throwing a ClassNotFoundException */ public void testLoadClassAfterResourceStoreRemoved() { // Create a class loader & add resource store ReloadingClassLoader loader = new ReloadingClassLoader(this.getClass().getClassLoader()); MemoryResourceStore store = new MemoryResourceStore(); loader.addResourceStore(store); // Check "jci.Simple" class can't be loaded try { loader.loadClass("jci.Simple").newInstance(); fail("Success loadClass[1]"); } catch(ClassNotFoundException e) { // expected not found } catch(Exception e) { log.error(e); fail("Error loadClass[1]: " + e); } // Add "jci.Simple" class to the resource store String toStringValue = "FooBar"; try { byte[] classBytes = SimpleDump.dump(toStringValue); store.write("jci/Simple.class", classBytes); } catch(Exception e) { log.error(e); fail("Error adding class to store: " + e); } // Check "jci.Simple" class can now be loaded try { Object simple2 = loader.loadClass("jci.Simple").newInstance(); assertNotNull("Found loadClass[2]", simple2); assertEquals("toString loadClass[2]", toStringValue, simple2.toString()); } catch(Exception e) { log.error(e); fail("Error loadClass[2]: " + e); } // Remove the resource store from the class loader checkRemoveResourceStore("Remove Resource Store", loader, store, true); // Test "jci.Simple" class can't be loaded after ResourceStore removed try { loader.loadClass("jci.Simple").newInstance(); fail("Success loadClass[3]"); } catch(ClassNotFoundException e) { // expected not found } catch(Exception e) { log.error(e); fail("Error loadClass[3]: " + e); } } /** * Check removing a ResourceStore from ReloadingClassLoader */ private void checkRemoveResourceStore(String label, ReloadingClassLoader loader, ResourceStore store, boolean expected) { try { assertEquals(label, expected, loader.removeResourceStore(store)); } catch(Exception e) { log.error(label, e); fail(label + " failed: " + e); } } } commons-jci-1.1-src/core/src/test/java/org/apache/commons/jci/ReloadingClassLoaderTestCase.java100644 0 0 13622 12204234514 27715 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci; import java.io.File; import org.apache.commons.jci.classes.ExtendedDump; import org.apache.commons.jci.classes.SimpleDump; import org.apache.commons.jci.listeners.ReloadingListener; import org.apache.commons.jci.monitor.FilesystemAlterationMonitor; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * * @author tcurdt */ public final class ReloadingClassLoaderTestCase extends AbstractTestCase { private final Log log = LogFactory.getLog(ReloadingClassLoaderTestCase.class); private ReloadingClassLoader classloader; private ReloadingListener listener; private FilesystemAlterationMonitor fam; private final byte[] clazzSimple1; private final byte[] clazzSimple2; private final byte[] clazzExtended; public ReloadingClassLoaderTestCase() throws Exception { clazzSimple1 = SimpleDump.dump("Simple1"); clazzSimple2 = SimpleDump.dump("Simple2"); clazzExtended = ExtendedDump.dump(); assertTrue(clazzSimple1.length > 0); assertTrue(clazzSimple2.length > 0); assertTrue(clazzExtended.length > 0); } @Override protected void setUp() throws Exception { super.setUp(); classloader = new ReloadingClassLoader(this.getClass().getClassLoader()); listener = new ReloadingListener(); listener.addReloadNotificationListener(classloader); fam = new FilesystemAlterationMonitor(); fam.addListener(directory, listener); fam.start(); } public void testCreate() throws Exception { listener.waitForFirstCheck(); log.debug("creating class"); writeFile("jci/Simple.class", clazzSimple1); listener.waitForCheck(); final Object simple = classloader.loadClass("jci.Simple").newInstance(); assertEquals("Simple1", simple.toString()); } public void testChange() throws Exception { listener.waitForFirstCheck(); log.debug("creating class"); writeFile("jci/Simple.class", clazzSimple1); listener.waitForCheck(); final Object simple1 = classloader.loadClass("jci.Simple").newInstance(); assertEquals("Simple1", simple1.toString()); log.debug("changing class"); writeFile("jci/Simple.class", clazzSimple2); listener.waitForEvent(); final Object simple2 = classloader.loadClass("jci.Simple").newInstance(); assertEquals("Simple2", simple2.toString()); } public void testDelete() throws Exception { listener.waitForFirstCheck(); log.debug("creating class"); writeFile("jci/Simple.class", clazzSimple1); listener.waitForCheck(); final Object simple = classloader.loadClass("jci.Simple").newInstance(); assertEquals("Simple1", simple.toString()); log.debug("deleting class"); assertTrue(new File(directory, "jci/Simple.class").delete()); listener.waitForEvent(); try { classloader.loadClass("jci.Simple").newInstance(); fail(); } catch(final ClassNotFoundException e) { assertEquals("jci.Simple", e.getMessage()); } } public void testDeleteDependency() throws Exception { listener.waitForFirstCheck(); log.debug("creating classes"); writeFile("jci/Simple.class", clazzSimple1); writeFile("jci/Extended.class", clazzExtended); listener.waitForCheck(); final Object simple = classloader.loadClass("jci.Simple").newInstance(); assertEquals("Simple1", simple.toString()); final Object extended = classloader.loadClass("jci.Extended").newInstance(); assertEquals("Extended:Simple1", extended.toString()); log.debug("deleting class dependency"); assertTrue(new File(directory, "jci/Simple.class").delete()); listener.waitForEvent(); try { classloader.loadClass("jci.Extended").newInstance(); fail(); } catch(final NoClassDefFoundError e) { assertEquals("jci/Simple", e.getMessage()); } } public void testClassNotFound() { try { classloader.loadClass("bla"); fail(); } catch(final ClassNotFoundException e) { } } public void testDelegation() { classloader.clearAssertionStatus(); classloader.setClassAssertionStatus("org.apache.commons.jci.ReloadingClassLoader", true); classloader.setDefaultAssertionStatus(false); classloader.setPackageAssertionStatus("org.apache.commons.jci", true); // FIXME: compare with delegation } @Override protected void tearDown() throws Exception { fam.removeListener(listener); fam.stop(); super.tearDown(); } } commons-jci-1.1-src/core/src/test/java/org/apache/commons/jci/stores/ResourceStoreTestCase.java100644 0 0 5054 12204370734 30004 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.stores; import org.apache.commons.jci.AbstractTestCase; import org.apache.commons.lang3.ArrayUtils; /** * * @author tcurdt */ public final class ResourceStoreTestCase extends AbstractTestCase { public void testMemoryResourceStore() { checkReadWrite(new MemoryResourceStore()); checkRemove(new MemoryResourceStore()); } public void testFileResourceStore() { checkReadWrite(new FileResourceStore(directory)); checkRemove(new FileResourceStore(directory)); } public void testTransactionalFileResourceStore() { checkReadWrite(new TransactionalResourceStore(new FileResourceStore(directory))); checkRemove(new TransactionalResourceStore(new FileResourceStore(directory))); final ResourceStore rs = new FileResourceStore(directory); final TransactionalResourceStore trs = new TransactionalResourceStore(rs); assertEquals(rs.toString(), trs.toString()); } private void checkReadWrite( final ResourceStore pStore ) { final byte[] data = { 1, 2, 3 }; pStore.write("key", data); final byte[] read = pStore.read("key"); assertTrue(read != null); assertTrue(ArrayUtils.isEquals(data, read)); } private void checkRemove( final ResourceStore pStore ) { final byte[] data = { 1, 2, 3 }; pStore.write("key", data); final byte[] read = pStore.read("key"); assertTrue(read != null); assertTrue(ArrayUtils.isEquals(data, read)); pStore.remove("key"); final byte[] empty = pStore.read("key"); assertTrue(empty == null); } } commons-jci-1.1-src/core/src/test/resources/simplelog.properties100644 0 0 155 10573617463 22323 0ustar 0 0 org.apache.commons.logging.simplelog.defaultlog=debug org.apache.commons.logging.simplelog.showdatetime=truecommons-jci-1.1-src/examples/src/ 40755 0 0 0 12060700107 14006 5ustar 0 0 commons-jci-1.1-src/examples/src/main/ 40755 0 0 0 12060700107 14732 5ustar 0 0 commons-jci-1.1-src/examples/src/main/java/ 40755 0 0 0 12060700107 15653 5ustar 0 0 commons-jci-1.1-src/examples/src/main/java/org/ 40755 0 0 0 12060700107 16442 5ustar 0 0 commons-jci-1.1-src/examples/src/main/java/org/apache/ 40755 0 0 0 12060700107 17663 5ustar 0 0 commons-jci-1.1-src/examples/src/main/java/org/apache/commons/ 40755 0 0 0 12060700107 21336 5ustar 0 0 commons-jci-1.1-src/examples/src/main/java/org/apache/commons/jci/ 40755 0 0 0 12060700107 22103 5ustar 0 0 commons-jci-1.1-src/examples/src/main/java/org/apache/commons/jci/examples/ 40755 0 0 0 12060700107 23721 5ustar 0 0 commons-jci-1.1-src/examples/src/main/java/org/apache/commons/jci/examples/commandline/ 40755 0 0 0 12225246462 26223 5ustar 0 0 commons-jci-1.1-src/examples/src/main/java/org/apache/commons/jci/examples/configuration/ 40755 0 0 0 12224752676 26614 5ustar 0 0 commons-jci-1.1-src/examples/src/main/java/org/apache/commons/jci/examples/serverpages/ 40755 0 0 0 12225247137 26263 5ustar 0 0 commons-jci-1.1-src/examples/src/main/resources/ 40755 0 0 0 12225261521 16751 5ustar 0 0 commons-jci-1.1-src/examples/src/main/webapp/ 40755 0 0 0 12060700107 16210 5ustar 0 0 commons-jci-1.1-src/examples/src/main/webapp/WEB-INF/ 40755 0 0 0 12060700107 17237 5ustar 0 0 commons-jci-1.1-src/examples/src/main/webapp/WEB-INF/jsp/ 40755 0 0 0 12060700107 20033 5ustar 0 0 commons-jci-1.1-src/examples/src/main/webapp/WEB-INF/jsp/org/ 40755 0 0 0 12060700107 20622 5ustar 0 0 commons-jci-1.1-src/examples/src/main/webapp/WEB-INF/jsp/org/vafer/ 40755 0 0 0 12060700107 21725 5ustar 0 0 commons-jci-1.1-src/examples/pom.xml100644 0 0 7035 12225257517 14655 0ustar 0 0 4.0.0 org.apache.commons commons-jci 1.1 commons-jci-examples 1.1 Apache Commons JCI examples Apache Commons JCI examples. true org.apache.commons commons-jci-core ${project.version} org.apache.commons commons-jci-eclipse ${project.version} commons-cli commons-cli javax.servlet servlet-api jci-examples true org.mortbay.jetty maven-jetty-plugin org.apache.commons.logging.Log org.apache.commons.logging.impl.SimpleLog maven-assembly-plugin true org.apache.maven.plugins maven-deploy-plugin 2.7 true ././@LongLink100644 0 0 160 12225263274 10255 Lustar 0 0 commons-jci-1.1-src/examples/src/main/java/org/apache/commons/jci/examples/commandline/CommandlineCompiler.javacommons-jci-1.1-src/examples/src/main/java/org/apache/commons/jci/examples/commandline/CommandlineCo100644 0 0 16472 12225246462 31005 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.examples.commandline; import java.io.File; import java.net.URL; import java.net.URLClassLoader; import java.util.Iterator; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.CommandLineParser; import org.apache.commons.cli.GnuParser; import org.apache.commons.cli.Option; import org.apache.commons.cli.OptionBuilder; import org.apache.commons.cli.Options; import org.apache.commons.jci.compilers.CompilationResult; import org.apache.commons.jci.compilers.JavaCompiler; import org.apache.commons.jci.compilers.JavaCompilerFactory; import org.apache.commons.jci.compilers.JavaCompilerSettings; import org.apache.commons.jci.problems.CompilationProblem; import org.apache.commons.jci.problems.CompilationProblemHandler; import org.apache.commons.jci.readers.FileResourceReader; import org.apache.commons.jci.readers.ResourceReader; import org.apache.commons.jci.stores.FileResourceStore; import org.apache.commons.jci.stores.ResourceStore; /** * A simple front end to jci mimicking the javac command line * * @author tcurdt */ public final class CommandlineCompiler { public static void main( String[] args ) throws Exception { final Options options = new Options(); options.addOption( OptionBuilder.withArgName("a.jar:b.jar") .hasArg() .withValueSeparator( ':' ) .withDescription("Specify where to find user class files") .create( "classpath" )); options.addOption( OptionBuilder.withArgName("release") .hasArg() .withDescription("Provide source compatibility with specified release") .create( "source" )); options.addOption( OptionBuilder.withArgName("release") .hasArg() .withDescription("Generate class files for specific VM version") .create( "target" )); options.addOption( OptionBuilder.withArgName("path") .hasArg() .withDescription("Specify where to find input source files") .create( "sourcepath" )); options.addOption( OptionBuilder.withArgName("directory") .hasArg() .withDescription("Specify where to place generated class files") .create( "d" )); options.addOption( OptionBuilder.withArgName("num") .hasArg() .withDescription("Stop compilation after these number of errors") .create( "Xmaxerrs" )); options.addOption( OptionBuilder.withArgName("num") .hasArg() .withDescription("Stop compilation after these number of warning") .create( "Xmaxwarns" )); options.addOption( OptionBuilder.withDescription("Generate no warnings") .create( "nowarn" )); // final HelpFormatter formatter = new HelpFormatter(); // formatter.printHelp("jci", options); final CommandLineParser parser = new GnuParser(); final CommandLine cmd = parser.parse(options, args, true); ClassLoader classloader = CommandlineCompiler.class.getClassLoader(); File sourcepath = new File("."); File targetpath = new File("."); int maxerrs = 10; int maxwarns = 10; final boolean nowarn = cmd.hasOption("nowarn"); final JavaCompiler compiler = new JavaCompilerFactory().createCompiler("eclipse"); final JavaCompilerSettings settings = compiler.createDefaultSettings(); for (Iterator it = cmd.iterator(); it.hasNext();) { final Option option = (Option) it.next(); if ("classpath".equals(option.getOpt())) { final String[] values = option.getValues(); final URL[] urls = new URL[values.length]; for (int i = 0; i < urls.length; i++) { urls[i] = new File(values[i]).toURL(); } classloader = new URLClassLoader(urls); } else if ("source".equals(option.getOpt())) { settings.setSourceVersion(option.getValue()); } else if ("target".equals(option.getOpt())) { settings.setTargetVersion(option.getValue()); } else if ("sourcepath".equals(option.getOpt())) { sourcepath = new File(option.getValue()); } else if ("d".equals(option.getOpt())) { targetpath = new File(option.getValue()); } else if ("Xmaxerrs".equals(option.getOpt())) { maxerrs = Integer.parseInt(option.getValue()); } else if ("Xmaxwarns".equals(option.getOpt())) { maxwarns = Integer.parseInt(option.getValue()); } } final ResourceReader reader = new FileResourceReader(sourcepath); final ResourceStore store = new FileResourceStore(targetpath); final int maxErrors = maxerrs; final int maxWarnings = maxwarns; compiler.setCompilationProblemHandler(new CompilationProblemHandler() { int errors = 0; int warnings = 0; public boolean handle(final CompilationProblem pProblem) { if (pProblem.isError()) { System.err.println(pProblem); errors++; if (errors >= maxErrors) { return false; } } else { if (!nowarn) { System.err.println(pProblem); } warnings++; if (warnings >= maxWarnings) { return false; } } return true; } }); final String[] resource = cmd.getArgs(); for (int i = 0; i < resource.length; i++) { System.out.println("compiling " + resource[i]); } final CompilationResult result = compiler.compile(resource, reader, store, classloader); System.out.println( result.getErrors().length + " errors"); System.out.println( result.getWarnings().length + " warnings"); } } commons-jci-1.1-src/examples/src/main/java/org/apache/commons/jci/examples/commandline/package.html100644 0 0 1647 10627343175 30614 0ustar 0 0 Example demonstrating a simple front end to jci mimicking the javac command line. ././@LongLink100644 0 0 153 12225263274 10257 Lustar 0 0 commons-jci-1.1-src/examples/src/main/java/org/apache/commons/jci/examples/configuration/Configurable.javacommons-jci-1.1-src/examples/src/main/java/org/apache/commons/jci/examples/configuration/Configurabl100644 0 0 2003 10613666121 31047 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.examples.configuration; import java.util.Properties; public interface Configurable { void configure( Properties properties ) throws ConfigurationException; } ././@LongLink100644 0 0 165 12225263274 10262 Lustar 0 0 commons-jci-1.1-src/examples/src/main/java/org/apache/commons/jci/examples/configuration/ConfigurationException.javacommons-jci-1.1-src/examples/src/main/java/org/apache/commons/jci/examples/configuration/Configurati100644 0 0 1745 10613666121 31102 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.examples.configuration; public class ConfigurationException extends Exception { private static final long serialVersionUID = 1L; } ././@LongLink100644 0 0 165 12225263274 10262 Lustar 0 0 commons-jci-1.1-src/examples/src/main/java/org/apache/commons/jci/examples/configuration/ConfigurationReloading.javacommons-jci-1.1-src/examples/src/main/java/org/apache/commons/jci/examples/configuration/Configurati100644 0 0 6401 12204226200 31060 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.examples.configuration; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Collection; import java.util.Properties; import org.apache.commons.jci.listeners.FileChangeListener; import org.apache.commons.jci.monitor.FilesystemAlterationListener; import org.apache.commons.jci.monitor.FilesystemAlterationMonitor; import org.apache.commons.jci.monitor.FilesystemAlterationObserver; /** * * @author tcurdt */ public final class ConfigurationReloading { private final FilesystemAlterationMonitor fam = new FilesystemAlterationMonitor(); private void run(String[] args) { final File configFile = new File("some.properties"); System.out.println("Watching " + configFile.getAbsolutePath()); final Collection configurables = new ArrayList(); final FilesystemAlterationListener listener = new FileChangeListener() { public void onStop(FilesystemAlterationObserver pObserver) { super.onStop(pObserver); if (hasChanged()) { System.out.println("Configuration change detected " + configFile); final Properties props = new Properties(); InputStream is = null; try { is = new FileInputStream(configFile); props.load(is); System.out.println("Notifying about configuration change " + configFile); for (Configurable configurable : configurables) { configurable.configure(props); } } catch (Exception e) { System.err.println("Failed to load configuration " + configFile); } finally { try { is.close(); } catch (IOException e) { } } } } }; fam.addListener(configFile, listener); fam.start(); configurables.add(new Something()); while(true) { try { Thread.sleep(1000); } catch (InterruptedException e) { } } } public static void main(String[] args) { new ConfigurationReloading().run(args); } } ././@LongLink100644 0 0 146 12225263274 10261 Lustar 0 0 commons-jci-1.1-src/examples/src/main/java/org/apache/commons/jci/examples/configuration/package.htmlcommons-jci-1.1-src/examples/src/main/java/org/apache/commons/jci/examples/configuration/package.htm100644 0 0 1615 10627343175 31014 0ustar 0 0 Example demonstrating auto-reloading of configurations. ././@LongLink100644 0 0 150 12225263274 10254 Lustar 0 0 commons-jci-1.1-src/examples/src/main/java/org/apache/commons/jci/examples/configuration/Something.javacommons-jci-1.1-src/examples/src/main/java/org/apache/commons/jci/examples/configuration/Something.j100644 0 0 2131 10613666121 31003 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.examples.configuration; import java.util.Properties; public class Something implements Configurable { public void configure( Properties properties ) throws ConfigurationException { System.out.println("Configuration changed"); } } commons-jci-1.1-src/examples/src/main/java/org/apache/commons/jci/examples/package.html100644 0 0 1566 10627343175 26326 0ustar 0 0 Examples showing how to use jci. ././@LongLink100644 0 0 151 12225263274 10255 Lustar 0 0 commons-jci-1.1-src/examples/src/main/java/org/apache/commons/jci/examples/serverpages/JspGenerator.javacommons-jci-1.1-src/examples/src/main/java/org/apache/commons/jci/examples/serverpages/JspGenerator.100644 0 0 13145 12225247137 31010 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.examples.serverpages; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.Reader; import java.io.Writer; import org.apache.commons.jci.utils.ConversionUtils; /** * @author tcurdt */ public final class JspGenerator { private String quote( final String s ) { final StringBuilder sb = new StringBuilder(); final char[] input = s.toCharArray(); for (char c : input) { if (c == '"') { sb.append('\\'); } if (c == '\\') { sb.append('\\'); } if (c == '\n') { sb.append("\");\n").append(" out.write(\""); continue; } sb.append(c); } return sb.toString(); } private void wrap( final StringBuilder pInput, final Writer pOutput ) throws IOException { pOutput.append(" out.write(\""); pOutput.append(quote(pInput.toString())); pOutput.append("\");").append('\n'); } public byte[] generateJavaSource( final String pResourceName, final File pFile ) { final ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); final Writer output = new OutputStreamWriter(outputStream); try { final Reader input = new InputStreamReader(new FileInputStream(pFile)); final int p = pResourceName.lastIndexOf('/'); final String className; final String packageName; if (p < 0) { className = ConversionUtils.stripExtension(pResourceName); packageName = ""; } else { className = ConversionUtils.stripExtension(pResourceName.substring(p+1)); packageName = pResourceName.substring(0, p).replace('/', '.'); output.append("package ").append(packageName).append(";").append('\n'); } output.append("import java.io.PrintWriter;").append('\n'); output.append("import java.io.IOException;").append('\n'); output.append("import javax.servlet.http.HttpServlet;").append('\n'); output.append("import javax.servlet.http.HttpServletRequest;").append('\n'); output.append("import javax.servlet.http.HttpServletResponse;").append('\n'); output.append("import javax.servlet.ServletException;").append('\n'); output.append("public class ").append(className).append(" extends HttpServlet {").append('\n'); output.append(" protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {").append('\n'); output.append(" final PrintWriter out = response.getWriter();").append('\n'); final char[] open = "".toCharArray(); StringBuilder sb = new StringBuilder(); char[] watch = open; int w = 0; while(true) { int c = input.read(); if (c < 0) { break; } if (c == watch[w]) { w++; if (watch.length == w) { if (watch == open) { // found open wrap(sb, output); sb = new StringBuilder(); watch = close; } else if (watch == close) { // found close // is java output.append(sb.toString()); sb = new StringBuilder(); watch = open; } w = 0; } } else { if (w > 0) { sb.append(watch, 0, w); } sb.append((char)c); w = 0; } } if (watch == open) { wrap(sb, output); } output.append(" out.close();").append('\n'); output.append(" out.flush();").append('\n'); output.append(" }").append('\n'); output.append("}").append('\n'); return outputStream.toByteArray(); } catch (IOException e) { return null; } finally { try { output.close(); } catch (IOException e) { } } } } ././@LongLink100644 0 0 146 12225263274 10261 Lustar 0 0 commons-jci-1.1-src/examples/src/main/java/org/apache/commons/jci/examples/serverpages/JspReader.javacommons-jci-1.1-src/examples/src/main/java/org/apache/commons/jci/examples/serverpages/JspReader.jav100644 0 0 3335 12204226200 30726 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.examples.serverpages; import java.util.Map; import org.apache.commons.jci.readers.ResourceReader; /** * @author tcurdt */ public final class JspReader implements ResourceReader { private final Map sources; private final ResourceReader reader; public JspReader( final Map pSources, final ResourceReader pReader ) { reader = pReader; sources = pSources; } public byte[] getBytes( String pResourceName ) { final byte[] bytes = sources.get(pResourceName); if (bytes != null) { return bytes; } return reader.getBytes(pResourceName); } public boolean isAvailable( String pResourceName ) { if (sources.containsKey(pResourceName)) { return true; } return reader.isAvailable(pResourceName); } } commons-jci-1.1-src/examples/src/main/java/org/apache/commons/jci/examples/serverpages/package.html100644 0 0 1613 10627343175 30645 0ustar 0 0 Example how to use jci to build a simple JSP servlet. ././@LongLink100644 0 0 156 12225263274 10262 Lustar 0 0 commons-jci-1.1-src/examples/src/main/java/org/apache/commons/jci/examples/serverpages/ServerPageServlet.javacommons-jci-1.1-src/examples/src/main/java/org/apache/commons/jci/examples/serverpages/ServerPageSer100644 0 0 21441 12225247030 31032 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.examples.serverpages; import java.io.File; import java.io.IOException; import java.io.PrintWriter; import java.lang.String; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.jci.ReloadingClassLoader; import org.apache.commons.jci.compilers.CompilationResult; import org.apache.commons.jci.compilers.JavaCompilerFactory; import org.apache.commons.jci.listeners.CompilingListener; import org.apache.commons.jci.monitor.FilesystemAlterationMonitor; import org.apache.commons.jci.monitor.FilesystemAlterationObserver; import org.apache.commons.jci.problems.CompilationProblem; import org.apache.commons.jci.readers.ResourceReader; import org.apache.commons.jci.stores.MemoryResourceStore; import org.apache.commons.jci.stores.TransactionalResourceStore; import org.apache.commons.jci.utils.ConversionUtils; /** * A mini JSP servlet that monitors a certain directory and * recompiles and then instantiates the JSP pages as soon as * they have changed. * * @author tcurdt */ public final class ServerPageServlet extends HttpServlet { private static final long serialVersionUID = 1L; private final ReloadingClassLoader classloader = new ReloadingClassLoader(ServerPageServlet.class.getClassLoader()); private FilesystemAlterationMonitor fam; private CompilingListener jspListener; private Map servletsByClassname = new HashMap(); public void init() throws ServletException { super.init(); final File serverpagesDir = new File(getServletContext().getRealPath("/") + getInitParameter("serverpagesDir")); log("Monitoring serverpages in " + serverpagesDir); final TransactionalResourceStore store = new TransactionalResourceStore(new MemoryResourceStore()) { private Set newClasses; private Map newServletsByClassname; public void onStart() { super.onStart(); newClasses = new HashSet(); newServletsByClassname = new HashMap(servletsByClassname); } public void onStop() { super.onStop(); boolean reload = false; for (String clazzName : newClasses) { try { final Class clazz = classloader.loadClass(clazzName); if (!HttpServlet.class.isAssignableFrom(clazz)) { log(clazzName + " is not a servlet"); continue; } // create new instance of jsp page final HttpServlet servlet = (HttpServlet) clazz.newInstance(); newServletsByClassname.put(clazzName, servlet); reload = true; } catch(Exception e) { log("", e); } } if (reload) { log("Activating new map of servlets "+ newServletsByClassname); servletsByClassname = newServletsByClassname; } } public void write(String pResourceName, byte[] pResourceData) { super.write(pResourceName, pResourceData); if (pResourceName.endsWith(".class")) { // compiler writes a new class, remember the classes to reload newClasses.add(pResourceName.replace('/', '.').substring(0, pResourceName.length() - ".class".length())); } } }; // listener that generates the java code from the jsp page and provides that to the compiler jspListener = new CompilingListener(new JavaCompilerFactory().createCompiler("eclipse"), store) { private final JspGenerator transformer = new JspGenerator(); private final Map sources = new HashMap(); private final Set resourceToCompile = new HashSet(); public void onStart(FilesystemAlterationObserver pObserver) { super.onStart(pObserver); resourceToCompile.clear(); } public void onFileChange(File pFile) { if (pFile.getName().endsWith(".jsp")) { final String resourceName = ConversionUtils.stripExtension(getSourceNameFromFile(observer, pFile)) + ".java"; log("Updating " + resourceName); sources.put(resourceName, transformer.generateJavaSource(resourceName, pFile)); resourceToCompile.add(resourceName); } super.onFileChange(pFile); } public void onFileCreate(File pFile) { if (pFile.getName().endsWith(".jsp")) { final String resourceName = ConversionUtils.stripExtension(getSourceNameFromFile(observer, pFile)) + ".java"; log("Creating " + resourceName); sources.put(resourceName, transformer.generateJavaSource(resourceName, pFile)); resourceToCompile.add(resourceName); } super.onFileCreate(pFile); } public String[] getResourcesToCompile(FilesystemAlterationObserver pObserver) { // we only want to compile the jsp pages final String[] resourceNames = new String[resourceToCompile.size()]; resourceToCompile.toArray(resourceNames); return resourceNames; } public ResourceReader getReader( final FilesystemAlterationObserver pObserver ) { return new JspReader(sources, super.getReader(pObserver)); } }; jspListener.addReloadNotificationListener(classloader); fam = new FilesystemAlterationMonitor(); fam.addListener(serverpagesDir, jspListener); fam.start(); } private String convertRequestToServletClassname( final HttpServletRequest request ) { String path = request.getPathInfo().substring(1); return ConversionUtils.stripExtension(path).replace('/', '.'); } protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { log("Request " + request.getRequestURI()); final CompilationResult result = jspListener.getCompilationResult(); final CompilationProblem[] errors = result.getErrors(); if (errors.length > 0) { // if there are errors we provide the compilation errors instead of the jsp page final PrintWriter out = response.getWriter(); out.append(""); for (CompilationProblem problem : errors) { out.append(problem.toString()).append("
").append('\n'); } out.append(""); out.flush(); out.close(); return; } final String servletClassname = convertRequestToServletClassname(request); log("Checking for serverpage " + servletClassname); final HttpServlet servlet = servletsByClassname.get(servletClassname); if (servlet == null) { log("No servlet for " + request.getRequestURI()); response.sendError(404); return; } log("Delegating request to " + servletClassname); servlet.service(request, response); } public void destroy() { fam.stop(); super.destroy(); } } commons-jci-1.1-src/examples/src/main/resources/LICENSE.txt100644 0 0 26446 10607602354 20732 0ustar 0 0 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. commons-jci-1.1-src/examples/src/main/resources/NOTICE.txt100644 0 0 274 12225261521 20553 0ustar 0 0 Apache Commons JCI - Examples Copyright 2004-2013 The Apache Software Foundation This product includes software developed by The Apache Software Foundation (http://www.apache.org/). commons-jci-1.1-src/examples/src/main/webapp/WEB-INF/jsp/org/vafer/Test.jsp100644 0 0 1532 10627343175 23477 0ustar 0 0 org.vafer.Testcommons-jci-1.1-src/examples/src/main/webapp/WEB-INF/jsp/Test.jsp100644 0 0 1622 10627343175 21605 0ustar 0 0 line
commons-jci-1.1-src/examples/src/main/webapp/WEB-INF/web.xml100644 0 0 3076 10627343175 20660 0ustar 0 0 serverpages org.apache.commons.jci.examples.serverpages.ServerPageServlet serverpagesDir /WEB-INF/jsp 1 serverpages /* commons-jci-1.1-src/fam/src/ 40755 0 0 0 12060700107 12733 5ustar 0 0 commons-jci-1.1-src/fam/src/main/ 40755 0 0 0 12060700107 13657 5ustar 0 0 commons-jci-1.1-src/fam/src/main/java/ 40755 0 0 0 12060700107 14600 5ustar 0 0 commons-jci-1.1-src/fam/src/main/java/org/ 40755 0 0 0 12060700107 15367 5ustar 0 0 commons-jci-1.1-src/fam/src/main/java/org/apache/ 40755 0 0 0 12060700107 16610 5ustar 0 0 commons-jci-1.1-src/fam/src/main/java/org/apache/commons/ 40755 0 0 0 12060700107 20263 5ustar 0 0 commons-jci-1.1-src/fam/src/main/java/org/apache/commons/jci/ 40755 0 0 0 12060700107 21030 5ustar 0 0 commons-jci-1.1-src/fam/src/main/java/org/apache/commons/jci/listeners/ 40755 0 0 0 12225025772 23053 5ustar 0 0 commons-jci-1.1-src/fam/src/main/java/org/apache/commons/jci/monitor/ 40755 0 0 0 12225026141 22521 5ustar 0 0 commons-jci-1.1-src/fam/src/main/resources/ 40755 0 0 0 12225261527 15704 5ustar 0 0 commons-jci-1.1-src/fam/src/test/ 40755 0 0 0 12060700107 13712 5ustar 0 0 commons-jci-1.1-src/fam/src/test/java/ 40755 0 0 0 12060700107 14633 5ustar 0 0 commons-jci-1.1-src/fam/src/test/java/org/ 40755 0 0 0 12060700107 15422 5ustar 0 0 commons-jci-1.1-src/fam/src/test/java/org/apache/ 40755 0 0 0 12060700107 16643 5ustar 0 0 commons-jci-1.1-src/fam/src/test/java/org/apache/commons/ 40755 0 0 0 12060700107 20316 5ustar 0 0 commons-jci-1.1-src/fam/src/test/java/org/apache/commons/jci/ 40755 0 0 0 12060700107 21063 5ustar 0 0 commons-jci-1.1-src/fam/src/test/java/org/apache/commons/jci/monitor/ 40755 0 0 0 12225026570 22562 5ustar 0 0 commons-jci-1.1-src/fam/src/test/resources/ 40755 0 0 0 12060700107 15724 5ustar 0 0 commons-jci-1.1-src/fam/pom.xml100644 0 0 5006 12225250625 13567 0ustar 0 0 4.0.0 org.apache.commons commons-jci 1.1 commons-jci-fam 1.1 Apache Commons JCI FileAlterationMonitor Commons JCI FileAlterationMonitor (FAM) to monitor local filesystems and get notified about changes. commons-logging commons-logging junit junit test commons-io commons-io test jci-fam true maven-assembly-plugin true ././@LongLink100644 0 0 161 12225263274 10256 Lustar 0 0 commons-jci-1.1-src/fam/src/main/java/org/apache/commons/jci/listeners/AbstractFilesystemAlterationListener.javacommons-jci-1.1-src/fam/src/main/java/org/apache/commons/jci/listeners/AbstractFilesystemAlterationL100644 0 0 14467 12204235540 31067 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.listeners; import java.io.File; import java.util.ArrayList; import java.util.Collection; import org.apache.commons.jci.monitor.FilesystemAlterationListener; import org.apache.commons.jci.monitor.FilesystemAlterationObserver; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * AbstractFilesystemAlterationListener provides some convenience methods helping to * implement a FilesystemAlterationListener. * @author tcurdt */ public abstract class AbstractFilesystemAlterationListener implements FilesystemAlterationListener { private final Log log = LogFactory.getLog(AbstractFilesystemAlterationListener.class); private final Collection createdFiles = new ArrayList(); private final Collection changedFiles = new ArrayList(); private final Collection deletedFiles = new ArrayList(); private final Collection createdDirectories = new ArrayList(); private final Collection changedDirectories = new ArrayList(); private final Collection deletedDirectories = new ArrayList(); private final static class Signal { public boolean triggered; } private final Signal eventSignal = new Signal(); private final Signal checkSignal = new Signal(); protected FilesystemAlterationObserver observer; public void onDirectoryCreate( final File pDir ) { createdDirectories.add(pDir); } public void onDirectoryChange( final File pDir ) { changedDirectories.add(pDir); } public void onDirectoryDelete( final File pDir ) { deletedDirectories.add(pDir); } public void onFileCreate( final File pFile) { createdFiles.add(pFile); } public void onFileChange( final File pFile ) { changedFiles.add(pFile); } public void onFileDelete( final File pFile ) { deletedFiles.add(pFile); } public Collection getChangedDirectories() { return changedDirectories; } public Collection getChangedFiles() { return changedFiles; } public Collection getCreatedDirectories() { return createdDirectories; } public Collection getCreatedFiles() { return createdFiles; } public Collection getDeletedDirectories() { return deletedDirectories; } public Collection getDeletedFiles() { return deletedFiles; } protected void signals() { if (createdFiles.size() > 0 || createdDirectories.size() > 0 || changedFiles.size() > 0 || changedDirectories.size() > 0 || deletedFiles.size() > 0 || deletedDirectories.size() > 0) { log.debug("event signal"); synchronized(eventSignal) { eventSignal.triggered = true; eventSignal.notifyAll(); } } log.debug("check signal"); synchronized(checkSignal) { checkSignal.triggered = true; checkSignal.notifyAll(); } } public void onStart( final FilesystemAlterationObserver pObserver ) { observer = pObserver; createdFiles.clear(); changedFiles.clear(); deletedFiles.clear(); createdDirectories.clear(); changedDirectories.clear(); deletedDirectories.clear(); } public void onStop( final FilesystemAlterationObserver pObserver ) { signals(); observer = null; } public void waitForEvent() throws Exception { synchronized(eventSignal) { eventSignal.triggered = false; } log.debug("waiting for change"); if (!waitForSignal(eventSignal, 10)) { throw new Exception("timeout"); } } /** * we don't reset the signal so if there was a check it is * already true and exit immediatly otherwise it will behave just * like waitForCheck() * * @throws Exception in case of a timeout */ public void waitForFirstCheck() throws Exception { log.debug("waiting for first check"); if (!waitForSignal(checkSignal, 10)) { throw new Exception("timeout"); } } /** * wait for the next filesystem check to happen * * @throws Exception in case of a timeout */ public void waitForCheck() throws Exception { synchronized(checkSignal) { checkSignal.triggered = false; } log.debug("waiting for check"); if (!waitForSignal(checkSignal, 10)) { throw new Exception("timeout"); } } private boolean waitForSignal(final Signal pSignal, final int pSecondsTimeout) { int i = 0; while(true) { synchronized(pSignal) { if (!pSignal.triggered) { try { pSignal.wait(1000); } catch (InterruptedException e) { } if (++i > pSecondsTimeout) { log.error("timeout after " + pSecondsTimeout + "s"); return false; } } else { pSignal.triggered = false; break; } } } return true; } } ././@LongLink100644 0 0 147 12225263274 10262 Lustar 0 0 commons-jci-1.1-src/fam/src/main/java/org/apache/commons/jci/monitor/FilesystemAlterationListener.javacommons-jci-1.1-src/fam/src/main/java/org/apache/commons/jci/monitor/FilesystemAlterationListener.ja100644 0 0 3056 10613666121 31022 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.monitor; import java.io.File; /** * A listener that receives events of filesystem modifications. * The observer basically represents the source of the events. * The file root and its state. (see FilesystemAlterationObserver) * * @author tcurdt */ public interface FilesystemAlterationListener { void onStart( final FilesystemAlterationObserver pObserver ); void onFileCreate( final File pFile ); void onFileChange( final File pFile ); void onFileDelete( final File pFile ); void onDirectoryCreate( final File pDir ); void onDirectoryChange( final File pDir ); void onDirectoryDelete( final File pDir ); void onStop( final FilesystemAlterationObserver pObserver ); } ././@LongLink100644 0 0 146 12225263274 10261 Lustar 0 0 commons-jci-1.1-src/fam/src/main/java/org/apache/commons/jci/monitor/FilesystemAlterationMonitor.javacommons-jci-1.1-src/fam/src/main/java/org/apache/commons/jci/monitor/FilesystemAlterationMonitor.jav100644 0 0 10437 12224771244 31076 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.monitor; import java.io.File; import java.util.Collections; import java.util.HashMap; import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * It's a runnable that spawns of a monitoring thread triggering the * the observers and managing the their listeners. * * @author tcurdt */ public final class FilesystemAlterationMonitor implements Runnable { private final Log log = LogFactory.getLog(FilesystemAlterationMonitor.class); private final Object observersLock = new Object(); private Map observers = Collections.unmodifiableMap(new HashMap()); /** delay between calls to {@link FilesystemAlterationObserver#checkAndNotify()}, default 3000 ms */ private volatile long delay = 3000; // volatile because shared with daemon thread private Thread thread = null; private volatile boolean running = true; public FilesystemAlterationMonitor() { } public void start() { thread = new Thread(this); thread.setName("Filesystem Alteration Monitor"); thread.setDaemon(true); thread.start(); } public void stop() { running = false; if (thread != null) { try { thread.join(delay); } catch (InterruptedException e) { } } } /** * Set the delay between calls to the observers. * * @param pDelay the delay in milliseconds (default if not set 3000 ms) */ public void setInterval( final long pDelay ) { delay = pDelay; } public void addListener( final File pRoot, final FilesystemAlterationListener pListener ) { FilesystemAlterationObserver observer; synchronized (observersLock) { observer = observers.get(pRoot); if (observer == null) { final Map newObservers = new HashMap(observers); observer = new FilesystemAlterationObserverImpl(pRoot); newObservers.put(pRoot, observer); observers = Collections.unmodifiableMap(newObservers); } } observer.addListener(pListener); } public void removeListener( final FilesystemAlterationListener pListener ) { synchronized (observersLock) { for (FilesystemAlterationObserver observer : observers.values()) { observer.removeListener(pListener); // FIXME: remove observer if there are no listeners? } } } public FilesystemAlterationListener[] getListenersFor( final File pRoot ) { final FilesystemAlterationObserver observer = observers.get(pRoot); if (observer == null) { return new FilesystemAlterationListener[0]; } return observer.getListeners(); } public void run() { log.debug("fam running"); while (running) { for (FilesystemAlterationObserver observer : observers.values()) { observer.checkAndNotify(); } try { Thread.sleep(delay); } catch (final InterruptedException e) { } } log.debug("fam exiting"); } } ././@LongLink100644 0 0 147 12225263274 10262 Lustar 0 0 commons-jci-1.1-src/fam/src/main/java/org/apache/commons/jci/monitor/FilesystemAlterationObserver.javacommons-jci-1.1-src/fam/src/main/java/org/apache/commons/jci/monitor/FilesystemAlterationObserver.ja100644 0 0 2603 10613666121 31021 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.monitor; import java.io.File; /** * FilesystemAlterationObserver represents the state of files * below a certain root directory. It implements the code to * check the filesystem and notify listeners. * * @author tcurdt */ public interface FilesystemAlterationObserver { File getRootDirectory(); void checkAndNotify(); void addListener( final FilesystemAlterationListener pListener ); void removeListener( final FilesystemAlterationListener pListener ); FilesystemAlterationListener[] getListeners(); }././@LongLink100644 0 0 153 12225263274 10257 Lustar 0 0 commons-jci-1.1-src/fam/src/main/java/org/apache/commons/jci/monitor/FilesystemAlterationObserverImpl.javacommons-jci-1.1-src/fam/src/main/java/org/apache/commons/jci/monitor/FilesystemAlterationObserverImp100644 0 0 26430 12225026141 31113 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.monitor; import java.io.File; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * Implementation of a FilesystemAlterationObserver * * @author tcurdt */ public class FilesystemAlterationObserverImpl implements FilesystemAlterationObserver { private final Log log = LogFactory.getLog(FilesystemAlterationObserverImpl.class); private interface MonitorFile { long lastModified(); MonitorFile[] listFiles(); boolean isDirectory(); boolean exists(); String getName(); } private final static class MonitorFileImpl implements MonitorFile { private final File file; public MonitorFileImpl( final File pFile ) { file = pFile; } public boolean exists() { return file.exists(); } public MonitorFile[] listFiles() { final File[] children = file.listFiles(); if (children == null) { // not a directory or IOError (e.g. protection issue) return new MonitorFile[0]; } final MonitorFile[] providers = new MonitorFile[children.length]; for (int i = 0; i < providers.length; i++) { providers[i] = new MonitorFileImpl(children[i]); } return providers; } public String getName() { return file.getName(); } public boolean isDirectory() { return file.isDirectory(); } public long lastModified() { return file.lastModified(); } @Override public String toString() { return file.toString(); } } private final class Entry { private final static int TYPE_UNKNOWN = 0; private final static int TYPE_FILE = 1; private final static int TYPE_DIRECTORY = 2; private final MonitorFile file; private long lastModified = -1; private int lastType = TYPE_UNKNOWN; private final Map children = new HashMap(); public Entry(final MonitorFile pFile) { file = pFile; } public String getName() { return file.getName(); } @Override public String toString() { return file.toString(); } private void compareChildren() { if (!file.isDirectory()) { return; } final MonitorFile[] files = file.listFiles(); final Set deleted = new HashSet(children.values()); for (MonitorFile f : files) { final String name = f.getName(); final Entry entry = children.get(name); if (entry != null) { // already recognized as child deleted.remove(entry); if(entry.needsToBeDeleted()) { // we have to delete this one children.remove(name); } } else { // a new child final Entry newChild = new Entry(f); children.put(name, newChild); newChild.needsToBeDeleted(); } } // the ones not found on disk anymore for (Entry entry : deleted) { entry.deleteChildrenAndNotify(); children.remove(entry.getName()); } } private void deleteChildrenAndNotify() { for (Entry entry : children.values()) { entry.deleteChildrenAndNotify(); } children.clear(); if(lastType == TYPE_DIRECTORY) { notifyOnDirectoryDelete(this); } else if (lastType == TYPE_FILE) { notifyOnFileDelete(this); } } public boolean needsToBeDeleted() { if (!file.exists()) { // deleted or has never existed yet // log.debug(file + " does not exist or has been deleted"); deleteChildrenAndNotify(); // mark to be deleted by parent return true; } else { // exists final long currentModified = file.lastModified(); if (currentModified != lastModified) { // last modified has changed lastModified = currentModified; // log.debug(file + " has new last modified"); // types only changes when also the last modified changes final int newType = (file.isDirectory()?TYPE_DIRECTORY:TYPE_FILE); if (lastType != newType) { // the type has changed // log.debug(file + " has a new type"); deleteChildrenAndNotify(); lastType = newType; // and then an add as the new type if (newType == TYPE_DIRECTORY) { notifyOnDirectoryCreate(this); compareChildren(); } else { notifyOnFileCreate(this); } return false; } if (newType == TYPE_DIRECTORY) { notifyOnDirectoryChange(this); compareChildren(); } else { notifyOnFileChange(this); } return false; } else { // so exists and has not changed // log.debug(file + " does exist and has not changed"); compareChildren(); return false; } } } public MonitorFile getFile() { return file; } public void markNotChanged() { lastModified = file.lastModified(); } } private final File rootDirectory; private final Entry rootEntry; private FilesystemAlterationListener[] listeners = new FilesystemAlterationListener[0]; private final Set listenersSet = new HashSet(); public FilesystemAlterationObserverImpl( final File pRootDirectory ) { rootDirectory = pRootDirectory; rootEntry = new Entry(new MonitorFileImpl(pRootDirectory)); } private void notifyOnStart() { log.debug("onStart " + rootEntry); for (FilesystemAlterationListener listener : listeners) { listener.onStart(this); } } private void notifyOnStop() { log.debug("onStop " + rootEntry); for (FilesystemAlterationListener listener : listeners) { listener.onStop(this); } } private void notifyOnFileCreate( final Entry pEntry ) { log.debug("onFileCreate " + pEntry); for (FilesystemAlterationListener listener : listeners) { listener.onFileCreate(((MonitorFileImpl)pEntry.getFile()).file ); } } private void notifyOnFileChange( final Entry pEntry ) { log.debug("onFileChange " + pEntry); for (FilesystemAlterationListener listener : listeners) { listener.onFileChange(((MonitorFileImpl)pEntry.getFile()).file ); } } private void notifyOnFileDelete( final Entry pEntry ) { log.debug("onFileDelete " + pEntry); for (FilesystemAlterationListener listener : listeners) { listener.onFileDelete(((MonitorFileImpl)pEntry.getFile()).file ); } } private void notifyOnDirectoryCreate( final Entry pEntry ) { log.debug("onDirectoryCreate " + pEntry); for (FilesystemAlterationListener listener : listeners) { listener.onDirectoryCreate(((MonitorFileImpl)pEntry.getFile()).file ); } } private void notifyOnDirectoryChange( final Entry pEntry ) { log.debug("onDirectoryChange " + pEntry); for (FilesystemAlterationListener listener : listeners) { listener.onDirectoryChange(((MonitorFileImpl)pEntry.getFile()).file ); } } private void notifyOnDirectoryDelete( final Entry pEntry ) { log.debug("onDirectoryDelete " + pEntry); for (FilesystemAlterationListener listener : listeners) { listener.onDirectoryDelete(((MonitorFileImpl)pEntry.getFile()).file ); } } private void checkEntries() { if(rootEntry.needsToBeDeleted()) { // root not existing rootEntry.lastType = Entry.TYPE_UNKNOWN; } } public void checkAndNotify() { synchronized(listenersSet) { if (listeners.length == 0) { return; } notifyOnStart(); checkEntries(); notifyOnStop(); } } public File getRootDirectory() { return rootDirectory; } public void addListener( final FilesystemAlterationListener pListener ) { synchronized(listenersSet) { if (listenersSet.add(pListener)) { listeners = createArrayFromSet(); } } } public void removeListener( final FilesystemAlterationListener pListener ) { synchronized(listenersSet) { if (listenersSet.remove(pListener)) { listeners = createArrayFromSet(); } } } private FilesystemAlterationListener[] createArrayFromSet() { final FilesystemAlterationListener[] newListeners = new FilesystemAlterationListener[listenersSet.size()]; listenersSet.toArray(newListeners); return newListeners; } public FilesystemAlterationListener[] getListeners() { synchronized(listenersSet) { final FilesystemAlterationListener[] res = new FilesystemAlterationListener[listeners.length]; System.arraycopy(listeners, 0, res, 0, res.length); return res; } } } commons-jci-1.1-src/fam/src/main/java/org/apache/commons/jci/monitor/package.html100644 0 0 1613 10627343175 25115 0ustar 0 0 Monitor to keep track of changes on the local filesystem. commons-jci-1.1-src/fam/src/main/resources/LICENSE.txt100644 0 0 26446 10607602354 17657 0ustar 0 0 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. commons-jci-1.1-src/fam/src/main/resources/NOTICE.txt100644 0 0 307 12225261527 17503 0ustar 0 0 Apache Commons JCI - File Access Monitor Copyright 2004-2013 The Apache Software Foundation This product includes software developed by The Apache Software Foundation (http://www.apache.org/). ././@LongLink100644 0 0 156 12225263274 10262 Lustar 0 0 commons-jci-1.1-src/fam/src/test/java/org/apache/commons/jci/monitor/FilesystemAlterationMonitorTestCase.javacommons-jci-1.1-src/fam/src/test/java/org/apache/commons/jci/monitor/FilesystemAlterationMonitorTest100644 0 0 24435 12225026570 31211 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.monitor; import java.io.File; import java.io.FileOutputStream; import java.io.FileWriter; import java.io.IOException; import junit.framework.TestCase; import org.apache.commons.io.FileUtils; import org.apache.commons.jci.listeners.AbstractFilesystemAlterationListener; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * * @author tcurdt */ public final class FilesystemAlterationMonitorTestCase extends TestCase { private final Log log = LogFactory.getLog(FilesystemAlterationMonitorTestCase.class); private FilesystemAlterationMonitor fam; private MyFilesystemAlterationListener listener; private File directory; @Override protected void setUp() throws Exception { directory = createTempDirectory(); assertTrue(directory.exists()); assertTrue(directory.isDirectory()); } @Override protected void tearDown() throws Exception { FileUtils.deleteDirectory(directory); } protected File createDirectory( final String pName ) throws Exception { final File newDirectory = new File(directory, pName); assertTrue(newDirectory.mkdir()); assertTrue(newDirectory.exists()); assertTrue(newDirectory.isDirectory()); return newDirectory; } protected File writeFile( final String pName, final byte[] pData ) throws Exception { final File file = new File(directory, pName); final File parent = file.getParentFile(); if (!parent.mkdirs() && !parent.isDirectory()) { throw new IOException("could not create" + parent); } log.debug("writing file " + pName + " (" + pData.length + " bytes)"); final FileOutputStream os = new FileOutputStream(file); os.write(pData); os.close(); assertTrue(file.exists()); assertTrue(file.isFile()); return file; } protected File writeFile( final String pName, final String pText ) throws Exception { final File file = new File(directory, pName); final File parent = file.getParentFile(); if (!parent.mkdirs() && !parent.isDirectory()) { throw new IOException("could not create" + parent); } log.debug("writing " + file); final FileWriter writer = new FileWriter(file); writer.write(pText); writer.close(); assertTrue(file.exists()); assertTrue(file.isFile()); return file; } protected File createTempDirectory() throws IOException { final File tempFile = File.createTempFile("jci", null); if (!tempFile.delete()) { throw new IOException(); } if (!tempFile.mkdir()) { throw new IOException(); } return tempFile; } protected void delay() { try { Thread.sleep(1500); } catch (final InterruptedException e) { } } private static class MyFilesystemAlterationListener extends AbstractFilesystemAlterationListener { } private void start() throws Exception { fam = new FilesystemAlterationMonitor(); listener = new MyFilesystemAlterationListener(); fam.addListener(directory, listener); fam.start(); listener.waitForFirstCheck(); } private void stop() { fam.stop(); } public void testListenerDoublication() throws Exception { fam = new FilesystemAlterationMonitor(); listener = new MyFilesystemAlterationListener(); fam.addListener(directory, listener); assertEquals(1, fam.getListenersFor(directory).length); fam.addListener(directory, listener); assertEquals(1, fam.getListenersFor(directory).length); fam.removeListener(listener); assertEquals(0, fam.getListenersFor(directory).length); } public void testDirectoryDoublication() throws Exception { fam = new FilesystemAlterationMonitor(); fam.addListener(directory, new MyFilesystemAlterationListener()); assertEquals(1, fam.getListenersFor(directory).length); fam.addListener(directory, new MyFilesystemAlterationListener()); assertEquals(2, fam.getListenersFor(directory).length); } public void testCreateFileDetection() throws Exception { start(); writeFile("file", "file"); listener.waitForCheck(); assertEquals(1, listener.getCreatedFiles().size()); stop(); } public void testTimeout() throws Exception { listener = new MyFilesystemAlterationListener(); try { listener.waitForFirstCheck(); fail("should be an timeout"); } catch(Exception e) { assertEquals("timeout", e.getMessage()); } start(); try { listener.waitForEvent(); fail("should be an timeout"); } catch(Exception e) { assertEquals("timeout", e.getMessage()); } stop(); try { listener.waitForCheck(); fail("should be an timeout"); } catch(Exception e) { assertEquals("timeout", e.getMessage()); } } public void testCreateDirectoryDetection() throws Exception { start(); createDirectory("dir"); listener.waitForCheck(); assertEquals(1, listener.getCreatedDirectories().size()); stop(); } public void testDeleteFileDetection() throws Exception { start(); final File file = writeFile("file", "file"); assertTrue("file should exist", file.exists()); listener.waitForCheck(); assertEquals("expecting 1 file created", 1, listener.getCreatedFiles().size()); //assertEquals("expecting 0 directories changed", 0, listener.getChangedDirectories().size()); // todo investigate why this is failing on Windows file.delete(); assertFalse("file should not exist", file.exists()); listener.waitForCheck(); assertEquals("expecting 1 file deleted", 1, listener.getDeletedFiles().size()); stop(); } public void testDeleteDirectoryDetection() throws Exception { start(); final File dir = createDirectory("dir"); createDirectory("dir/sub"); final File file = writeFile("dir/sub/file", "file"); listener.waitForCheck(); assertEquals(2, listener.getCreatedDirectories().size()); assertEquals(1, listener.getCreatedFiles().size()); delay(); FileUtils.deleteDirectory(dir); assertTrue(!dir.exists()); assertTrue(!file.exists()); listener.waitForCheck(); assertEquals(2, listener.getDeletedDirectories().size()); assertEquals(1, listener.getDeletedFiles().size()); stop(); } public void testModifyFileDetection() throws Exception { start(); writeFile("file", "file"); listener.waitForCheck(); assertEquals(1, listener.getCreatedFiles().size()); delay(); writeFile("file", "changed file"); listener.waitForCheck(); assertEquals(1, listener.getChangedFiles().size()); stop(); } public void testCreatingLocalDirectoryChangesLastModified() throws Exception { final long modified = directory.lastModified(); delay(); createDirectory("directory"); delay(); assertTrue(directory.lastModified() != modified); } public void testCreatingLocalFileChangesLastModified() throws Exception { final long modified = directory.lastModified(); delay(); writeFile("file", "file"); delay(); assertTrue(directory.lastModified() != modified); } public void testCreatingSubDirectoryChangesLastModified() throws Exception { createDirectory("dir"); final long modified = directory.lastModified(); delay(); createDirectory("dir/sub"); assertTrue(directory.lastModified() == modified); } public void testCreatingFileInSubDirectoryChangesLastModified() throws Exception { createDirectory("dir"); final long modified = directory.lastModified(); delay(); writeFile("dir/file", "file"); assertTrue(directory.lastModified() == modified); } public void testInterval() throws Exception { final long interval = 1000; start(); fam.setInterval(interval); listener.waitForCheck(); long t1 = System.currentTimeMillis(); listener.waitForCheck(); long t2 = System.currentTimeMillis(); long diff = t2-t1; // interval should be at around the same interval assertTrue("the interval was set to " + interval + " but the time difference was " + diff, (diff > (interval-50)) && (diff < (interval+50))); stop(); } } commons-jci-1.1-src/fam/src/test/resources/simplelog.properties100644 0 0 155 10573617463 22136 0ustar 0 0 org.apache.commons.logging.simplelog.defaultlog=debug org.apache.commons.logging.simplelog.showdatetime=truecommons-jci-1.1-src/src/ 40755 0 0 0 12060700107 12170 5ustar 0 0 commons-jci-1.1-src/src/assembly/ 40755 0 0 0 12225076271 14022 5ustar 0 0 commons-jci-1.1-src/src/media/ 40755 0 0 0 12060700107 13247 5ustar 0 0 commons-jci-1.1-src/src/site/ 40755 0 0 0 12225237646 13154 5ustar 0 0 commons-jci-1.1-src/src/site/resources/ 40755 0 0 0 12225212023 15144 5ustar 0 0 commons-jci-1.1-src/src/site/xdoc/ 40755 0 0 0 12225243654 14105 5ustar 0 0 commons-jci-1.1-src/src/assembly/bin.xml100644 0 0 5473 12225076271 15422 0ustar 0 0 bin tar.gz zip ${project.artifactId}-${commons.release.version} false LICENSE.txt NOTICE.txt target/site/apidocs apidocs core/target lib *.jar examples/target lib *.jar fam/target lib *.jar compilers/eclipse/target lib *.jar compilers/groovy/target lib *.jar compilers/janino/target lib *.jar compilers/rhino/target lib *.jar commons-jci-1.1-src/src/assembly/src.xml100644 0 0 6616 12225073621 15435 0ustar 0 0 src tar.gz zip ${project.artifactId}-${commons.release.version}-src LICENSE.txt NOTICE.txt pom.xml README.txt TODO.txt core src/** pom.xml examples src/** pom.xml fam src/** pom.xml src compilers/eclipse src/** pom.xml compilers/eclipse src/** pom.xml compilers/groovy src/** pom.xml compilers/janino src/** pom.xml compilers/jsr199 src/** pom.xml compilers/rhino src/** pom.xml commons-jci-1.1-src/src/media/jci-logo-white.xcf100644 0 0 110565 11535744642 16761 0ustar 0 0 gimp xcf fileæPBœBœK gimp-commentCreated with The GIMPgimp-image-grid(style solid) (fgcolor (color-rgba 0.000000 0.000000 0.000000 1.000000)) (bgcolor (color-rgba 1.000000 1.000000 1.000000 1.000000)) (xspacing 10.000000) (yspacing 10.000000) (spacing-unit inches) (xoffset 0.000000) (yoffset 0.000000) (offset-unit inches) ¶" TMÿ     Õ@:gimp-text-layer(text "TM") (font "Sans") (font-size 8.000000) (font-size-unit pixels) (hinting yes) (antialias yes) (language "en-us") (base-direction ltr) (color (color-rgb 0.000000 0.000000 0.000000)) (justify left) (box-mode dynamic) (box-width 12.000000) (box-height 11.000000) (box-unit pixels) Ÿ ³ Ä„„#°öɰ¥-É>ÉöÈ8Âx¡ÐöÈ8€²8wÈöÈ8€PÛÈöÈ8€?ÈúÈ8€þÈæP Backgroundÿ     ÉæPå‘]‘iæP$SC’iÙ…[……‘Š· ÿþý þýþ ÿýÆTTüq¨àûûþúûûüýüþŨTTýŒÄûûúûüýûáŒÅýÿÿýýSÝùùúùûüýýŒüoÝùùúöûüü¨T¨üÿÿõÇqÄûúÝSþ£õõïö÷øùù¦pÃúùÝŠþ£õõúö÷ÜŠSý¦ùÿÿó©8áûúùù÷ö6þ ññùòóôõö‰þ¦ùùú÷öõõQþPññùòóômQRý¤Úÿÿò©üûùø÷õôò†öíìííîðñ¡ô¤÷ööõôóññðOþOííùîïññó‡ýQÿÿþÆõàúù÷õôòñïÒøšççèéê¸þ6óóöòñðïíìëêöšçèééëíîïìOÿÿþpúùöõòðîìêé3øÈááâãå3þžïïöîíëééçæå±öááâäåçééú4éÿÿéÃøöôñîìéèåäÉ“ÝÜÜÝÝ®ñéêëêéèæåãâáàß÷zÜÜÝßáãåúLãÿþ8îøõóñíêçåâáßÝÝÂÚÙØ××ýØHþ2ååõãâàßÝÝÜÛÛa÷/ÕÕÖØÚÜÞûJÝþâé7öóðíéåãàÞÜÛÙÙØÖÕÔÓÒÓÔôJßààßÝÜÚÙØØ××þ§ÐûÑÓÕ×ûHÖþ¨éRôðíéåáÝÛÙØ×ÖÖÕÔÓÑÑÐϹþHÚÚôÙ×ÕÕÔÓÓÔÔÕÔøžÊÉÊÌÎÑûFÐþqôQñíéäàÜÙ×ÕÕÔÔøÓÒÑÏÎ͈þGÕÕóÓÑÐÏÎÎÏÑÑÒÓø„ÅÄÄÅÇÉûDÉýTéPîéåàÛ×ÕÒÑÑÒÓÓÔÓÒÑÐÎ͈ïEÑÑÏÍËÊÉÉÊÌÎÐÑÒFøƒÁÀ¿ÀÁÃûBÄýTéëæáÛÖÒÐÎÎÏÑÒÔÕÕÔÓÑÐωúÍÌÊÈÆÅÅøÇÉÍÐÑÓFø‚¿½»º¼½û@ÀýSêèâÝ×ÑÎÌËËÍÐÒÕÖ××ÖÕÓÑ‹ðËÉÆÃÁÀÀÁÄÈÌÐÓÕGø˜¾º·¶·¹û?¼ýSñ˜ßÙÒÍÉÈÈÉÌÏÒÖÙÚÚûÙ×ÕÔð†ÆÂ¿½¼½¾ÂÆËÐÔÖGøÃ½¹µ³³µû>¹ü¦é2ÜÕÎÉÆÄÅÆÊÎÓ×ÚÝÞ­ÝÜÚØûYÄÀ¼¹¹÷¼ÀÅËÑÕÙHú-Ľ¸´±±û=¶üÂê©ÑËÅÂÁÁÅÉÍÓØÝß–áàÞÜañ,½¹¶µ¶¹¾ÅËÑÖÚ÷rž¸³°¯¯ú<µûùê·È¿½¿ÂÇÍÓÙݯ²åäâà¬ò–¼·´³´¸½ÄËÑ×Â÷·ÇÀ¹³¯­®ú<´ûùˆêD¯À¼»½ÀÅËÒØ¬3æçæåãà1òV»µ²±²¶¼ÃÊÑØzö_ÐÉÁ¹´°­­ù<´ûùõ듹¸¹½ÂÉÐwËçèèçåâÆ祵±°±µºÁÉÑרÑÊ»µ±®®ù<´ûøõ ìPz|€X•äæèèçåãà’ç)µ±¯°³¹ÁÈÐwÄØÒËü¶±¯¯ø<´ûøõð› óÝáäæçæåãàÜŽè<±¯¯²¸¿Ç‰ÅÝÙÒÌŽ¸³±÷<µûùõðê– ïˆÓÙÝáãäåäâßÛÖ£éaœ²·~,0ÃÝÛØÒÌÅ¿¹µ´cö¢ûùõñêãÂ.÷S«ÇÍÓØÜÞáá÷àÝÚÖÑËmñ-£ÖÙÛÙ×ÒÌÅÀ|f(ÙüùõñìåÝÔ´><;Nt²¶¼ÁÈÍÒÖÙÜÝÞÝÝÚÖÒÍÆÀ‘d;;Í=}¬ÉÏÔØÙØÕÑÌÇÁ?>==>>??>=üùöòíæßÖÍŽ¶±®®°³·½ÂÈÍÑÕ×ÙÛÛ÷Ù×ÓÎÉý¹µµ€“¸½ÁÈÍÑÕÖÖÔÑÍÈÄÀ¾½½¿ÀÁÁ¿¼ýúøôïéáÙÑÈÀ¹³°®®±´¹½ÂÇËÏÓÕØÙÚÙØÕÑÍÇÁ½¹¸¸¹½ÁÇÌÐÓÕÕÓÐÍÉÆÃÂÁÂÄÅÅÄ¿ýûùõñëåÝÕÌĽ¶²¯®°²µ¹¾ÂÇËÏÓÕØÙÚÙØÕÑÌǾ¼»½¿ÂÆÊÎÑÓÓÒÐÍËÉÇÆÆÇÉÉíÈÅÁýüùöòíèáÙÑÉÁ»µ²±±âµ¸¼ÀÅÉÍÑÕØÚÛÜÚÙÕÑÍÈÄÁÀÀÁÄÇËÎÑÒÒÊÑÏÍÌËËÌÍÍÎÍÌÉÅýýúøõðëåÝÖÎÇÁ»·µ³´µ¸»¿ÄÈÍÑÕÙÛÝÞÞÝÚ×ÓÎËÈÅŹÇÉÌÎÑÒÓÓÒÑÑÐÐÑÑÒÓÓÒÑÍÉþýûùöòîéâÛÕÍÇÁ½º¸¸¹º½ÁÅÉÍÒÖÚÝàáâáßÝÙÕÑÎÌÊÊËÍÎÑÒÓÕÕÄרÙÙØÕÒÎþýüúøõñíçáÛÕÎÉÅÁ¿½¾¿ÁÅÉÍÑÕÙÝáäåææåâßÜÙÕÒÑÐÐÑÒÓÕÖרØÙÙäÚÜÝÝÞÞÝÚ×Óþþýüù÷ôðìæáÜÖÑÍÉÇÅÅêÈÊÍÑÕÙÝáåèéëëéèåâßÜÙØÖÖÛØÙÙÚÛÜÝÝßàáâãäãâàÝÙÿþýýûùöôðìçâÝÙÕÑÏÍÍéÏÑÔ×ÚÞâåéìíïïîíëéåãáÞÝÜÜݶÞßàááãäåæèééèçåâßÿþþýüûùöóðíéåáÝÚØÖÕÕÖØÚÝáäçêíðñòóòñðíëéæåãâááââãäååçèéêìííÃìéçåÿÿþþýüúùöôñîêèåâàÞÝÝÞàáäæéìïñóõõöõõôòðîìêéèèççèèééêìíîïðññûðîìéÿÿþòýüûù÷õòðíëéçæååõçéêìîñóõöøùù÷ø÷õõóñðîííøîïðñòóôõõûôòñîÿÿþÚýüûùøöõòñïîííìííîðñóõöøùúúûûúùùøöõôóòññ÷òóóôõõö÷øøû÷õõóÿÿþýöüúùøöõôóòññéòóôõöøùúûüüýýüüûúùùø÷öõõûö÷÷øùùúùý÷öÿÿþýøüûúùùø÷ööø÷øùùúûüýýüýûúùùúûüûûúúùÿÿþýûüûúúùùúüûüüýýþýüûüýýüûÿÿþýüýþÿþýþý ÿþýþ ÿþýþÿþÿþ¨ÿ ÿþý þýþ ÿýÆTTüq¨àûûþúûûüýüþŨTTýŒÄûûúûüýûáŒÅýÿÿýýSÝùùúùûüýýŒüoÝùùúöûüü¨T¨üÿÿõÇqÄûúÝSþ£õõïö÷øùù¦pÃúùÝŠþ£õõúö÷ÜŠSý¦ùÿÿó©8áûúùù÷ö6þ ññùòóôõö‰þ¦ùùú÷öõõQþPññùòóômQRý¤Úÿÿò©üûùø÷õôò†öíìííîðñ¡ô¤÷ööõôóññðOþOííùîïññó‡ýQÿÿþÆõàúù÷õôòñïÒøšççèéê¸þ6óóöòñðïíìëêöšçèééëíîïìOÿÿþpúùöõòðîìêé3øÈááâãå3þžïïöîíëééçæå±öááâäåçééú4éÿÿéÃøöôñîìéèåäÉ“ÝÜÜÝÝ®ñéêëêéèæåãâáàß÷zÜÜÝßáãåúLãÿþ8îøõóñíêçåâáßÝÝÂÚÙØ××ýØHþ2ååõãâàßÝÝÜÛÛa÷/ÕÕÖØÚÜÞûJÝþâé7öóðíéåãàÞÜÛÙÙØÖÕÔÓÒÓÔôJßààßÝÜÚÙØØ××þ§ÐûÑÓÕ×ûHÖþ¨éRôðíéåáÝÛÙØ×ÖÖÕÔÓÑÑÐϹþHÚÚôÙ×ÕÕÔÓÓÔÔÕÔøžÊÉÊÌÎÑûFÐþqôQñíéäàÜÙ×ÕÕÔÔøÓÒÑÏÎ͈þGÕÕóÓÑÐÏÎÎÏÑÑÒÓø„ÅÄÄÅÇÉûDÉýTéPîéåàÛ×ÕÒÑÑÒÓÓÔÓÒÑÐÎ͈ïEÑÑÏÍËÊÉÉÊÌÎÐÑÒFøƒÁÀ¿ÀÁÃûBÄýTéëæáÛÖÒÐÎÎÏÑÒÔÕÕÔÓÑÐωúÍÌÊÈÆÅÅøÇÉÍÐÑÓFø‚¿½»º¼½û@ÀýSêèâÝ×ÑÎÌËËÍÐÒÕÖ××ÖÕÓÑ‹ðËÉÆÃÁÀÀÁÄÈÌÐÓÕGø˜¾º·¶·¹û?¼ýSñ˜ßÙÒÍÉÈÈÉÌÏÒÖÙÚÚûÙ×ÕÔð†ÆÂ¿½¼½¾ÂÆËÐÔÖGøÃ½¹µ³³µû>¹ü¦é2ÜÕÎÉÆÄÅÆÊÎÓ×ÚÝÞ­ÝÜÚØûYÄÀ¼¹¹÷¼ÀÅËÑÕÙHú-Ľ¸´±±û=¶üÂê©ÑËÅÂÁÁÅÉÍÓØÝß–áàÞÜañ,½¹¶µ¶¹¾ÅËÑÖÚ÷rž¸³°¯¯ú<µûùê·È¿½¿ÂÇÍÓÙݯ²åäâà¬ò–¼·´³´¸½ÄËÑ×Â÷·ÇÀ¹³¯­®ú<´ûùˆêD¯À¼»½ÀÅËÒØ¬3æçæåãà1òV»µ²±²¶¼ÃÊÑØzö_ÐÉÁ¹´°­­ù<´ûùõ듹¸¹½ÂÉÐwËçèèçåâÆ祵±°±µºÁÉÑרÑÊ»µ±®®ù<´ûøõ ìPz|€X•äæèèçåãà’ç)µ±¯°³¹ÁÈÐwÄØÒËü¶±¯¯ø<´ûøõð› óÝáäæçæåãàÜŽè<±¯¯²¸¿Ç‰ÅÝÙÒÌŽ¸³±÷<µûùõðê– ïˆÓÙÝáãäåäâßÛÖ£éaœ²·~,0ÃÝÛØÒÌÅ¿¹µ´cö¢ûùõñêãÂ.÷S«ÇÍÓØÜÞáá÷àÝÚÖÑËmñ-£ÖÙÛÙ×ÒÌÅÀ|f(ÙüùõñìåÝÔ´><;Nt²¶¼ÁÈÍÒÖÙÜÝÞÝÝÚÖÒÍÆÀ‘d;;Í=}¬ÉÏÔØÙØÕÑÌÇÁ?>==>>??>=üùöòíæßÖÍŽ¶±®®°³·½ÂÈÍÑÕ×ÙÛÛ÷Ù×ÓÎÉý¹µµ€“¸½ÁÈÍÑÕÖÖÔÑÍÈÄÀ¾½½¿ÀÁÁ¿¼ýúøôïéáÙÑÈÀ¹³°®®±´¹½ÂÇËÏÓÕØÙÚÙØÕÑÍÇÁ½¹¸¸¹½ÁÇÌÐÓÕÕÓÐÍÉÆÃÂÁÂÄÅÅÄ¿ýûùõñëåÝÕÌĽ¶²¯®°²µ¹¾ÂÇËÏÓÕØÙÚÙØÕÑÌǾ¼»½¿ÂÆÊÎÑÓÓÒÐÍËÉÇÆÆÇÉÉíÈÅÁýüùöòíèáÙÑÉÁ»µ²±±âµ¸¼ÀÅÉÍÑÕØÚÛÜÚÙÕÑÍÈÄÁÀÀÁÄÇËÎÑÒÒÊÑÏÍÌËËÌÍÍÎÍÌÉÅýýúøõðëåÝÖÎÇÁ»·µ³´µ¸»¿ÄÈÍÑÕÙÛÝÞÞÝÚ×ÓÎËÈÅŹÇÉÌÎÑÒÓÓÒÑÑÐÐÑÑÒÓÓÒÑÍÉþýûùöòîéâÛÕÍÇÁ½º¸¸¹º½ÁÅÉÍÒÖÚÝàáâáßÝÙÕÑÎÌÊÊËÍÎÑÒÓÕÕÄרÙÙØÕÒÎþýüúøõñíçáÛÕÎÉÅÁ¿½¾¿ÁÅÉÍÑÕÙÝáäåææåâßÜÙÕÒÑÐÐÑÒÓÕÖרØÙÙäÚÜÝÝÞÞÝÚ×Óþþýüù÷ôðìæáÜÖÑÍÉÇÅÅêÈÊÍÑÕÙÝáåèéëëéèåâßÜÙØÖÖÛØÙÙÚÛÜÝÝßàáâãäãâàÝÙÿþýýûùöôðìçâÝÙÕÑÏÍÍéÏÑÔ×ÚÞâåéìíïïîíëéåãáÞÝÜÜݶÞßàááãäåæèééèçåâßÿþþýüûùöóðíéåáÝÚØÖÕÕÖØÚÝáäçêíðñòóòñðíëéæåãâááââãäååçèéêìííÃìéçåÿÿþþýüúùöôñîêèåâàÞÝÝÞàáäæéìïñóõõöõõôòðîìêéèèççèèééêìíîïðññûðîìéÿÿþòýüûù÷õòðíëéçæååõçéêìîñóõöøùù÷ø÷õõóñðîííøîïðñòóôõõûôòñîÿÿþÚýüûùøöõòñïîííìííîðñóõöøùúúûûúùùøöõôóòññ÷òóóôõõö÷øøû÷õõóÿÿþýöüúùøöõôóòññéòóôõöøùúûüüýýüüûúùùø÷öõõûö÷÷øùùúùý÷öÿÿþýøüûúùùø÷ööø÷øùùúûüýýüýûúùùúûüûûúúùÿÿþýûüûúúùùúüûüüýýþýüûüýýüûÿÿþýüýþÿþýþý ÿþýþ ÿþýþÿþÿþ¨ÿ ÿþý þýþ ÿýÆTTüq¨àûûþúûûüýüþŨTTýŒÄûûúûüýûáŒÅýÿÿýýSÝùùúùûüýýŒüoÝùùúöûüü¨T¨üÿÿõÇqÄûúÝSþ£õõïö÷øùù¦pÃúùÝŠþ£õõúö÷ÜŠSý¦ùÿÿó©8áûúùù÷ö6þ ññùòóôõö‰þ¦ùùú÷öõõQþPññùòóômQRý¤Úÿÿò©üûùø÷õôò†öíìííîðñ¡ô¤÷ööõôóññðOþOííùîïññó‡ýQÿÿþÆõàúù÷õôòñïÒøšççèéê¸þ6óóöòñðïíìëêöšçèééëíîïìOÿÿþpúùöõòðîìêé3øÈááâãå3þžïïöîíëééçæå±öááâäåçééú4éÿÿéÃøöôñîìéèåäÉ“ÝÜÜÝÝ®ñéêëêéèæåãâáàß÷zÜÜÝßáãåúLãÿþ8îøõóñíêçåâáßÝÝÂÚÙØ××ýØHþ2ååõãâàßÝÝÜÛÛa÷/ÕÕÖØÚÜÞûJÝþâé7öóðíéåãàÞÜÛÙÙØÖÕÔÓÒÓÔôJßààßÝÜÚÙØØ××þ§ÐûÑÓÕ×ûHÖþ¨éRôðíéåáÝÛÙØ×ÖÖÕÔÓÑÑÐϹþHÚÚôÙ×ÕÕÔÓÓÔÔÕÔøžÊÉÊÌÎÑûFÐþqôQñíéäàÜÙ×ÕÕÔÔøÓÒÑÏÎ͈þGÕÕóÓÑÐÏÎÎÏÑÑÒÓø„ÅÄÄÅÇÉûDÉýTéPîéåàÛ×ÕÒÑÑÒÓÓÔÓÒÑÐÎ͈ïEÑÑÏÍËÊÉÉÊÌÎÐÑÒFøƒÁÀ¿ÀÁÃûBÄýTéëæáÛÖÒÐÎÎÏÑÒÔÕÕÔÓÑÐωúÍÌÊÈÆÅÅøÇÉÍÐÑÓFø‚¿½»º¼½û@ÀýSêèâÝ×ÑÎÌËËÍÐÒÕÖ××ÖÕÓÑ‹ðËÉÆÃÁÀÀÁÄÈÌÐÓÕGø˜¾º·¶·¹û?¼ýSñ˜ßÙÒÍÉÈÈÉÌÏÒÖÙÚÚûÙ×ÕÔð†ÆÂ¿½¼½¾ÂÆËÐÔÖGøÃ½¹µ³³µû>¹ü¦é2ÜÕÎÉÆÄÅÆÊÎÓ×ÚÝÞ­ÝÜÚØûYÄÀ¼¹¹÷¼ÀÅËÑÕÙHú-Ľ¸´±±û=¶üÂê©ÑËÅÂÁÁÅÉÍÓØÝß–áàÞÜañ,½¹¶µ¶¹¾ÅËÑÖÚ÷rž¸³°¯¯ú<µûùê·È¿½¿ÂÇÍÓÙݯ²åäâà¬ò–¼·´³´¸½ÄËÑ×Â÷·ÇÀ¹³¯­®ú<´ûùˆêD¯À¼»½ÀÅËÒØ¬3æçæåãà1òV»µ²±²¶¼ÃÊÑØzö_ÐÉÁ¹´°­­ù<´ûùõ듹¸¹½ÂÉÐwËçèèçåâÆ祵±°±µºÁÉÑרÑÊ»µ±®®ù<´ûøõ ìPz|€X•äæèèçåãà’ç)µ±¯°³¹ÁÈÐwÄØÒËü¶±¯¯ø<´ûøõð› óÝáäæçæåãàÜŽè<±¯¯²¸¿Ç‰ÅÝÙÒÌŽ¸³±÷<µûùõðê– ïˆÓÙÝáãäåäâßÛÖ£éaœ²·~,0ÃÝÛØÒÌÅ¿¹µ´cö¢ûùõñêãÂ.÷S«ÇÍÓØÜÞáá÷àÝÚÖÑËmñ-£ÖÙÛÙ×ÒÌÅÀ|f(ÙüùõñìåÝÔ´><;Nt²¶¼ÁÈÍÒÖÙÜÝÞÝÝÚÖÒÍÆÀ‘d;;Í=}¬ÉÏÔØÙØÕÑÌÇÁ?>==>>??>=üùöòíæßÖÍŽ¶±®®°³·½ÂÈÍÑÕ×ÙÛÛ÷Ù×ÓÎÉý¹µµ€“¸½ÁÈÍÑÕÖÖÔÑÍÈÄÀ¾½½¿ÀÁÁ¿¼ýúøôïéáÙÑÈÀ¹³°®®±´¹½ÂÇËÏÓÕØÙÚÙØÕÑÍÇÁ½¹¸¸¹½ÁÇÌÐÓÕÕÓÐÍÉÆÃÂÁÂÄÅÅÄ¿ýûùõñëåÝÕÌĽ¶²¯®°²µ¹¾ÂÇËÏÓÕØÙÚÙØÕÑÌǾ¼»½¿ÂÆÊÎÑÓÓÒÐÍËÉÇÆÆÇÉÉíÈÅÁýüùöòíèáÙÑÉÁ»µ²±±âµ¸¼ÀÅÉÍÑÕØÚÛÜÚÙÕÑÍÈÄÁÀÀÁÄÇËÎÑÒÒÊÑÏÍÌËËÌÍÍÎÍÌÉÅýýúøõðëåÝÖÎÇÁ»·µ³´µ¸»¿ÄÈÍÑÕÙÛÝÞÞÝÚ×ÓÎËÈÅŹÇÉÌÎÑÒÓÓÒÑÑÐÐÑÑÒÓÓÒÑÍÉþýûùöòîéâÛÕÍÇÁ½º¸¸¹º½ÁÅÉÍÒÖÚÝàáâáßÝÙÕÑÎÌÊÊËÍÎÑÒÓÕÕÄרÙÙØÕÒÎþýüúøõñíçáÛÕÎÉÅÁ¿½¾¿ÁÅÉÍÑÕÙÝáäåææåâßÜÙÕÒÑÐÐÑÒÓÕÖרØÙÙäÚÜÝÝÞÞÝÚ×Óþþýüù÷ôðìæáÜÖÑÍÉÇÅÅêÈÊÍÑÕÙÝáåèéëëéèåâßÜÙØÖÖÛØÙÙÚÛÜÝÝßàáâãäãâàÝÙÿþýýûùöôðìçâÝÙÕÑÏÍÍéÏÑÔ×ÚÞâåéìíïïîíëéåãáÞÝÜÜݶÞßàááãäåæèééèçåâßÿþþýüûùöóðíéåáÝÚØÖÕÕÖØÚÝáäçêíðñòóòñðíëéæåãâááââãäååçèéêìííÃìéçåÿÿþþýüúùöôñîêèåâàÞÝÝÞàáäæéìïñóõõöõõôòðîìêéèèççèèééêìíîïðññûðîìéÿÿþòýüûù÷õòðíëéçæååõçéêìîñóõöøùù÷ø÷õõóñðîííøîïðñòóôõõûôòñîÿÿþÚýüûùøöõòñïîííìííîðñóõöøùúúûûúùùøöõôóòññ÷òóóôõõö÷øøû÷õõóÿÿþýöüúùøöõôóòññéòóôõöøùúûüüýýüüûúùùø÷öõõûö÷÷øùùúùý÷öÿÿþýøüûúùùø÷ööø÷øùùúûüýýüýûúùùúûüûûúúùÿÿþýûüûúúùùúüûüüýýþýüûüýýüûÿÿþýüýþÿþýþý ÿþýþ ÿþýþÿþÿþ¨ÿ¹ÿþúÿ=ÿþýÿÿþþý ýü ýþüýýþ ýüýüùÄ‹SSpÃúúø§pSSpÃûúúûüýýÅqýýüù¨pSS‹ßúúùÞ§ûúÃ7ý7Ü÷÷ý‰ü7Üø÷÷øùòúûߌ8üûûú‹ýnø÷÷ùÛnùnù6ôóó½þôôõü¿n7ùýÝ7ú‡ôóó‡ø6l¡ kô…îžOŸ  kþ…ïïúðñ6Q6ö÷¤6†  5ïÔîOjŸ 5»ïííììÒú›MÎééûêëÑþééùëìíðñ6õQkÕîííìì‚ûhMééùêíëéèæååþfþKááùâãäååþ±ããùåæèêížùžìêéçæååþþ–ááøâãçåâáàÞÞþ¬ý0ÚÙÙùÚÛÜÝÞ­þ’ÜÜùÝßáåç›ô‚éæäâáßÞÞÝbþyÙÙ÷ÚÜáÝÛÙØ×ÖÖýFÒÑÑùÒÓÔÕרþGÕÕùÖØÛÝá˜ô˜ãàÝÛÙØ×ÖÖŽýŒÒÑÑôÒÓÙÖÔÑÐÏÎÎÏýDËÉÉúÊÌÍÏÑþDÍÍùÎÑÔ×Ú”ô•ÝÙÖÓÑÐÏÎÏŠýˆÊÉÉùËÓÏÌÉÈÇÇþÈüBÅÃÁÁúÃÅÆÈÉõCÇÆÇÈÉÍÑÕô‘×ÓÏÌÉÈÇÇȆïƒÄÂÁÁÂÃÌÉÅÂÁÀÀÁÂô@¿½»ºº¼½ÀÁÄýAÂÁÁúÃÆÊÎŒôŽÑÍÉÅÂÁÀÁÁ‚½»º»¼Å¾¼º¹º¼½û?»¹¶µµû¸º½¿õ@¾½¼¼½ÁÅɈôŠÌÇÿ¼ºº»½~ï~º¸¶µµ¶Á½¹¶µµ¶¸ºû>¹µ³±±û³µ¹¼ü?¼º¹¹û¼¿Ä…ôˆÈþ¹·µµ·¹|û|·µ²±±ö¼¸µ²±±³µ¹ô>¸´±¯­®°³¶ºõ?»¹¶µ¶¸»À‚ô†Ä¿º¶³²²´·{ï{¶³°®­®¸µ±¯®¯±´¸ô>¸´±­¬­®±µ¹õ?»¸µ´´µ¹½€ôƒÁ½¸³±°±²µ{õ|·³¯­¬­µ²¯­­ü°´¸ô?¹µ±­¬¬­±µ¹õ?¼¹µ³²³¶º~ô‚À»µ±¯®¯²¶{ï}¸´°­¬¬´±­¬¬­±µ¹ô?»¶²®¬¬­±µºõ@½¹µ³±²µ¸~ô‚¿¹µ±®­¯²¶|ï~¹µ±­¬¬²¯­««­±µ»ô@½¸³¯­­®±¶¼õA¿»¶³±±³·|ô¾¹µ±®®°³¸~¶²®­­±¯­«¬®±·¼ôA¿ºµ±®­¯²¸½õAÁ¼·³±±²µ|ô€½¹µ±®®±´¹~ク³°­­±¯­¬¬®²¸½ôAÁ¼¶²¯®°´¹¾õB½¸´±±²µ{ô€½¹µ±¯¯±µº€ï‚¿¹µ±®¯±¯­¬­¯´¹¿ôB½¸³°¯±µ¹¿úBþ¹´±±ýµ{ô€½¹µ±¯°²¶»€öƒÁ»µ±°°²°­­û°´¹ÀôBľ¹´±°±µºÀúCÄ¿¹µ±±ýµ{ô€½¹µ±°°²·¼€ï„Á¼·²°±³°®­­°µº«úľ¹´±±üµ»Áú,Å¿¹µ±±ý´fô€½¹µ±°°³·½lïX½·³±±´±®­®±µ»kõƒ¿¹µ±±²µ»kû¯¿¹µ±±ý´)ô+½¹µ²°±³¸½+𬽸³±±@BCDDCA?=d²±c<>@BCDDCA@>dŠ;;<=>@@Â?=<²±±<=?ABCDCBA?=Œ±±¹µ±°±³¶¼ÁÇÊÍÌÉÅÀºµ³²³·¼ÁÆÊÌÌÉÅÀºµ²±²µ¸¼¿ÁÁ˜½¹µ³±²µ¹¾ÄÈËÍËÈþ¹µ²²»·´²²´¸½ÂÇËÍÍÉÅÁ»¶´³´¸¼ÁÆÊÌÌÉÅÁ»¶³²³µ¹½ÀÁÂÁ½º¶´²³µ¹¾ÄÉÌÍËÉľ¹µ³³½¹¶´´µ¹¾ÃÈËÍÍÊÆÁ½¸µµ€Ô¹½ÂÇËÍÍÊÆÁ½¸µ´µ¶¹½ÁÂÂÁ¾»¸µ´µ·»ÀÅÉÌÍÌÉÅÀ»·µµÁ½¹··¹¼ÁÅÉÍÎÎÌÈþº¸·¹»ÀÄÉÌÍÍËÈþº¸¶·¹¼¿ÂÄÅÃÁ½º¸¶·¹½ÂÇËÍÎÍÊÆÁ½¹¸¸ÅÁ½»»¼¿ÃÈÌÎÐÐÍÊÅÁ½»º¼¾ÂÆÊÍÏÏÍÉÅÁ½»¹º¼¿ÂÅÆÆÅÃÀ½»ºº½ÀÅÉÍÏÐÏÍÉÄÀ½»»ÊÆÂÁÀÁÄÇËÏÑÓÒÑÍÉÅÂÀ¿ÁÃÆÊÍÑÒÒÐÍÉÅÂÀ¿¿ÁÃÅÈÉÉØÇÄÁÀ¿¿ÁÅÉÍÐÒÓÒÐÌÈÅÁÀÀÏËÈÆÅÆÉÌÏÒÕÖÕÔÑÍÊÇÅÅíÈËÎÑÔÕÕÔÑÍÊÇÅÄÅÆÈÊÍÍüËÉÆÅÅÂÆÉÍÑÔÕÖÕÓÐÍÉÆÅÅÕÑÎÍÌÍÏÑÕ×ÙÚÚÙÖÓÐÍÌËÌÍÑÓÖØÙÙØÕÓÐÍÌËËÌÎÐÑÒÓÒÑÎÍËËíÍÏÒÕØÙÚÙØÕÒÏÍÌÌÛØÕÔÔ×ÕØÚÝÞßßÝÜÙ×ÕÓÒÓÕ×ÙÜÝÞÞÝÛÙÖÕÓÒÒÓÕÖØÙÙØÖÕÔÒÒÈÔÖÙÛÝÞßÞÝÛØÕÔÓÓáßÝÛÚÛÝÞàâãääãáßÝÛÚÙÚÜÝßáâããâáßÝÛÚÙÙÚÛÝÝÞÞüÝÜÚÙÙúÛÝÞáâääîâáÞÝÛÚÙçåãâáâãååçééúèæåãâááóâäåæèéèèæåãâáá÷âãäååäãâááûãåæèééïèæåãâááíêééèèéêëííôìêééèçèééêìííûìêéèççèéêéþèççûèéêìííöëêéèèçñðïîîïñòñüðïîííüîïðññüðïîííîïîíüîïðññþòññøðîîííõôóóþôõõüôóóòòóþôõõüôóóòòóôóòýóôõõõôóóòòùø÷÷ö÷÷øùø÷ö÷øùø÷ö÷ö÷øùø÷öüûúúùùúûúùúûúùúùúûúùþýüüý üýüýü?ý þþÿþ2þ€ÿþþý ýü ýþüýýþ ýüýüùÄ‹SSpÃúúø§pSSpÃûúúûüýýÅqýýüù¨pSS‹ßúúùÞ§ûúÃ7ý7Ü÷÷ý‰ü7Üø÷÷øùòúûߌ8üûûú‹ýnø÷÷ùÛnùnù6ôóó½þôôõü¿n7ùýÝ7ú‡ôóó‡ø6l¡ kô…îžOŸ  kþ…ïïúðñ6Q6ö÷¤6†  5ïÔîOjŸ 5»ïííììÒú›MÎééûêëÑþééùëìíðñ6õQkÕîííìì‚ûhMééùêíëéèæååþfþKááùâãäååþ±ããùåæèêížùžìêéçæååþþ–ááøâãçåâáàÞÞþ¬ý0ÚÙÙùÚÛÜÝÞ­þ’ÜÜùÝßáåç›ô‚éæäâáßÞÞÝbþyÙÙ÷ÚÜáÝÛÙØ×ÖÖýFÒÑÑùÒÓÔÕרþGÕÕùÖØÛÝá˜ô˜ãàÝÛÙØ×ÖÖŽýŒÒÑÑôÒÓÙÖÔÑÐÏÎÎÏýDËÉÉúÊÌÍÏÑþDÍÍùÎÑÔ×Ú”ô•ÝÙÖÓÑÐÏÎÏŠýˆÊÉÉùËÓÏÌÉÈÇÇþÈüBÅÃÁÁúÃÅÆÈÉõCÇÆÇÈÉÍÑÕô‘×ÓÏÌÉÈÇÇȆïƒÄÂÁÁÂÃÌÉÅÂÁÀÀÁÂô@¿½»ºº¼½ÀÁÄýAÂÁÁúÃÆÊÎŒôŽÑÍÉÅÂÁÀÁÁ‚½»º»¼Å¾¼º¹º¼½û?»¹¶µµû¸º½¿õ@¾½¼¼½ÁÅɈôŠÌÇÿ¼ºº»½~ï~º¸¶µµ¶Á½¹¶µµ¶¸ºû>¹µ³±±û³µ¹¼ü?¼º¹¹û¼¿Ä…ôˆÈþ¹·µµ·¹|û|·µ²±±ö¼¸µ²±±³µ¹ô>¸´±¯­®°³¶ºõ?»¹¶µ¶¸»À‚ô†Ä¿º¶³²²´·{ï{¶³°®­®¸µ±¯®¯±´¸ô>¸´±­¬­®±µ¹õ?»¸µ´´µ¹½€ôƒÁ½¸³±°±²µ{õ|·³¯­¬­µ²¯­­ü°´¸ô?¹µ±­¬¬­±µ¹õ?¼¹µ³²³¶º~ô‚À»µ±¯®¯²¶{ï}¸´°­¬¬´±­¬¬­±µ¹ô?»¶²®¬¬­±µºõ@½¹µ³±²µ¸~ô‚¿¹µ±®­¯²¶|ï~¹µ±­¬¬²¯­««­±µ»ô@½¸³¯­­®±¶¼õA¿»¶³±±³·|ô¾¹µ±®®°³¸~¶²®­­±¯­«¬®±·¼ôA¿ºµ±®­¯²¸½õAÁ¼·³±±²µ|ô€½¹µ±®®±´¹~ク³°­­±¯­¬¬®²¸½ôAÁ¼¶²¯®°´¹¾õB½¸´±±²µ{ô€½¹µ±¯¯±µº€ï‚¿¹µ±®¯±¯­¬­¯´¹¿ôB½¸³°¯±µ¹¿úBþ¹´±±ýµ{ô€½¹µ±¯°²¶»€öƒÁ»µ±°°²°­­û°´¹ÀôBľ¹´±°±µºÀúCÄ¿¹µ±±ýµ{ô€½¹µ±°°²·¼€ï„Á¼·²°±³°®­­°µº«úľ¹´±±üµ»Áú,Å¿¹µ±±ý´fô€½¹µ±°°³·½lïX½·³±±´±®­®±µ»kõƒ¿¹µ±±²µ»kû¯¿¹µ±±ý´)ô+½¹µ²°±³¸½+𬽸³±±@BCDDCA?=d²±c<>@BCDDCA@>dŠ;;<=>@@Â?=<²±±<=?ABCDCBA?=Œ±±¹µ±°±³¶¼ÁÇÊÍÌÉÅÀºµ³²³·¼ÁÆÊÌÌÉÅÀºµ²±²µ¸¼¿ÁÁ˜½¹µ³±²µ¹¾ÄÈËÍËÈþ¹µ²²»·´²²´¸½ÂÇËÍÍÉÅÁ»¶´³´¸¼ÁÆÊÌÌÉÅÁ»¶³²³µ¹½ÀÁÂÁ½º¶´²³µ¹¾ÄÉÌÍËÉľ¹µ³³½¹¶´´µ¹¾ÃÈËÍÍÊÆÁ½¸µµ€Ô¹½ÂÇËÍÍÊÆÁ½¸µ´µ¶¹½ÁÂÂÁ¾»¸µ´µ·»ÀÅÉÌÍÌÉÅÀ»·µµÁ½¹··¹¼ÁÅÉÍÎÎÌÈþº¸·¹»ÀÄÉÌÍÍËÈþº¸¶·¹¼¿ÂÄÅÃÁ½º¸¶·¹½ÂÇËÍÎÍÊÆÁ½¹¸¸ÅÁ½»»¼¿ÃÈÌÎÐÐÍÊÅÁ½»º¼¾ÂÆÊÍÏÏÍÉÅÁ½»¹º¼¿ÂÅÆÆÅÃÀ½»ºº½ÀÅÉÍÏÐÏÍÉÄÀ½»»ÊÆÂÁÀÁÄÇËÏÑÓÒÑÍÉÅÂÀ¿ÁÃÆÊÍÑÒÒÐÍÉÅÂÀ¿¿ÁÃÅÈÉÉØÇÄÁÀ¿¿ÁÅÉÍÐÒÓÒÐÌÈÅÁÀÀÏËÈÆÅÆÉÌÏÒÕÖÕÔÑÍÊÇÅÅíÈËÎÑÔÕÕÔÑÍÊÇÅÄÅÆÈÊÍÍüËÉÆÅÅÂÆÉÍÑÔÕÖÕÓÐÍÉÆÅÅÕÑÎÍÌÍÏÑÕ×ÙÚÚÙÖÓÐÍÌËÌÍÑÓÖØÙÙØÕÓÐÍÌËËÌÎÐÑÒÓÒÑÎÍËËíÍÏÒÕØÙÚÙØÕÒÏÍÌÌÛØÕÔÔ×ÕØÚÝÞßßÝÜÙ×ÕÓÒÓÕ×ÙÜÝÞÞÝÛÙÖÕÓÒÒÓÕÖØÙÙØÖÕÔÒÒÈÔÖÙÛÝÞßÞÝÛØÕÔÓÓáßÝÛÚÛÝÞàâãääãáßÝÛÚÙÚÜÝßáâããâáßÝÛÚÙÙÚÛÝÝÞÞüÝÜÚÙÙúÛÝÞáâääîâáÞÝÛÚÙçåãâáâãååçééúèæåãâááóâäåæèéèèæåãâáá÷âãäååäãâááûãåæèééïèæåãâááíêééèèéêëííôìêééèçèééêìííûìêéèççèéêéþèççûèéêìííöëêéèèçñðïîîïñòñüðïîííüîïðññüðïîííîïîíüîïðññþòññøðîîííõôóóþôõõüôóóòòóþôõõüôóóòòóôóòýóôõõõôóóòòùø÷÷ö÷÷øùø÷ö÷øùø÷ö÷ö÷øùø÷öüûúúùùúûúùúûúùúùúûúùþýüüý üýüýü?ý þþÿþ2þ€ÿþþý ýü ýþüýýþ ýüýüùÄ‹SSpÃúúø§pSSpÃûúúûüýýÅqýýüù¨pSS‹ßúúùÞ§ûúÃ7ý7Ü÷÷ý‰ü7Üø÷÷øùòúûߌ8üûûú‹ýnø÷÷ùÛnùnù6ôóó½þôôõü¿n7ùýÝ7ú‡ôóó‡ø6l¡ kô…îžOŸ  kþ…ïïúðñ6Q6ö÷¤6†  5ïÔîOjŸ 5»ïííììÒú›MÎééûêëÑþééùëìíðñ6õQkÕîííìì‚ûhMééùêíëéèæååþfþKááùâãäååþ±ããùåæèêížùžìêéçæååþþ–ááøâãçåâáàÞÞþ¬ý0ÚÙÙùÚÛÜÝÞ­þ’ÜÜùÝßáåç›ô‚éæäâáßÞÞÝbþyÙÙ÷ÚÜáÝÛÙØ×ÖÖýFÒÑÑùÒÓÔÕרþGÕÕùÖØÛÝá˜ô˜ãàÝÛÙØ×ÖÖŽýŒÒÑÑôÒÓÙÖÔÑÐÏÎÎÏýDËÉÉúÊÌÍÏÑþDÍÍùÎÑÔ×Ú”ô•ÝÙÖÓÑÐÏÎÏŠýˆÊÉÉùËÓÏÌÉÈÇÇþÈüBÅÃÁÁúÃÅÆÈÉõCÇÆÇÈÉÍÑÕô‘×ÓÏÌÉÈÇÇȆïƒÄÂÁÁÂÃÌÉÅÂÁÀÀÁÂô@¿½»ºº¼½ÀÁÄýAÂÁÁúÃÆÊÎŒôŽÑÍÉÅÂÁÀÁÁ‚½»º»¼Å¾¼º¹º¼½û?»¹¶µµû¸º½¿õ@¾½¼¼½ÁÅɈôŠÌÇÿ¼ºº»½~ï~º¸¶µµ¶Á½¹¶µµ¶¸ºû>¹µ³±±û³µ¹¼ü?¼º¹¹û¼¿Ä…ôˆÈþ¹·µµ·¹|û|·µ²±±ö¼¸µ²±±³µ¹ô>¸´±¯­®°³¶ºõ?»¹¶µ¶¸»À‚ô†Ä¿º¶³²²´·{ï{¶³°®­®¸µ±¯®¯±´¸ô>¸´±­¬­®±µ¹õ?»¸µ´´µ¹½€ôƒÁ½¸³±°±²µ{õ|·³¯­¬­µ²¯­­ü°´¸ô?¹µ±­¬¬­±µ¹õ?¼¹µ³²³¶º~ô‚À»µ±¯®¯²¶{ï}¸´°­¬¬´±­¬¬­±µ¹ô?»¶²®¬¬­±µºõ@½¹µ³±²µ¸~ô‚¿¹µ±®­¯²¶|ï~¹µ±­¬¬²¯­««­±µ»ô@½¸³¯­­®±¶¼õA¿»¶³±±³·|ô¾¹µ±®®°³¸~¶²®­­±¯­«¬®±·¼ôA¿ºµ±®­¯²¸½õAÁ¼·³±±²µ|ô€½¹µ±®®±´¹~ク³°­­±¯­¬¬®²¸½ôAÁ¼¶²¯®°´¹¾õB½¸´±±²µ{ô€½¹µ±¯¯±µº€ï‚¿¹µ±®¯±¯­¬­¯´¹¿ôB½¸³°¯±µ¹¿úBþ¹´±±ýµ{ô€½¹µ±¯°²¶»€öƒÁ»µ±°°²°­­û°´¹ÀôBľ¹´±°±µºÀúCÄ¿¹µ±±ýµ{ô€½¹µ±°°²·¼€ï„Á¼·²°±³°®­­°µº«úľ¹´±±üµ»Áú,Å¿¹µ±±ý´fô€½¹µ±°°³·½lïX½·³±±´±®­®±µ»kõƒ¿¹µ±±²µ»kû¯¿¹µ±±ý´)ô+½¹µ²°±³¸½+𬽸³±±@BCDDCA?=d²±c<>@BCDDCA@>dŠ;;<=>@@Â?=<²±±<=?ABCDCBA?=Œ±±¹µ±°±³¶¼ÁÇÊÍÌÉÅÀºµ³²³·¼ÁÆÊÌÌÉÅÀºµ²±²µ¸¼¿ÁÁ˜½¹µ³±²µ¹¾ÄÈËÍËÈþ¹µ²²»·´²²´¸½ÂÇËÍÍÉÅÁ»¶´³´¸¼ÁÆÊÌÌÉÅÁ»¶³²³µ¹½ÀÁÂÁ½º¶´²³µ¹¾ÄÉÌÍËÉľ¹µ³³½¹¶´´µ¹¾ÃÈËÍÍÊÆÁ½¸µµ€Ô¹½ÂÇËÍÍÊÆÁ½¸µ´µ¶¹½ÁÂÂÁ¾»¸µ´µ·»ÀÅÉÌÍÌÉÅÀ»·µµÁ½¹··¹¼ÁÅÉÍÎÎÌÈþº¸·¹»ÀÄÉÌÍÍËÈþº¸¶·¹¼¿ÂÄÅÃÁ½º¸¶·¹½ÂÇËÍÎÍÊÆÁ½¹¸¸ÅÁ½»»¼¿ÃÈÌÎÐÐÍÊÅÁ½»º¼¾ÂÆÊÍÏÏÍÉÅÁ½»¹º¼¿ÂÅÆÆÅÃÀ½»ºº½ÀÅÉÍÏÐÏÍÉÄÀ½»»ÊÆÂÁÀÁÄÇËÏÑÓÒÑÍÉÅÂÀ¿ÁÃÆÊÍÑÒÒÐÍÉÅÂÀ¿¿ÁÃÅÈÉÉØÇÄÁÀ¿¿ÁÅÉÍÐÒÓÒÐÌÈÅÁÀÀÏËÈÆÅÆÉÌÏÒÕÖÕÔÑÍÊÇÅÅíÈËÎÑÔÕÕÔÑÍÊÇÅÄÅÆÈÊÍÍüËÉÆÅÅÂÆÉÍÑÔÕÖÕÓÐÍÉÆÅÅÕÑÎÍÌÍÏÑÕ×ÙÚÚÙÖÓÐÍÌËÌÍÑÓÖØÙÙØÕÓÐÍÌËËÌÎÐÑÒÓÒÑÎÍËËíÍÏÒÕØÙÚÙØÕÒÏÍÌÌÛØÕÔÔ×ÕØÚÝÞßßÝÜÙ×ÕÓÒÓÕ×ÙÜÝÞÞÝÛÙÖÕÓÒÒÓÕÖØÙÙØÖÕÔÒÒÈÔÖÙÛÝÞßÞÝÛØÕÔÓÓáßÝÛÚÛÝÞàâãääãáßÝÛÚÙÚÜÝßáâããâáßÝÛÚÙÙÚÛÝÝÞÞüÝÜÚÙÙúÛÝÞáâääîâáÞÝÛÚÙçåãâáâãååçééúèæåãâááóâäåæèéèèæåãâáá÷âãäååäãâááûãåæèééïèæåãâááíêééèèéêëííôìêééèçèééêìííûìêéèççèéêéþèççûèéêìííöëêéèèçñðïîîïñòñüðïîííüîïðññüðïîííîïîíüîïðññþòññøðîîííõôóóþôõõüôóóòòóþôõõüôóóòòóôóòýóôõõõôóóòòùø÷÷ö÷÷øùø÷ö÷øùø÷ö÷ö÷øùø÷öüûúúùùúûúùúûúùúùúûúùþýüüý üýüýü?ý þþÿþ2þ€ÿÿýþÿþ ýþ ýþüSSü‹ßûúúûþüýýþüâ©qTTüp¨üûûüýöÅqÅýýüüß‹SSþ¦úúþnøøü÷øøùùøúûüýýÅ8üSÂùøøùòúûûÄp§ûúÞoû¤÷÷þmôôõïö÷øùúß88¨ûúù¦7þQõõúö÷¥Sû¦ùÁû¢ó PþÔïïìðñòóõöÁSúùùø÷öõ¢ýÖññúòóQQRö¤£l  kúîëëþhééëêëíïñØRøø÷öõôòñðŸýÒííúîðñòQõPÓíìëêê4ú›äåå3þããùäåçéìóÚõõôòñðîíìêhöMçèééêìížöêéçååäã±úKÝÝÞcÜúÝÞáã€þPññõðîíëéèæåå÷¯áâãåæè›ôæäâàÞÝÜÜÛúÕÖ×þŽÕÕû×ÙÝñííìëéçåäâááàc÷0ÛÜÝÝßá—ø–àÝÚØÖÕÔÔþFûÍÎЋþ‰ÍÍüÏÒŽñÌçèçåäáàÞÝÝÜÛªø½ÕÕ×ÙÚ’ø’ÙÖÓÐÎÍÌÌþDûÅÇɆø…ÇÆÇÉËDáøßÝÜÚÙØØ××þøŠÏÏÐÑÓŽôŽÒÎËÈÆÅÄÄÅAû¾Áƒþ‚ÁÁüÂÄ,õÚÜÜÛÙ×ÕÕÔÓÔÔýÕFøZÊÉÉÊ̈ùˆËÇÄÁ¾½½ý¾?û¹»½€ù€½½¼½¾ðÔÕÕÔÒÑÐÎÎÏÐÑÒÒ]øBÅÄÃÄÅ„ô„ÅÁ½º¸¶¶·¹>û´·º~ù~»¹¸¸¹ðÍÏÎÍÌËÉÉÊÌÍÐÑÒŒøAÂÀ¾¾¿€ô€¾»¸µ²±±³µ=û±´¸|ü~¹·µµú„ÉÈÇÆÅÅøÆÉÌÎÑÓŒøAÀ½º¹¹|ô}¹¶³°®­®±³<û¯²·|ù~º¶´²²ð€ÂÂÁÀ¿ÀÁÃÆÊÎÒÔŽøX¿»·µµxôzµ³°­¬«­¯³<û®²·|ø~»·´±°;ð?½½¼»º»½ÁÅÉÎÓÕøƒ¿¹µ²±vôx²°­«©ª¬¯³=û®²·}ø€¼¸³±¯M𹸷¶¶·º¾ÄÉÏÔØø°À¹´±¯tûv°®¬©©û¬°´=û¯³¹~ø€½¹´°­‡ñ ´²±²´·¼ÂÉÏÕÙI÷.ÈÁ¹´°­sûu¯­«©©û­±µ>û°´¹÷‚¿¹µ°­¬ñO°¯®¯±µºÁÈÏÕÚ1÷tÉÁº´¯­rôt®¬ª©©ª­±·>û±µº€÷ƒÀºµ°­«_ò­­¬­¯³¹ÀÈÏÕÂöÒËüµ°­rôt­¬ª©©«®³¸?û²¶¼€ö„Á»µ±­«ª&ó_«ª«­±·¾ÆÎÕaö©ÔÍŽ¶±­rôt­¬ª©©¬¯´¹?û²·½õ„¼¶±­«ª—õ—©©¬°¶½Åͽõ“ÚÕÍž·±®sôt®­«ªª¬°µº@û³·½ôn½¶±­«ªª™è–©«¯µ¼Äµ”ÝÙÕÍÆ¿¹³°`ôv¯­¬««­±µ»û³¸½+ó,½¶±­«ª«¬š9êL…¯´‘V’ÝÜÙÕÎÇÁºµ²õ'±¯­¬¬­±µ|üxRò+iz­¬«¬­®¯ˆ&ñsÕÙÛÚØÔÎÈÁ’f÷Nt­­šv<í<=?ABCDCBA?=Š®­¬­¯±±ê›t9:;==Ú<;:®­ˆ;=>@BCCBµ¹½ÃÈËÌËÈý¸³¯­­¯±³´µ´³±±î²µ¹¿ÅËÑÔÖÖÕÒÍÉÅÁ½¼¼Â»¹·µ±¯¯°³·½ÁÆÉÉȵ¹¾ÃÈËÌËÈľ¹´±°°±´¶¸¹¸·µµ´µ·»ÀÅÉÎÒÔÕÔÑÎÊÆÄÁÁÀÁÁú¿½º·´±±ú´¹½ÂÆÉÉë·º¿ÄÉËÍÌÉÅ¿º¶³²²µ·¹¼½½þ»¹¹ðº½ÁÅÉÍÑÒÓÒÑÎÌÉÇÅÅêÄÁ½º¶´³´¶¹¾ÃÇÉÊɹ½ÁÅÊÍÍóÊÆÁ½¹¶µ¶¹»¾ÁÂÂìÁ¿¾½¾ÀÂÆÉÍÐÑÒÒÑÐÍÌËÊÊËÂÊÉžº¸¶·¹½ÁÅÉËÌʽÀÄÈÌÎÏÎÌÉÄÀ½º¹º½ÀÃÅÈÉÈÇÅÅÃÃÄÆÉËÍÐÑÓÓÒÑÑÐÏÏÐÑÑñÏÍÊÆÂ¿¼ºº½ÀÄÈËÍÍÛÁÄÈÌÏÑÒÑÏÌÈÅÁ¿¿ÀÂÅÉÌÍÏÏÎÍËÊÉÉÊÌÍÐÑÓÔÕÕÔÕÖéÕÓÐÌÈÄÁÀÀÁÄÈËÎÐÑÏÆÉÌÐÒÕÕòÓÐÍÉÇÅÅÆÉËÎÑÔÕÕðÔÒÑÐÏÐÑÑÓÕÕ×רØÙÙäÚÛÜÝÜÚÙÕÑÍÊÇÅÅÇÉÌÏÒÔÔÓÍÏÑÕ×ÙÙë×ÕÒÏÍÌÌÍÏÑÕØÚÛÜÛÚÙØÖÕÕÁÖ×ÙÙÚÛÜÝÝÞßàááâáàÝÛ×ÔÑÍÍÌÍÏÑÕÖØØ×ÔÕØÚÝÝÞÞÝÚØÖÔÓÓÕÖÙÜÞááââáàßÝÝÜÜÝäÞßàááâäååççèçåäáÝÚ×ÕÔÓÔÕØÚÜÝÝúÚÜÞàáããéâáÞÝÛÚÚÜÝßáäæçèèçæåäãâááãâãäååæèééëìííìêéæãáÞÜÛÚÛÝÞàáââêáãäåçèéèçæåãâááâäåèéëííÓìëêéèèççèèééêëííîïðññðïíëéçåãâáâãååçèèçèééëìííêìëêééèèééëíîðññòññðïîííæîïðññòóôõõôóñðîìêééèééêëìííüîïðññýðïîîúïñòóôõõüôóòññòîóôõõö÷÷øø÷öõôòñðïîîïþðññüòóôõõþôóóùôõõöøøùùûø÷÷öõõöý÷øùùúùúø÷öôóòòýóôõõúö÷÷øøùùø÷þö÷÷úøùùúúûûú ùúûüöûùøø÷öõõôõõþö÷÷ùúûúùúüûüüýýüûüýüùûúùùø÷ööþ÷øøùþøüüýüý þø÷÷úÓ{<ýý þýþýðŒð‡ç÷÷ööõõÙR#”Ùþþÿýþùðôøöôôóó« Yîõöÿ(ÿþþýðöõóñðï¥Eïòóóÿ(ÿüþýýðôñïíëÉ Íííîîÿ'ÿþýýüùñíêèå?üDæçéé(ÿûþýýûúíéåâ±ù…àáâããÿ'ÿûþýýûúêåáÝ^ù¯ÙÚÛÜÝÿ'ÿûþýüúúçáÝØ(ùÂÑÓÔÕÕÿ'ÿûþýüùúäÞØÓ ùÆÊÌÍÍÎÿ&ÿúþýýûùúáÚÔÎù¾ÃÅÅÆÈÿ&ÿúþýýûùúߨÑÊù«½½¿ÀÁÿ&ÿúþýüúøúÝÕÍÇ3ùŽ··¹¹»ÿ%ÿþûýüù÷ùÛÓËÄjùf±²³´µÿ#ÿ÷® ýûùõøÙÑÉÁ® ù3­®®°±ÿ#ÿ÷üúøïø,ØÐÈÀ¹dù˜ª«¬®ÿ#ÿ÷#ûùöá÷aÖÎÆ¿¸²8ú9©©ª¬ÿ#ÿëk½ùøõ¼ ÀÕÍŽ·²©>ûQ§©«ÿ"ÿãþõKŒßñÊ4©ÙÒËĽ·²®¬r$l–ÿ"ÿãþýý¨I -tÒÞØÑÉý·³¯­¬©|I%ÿ!ÿþêýüúùõóïëæáÜÕÏɽ¸´±°®­­¯ýþÿþ ýþ ýþüSSü‹ßûúúûþüýýþüâ©qTTüp¨üûûüýöÅqÅýýüüß‹SSþ¦úúþnøøü÷øøùùøúûüýýÅ8üSÂùøøùòúûûÄp§ûúÞoû¤÷÷þmôôõïö÷øùúß88¨ûúù¦7þQõõúö÷¥Sû¦ùÁû¢ó PþÔïïìðñòóõöÁSúùùø÷öõ¢ýÖññúòóQQRö¤£l  kúîëëþhééëêëíïñØRøø÷öõôòñðŸýÒííúîðñòQõPÓíìëêê4ú›äåå3þããùäåçéìóÚõõôòñðîíìêhöMçèééêìížöêéçååäã±úKÝÝÞcÜúÝÞáã€þPññõðîíëéèæåå÷¯áâãåæè›ôæäâàÞÝÜÜÛúÕÖ×þŽÕÕû×ÙÝñííìëéçåäâááàc÷0ÛÜÝÝßá—ø–àÝÚØÖÕÔÔþFûÍÎЋþ‰ÍÍüÏÒŽñÌçèçåäáàÞÝÝÜÛªø½ÕÕ×ÙÚ’ø’ÙÖÓÐÎÍÌÌþDûÅÇɆø…ÇÆÇÉËDáøßÝÜÚÙØØ××þøŠÏÏÐÑÓŽôŽÒÎËÈÆÅÄÄÅAû¾Áƒþ‚ÁÁüÂÄ,õÚÜÜÛÙ×ÕÕÔÓÔÔýÕFøZÊÉÉÊ̈ùˆËÇÄÁ¾½½ý¾?û¹»½€ù€½½¼½¾ðÔÕÕÔÒÑÐÎÎÏÐÑÒÒ]øBÅÄÃÄÅ„ô„ÅÁ½º¸¶¶·¹>û´·º~ù~»¹¸¸¹ðÍÏÎÍÌËÉÉÊÌÍÐÑÒŒøAÂÀ¾¾¿€ô€¾»¸µ²±±³µ=û±´¸|ü~¹·µµú„ÉÈÇÆÅÅøÆÉÌÎÑÓŒøAÀ½º¹¹|ô}¹¶³°®­®±³<û¯²·|ù~º¶´²²ð€ÂÂÁÀ¿ÀÁÃÆÊÎÒÔŽøX¿»·µµxôzµ³°­¬«­¯³<û®²·|ø~»·´±°;ð?½½¼»º»½ÁÅÉÎÓÕøƒ¿¹µ²±vôx²°­«©ª¬¯³=û®²·}ø€¼¸³±¯M𹸷¶¶·º¾ÄÉÏÔØø°À¹´±¯tûv°®¬©©û¬°´=û¯³¹~ø€½¹´°­‡ñ ´²±²´·¼ÂÉÏÕÙI÷.ÈÁ¹´°­sûu¯­«©©û­±µ>û°´¹÷‚¿¹µ°­¬ñO°¯®¯±µºÁÈÏÕÚ1÷tÉÁº´¯­rôt®¬ª©©ª­±·>û±µº€÷ƒÀºµ°­«_ò­­¬­¯³¹ÀÈÏÕÂöÒËüµ°­rôt­¬ª©©«®³¸?û²¶¼€ö„Á»µ±­«ª&ó_«ª«­±·¾ÆÎÕaö©ÔÍŽ¶±­rôt­¬ª©©¬¯´¹?û²·½õ„¼¶±­«ª—õ—©©¬°¶½Åͽõ“ÚÕÍž·±®sôt®­«ªª¬°µº@û³·½ôn½¶±­«ªª™è–©«¯µ¼Äµ”ÝÙÕÍÆ¿¹³°`ôv¯­¬««­±µ»û³¸½+ó,½¶±­«ª«¬š9êL…¯´‘V’ÝÜÙÕÎÇÁºµ²õ'±¯­¬¬­±µ|üxRò+iz­¬«¬­®¯ˆ&ñsÕÙÛÚØÔÎÈÁ’f÷Nt­­šv<í<=?ABCDCBA?=Š®­¬­¯±±ê›t9:;==Ú<;:®­ˆ;=>@BCCBµ¹½ÃÈËÌËÈý¸³¯­­¯±³´µ´³±±î²µ¹¿ÅËÑÔÖÖÕÒÍÉÅÁ½¼¼Â»¹·µ±¯¯°³·½ÁÆÉÉȵ¹¾ÃÈËÌËÈľ¹´±°°±´¶¸¹¸·µµ´µ·»ÀÅÉÎÒÔÕÔÑÎÊÆÄÁÁÀÁÁú¿½º·´±±ú´¹½ÂÆÉÉë·º¿ÄÉËÍÌÉÅ¿º¶³²²µ·¹¼½½þ»¹¹ðº½ÁÅÉÍÑÒÓÒÑÎÌÉÇÅÅêÄÁ½º¶´³´¶¹¾ÃÇÉÊɹ½ÁÅÊÍÍóÊÆÁ½¹¶µ¶¹»¾ÁÂÂìÁ¿¾½¾ÀÂÆÉÍÐÑÒÒÑÐÍÌËÊÊËÂÊÉžº¸¶·¹½ÁÅÉËÌʽÀÄÈÌÎÏÎÌÉÄÀ½º¹º½ÀÃÅÈÉÈÇÅÅÃÃÄÆÉËÍÐÑÓÓÒÑÑÐÏÏÐÑÑñÏÍÊÆÂ¿¼ºº½ÀÄÈËÍÍÛÁÄÈÌÏÑÒÑÏÌÈÅÁ¿¿ÀÂÅÉÌÍÏÏÎÍËÊÉÉÊÌÍÐÑÓÔÕÕÔÕÖéÕÓÐÌÈÄÁÀÀÁÄÈËÎÐÑÏÆÉÌÐÒÕÕòÓÐÍÉÇÅÅÆÉËÎÑÔÕÕðÔÒÑÐÏÐÑÑÓÕÕ×רØÙÙäÚÛÜÝÜÚÙÕÑÍÊÇÅÅÇÉÌÏÒÔÔÓÍÏÑÕ×ÙÙë×ÕÒÏÍÌÌÍÏÑÕØÚÛÜÛÚÙØÖÕÕÁÖ×ÙÙÚÛÜÝÝÞßàááâáàÝÛ×ÔÑÍÍÌÍÏÑÕÖØØ×ÔÕØÚÝÝÞÞÝÚØÖÔÓÓÕÖÙÜÞááââáàßÝÝÜÜÝäÞßàááâäååççèçåäáÝÚ×ÕÔÓÔÕØÚÜÝÝúÚÜÞàáããéâáÞÝÛÚÚÜÝßáäæçèèçæåäãâááãâãäååæèééëìííìêéæãáÞÜÛÚÛÝÞàáââêáãäåçèéèçæåãâááâäåèéëííÓìëêéèèççèèééêëííîïðññðïíëéçåãâáâãååçèèçèééëìííêìëêééèèééëíîðññòññðïîííæîïðññòóôõõôóñðîìêééèééêëìííüîïðññýðïîîúïñòóôõõüôóòññòîóôõõö÷÷øø÷öõôòñðïîîïþðññüòóôõõþôóóùôõõöøøùùûø÷÷öõõöý÷øùùúùúø÷öôóòòýóôõõúö÷÷øøùùø÷þö÷÷úøùùúúûûú ùúûüöûùøø÷öõõôõõþö÷÷ùúûúùúüûüüýýüûüýüùûúùùø÷ööþ÷øøùþøüüýüý þø÷÷úÓ{<ýý þýþýðŒð‡ç÷÷ööõõÙR#”Ùþþÿýþùðôøöôôóó« Yîõöÿ(ÿþþýðöõóñðï¥Eïòóóÿ(ÿüþýýðôñïíëÉ Íííîîÿ'ÿþýýüùñíêèå?üDæçéé(ÿûþýýûúíéåâ±ù…àáâããÿ'ÿûþýýûúêåáÝ^ù¯ÙÚÛÜÝÿ'ÿûþýüúúçáÝØ(ùÂÑÓÔÕÕÿ'ÿûþýüùúäÞØÓ ùÆÊÌÍÍÎÿ&ÿúþýýûùúáÚÔÎù¾ÃÅÅÆÈÿ&ÿúþýýûùúߨÑÊù«½½¿ÀÁÿ&ÿúþýüúøúÝÕÍÇ3ùŽ··¹¹»ÿ%ÿþûýüù÷ùÛÓËÄjùf±²³´µÿ#ÿ÷® ýûùõøÙÑÉÁ® ù3­®®°±ÿ#ÿ÷üúøïø,ØÐÈÀ¹dù˜ª«¬®ÿ#ÿ÷#ûùöá÷aÖÎÆ¿¸²8ú9©©ª¬ÿ#ÿëk½ùøõ¼ ÀÕÍŽ·²©>ûQ§©«ÿ"ÿãþõKŒßñÊ4©ÙÒËĽ·²®¬r$l–ÿ"ÿãþýý¨I -tÒÞØÑÉý·³¯­¬©|I%ÿ!ÿþêýüúùõóïëæáÜÕÏɽ¸´±°®­­¯ýþÿþ ýþ ýþüSSü‹ßûúúûþüýýþüâ©qTTüp¨üûûüýöÅqÅýýüüß‹SSþ¦úúþnøøü÷øøùùøúûüýýÅ8üSÂùøøùòúûûÄp§ûúÞoû¤÷÷þmôôõïö÷øùúß88¨ûúù¦7þQõõúö÷¥Sû¦ùÁû¢ó PþÔïïìðñòóõöÁSúùùø÷öõ¢ýÖññúòóQQRö¤£l  kúîëëþhééëêëíïñØRøø÷öõôòñðŸýÒííúîðñòQõPÓíìëêê4ú›äåå3þããùäåçéìóÚõõôòñðîíìêhöMçèééêìížöêéçååäã±úKÝÝÞcÜúÝÞáã€þPññõðîíëéèæåå÷¯áâãåæè›ôæäâàÞÝÜÜÛúÕÖ×þŽÕÕû×ÙÝñííìëéçåäâááàc÷0ÛÜÝÝßá—ø–àÝÚØÖÕÔÔþFûÍÎЋþ‰ÍÍüÏÒŽñÌçèçåäáàÞÝÝÜÛªø½ÕÕ×ÙÚ’ø’ÙÖÓÐÎÍÌÌþDûÅÇɆø…ÇÆÇÉËDáøßÝÜÚÙØØ××þøŠÏÏÐÑÓŽôŽÒÎËÈÆÅÄÄÅAû¾Áƒþ‚ÁÁüÂÄ,õÚÜÜÛÙ×ÕÕÔÓÔÔýÕFøZÊÉÉÊ̈ùˆËÇÄÁ¾½½ý¾?û¹»½€ù€½½¼½¾ðÔÕÕÔÒÑÐÎÎÏÐÑÒÒ]øBÅÄÃÄÅ„ô„ÅÁ½º¸¶¶·¹>û´·º~ù~»¹¸¸¹ðÍÏÎÍÌËÉÉÊÌÍÐÑÒŒøAÂÀ¾¾¿€ô€¾»¸µ²±±³µ=û±´¸|ü~¹·µµú„ÉÈÇÆÅÅøÆÉÌÎÑÓŒøAÀ½º¹¹|ô}¹¶³°®­®±³<û¯²·|ù~º¶´²²ð€ÂÂÁÀ¿ÀÁÃÆÊÎÒÔŽøX¿»·µµxôzµ³°­¬«­¯³<û®²·|ø~»·´±°;ð?½½¼»º»½ÁÅÉÎÓÕøƒ¿¹µ²±vôx²°­«©ª¬¯³=û®²·}ø€¼¸³±¯M𹸷¶¶·º¾ÄÉÏÔØø°À¹´±¯tûv°®¬©©û¬°´=û¯³¹~ø€½¹´°­‡ñ ´²±²´·¼ÂÉÏÕÙI÷.ÈÁ¹´°­sûu¯­«©©û­±µ>û°´¹÷‚¿¹µ°­¬ñO°¯®¯±µºÁÈÏÕÚ1÷tÉÁº´¯­rôt®¬ª©©ª­±·>û±µº€÷ƒÀºµ°­«_ò­­¬­¯³¹ÀÈÏÕÂöÒËüµ°­rôt­¬ª©©«®³¸?û²¶¼€ö„Á»µ±­«ª&ó_«ª«­±·¾ÆÎÕaö©ÔÍŽ¶±­rôt­¬ª©©¬¯´¹?û²·½õ„¼¶±­«ª—õ—©©¬°¶½Åͽõ“ÚÕÍž·±®sôt®­«ªª¬°µº@û³·½ôn½¶±­«ªª™è–©«¯µ¼Äµ”ÝÙÕÍÆ¿¹³°`ôv¯­¬««­±µ»û³¸½+ó,½¶±­«ª«¬š9êL…¯´‘V’ÝÜÙÕÎÇÁºµ²õ'±¯­¬¬­±µ|üxRò+iz­¬«¬­®¯ˆ&ñsÕÙÛÚØÔÎÈÁ’f÷Nt­­šv<í<=?ABCDCBA?=Š®­¬­¯±±ê›t9:;==Ú<;:®­ˆ;=>@BCCBµ¹½ÃÈËÌËÈý¸³¯­­¯±³´µ´³±±î²µ¹¿ÅËÑÔÖÖÕÒÍÉÅÁ½¼¼Â»¹·µ±¯¯°³·½ÁÆÉÉȵ¹¾ÃÈËÌËÈľ¹´±°°±´¶¸¹¸·µµ´µ·»ÀÅÉÎÒÔÕÔÑÎÊÆÄÁÁÀÁÁú¿½º·´±±ú´¹½ÂÆÉÉë·º¿ÄÉËÍÌÉÅ¿º¶³²²µ·¹¼½½þ»¹¹ðº½ÁÅÉÍÑÒÓÒÑÎÌÉÇÅÅêÄÁ½º¶´³´¶¹¾ÃÇÉÊɹ½ÁÅÊÍÍóÊÆÁ½¹¶µ¶¹»¾ÁÂÂìÁ¿¾½¾ÀÂÆÉÍÐÑÒÒÑÐÍÌËÊÊËÂÊÉžº¸¶·¹½ÁÅÉËÌʽÀÄÈÌÎÏÎÌÉÄÀ½º¹º½ÀÃÅÈÉÈÇÅÅÃÃÄÆÉËÍÐÑÓÓÒÑÑÐÏÏÐÑÑñÏÍÊÆÂ¿¼ºº½ÀÄÈËÍÍÛÁÄÈÌÏÑÒÑÏÌÈÅÁ¿¿ÀÂÅÉÌÍÏÏÎÍËÊÉÉÊÌÍÐÑÓÔÕÕÔÕÖéÕÓÐÌÈÄÁÀÀÁÄÈËÎÐÑÏÆÉÌÐÒÕÕòÓÐÍÉÇÅÅÆÉËÎÑÔÕÕðÔÒÑÐÏÐÑÑÓÕÕ×רØÙÙäÚÛÜÝÜÚÙÕÑÍÊÇÅÅÇÉÌÏÒÔÔÓÍÏÑÕ×ÙÙë×ÕÒÏÍÌÌÍÏÑÕØÚÛÜÛÚÙØÖÕÕÁÖ×ÙÙÚÛÜÝÝÞßàááâáàÝÛ×ÔÑÍÍÌÍÏÑÕÖØØ×ÔÕØÚÝÝÞÞÝÚØÖÔÓÓÕÖÙÜÞááââáàßÝÝÜÜÝäÞßàááâäååççèçåäáÝÚ×ÕÔÓÔÕØÚÜÝÝúÚÜÞàáããéâáÞÝÛÚÚÜÝßáäæçèèçæåäãâááãâãäååæèééëìííìêéæãáÞÜÛÚÛÝÞàáââêáãäåçèéèçæåãâááâäåèéëííÓìëêéèèççèèééêëííîïðññðïíëéçåãâáâãååçèèçèééëìííêìëêééèèééëíîðññòññðïîííæîïðññòóôõõôóñðîìêééèééêëìííüîïðññýðïîîúïñòóôõõüôóòññòîóôõõö÷÷øø÷öõôòñðïîîïþðññüòóôõõþôóóùôõõöøøùùûø÷÷öõõöý÷øùùúùúø÷öôóòòýóôõõúö÷÷øøùùø÷þö÷÷úøùùúúûûú ùúûüöûùøø÷öõõôõõþö÷÷ùúûúùúüûüüýýüûüýüùûúùùø÷ööþ÷øøùþøüüýüý þø÷÷úÓ{<ýý þýþýðŒð‡ç÷÷ööõõÙR#”Ùþþÿýþùðôøöôôóó« Yîõöÿ(ÿþþýðöõóñðï¥Eïòóóÿ(ÿüþýýðôñïíëÉ Íííîîÿ'ÿþýýüùñíêèå?üDæçéé(ÿûþýýûúíéåâ±ù…àáâããÿ'ÿûþýýûúêåáÝ^ù¯ÙÚÛÜÝÿ'ÿûþýüúúçáÝØ(ùÂÑÓÔÕÕÿ'ÿûþýüùúäÞØÓ ùÆÊÌÍÍÎÿ&ÿúþýýûùúáÚÔÎù¾ÃÅÅÆÈÿ&ÿúþýýûùúߨÑÊù«½½¿ÀÁÿ&ÿúþýüúøúÝÕÍÇ3ùŽ··¹¹»ÿ%ÿþûýüù÷ùÛÓËÄjùf±²³´µÿ#ÿ÷® ýûùõøÙÑÉÁ® ù3­®®°±ÿ#ÿ÷üúøïø,ØÐÈÀ¹dù˜ª«¬®ÿ#ÿ÷#ûùöá÷aÖÎÆ¿¸²8ú9©©ª¬ÿ#ÿëk½ùøõ¼ ÀÕÍŽ·²©>ûQ§©«ÿ"ÿãþõKŒßñÊ4©ÙÒËĽ·²®¬r$l–ÿ"ÿãþýý¨I -tÒÞØÑÉý·³¯­¬©|I%ÿ!ÿþêýüúùõóïëæáÜÕÏɽ¸´±°®­­¯ÿüý þ ýþÿúûüýý©qTT÷¨áüüpüûûüüýþÿ÷øùïúûûüqTT8S7ùùúüûüüýýþëÿóóôõõö÷øù7ÃûûúùÂ7ô÷öö÷÷øøùùúüýýþîõïðñòôõRÂùùèø÷öõôóóôôõõöøùúûüýýþééìêëíï¼6ö÷ööõôóò¼ïïÜðññòôõöøùûüýýááâäåçéiPóôóòñðïííNëëÅìíïñòôöøùûýýÚÚÛÜÞáäLïððîíìêéç™ååæçèéëíïñôöùúüýÒÒÓÕÖÙÝJô‚ëëêéçåãâáááêâãåçéìïñõ÷ùûýËËÌÍÏÒÕx倿åãáßÝÜÛªÛÜÝÝßáãæéíðóõøúüÅÅúÆÈËÏ»Ý2®ÝÛÙØÖÕÕÖרÙÛÝàãæêíñõ÷ùûÀ¿¿ÀÁÄÈÍ]Þ0½ÓÑÑÐÑÑÒÔÕØÚÝáåéíðôöùû¼»ºº¼¾ÂÇÌEý[µËËäÍÎÐÒÕØÛßãçëïóöùû¹¸·¶·¹½ÁÆË\ÞmÅÆÈÊÍÏÒÕÙÝáæêîòõùú¹¶µ´´µ¹½ÂÇËŸß«ÃÅÉÌÏÓ×Üàåéîòõøú¹¶´²±³µº¿ÄÈÊÌqëÁÅÉÌÑÕÙßäéíñõøúº·´±±ú´¸¼ÁÅÉÉý±XݨÁÅÉÍÒØÝâèíñõøú¼¹µ±°°²µº¿ÄÇÉÈÆÃª>ÝR½ÁÅÊÏÕÛáæëðô÷ù½ºµ²°°±²±±Œ¤¾ÄÉŸŠ]EE[‡ÈÄÁ½¹¶µ´µ·»ÁÈÐØßæíòÅÀ»¶²±±´¹¾ÄÉÍÐÑÒÑÏÍÊÇÄÁ½º¸··¹½ÁÉÐØßæíòÅÁ»·³±²µ¹¾ÄÉÍÐÑÒÑÑÏÍÊÇÄÁ¾¼ºº¼¿ÄÊÑÙàçíòÅÁ½¸µ³´¶º¿ÅÉÍÑÒÓÒÑÑÏÍÊÈÅÂÀ¿¾ÀÃÇÍÔÛáèîóÈÿ»¸¶·¹½ÁÆËÎÑÓÔÔÓÒÑÏÍÌÉÇÅÄÄÅÈÌÑ×ÝäêïôÉÅÁ½»¹º½ÀÄÉÍÐÓÕÕÜÔÓÒÑÏÍÌÊÉÉÊÍÑÕÛáçìñõÍÉÅÂÀ¿¿ÁÄÈÌÐÓÕÖ××ÖúÕÔÓÑÑÏÏæÑÒÖÚßåéîóöÑÍÊÇÅÄÅÆÉÍÐÔÖÙÙÚÚÙüØ×ÖÕÕæÖÙÜàäéíñõøÕÓÐÍÌËËÍÏÒÕÙÚÝÝÞÞÝáÜÛÛÚÚÛÝÞáåéíðôöùÛÙ×ÕÓÒÓÔÖÙÛÝàáââáãàááâåçéíðóöùúáßÝÛÚÙÚÛÝßáãåææççæåïæçèéìîñóöøúüæåäâááöâãåçééëëìëëêëæìíïñòõöùúûýìêééèçèééëìíîïððïðñòóôõ÷ùúüýýñðïîííøîïðñòóóôôóôõòöøùùûüýýþõôóóòòùóôóôôõööõöù÷ùùúûüýýþþ÷ööõúôõõöö÷ ÷øúþûýýþþÿøø÷øùúþùøøùúûûüýþþÿÿôDx·í¬øøù÷øøùúûüüýþÿÿûòá¤4÷üøæ…ý„äööõ÷øøùúüýýþþÿÿöüõôxõüöõðüðôôóóôóõöøùúûýýþþÿÿóóúkóóòòëñðïïîîïðñóõöøùûýýþþÿîîüæïïîüìëêééñêëíïñôöøúüýýþÿééêý}ëëþêèçæåäãäååèêíñôöùúüýþþãääååýÄççþæüáàßÝÝèÞàâåéíñô÷ùûýýþÝÝÞßàááããääýãââÝÛÙØ×רÚÝáåêîòõùûýýþÖרÙÛÝÞßàááýàßüØÕÓÑÑéÔØÝáçìñõøúüýþÏÑÒÔÖÙÛÝÞßßýÞÝÝÔÑÏÍËËÍÏÓÙÞäéïó÷ùüýþÉÊÍÏÒÕÙÛÝÝÞÞÝÝâÑÍËÈÆÆÈËÏÕÛáèíòöùûýþÂÅÈËÏÓ×ÚÝÞÞÝÝÏÌÈÅÃÃÄÇÌÒÙàæíñõùûýþ½ÀÄÈÍÑÖÚÝßààßÝâÎÊÆÂÀÀÁÄÉÐ×Þåìñõùûýþ¹¼ÀÅËÑÖÚÞááþàÝÎÉÅÁ¾½¾ÂÇÍÕÝåëñõùûýþµ¹½ÄÊÑÖÜàâäåäâûÏÉÅÁ½½äÁÆÍÕÝäêñõùûýþ±¶¼ÂÉÑ×°áåæçæåáÐÊÅÀ½¼½ÀÅÌÔÜäêðõùûýþ°µºÁÉѨãæééþçÝÑÌÅÁ½¼½ÀÅÌÔÜäêðõùûýþ®³¹ÁÈzqäèêëëãÝÏÍÆÁ½¼½ÀÅÌÔÜãêðõùûýþª­›q$%¥àåéëíÞ€àu¿ÇÁ½¼½ÀÅÌÔÜãêðõùûýþ $N“ÐÙàåéìɾ½½ÀÅÌÔÜäêðõùûýþ±µ¼ÂÉÑÙßåéëííìéæáÜÕÏÉÿ½½ÁÅÍÔÜäêðõùûýþüý þ ýþÿúûüýý©qTT÷¨áüüpüûûüüýþÿ÷øùïúûûüqTT8S7ùùúüûüüýýþëÿóóôõõö÷øù7ÃûûúùÂ7ô÷öö÷÷øøùùúüýýþîõïðñòôõRÂùùèø÷öõôóóôôõõöøùúûüýýþééìêëíï¼6ö÷ööõôóò¼ïïÜðññòôõöøùûüýýááâäåçéiPóôóòñðïííNëëÅìíïñòôöøùûýýÚÚÛÜÞáäLïððîíìêéç™ååæçèéëíïñôöùúüýÒÒÓÕÖÙÝJô‚ëëêéçåãâáááêâãåçéìïñõ÷ùûýËËÌÍÏÒÕx倿åãáßÝÜÛªÛÜÝÝßáãæéíðóõøúüÅÅúÆÈËÏ»Ý2®ÝÛÙØÖÕÕÖרÙÛÝàãæêíñõ÷ùûÀ¿¿ÀÁÄÈÍ]Þ0½ÓÑÑÐÑÑÒÔÕØÚÝáåéíðôöùû¼»ºº¼¾ÂÇÌEý[µËËäÍÎÐÒÕØÛßãçëïóöùû¹¸·¶·¹½ÁÆË\ÞmÅÆÈÊÍÏÒÕÙÝáæêîòõùú¹¶µ´´µ¹½ÂÇËŸß«ÃÅÉÌÏÓ×Üàåéîòõøú¹¶´²±³µº¿ÄÈÊÌqëÁÅÉÌÑÕÙßäéíñõøúº·´±±ú´¸¼ÁÅÉÉý±XݨÁÅÉÍÒØÝâèíñõøú¼¹µ±°°²µº¿ÄÇÉÈÆÃª>ÝR½ÁÅÊÏÕÛáæëðô÷ù½ºµ²°°±²±±Œ¤¾ÄÉŸŠ]EE[‡ÈÄÁ½¹¶µ´µ·»ÁÈÐØßæíòÅÀ»¶²±±´¹¾ÄÉÍÐÑÒÑÏÍÊÇÄÁ½º¸··¹½ÁÉÐØßæíòÅÁ»·³±²µ¹¾ÄÉÍÐÑÒÑÑÏÍÊÇÄÁ¾¼ºº¼¿ÄÊÑÙàçíòÅÁ½¸µ³´¶º¿ÅÉÍÑÒÓÒÑÑÏÍÊÈÅÂÀ¿¾ÀÃÇÍÔÛáèîóÈÿ»¸¶·¹½ÁÆËÎÑÓÔÔÓÒÑÏÍÌÉÇÅÄÄÅÈÌÑ×ÝäêïôÉÅÁ½»¹º½ÀÄÉÍÐÓÕÕÜÔÓÒÑÏÍÌÊÉÉÊÍÑÕÛáçìñõÍÉÅÂÀ¿¿ÁÄÈÌÐÓÕÖ××ÖúÕÔÓÑÑÏÏæÑÒÖÚßåéîóöÑÍÊÇÅÄÅÆÉÍÐÔÖÙÙÚÚÙüØ×ÖÕÕæÖÙÜàäéíñõøÕÓÐÍÌËËÍÏÒÕÙÚÝÝÞÞÝáÜÛÛÚÚÛÝÞáåéíðôöùÛÙ×ÕÓÒÓÔÖÙÛÝàáââáãàááâåçéíðóöùúáßÝÛÚÙÚÛÝßáãåææççæåïæçèéìîñóöøúüæåäâááöâãåçééëëìëëêëæìíïñòõöùúûýìêééèçèééëìíîïððïðñòóôõ÷ùúüýýñðïîííøîïðñòóóôôóôõòöøùùûüýýþõôóóòòùóôóôôõööõöù÷ùùúûüýýþþ÷ööõúôõõöö÷ ÷øúþûýýþþÿøø÷øùúþùøøùúûûüýþþÿÿôDx·í¬øøù÷øøùúûüüýþÿÿûòá¤4÷üøæ…ý„äööõ÷øøùúüýýþþÿÿöüõôxõüöõðüðôôóóôóõöøùúûýýþþÿÿóóúkóóòòëñðïïîîïðñóõöøùûýýþþÿîîüæïïîüìëêééñêëíïñôöøúüýýþÿééêý}ëëþêèçæåäãäååèêíñôöùúüýþþãääååýÄççþæüáàßÝÝèÞàâåéíñô÷ùûýýþÝÝÞßàááããääýãââÝÛÙØ×רÚÝáåêîòõùûýýþÖרÙÛÝÞßàááýàßüØÕÓÑÑéÔØÝáçìñõøúüýþÏÑÒÔÖÙÛÝÞßßýÞÝÝÔÑÏÍËËÍÏÓÙÞäéïó÷ùüýþÉÊÍÏÒÕÙÛÝÝÞÞÝÝâÑÍËÈÆÆÈËÏÕÛáèíòöùûýþÂÅÈËÏÓ×ÚÝÞÞÝÝÏÌÈÅÃÃÄÇÌÒÙàæíñõùûýþ½ÀÄÈÍÑÖÚÝßààßÝâÎÊÆÂÀÀÁÄÉÐ×Þåìñõùûýþ¹¼ÀÅËÑÖÚÞááþàÝÎÉÅÁ¾½¾ÂÇÍÕÝåëñõùûýþµ¹½ÄÊÑÖÜàâäåäâûÏÉÅÁ½½äÁÆÍÕÝäêñõùûýþ±¶¼ÂÉÑ×°áåæçæåáÐÊÅÀ½¼½ÀÅÌÔÜäêðõùûýþ°µºÁÉѨãæééþçÝÑÌÅÁ½¼½ÀÅÌÔÜäêðõùûýþ®³¹ÁÈzqäèêëëãÝÏÍÆÁ½¼½ÀÅÌÔÜãêðõùûýþª­›q$%¥àåéëíÞ€àu¿ÇÁ½¼½ÀÅÌÔÜãêðõùûýþ $N“ÐÙàåéìɾ½½ÀÅÌÔÜäêðõùûýþ±µ¼ÂÉÑÙßåéëííìéæáÜÕÏÉÿ½½ÁÅÍÔÜäêðõùûýþüý þ ýþÿúûüýý©qTT÷¨áüüpüûûüüýþÿ÷øùïúûûüqTT8S7ùùúüûüüýýþëÿóóôõõö÷øù7ÃûûúùÂ7ô÷öö÷÷øøùùúüýýþîõïðñòôõRÂùùèø÷öõôóóôôõõöøùúûüýýþééìêëíï¼6ö÷ööõôóò¼ïïÜðññòôõöøùûüýýááâäåçéiPóôóòñðïííNëëÅìíïñòôöøùûýýÚÚÛÜÞáäLïððîíìêéç™ååæçèéëíïñôöùúüýÒÒÓÕÖÙÝJô‚ëëêéçåãâáááêâãåçéìïñõ÷ùûýËËÌÍÏÒÕx倿åãáßÝÜÛªÛÜÝÝßáãæéíðóõøúüÅÅúÆÈËÏ»Ý2®ÝÛÙØÖÕÕÖרÙÛÝàãæêíñõ÷ùûÀ¿¿ÀÁÄÈÍ]Þ0½ÓÑÑÐÑÑÒÔÕØÚÝáåéíðôöùû¼»ºº¼¾ÂÇÌEý[µËËäÍÎÐÒÕØÛßãçëïóöùû¹¸·¶·¹½ÁÆË\ÞmÅÆÈÊÍÏÒÕÙÝáæêîòõùú¹¶µ´´µ¹½ÂÇËŸß«ÃÅÉÌÏÓ×Üàåéîòõøú¹¶´²±³µº¿ÄÈÊÌqëÁÅÉÌÑÕÙßäéíñõøúº·´±±ú´¸¼ÁÅÉÉý±XݨÁÅÉÍÒØÝâèíñõøú¼¹µ±°°²µº¿ÄÇÉÈÆÃª>ÝR½ÁÅÊÏÕÛáæëðô÷ù½ºµ²°°±²±±Œ¤¾ÄÉŸŠ]EE[‡ÈÄÁ½¹¶µ´µ·»ÁÈÐØßæíòÅÀ»¶²±±´¹¾ÄÉÍÐÑÒÑÏÍÊÇÄÁ½º¸··¹½ÁÉÐØßæíòÅÁ»·³±²µ¹¾ÄÉÍÐÑÒÑÑÏÍÊÇÄÁ¾¼ºº¼¿ÄÊÑÙàçíòÅÁ½¸µ³´¶º¿ÅÉÍÑÒÓÒÑÑÏÍÊÈÅÂÀ¿¾ÀÃÇÍÔÛáèîóÈÿ»¸¶·¹½ÁÆËÎÑÓÔÔÓÒÑÏÍÌÉÇÅÄÄÅÈÌÑ×ÝäêïôÉÅÁ½»¹º½ÀÄÉÍÐÓÕÕÜÔÓÒÑÏÍÌÊÉÉÊÍÑÕÛáçìñõÍÉÅÂÀ¿¿ÁÄÈÌÐÓÕÖ××ÖúÕÔÓÑÑÏÏæÑÒÖÚßåéîóöÑÍÊÇÅÄÅÆÉÍÐÔÖÙÙÚÚÙüØ×ÖÕÕæÖÙÜàäéíñõøÕÓÐÍÌËËÍÏÒÕÙÚÝÝÞÞÝáÜÛÛÚÚÛÝÞáåéíðôöùÛÙ×ÕÓÒÓÔÖÙÛÝàáââáãàááâåçéíðóöùúáßÝÛÚÙÚÛÝßáãåææççæåïæçèéìîñóöøúüæåäâááöâãåçééëëìëëêëæìíïñòõöùúûýìêééèçèééëìíîïððïðñòóôõ÷ùúüýýñðïîííøîïðñòóóôôóôõòöøùùûüýýþõôóóòòùóôóôôõööõöù÷ùùúûüýýþþ÷ööõúôõõöö÷ ÷øúþûýýþþÿøø÷øùúþùøøùúûûüýþþÿÿôDx·í¬øøù÷øøùúûüüýþÿÿûòá¤4÷üøæ…ý„äööõ÷øøùúüýýþþÿÿöüõôxõüöõðüðôôóóôóõöøùúûýýþþÿÿóóúkóóòòëñðïïîîïðñóõöøùûýýþþÿîîüæïïîüìëêééñêëíïñôöøúüýýþÿééêý}ëëþêèçæåäãäååèêíñôöùúüýþþãääååýÄççþæüáàßÝÝèÞàâåéíñô÷ùûýýþÝÝÞßàááããääýãââÝÛÙØ×רÚÝáåêîòõùûýýþÖרÙÛÝÞßàááýàßüØÕÓÑÑéÔØÝáçìñõøúüýþÏÑÒÔÖÙÛÝÞßßýÞÝÝÔÑÏÍËËÍÏÓÙÞäéïó÷ùüýþÉÊÍÏÒÕÙÛÝÝÞÞÝÝâÑÍËÈÆÆÈËÏÕÛáèíòöùûýþÂÅÈËÏÓ×ÚÝÞÞÝÝÏÌÈÅÃÃÄÇÌÒÙàæíñõùûýþ½ÀÄÈÍÑÖÚÝßààßÝâÎÊÆÂÀÀÁÄÉÐ×Þåìñõùûýþ¹¼ÀÅËÑÖÚÞááþàÝÎÉÅÁ¾½¾ÂÇÍÕÝåëñõùûýþµ¹½ÄÊÑÖÜàâäåäâûÏÉÅÁ½½äÁÆÍÕÝäêñõùûýþ±¶¼ÂÉÑ×°áåæçæåáÐÊÅÀ½¼½ÀÅÌÔÜäêðõùûýþ°µºÁÉѨãæééþçÝÑÌÅÁ½¼½ÀÅÌÔÜäêðõùûýþ®³¹ÁÈzqäèêëëãÝÏÍÆÁ½¼½ÀÅÌÔÜãêðõùûýþª­›q$%¥àåéëíÞ€àu¿ÇÁ½¼½ÀÅÌÔÜãêðõùûýþ $N“ÐÙàåéìɾ½½ÀÅÌÔÜäêðõùûýþ±µ¼ÂÉÑÙßåéëííìéæáÜÕÏÉÿ½½ÁÅÍÔÜäêðõùûýþ €ÿÿÿÿæÿüþýüÿ>ÿýþýÿ>ÿüþÿüÿ‘ÿÿÿÿÿ"ÿèþýýûù÷õñíéäßÙÔÎÈý¹¶µ³²±±þ²ÿ!ÿêþýýûùöóðìçâÝØÓÍÈÿ¼¹¸··¶þ·ÿ!ÿìþýýûùöóïëæáÝ×ÒÍÉÅ¿½½¼þ½ÿ!ÿèþýüúùõòïêæáÝØÓÏËÈÅÄÃÂÃÃÄÄÃ"ÿíþýüûùöóïëçâÝÙÕÑÏÌÊÉÉþÊËËÊ"ÿâþýýûùöôðìèäàÜÙÕÓÑÐÏÏÐÑÑÒÓÓÒÑÑÿ!ÿèþýýûù÷õñîêæãàÝÚØÖÕÕÖרÙÚÚÙ"ÿþêýüúùöóðíéæäáßÝÝÜÜÝÝßàááþàÿ"ÿðþýýûù÷õòðíêèæåãââûãååçèèýçæÿ"ÿêþýýüúù÷õóñîíëééèèééêëííþìÿ#ÿòþýýüúù÷õôòñïîííûîïññòòñ$ÿþý÷üúùø÷õõóòòýóôõõöõ%ÿþýðüûúùø÷÷ööõöö÷÷øùù&ÿþýüüûúùùúû'ÿþýüûüý)ÿþ ýþý"ÿèþýýûù÷õñíéäßÙÔÎÈý¹¶µ³²±±þ²ÿ!ÿêþýýûùöóðìçâÝØÓÍÈÿ¼¹¸··¶þ·ÿ!ÿìþýýûùöóïëæáÝ×ÒÍÉÅ¿½½¼þ½ÿ!ÿèþýüúùõòïêæáÝØÓÏËÈÅÄÃÂÃÃÄÄÃ"ÿíþýüûùöóïëçâÝÙÕÑÏÌÊÉÉþÊËËÊ"ÿâþýýûùöôðìèäàÜÙÕÓÑÐÏÏÐÑÑÒÓÓÒÑÑÿ!ÿèþýýûù÷õñîêæãàÝÚØÖÕÕÖרÙÚÚÙ"ÿþêýüúùöóðíéæäáßÝÝÜÜÝÝßàááþàÿ"ÿðþýýûù÷õòðíêèæåãââûãååçèèýçæÿ"ÿêþýýüúù÷õóñîíëééèèééêëííþìÿ#ÿòþýýüúù÷õôòñïîííûîïññòòñ$ÿþý÷üúùø÷õõóòòýóôõõöõ%ÿþýðüûúùø÷÷ööõöö÷÷øùù&ÿþýüüûúùùúû'ÿþýüûüý)ÿþ ýþý"ÿèþýýûù÷õñíéäßÙÔÎÈý¹¶µ³²±±þ²ÿ!ÿêþýýûùöóðìçâÝØÓÍÈÿ¼¹¸··¶þ·ÿ!ÿìþýýûùöóïëæáÝ×ÒÍÉÅ¿½½¼þ½ÿ!ÿèþýüúùõòïêæáÝØÓÏËÈÅÄÃÂÃÃÄÄÃ"ÿíþýüûùöóïëçâÝÙÕÑÏÌÊÉÉþÊËËÊ"ÿâþýýûùöôðìèäàÜÙÕÓÑÐÏÏÐÑÑÒÓÓÒÑÑÿ!ÿèþýýûù÷õñîêæãàÝÚØÖÕÕÖרÙÚÚÙ"ÿþêýüúùöóðíéæäáßÝÝÜÜÝÝßàááþàÿ"ÿðþýýûù÷õòðíêèæåãââûãååçèèýçæÿ"ÿêþýýüúù÷õóñîíëééèèééêëííþìÿ#ÿòþýýüúù÷õôòñïîííûîïññòòñ$ÿþý÷üúùø÷õõóòòýóôõõöõ%ÿþýðüûúùø÷÷ööõöö÷÷øùù&ÿþýüüûúùùúû'ÿþýüûüý)ÿþ ýþýÿ€µ¹½ÄÊÑÙßäèëííìéæâÝÖÐÉÄÀ¾¿ÁÆÍÕÝäêñõùûýþ¹¼ÀÅÌÒÙÞãçéëìëéæâÝ×ÑÊÅÁÀÁÃÈÎÕÝåëñõùûýþ½ÀÄÉÍÓÙÞãæéêëêéæâÝØÒÍÇÄÂÃÅÊÐ×ÞåìñõùûýþÄÅÈÌÐÕÙÞâåèéêêéæãÞÙÔÏÊÇÅÅÉÍÒÙàæíñõùûýþÊËÍÐÓ×ÛßãåèéêêéçäàÛÖÑÍÊÉÉÌÐÕÛáèíòöùûýþÑÑÓÕ×ÚÝáäæééêêéèåáÝÙÕÑÏÎÎÑÔÙÞäéïó÷ùüýþØØÙÚÜÞáãåèéëììëéçåáÝÙÖÔÓÓÕÙÝáçìñõøúüýþßÞßàáâäæèêëííèìêèåáÞÜÚÙÙÛÝáåêîòõùûýýþååÝçèéëííïïðïîíëéæãáàßßáãæéíñô÷ùûýýþëêêúëìíîïññöòññðîíêéçååðæèëíñôöùúüýþþñðïïðñàòóôôõôôóññïíìëêëìíïñôöøúüýýþÿõôóóôõö÷øöõõôóññððñóóõöøùûýýþþÿø÷÷ö÷øùúø÷öõõôôõòöøùúûýýþþÿÿúúùùúûúùø÷øùýûüýýþþÿÿþýüüûüýüûúûþüýýþÿýüýþÿ€µ¹½ÄÊÑÙßäèëííìéæâÝÖÐÉÄÀ¾¿ÁÆÍÕÝäêñõùûýþ¹¼ÀÅÌÒÙÞãçéëìëéæâÝ×ÑÊÅÁÀÁÃÈÎÕÝåëñõùûýþ½ÀÄÉÍÓÙÞãæéêëêéæâÝØÒÍÇÄÂÃÅÊÐ×ÞåìñõùûýþÄÅÈÌÐÕÙÞâåèéêêéæãÞÙÔÏÊÇÅÅÉÍÒÙàæíñõùûýþÊËÍÐÓ×ÛßãåèéêêéçäàÛÖÑÍÊÉÉÌÐÕÛáèíòöùûýþÑÑÓÕ×ÚÝáäæééêêéèåáÝÙÕÑÏÎÎÑÔÙÞäéïó÷ùüýþØØÙÚÜÞáãåèéëììëéçåáÝÙÖÔÓÓÕÙÝáçìñõøúüýþßÞßàáâäæèêëííèìêèåáÞÜÚÙÙÛÝáåêîòõùûýýþååÝçèéëííïïðïîíëéæãáàßßáãæéíñô÷ùûýýþëêêúëìíîïññöòññðîíêéçååðæèëíñôöùúüýþþñðïïðñàòóôôõôôóññïíìëêëìíïñôöøúüýýþÿõôóóôõö÷øöõõôóññððñóóõöøùûýýþþÿø÷÷ö÷øùúø÷öõõôôõòöøùúûýýþþÿÿúúùùúûúùø÷øùýûüýýþþÿÿþýüüûüýüûúûþüýýþÿýüýþÿ€µ¹½ÄÊÑÙßäèëííìéæâÝÖÐÉÄÀ¾¿ÁÆÍÕÝäêñõùûýþ¹¼ÀÅÌÒÙÞãçéëìëéæâÝ×ÑÊÅÁÀÁÃÈÎÕÝåëñõùûýþ½ÀÄÉÍÓÙÞãæéêëêéæâÝØÒÍÇÄÂÃÅÊÐ×ÞåìñõùûýþÄÅÈÌÐÕÙÞâåèéêêéæãÞÙÔÏÊÇÅÅÉÍÒÙàæíñõùûýþÊËÍÐÓ×ÛßãåèéêêéçäàÛÖÑÍÊÉÉÌÐÕÛáèíòöùûýþÑÑÓÕ×ÚÝáäæééêêéèåáÝÙÕÑÏÎÎÑÔÙÞäéïó÷ùüýþØØÙÚÜÞáãåèéëììëéçåáÝÙÖÔÓÓÕÙÝáçìñõøúüýþßÞßàáâäæèêëííèìêèåáÞÜÚÙÙÛÝáåêîòõùûýýþååÝçèéëííïïðïîíëéæãáàßßáãæéíñô÷ùûýýþëêêúëìíîïññöòññðîíêéçååðæèëíñôöùúüýþþñðïïðñàòóôôõôôóññïíìëêëìíïñôöøúüýýþÿõôóóôõö÷øöõõôóññððñóóõöøùûýýþþÿø÷÷ö÷øùúø÷öõõôôõòöøùúûýýþþÿÿúúùùúûúùø÷øùýûüýýþþÿÿþýüüûüýüûúûþüýýþÿýüýþÿ`ÿs(9commons-jci-1.1-src/src/site/resources/download_jci.cgi100644 0 0 240 12113245240 20340 0ustar 0 0 #!/bin/sh # Just call the standard mirrors.cgi script. It will use download.html # as the input template. exec /www/www.apache.org/dyn/mirrors/mirrors.cgi $*commons-jci-1.1-src/src/site/resources/jci-logo-white.png100644 0 0 24323 11535744642 20640 0ustar 0 0 ‰PNG  IHDRæP ù ÓsRGB®ÎébKGDÿÿÿ ½§“ pHYs  šœtIMEÛ ';úé_I!iTXtCommentCreated with The GIMPm°— IDATxÚí}ypVEÖþó&o·™Qo_M•,€ IÄ¥ÙH)T°fÆB©²´\jDQ¡d#â(8n  $†=€ KÈ ²åÝ’þý1öý{îé{o`¾)øæíª[„äöíÓÝç9çôéÓ§J)…6úz«ÚJ hs{çSºŽß6x]·znk+­ÒûgC³Z¥ïòöÏv>ýÐ|.ccúþÿ&¹]À/07mÚd=ºtîÜùùù(((@§N<™Oÿ_êl À¦M›pðàA¬\¹Òö·‚‚ ??ßsPÝÚ€C‡áwÞÁ7Þˆ‚‚Ç÷6oÞŒM›6aóæÍV‹‹‹mm›Ê»ï¾‹-[¶ààÁƒ¶ºƉãôrº7oÞŒ•+WbÖ¬YbßW®\‰Í›7[m ¤¤Ä1Ò8lÙ²Å6Öºnvv¶/zM󫿯ÇQÓÙÙÙV;^¬çz=6%%%Ö\êoj>ÒóÅÅÅ())ñlχøx@II n¼ñFkÌ~øaÌš5Ë(¼Ýþoý¬<Ê‹/¾¨²³³×§¸¸Xíß¿_E"ãFU4U±XLÅãqÕÒÒ¢ZZZÔ¬Y³|µ‘­&MšÔævâñ¸*--U%%%Ö·JKKU<W±XLE£QµaÕŸŸol;??_íÛ·O577;žçž{Ε~]7Ûê…Ãa‡mtÇb1õÝwß©Y³f©‚‚ëšVMï /¼àÚæÄ‰í577«êêj5qâD×qÖuõ#ÑJé¥s¹qãFÝ^<³~ýz‰DlíIó©û^^^®zè![ßßzë-k\8 &MšäÊCË–-sŒ‹i.tÿ&OžlûFII‰*))±õµ¸¸Øâ!¿|©Ç­¥¥Eµ¶¶ªÖÖV¥”RF`nÚ´ÉÖùÉ“'«òòrköïߝЋ‹_ºt©:}ú´ã9sæŒ5šÐåË—ÛÚx衇Ԇ T4U‘HDíß¿_=ÿüó"zµ³oß>õüóÏ‹4PË—/·èðbTýäåå©S§N©“'Oª“'OªÏ>ûLuêÔÉWÝN:©S§N9MwYY™š8q¢Q8hZ÷ïßï*@è3sæL½3gÎôU€š0a‚‘V>—ÑhT}÷Ýw6&-((P¥¥¥¿èù–h1b„ë\¾ù曪¸¸Ø(ˆô\®[·Î—€ –,YbËÉ“']û§iÎÎÎV6l° ÈH$¢Ö¯_ïèWss³:sæŒõ-øMàùöÛoÛø‡~°‰D¬†óòò^´h‘úé§Ÿ¬çĉ¶ÎŸ9sF=÷ÜsF ÐïëÁ1b„£¢¢"c;&LP#FŒP#GŽ'fÙ²ejïÞ½ý:uR>ø Z¼x±Z´h‘zàÄzÓ§OWMMMjÁ‚Öï ÕÂ… Õ¢E‹¬º`§OŸ®Ž;f{Ž?®~úé'•——§FŒ!ާžèeË–YßÍËËS3f̰ÚìÝ»·Xoûöíª©©IZý?~¼Þ¢¢"c]‰V=Îz.9 Š‹‹m¼¢µ®žÏ%K–ˆ‚kçÎâ|Ž1Âs.—.]j›G¯¹èÔ©“jjj²Þ?Í«´M­ÝMý¢íP( 6*Ô¸Õ!“‚2;;Û2¡(!§OŸV§NR'NœP3fÌptºcÇŽª±±Q544¨ÆÆFÕØØ¨ššš¬Ž/^¼Ø1°TÂèïŸl½³wï^Ë Âiä??ýôÓxíµ×lt6 óæÍ³Ñ¥Û Ʊyã70lØ0¯R~Úºu+ sHÛÐý›2e ^}õU@QQ–.]Š@ ààQÝ&Œ;«W¯F}}½ÃÁC¿Mæÿ€$ ˆßýîwÖ‡zè! ”---hmmEKK âñ8âñ8b±b±222pà 78*77ÑhÔöÄb1<ñĶ÷î¿ÿ~ë›ô‰ÅbˆF£¶¶b±˜5P´üùÏF4E$A$±êê6£Ñh2¯Ó«W/Ì›7ÏzO×¥?G"Ü~ûíŽözöì‰Ù³g#ŸH$" ¬~øÁö}ý.¥»¥¥ÅQï™gžÁСCmôrZÃá°MèéòØcáÖ[oi¤4ôìÙÓV¯¦¦Æö}:FÑh/¿ü² ”EEEÈÈÈ0Χ~ô¼<õÔSÈÊʲµùÁ`óæÍ¶¶hil¦NŠÁƒ‹ã¡ûÖµkWdffÚêUTTˆs¡Û¢ž×¯¿þÚê Åî[<G4µ„å?i¼´¶¶Z™÷‰¶%íeµ¶¶:&ÎdñÒÒÒ‚p8l«“œœl=ZKõ(½šfJo ëÆãq„ÃaǾ!7£b±˜£n,³Ñ«MØ?ü555¶w{ôèh4j™{š>Î|t>ˆ7ÞxÃömÛ¶áÇ´4¥S¢1#‰XãÂdžÎ/‘HÄaj&''##77}ô‘õîÓO?ÖÖVüñ´™Ìt)¤”Š+¬qàK+ý}Ú¦¦‹šÉA¥:dÛˆÍÏÏ·ÓÕH§Z”ƒ' !;ìoMÀ'Ÿ|"j-M<$X:À·ß~»˜•••¶Iãà4K÷M÷“O¦ ˜ÑhÔf†HŒnŠ„‰F£¶q ƒÖc—¦‰^0µD§Ààk0u»š^ý.eX®¹è8yÍg÷îÝ‘™™‰£G:ÌÌ8h5Ö¦&`Ñ¡ôR`ƒAÜzë­xöÙgmïO™2«W¯Æ“O>‰=zˆ}ìÖ­b±˜m~9(y CRR’ 3AøòË/mwêÔI%'—ÖÜqÃ5]]]Èà”L wÞ É䀭[·âÚk¯u0 “ÆÔÿò6ýÓZü Æäädë_SŸ)ø“’’lÒÞKcRpRá§™ÔT—2×&ÆÕu9ór ií£… ×(t>y¤Knn®ã{Û¶mÃ-·Üb›‹¤¤$-\˜zlh;’Ƥs¡ÇD[.íڵØ1c°téRŸ9={öÄ‹/¾ˆP(dë£ä´JNNvôEÂ.Aزe‹CªS&¡ö±´`åuõï(x¿ùæQ{P`š¯;B/##µµµ¶ï9r]ºtqÔsÓ˜˜´}/­G­:zR“““EFÐuyÿ‚Á õ;“Vàk=´¯R]½á‚„2¡¦º”é¶oß.D²~¨ –¼ÁŽo=zÔ mׯ5Ay”×µ9]~Mû¤I“pôèQ¬Y³ÆQwÛ¶m¸õÖ[1zôhÜu×]…BFo;ô‘h *¥lÞ' LÉáÙ‘»µùšË-’Nºd«óA¥ìÑ£þùϺ2=Õ &ÍEûÉûeµf4Êìô»š^Icò­'þ{=ö¦±¢¥mkZ%a@—\´¶¶Zë[S] ÐRÑÓ´•À5ˆþ]=Z‰îÐún¦,Õ–´Ÿzl$^ä~ɬœ1c222°lÙ2±ßo¾ù&Ö¬Yƒ;ï¼£FrXk’ææ ˆ[žIRC_ýµCcrï·ã¥5 ß·áeÍš5â÷¹VÌS„?ÝÖ¡ž@£K3S»’eàæ“Ö¥&4oÛ ˜Üüæë*/ZMuMôJþ©|üñÇŽ-2“ùMÁæ&¸)êoIàrãIš„´t‹Çã˜4i.\(jw¨««Ãœ9sPTT„Ç;°ÂéÌWj&IæèáÇSZ`K^-½€NNN6jið%ÀM ÐC¡CÛëï˜LJ‰É%ÍíV¸Éæ§.×(^€æ´I8°¨U#i37¦åÞBM‡T´æ’ö¯ùøržá%##Ã!hõ#IÐP!àul‹or Ü­[7|øá‡˜ê‘ÆpçÎâwùÓ¯_?9•[œ,µ"{âú#&L÷’^|ñEÔÔÔ×6|¯rüøñ¸á†ЫW/›Ë899½zõÂu×]çhç‹/¾iÚÓäÚòž{îAVV–Ódz™r~LY“Æ4M²iR%FóK¯$L‚„Ó&Ñß–õôoû[Çûåååž|ÂyŒîqgffâî»ïv=¯Ü;nÖD[惗 6ˆ<"݈#ŒŽ)ÉÄ7yÔmÛ%&LµæÚµkñ§?ý UUUFS³µµ .DII jjjðÚk¯‰Û'IIIxå•Wm¬X±ÂŠ òò*¥láxYYYxì±ÇŒÀð3©~µ‹É|t3gÛê à_•W¬XÌÌLѹCÁ™œœìÒ×m566ºjº@ €/¾øBœÌ²²2O »bÅ $R@¿Ûº€ãXžIË—••9ê~þùç® ¨'ÑûùçŸ{ …ôôtÌœ97Þx£Í¤?~<–.]н{÷Zs¹cǼôÒK:t(jkk‘™™‰—^z ƒ6‚’‚óÿø‡ƒ†U«Vyš¾ëÖ­ž4^R)++Ã}÷݇ªª*=:ˆæÕW_µRöíÛ?þ¸c‰À“¸9±XLÑp/} õ»ï¾Ãƒ>ˆo¿ýÖ•àââbŒ5 ÙÙÙHMMEjjªµoÉOvHÁñÑhK–,Aii©§¦èÞ½;yäÜpà –´Ò¡‡¤c±Ö®]‹ºº:¬_¿»wï¿×¾}{\sÍ5èÓ§Í˸oß>ìÝ»7nÄ®]»ŒôÜ|óÍøÍo~ƒvíÚ᪫®ìÙ³ÕÕÕ(//7Ö …B¸ù曑““ƒvíÚáòË/Çž={°gÏlܸQÔzеkW\sÍ5ÈÉɱÌ$à_§ƒª««±aÃã†B!ôë×999ÈÉÉÁW\à_édöîÝëZ·[·nèׯ®¸â \y啸üòË¡˜úÙ³g,X`ÑM˜3ãÆ³x…Æ ÓCá•••ؾ};þþ÷¿Ǧ}ûöèÓ§rrr,ÑØØˆ}ûöáË/¿Dyy¹‘–®]»¢oß¾èÓ§Õ·@ €^x…BHJJ²@œ‘‘aºVJaíÚµVŸî¸ãŒ9Òq‹n[¥¤¤ 55]t‘í¡ø üœÈæ9Ò'¹›››ñý÷ߣ¢¢Ÿ}ö™¥ÒÓÓ‘““ƒ~ýú! ZKKK³hÏ7¨¥ö¢Ñ(*++QUUec褤$ÜrË-èÑ£:wîl¾þ&é‹F£xúé§ÇÆ$óª°°W_}5€¥·Ø»w¯Ñ3È=È]ºtÁðáá”ÂêÕ«±gÏϺú_ ”U«V‰Ž%i;E)…GyÄêÛ /¼`Ü[•i´¯m­;lØ0\uÕUŽ oNk]]%hè7»uë†ÜÜ\\ýõ¶¹Ô\ n:—Ë—/ÇŽ;|‡8>üðÃPJ¡ºº|ð1n›÷O‹n§ºº™™™èر£EëÎ;Q__ªª*k›' áÚk¯EÿþýÅ}>V3iii(ÓÒÒ¬ÇLÊÜZk677[é'tºšw…*Õ„ÓÁÖ’OÈáé'x–0Á`Ð"Z[0·¥ÒŠŸ•äuè ÒÁKNN¶õI .t,(‚¢OÔz B‰ç±Ñu¥8c‹Ê%1¶Ò´ÒººŸ’«^¯OÝ_-Lu_)­4¼Žnñ!¾'KéÔšA?´Ÿ´Mî(1íaR!Iiãmê1ÒB€¶Eû¦ÛѼÇùš+RÉw/8êñÖ€”€4yš(èxê ›-üó[ &úwjÒJ‘1šÙyTˆtĈK8:™ü¸–îƒt¶’fÕÇÉè±'iïË´žl«Ø«®És+… ú‰f1Ñäõ7Z¹³…oÒK‡å%¥™™÷S ó¤<@i¥ Ð`’¶ŠÜúÌǶ律¶šô7¥ãy¦H,]‚¦°.µ Î*u& ÚM¿ÃœÒb¹Ù„S íÿÑIZó8Y鬞óK¹\øÉu?Û7´®Ä ¦ÿÓó©ÒQ;·­¯ýL7!ÁÏ*òÈ÷*…àI¡ˆz^ùù]I ›bž9/Paà%ì¸ÃЋøïøYaþÝà[,züx[Ai¨¶Ôêß¡Àÿ5m(ók3ËÄxÒ¡eét„I2òö$‰lòNÒÁ“røHgNéQÍQÊ-ª™˜k{Ú®ÏKëH!‚¸¤BÎsòC¿Ôô¦ãeŠoå–‹i)PôasIpÒ±à@¡Â›zNùøèCâš?y’,Ó\HñÜ´Ž”5Bc‹Ž› D5C)0©ôã뜶S¢%3G›ÌTzi®$Ã'S:¥À™•2œ €ú{ô÷ |ÍëJçY)£ëú”yèï¨ áV†7Ì=…’ôæf>W¾&¦ã%™³|™À×Ï’µEÓ­Hå?:×”W%íDÇÏ?ùb[oÌ…µÜ€ÉªÇ?Èmj®1SRRÄ@šEÚ v“Ø|ñÌ5Œ[ÞzTÈ-”Ì0®MÉT¡ƒkš¾>¥ëX=àÔQ% îp3 9­Ü¡@'™Î-×.^œÖ¥R²Lh_¹3©ãséÇ"’|z}Iy‡ gî+¡S/³Ls!ùYÜh¥Ú“ %ʘ\ %m¦%‰t:ƒ&}âZ“šœQ¸·Q ·¬uRŒªä˜‘­øº•›Ö&`rMÀÛ¡ƒoª+E©ðvݲûiM+™v\Ü‘!™_´®®ÏÛ¥sËû*Y^æ,_KÛ®`N7Gýn<w,ƒ$g –þü|.¸€å&¯ëìe5š’ Päk+ªÁ”RHII·J¨Ô 5̇®¯¨ùª³Ìñü0~B°ÜâXõ@ÑÌpú‘ö›´‘ö¿h=^WKD¾vàN SnX·=Å––ƒA1Ÿ-_ÿЄ]R{´¯’0ðª+™ÂRh¥¤ ¼¼Ü&_Gž0[šK®Ñuÿ¤¹àãªëKÀtËi²$åeñÉ{©”r¨y?À”˜„6îfòèµ ý®[Š? 4Nç&£”ð‹¯›¨sA×áqŽÒÖ·t?¥ åÒ-ÊDzÝesÓž"|’BûÊ- šŽÓ”G×­¾´}âg.%§¦š~S ..(MÎ8ÓÉÉäå%v;÷kÚ^â&¶þ~/`ùº;((M9y¤u–dÚI’U²f\­LQ<~AÉÝëtÀMà2­™5Spfõ[—{¯% H{o&ÍÃg’³Iºª@$ÒÖ’f~Þ¶tS™©¿¦Tm¥)‚Šjs){£tÕ à–õQòhK ôÊ4Á¡äý rPraú¨ž,0MëÉf; J€B½’Y`:Òä¶IÛ BÀ4)|$…Õ™Ö\@HÉžü¦Ãp[·ppšÒ–HBŽ3½É5 HI H¡„¦ü©nýn&.·~¨ôšK·Œ^§[L{ånšSê—”µß±)“{¶øâZÒ&&‘Ì,ÓF³&òl³Öù&•´T“H&ϯ鼨›ÔwsˆxáÙ¤qL)MLWZ˜,·í/(Ó¼r¡ë&XüDS™€)i=É„4e ôšG?ßÍ”åsÉ¡4vAþ®9¹Ô¢ -i3·³‘n¡nÔIaʈíf"˜~–@AHkf@ø~•“ó^ž;/¯ŸŸ“ú\¢»­óÚB¯òv®}ö Iôâ·DÊ^á’~çÑë«_`z™é@¶¥M àv3°ßy…~™.Xñ#iÝbUM믌Ø~â^M·‘ù‰›5Õu;ßé–ÊOŠ 7zÛR×mìMq©^ ޽ÀéG8º%ÚöÒtnã"i^·qr›K7óÜÖe! œn ñˆ¶äàñó}¿’ÉÏ$˜´¾Ûƶ ¸™¤~œ~&ÞOß½èmK]Óy½ÛXí|šÌP·¹ôÒt&ëÏ+Ðßo_¤°QqÏV¹Œ”‰yLk7Éç¦ ÜÏï„úù¶€ú=}ÑV`™ÖŠ~'ô\ÆÀ4¦çZ× œ^¾- ô+¼Ý,8·¹ð+`ý|·1u †·ýMù%7fòZÈ·@mùv[Úë›mÈÙÐÖÖTšçRÎ%%f[…Á¹j¿Eº9M*ÒÍÙºìÛ·¥¥¥X·nvíÚ…cÇŽ! " ášk®A¯^½póÍ7#//eee())±nÓHKKóECss³§yîe²'ù(¯…¹ß,e~s˜žk¶|ïßÙ®Wý¶Ö;›çl<×^GÜþcx.t¶¶¶âøñã˜5k–£ÎÌ™3QSSƒææf1ëÂ?þˆÑ£G£{÷î˜>}:jjj0uêTìÚµ ظq#î½÷^¬]»ƒFzz:JJJÞßp8Œ#GŽˆÙ$§M›†C‡áÌ™3®ÛCÒ~¼¸¼Pç ÂÏic"×ÎIDATz.¥­šä?¡ñ.ÄòŸ˜g}Ñ1×\§N²öY¹×ù“O>ÁرcqêÔ)Àïÿ{¼òÊ+HKK·…¦M›f»ÞýôéÓŽùÅb¸üòËm4?~ÜŠ”ssšòùrs6x¾OÆùÆPÿú|!Íì4LÔ2ûHà:õÌ~ôÑG3fŒÖ`îܹÆKzà‰'žÀÉ“'­ÄäÒö’) 8MKbÚ—2jÐß[{¨*¡å&ÍšÀ5&[>pàú÷ï3gÎXu¾úê+üú׿ö°ápyyy8tèŽ;& ~Û™NpmròÈ#( ÿþÈÊʲ¾¹Ýã 1vìX0ÞÖÅ ÿM^Æ™yÝǪ”:7S6Qå? N ˜8ß|ó Ö­[g{§ÿþˆF£î›úäwÄ_þòãݪ¼D£Qcv@ÆjŠœâ¦l˜‰rÁ~'È»ï¾ëx§k×®ˆD"¾½å;wÆÁƒ­CØ’IÍ…ƒé´Ï—$EÅñ’f¢\ëL0c±¾úê+Ç;ééé‡Ã®iox\7Ï'äFƒÎ,]”¬OcQç=$³;$€™(ôz““&n>xð SƒˆD"®— »8÷£1¹Jƒ¾¦çõ±5þÍ0å‚Ñ’¦ ®1u´-áp)))ŽXUéà2ÍÞaJÀf¢ß¶N³:Ðt4ÒùÖ„ÆL”ÿS…_o÷‹_üÇ·½ÓØØhmqðM~­¹hbš–ÕÏÞ5ÍAIµ%Í® å ¦%±]’(”攘˜ß9yå•W:Þ9xð u?޾EÌkƒ:†¤|²œ>Ó&¦{0ÝBÀL” f=)13 ÅÓ ÈÏÏw|k÷îÝé¿|«…;n¤41¦€z§ËiºÉ ÌD¹ Ê{gÌÌL´oßK–,±11Îe—]ææm·Ý†K.¹Äö^EE…m*]·î–"Çt°$TLš>¡1å‚+ãÇGmm-ššš0qâDsG£QÛ»ÙÙÙŽ“—^z©íyøæ›oP__o‹Þ¡ÿJiD·oßîH7iÒ˜<‘ œ&p&€™(ç]¡¡t:t°™‡'Nœ°½Û»woqí6|øpØÖ¡‹/6¦«äëÊÊÊJÜsÏ=bÆG“Æ4¥U9›’f¢œwe̘1ÖÏóæÍ³¨ººÚúÛ¥—^Š{î¹Ç˜‚ròäÉèׯŸõþ¦M›PZZê$_÷½ýöÛ¸÷Þ{1nÜ8qŸS Ó“‚Ú²~æ%yÊ”)S¬(ç“çÿþ¨¬¬Duu5rssѹsg¤¦¦b×®]˜¹%9—nór%€™(ÔÚÓ”ÑGåøÉ–®ß¡ŽÓµÒ¿0õu‡:þVº1ÌO n˜‰r^;€¼®’nà¦wÞx]™GÅoœæÁË”Õt<úè£PJ¡¡¡íÛ·ÇÅ_ŒqãÆaÚ´iX¼x1.¾øblÙ²Ó¦MCYYY˜‰rá[Æ8—œÆÒmÑ&KZP2iMg1M äqöìÙhiiÁرc1kÖ,$''cçÎHMMÅòåË1qâD¼õÖ[¶Œ `&ÊJÓú§êÐÎ!ª)9 ¥+üh1e±ó›ô›Ó¤ë¦¤¤X€ïÓ§¶mÛ†mÛ¶¡K—.8pà€ñŠ„0弩)$ý»t²×=©|½iºÛté­<×-=Ï©gëí;3&MBYY>þøc£fN3QÎkVkAý¯”ÔJ§ï;n&)ßj1 P øô÷Ôñ“ššjú!C …ð«_ýÊõþ’0å¼4aùÝ”|íÈ÷(M‡›¹¦óãÔ‘n|Ö¿§tšMo,×ÀÔš3%%}ûöµ9ªÄ±HDþ$ÊùT¸VºÊH÷•HɶÜÚòº¡[Ò–Mܹ¤ÍZzZEºi=¡1å¼Óššá©’ÌH·[¤M—öð5¦ä 2EëÐÿK ´¨¶”4ªÉ¹$œÇS‘'9Á²ÿ]Z“ÿËž'»rsqÀyS§ô;i¿Uº„ˆ—ƒ‘šÊ6Ap˜² ‰ó£ÿÅàt»w’k/Slª›él2‡%k2‰Ýn'oË5|ÚShIhÑÿ>pš@àeû Ïó{3ºßp=7ÓXò;þŸpþ$Ê…N¿?·”¦úÒÏ^Àô¹×éÇMÞ `&Ê… ж:•Üù¿A«©}¯£_ÿaÁä6GáIEND®B`‚commons-jci-1.1-src/src/site/resources/profile.cobertura100644 0 0 0 12225212023 20517 0ustar 0 0 commons-jci-1.1-src/src/site/site.xml100644 0 0 2724 12225237646 14744 0ustar 0 0 Apache Commons JCI jci-logo-white.png http://commons.apache.org/jci/ commons-jci-1.1-src/src/site/xdoc/download_jci.xml100644 0 0 15457 12225040150 17376 0ustar 0 0 Download Apache Commons JCI Commons Documentation Team

We recommend you use a mirror to download our release builds, but you must verify the integrity of the downloaded files using signatures downloaded from our main distribution directories. Recent releases (48 hours) may not yet be available from the mirrors.

You are currently using [preferred]. If you encounter a problem with this mirror, please select another mirror. If all mirrors are failing, there are backup mirrors (at the end of the mirrors list) that should be available.

[if-any logo][end]

Other mirrors:

The KEYS link links to the code signing keys used to sign the product. The PGP link downloads the OpenPGP compatible signature from our main site. The MD5 link downloads the checksum from the main site.

commons-jci-1.1-bin.tar.gz md5 pgp
commons-jci-1.1-bin.zip md5 pgp
commons-jci-1.1-src.tar.gz md5 pgp
commons-jci-1.1-src.zip md5 pgp

Older releases can be obtained from the archives.

commons-jci-1.1-src/src/site/xdoc/faq.xml100644 0 0 5455 12225020575 15477 0ustar 0 0 Commons JCI - FAQ Commons Development Team
Yes, it is now. JSR199 in the end brought the official java compiler tools that now come with Java 6. Progress on this had stalled for many years. This is how JCI was born. JCI provided what was missing from the JDK. And it still provides it also for earlier versions. The main author of JCI has later on joined the EG and will make sure there is a bridge to the JSR199 API. Well, as said before ...there are no backports so far. And if you give the the final java tools API in Java 6 a try you might well come back and enjoy JCI :) Well, there are a couple of projects out there using this code already for quite some time in production. Drools and Cocoon to name just a few well known Open Source projects. Code coverage is not bad at all ...but there still a few things on the TODO list and contributions are always welcome. There is always room for new implementations. And if the compiler supports compilation to java bytecode, there is also a good chance it can be added. There are currently already a few potential candidates out there. But it all comes down to the need and the time to implement.
commons-jci-1.1-src/src/site/xdoc/index.xml100644 0 0 4755 12225241057 16041 0ustar 0 0 Apache Commons JCI - About Commons Documentation Team

JCI is a java compiler interface. It can be used to either compile java (or any other language that can be compiled to java classes like e.g. groovy or javascript) to java. It is well integrated with a filesystem alteration monitor that can be used with the JCI compiling/reloading classloader. All the currently supported compilers feature in-memory compilation.

The current implementation supports compilation via the following compilers:

See the downloads page for information on obtaining releases.

The Javadoc API documentation is available online. See the Usage page for some examples.

commons-jci-1.1-src/src/site/xdoc/issue-tracking.xml100644 0 0 13454 12225236275 17704 0ustar 0 0 Apache Commons JCI Issue tracking Commons Documentation Team

Apache Commons JCI uses ASF JIRA for tracking issues. See the Apache Commons JCI JIRA project page.

To use JIRA you may need to create an account (if you have previously created/updated Commons issues using Bugzilla an account will have been automatically created and you can use the Forgot Password page to get a new password).

If you would like to report a bug, or raise an enhancement request with Apache Commons JCI please do the following:

  1. Search existing open bugs. If you find your issue listed then please add a comment with your details.
  2. Search the mailing list archive(s). You may find your issue or idea has already been discussed.
  3. Decide if your issue is a bug or an enhancement.
  4. Submit either a bug report or enhancement request.

Please also remember these points:

  • the more information you provide, the better we can help you
  • test cases are vital, particularly for any proposed enhancements
  • the developers of Apache Commons JCI are all unpaid volunteers

For more information on subversion and creating patches see the Apache Contributors Guide.

You may also find these links useful:

commons-jci-1.1-src/src/site/xdoc/mail-lists.xml100644 0 0 23013 12225235624 17017 0ustar 0 0 Apache Commons JCI Mailing Lists Commons Documentation Team

Apache Commons JCI shares mailing lists with all the other Commons Components. To make it easier for people to only read messages related to components they are interested in, the convention in Commons is to prefix the subject line of messages with the component's name, for example:

  • [jci] Problem with the ...

Questions related to the usage of Apache Commons JCI should be posted to the User List.
The Developer List is for questions and discussion related to the development of Apache Commons JCI.
Please do not cross-post; developers are also subscribed to the user list.
You must be subscribed to post to the mailing lists. Follow the Subscribe links below to subscribe.

Note: please don't send patches or attachments to any of the mailing lists. Patches are best handled via the Issue Tracking system. Otherwise, please upload the file to a public server and include the URL in the mail.

Please prefix the subject line of any messages for Apache Commons JCI with [jci] - thanks!

Name Subscribe Unsubscribe Post Archive Other Archives
Commons User List

Questions on using Apache Commons JCI.

Subscribe Unsubscribe Post mail-archives.apache.org markmail.org
www.mail-archive.com
news.gmane.org
Commons Developer List

Discussion of development of Apache Commons JCI.

Subscribe Unsubscribe Post mail-archives.apache.org markmail.org
www.mail-archive.com
news.gmane.org
Commons Issues List

Only for e-mails automatically generated by the issue tracking system.

Subscribe Unsubscribe read only mail-archives.apache.org markmail.org
www.mail-archive.com
Commons Commits List

Only for e-mails automatically generated by the source control sytem.

Subscribe Unsubscribe read only mail-archives.apache.org markmail.org
www.mail-archive.com

Other mailing lists which you may find useful include:

Name Subscribe Unsubscribe Post Archive Other Archives
Apache Announce List

General announcements of Apache project releases.

Subscribe Unsubscribe read only mail-archives.apache.org markmail.org
old.nabble.com
www.mail-archive.com
news.gmane.org
commons-jci-1.1-src/src/site/xdoc/usage.xml100644 0 0 10637 12225243654 16057 0ustar 0 0 Apache Commons JCI - Usage Commons Development Team

The JavaCompiler is quite simple. You have to provide the paths to the sources, where to get the sources from and where to store the classes. Then you just pick one of the compilers to do the work. The result of the compilation is returned as a CompilationResult.

Information like line numbers of errors etc are accessible in a consistent way. If supported by the compiler you can even get notified about error before the end of the compilation. (see the CompilationProblemHandler) for that. The example module provides a simple JSP servlet and a javac-like command line interface.

A subproject of JCI provides a FilesystemAlterationMonitor that can be used to get notified when files change on the local filesystem. If you attach a ReloadingListener or a CompilingListener it can even trigger the reload of a class in the ReloadingClassLoader.

But you can also just implement a simple FilesystemAlterationListener yourself and just use it to get notified about configuration files changes for example. The example just extends the FileChangeListener that provides a few convenience methods.

Commons JCI is split into several modules, there is one artifact per compiler. Using the Eclipse compiler requires to declare the following dependency in your project:

org.apache.commons commons-jci-eclipse 1.1 ]]>

The other artifacts are commons-jci-groovy, commons-jci-janino and commons-jci-rhino.

commons-jci-1.1-src/compilers/eclipse/src/ 40755 0 0 0 12060700111 15604 5ustar 0 0 commons-jci-1.1-src/compilers/eclipse/src/main/ 40755 0 0 0 12060700111 16530 5ustar 0 0 commons-jci-1.1-src/compilers/eclipse/src/main/java/ 40755 0 0 0 12060700111 17451 5ustar 0 0 commons-jci-1.1-src/compilers/eclipse/src/main/java/org/ 40755 0 0 0 12060700111 20240 5ustar 0 0 commons-jci-1.1-src/compilers/eclipse/src/main/java/org/apache/ 40755 0 0 0 12060700111 21461 5ustar 0 0 commons-jci-1.1-src/compilers/eclipse/src/main/java/org/apache/commons/ 40755 0 0 0 12060700111 23134 5ustar 0 0 commons-jci-1.1-src/compilers/eclipse/src/main/java/org/apache/commons/jci/ 40755 0 0 0 12060700111 23701 5ustar 0 0 commons-jci-1.1-src/compilers/eclipse/src/main/java/org/apache/commons/jci/compilers/ 40755 0 0 0 12224752675 25726 5ustar 0 0 commons-jci-1.1-src/compilers/eclipse/src/main/resources/ 40755 0 0 0 12225261521 20554 5ustar 0 0 commons-jci-1.1-src/compilers/eclipse/src/test/ 40755 0 0 0 12060700111 16563 5ustar 0 0 commons-jci-1.1-src/compilers/eclipse/src/test/java/ 40755 0 0 0 12060700111 17504 5ustar 0 0 commons-jci-1.1-src/compilers/eclipse/src/test/java/org/ 40755 0 0 0 12060700111 20273 5ustar 0 0 commons-jci-1.1-src/compilers/eclipse/src/test/java/org/apache/ 40755 0 0 0 12060700111 21514 5ustar 0 0 commons-jci-1.1-src/compilers/eclipse/src/test/java/org/apache/commons/ 40755 0 0 0 12060700111 23167 5ustar 0 0 commons-jci-1.1-src/compilers/eclipse/src/test/java/org/apache/commons/jci/ 40755 0 0 0 12060700111 23734 5ustar 0 0 commons-jci-1.1-src/compilers/eclipse/src/test/java/org/apache/commons/jci/compilers/ 40755 0 0 0 12224752675 25761 5ustar 0 0 commons-jci-1.1-src/compilers/eclipse/src/test/resources/ 40755 0 0 0 12060700111 20575 5ustar 0 0 commons-jci-1.1-src/compilers/eclipse/pom.xml100644 0 0 5516 12225250625 16453 0ustar 0 0 4.0.0 org.apache.commons commons-jci 1.1 ../../pom.xml commons-jci-eclipse 1.1 Apache Commons JCI compiler-eclipse Apache Commons JCI compiler implementation for the Eclipse compiler. org.apache.commons commons-jci-core ${project.version} org.eclipse.jdt.core.compiler ecj org.apache.commons commons-jci-core ${project.version} test-jar test junit junit test jci-eclipse true maven-assembly-plugin true ././@LongLink100644 0 0 164 12225263274 10261 Lustar 0 0 commons-jci-1.1-src/compilers/eclipse/src/main/java/org/apache/commons/jci/compilers/EclipseCompilationProblem.javacommons-jci-1.1-src/compilers/eclipse/src/main/java/org/apache/commons/jci/compilers/EclipseCompilat100644 0 0 4357 12204234514 31015 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.compilers; import org.apache.commons.jci.problems.CompilationProblem; import org.eclipse.jdt.core.compiler.IProblem; /** * Wrapping an Eclipse compiler problem * * @author tcurdt */ public final class EclipseCompilationProblem implements CompilationProblem { private final IProblem problem; public EclipseCompilationProblem(final IProblem pProblem) { problem = pProblem; } public boolean isError() { return problem.isError(); } public String getFileName() { return new String(problem.getOriginatingFileName()); } public int getStartLine() { return problem.getSourceLineNumber(); } public int getStartColumn() { return problem.getSourceStart(); } public int getEndLine() { return getStartLine(); } public int getEndColumn() { return problem.getSourceEnd(); } public String getMessage() { return problem.getMessage(); } @Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append(getFileName()).append(" ("); sb.append(getStartLine()); sb.append(":"); sb.append(getStartColumn()); sb.append(") : "); sb.append(getMessage()); return sb.toString(); } public int getId() { return problem.getID(); } } ././@LongLink100644 0 0 156 12225263274 10262 Lustar 0 0 commons-jci-1.1-src/compilers/eclipse/src/main/java/org/apache/commons/jci/compilers/EclipseJavaCompiler.javacommons-jci-1.1-src/compilers/eclipse/src/main/java/org/apache/commons/jci/compilers/EclipseJavaComp100644 0 0 37767 12205126514 31001 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.compilers; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Collection; import java.util.Locale; import java.util.Map; import java.util.StringTokenizer; import org.apache.commons.jci.problems.CompilationProblem; import org.apache.commons.jci.readers.ResourceReader; import org.apache.commons.jci.stores.ResourceStore; import org.apache.commons.jci.utils.ConversionUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.eclipse.jdt.core.compiler.IProblem; import org.eclipse.jdt.internal.compiler.ClassFile; import org.eclipse.jdt.internal.compiler.CompilationResult; import org.eclipse.jdt.internal.compiler.Compiler; import org.eclipse.jdt.internal.compiler.DefaultErrorHandlingPolicies; import org.eclipse.jdt.internal.compiler.ICompilerRequestor; import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy; import org.eclipse.jdt.internal.compiler.IProblemFactory; import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader; import org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException; import org.eclipse.jdt.internal.compiler.env.ICompilationUnit; import org.eclipse.jdt.internal.compiler.env.INameEnvironment; import org.eclipse.jdt.internal.compiler.env.NameEnvironmentAnswer; import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory; /** * Eclipse compiler implemenation * * @author tcurdt */ public final class EclipseJavaCompiler extends AbstractJavaCompiler { private final Log log = LogFactory.getLog(EclipseJavaCompiler.class); private final EclipseJavaCompilerSettings defaultSettings; public EclipseJavaCompiler() { this(new EclipseJavaCompilerSettings()); } public EclipseJavaCompiler( final Map pSettings ) { defaultSettings = new EclipseJavaCompilerSettings(pSettings); } public EclipseJavaCompiler( final EclipseJavaCompilerSettings pSettings ) { defaultSettings = pSettings; } final class CompilationUnit implements ICompilationUnit { final private String clazzName; final private String fileName; final private char[] typeName; final private char[][] packageName; final private ResourceReader reader; CompilationUnit( final ResourceReader pReader, final String pSourceFile ) { reader = pReader; clazzName = ConversionUtils.convertResourceToClassName(pSourceFile); fileName = pSourceFile; int dot = clazzName.lastIndexOf('.'); if (dot > 0) { typeName = clazzName.substring(dot + 1).toCharArray(); } else { typeName = clazzName.toCharArray(); } log.debug("className=" + clazzName); log.debug("fileName=" + fileName); log.debug("typeName=" + new String(typeName)); final StringTokenizer izer = new StringTokenizer(clazzName, "."); packageName = new char[izer.countTokens() - 1][]; for (int i = 0; i < packageName.length; i++) { packageName[i] = izer.nextToken().toCharArray(); log.debug("package[" + i + "]=" + new String(packageName[i])); } } public char[] getFileName() { return fileName.toCharArray(); } public char[] getContents() { final byte[] content = reader.getBytes(fileName); if (content == null) { return null; //throw new RuntimeException("resource " + fileName + " could not be found"); } return new String(content).toCharArray(); } public char[] getMainTypeName() { return typeName; } public char[][] getPackageName() { return packageName; } public boolean ignoreOptionalProblems() { return false; } } public org.apache.commons.jci.compilers.CompilationResult compile( final String[] pSourceFiles, final ResourceReader pReader, final ResourceStore pStore, final ClassLoader pClassLoader, final JavaCompilerSettings pSettings ) { final Map settingsMap = new EclipseJavaCompilerSettings(pSettings).toNativeSettings(); final Collection problems = new ArrayList(); final ICompilationUnit[] compilationUnits = new ICompilationUnit[pSourceFiles.length]; for (int i = 0; i < compilationUnits.length; i++) { final String sourceFile = pSourceFiles[i]; if (pReader.isAvailable(sourceFile)) { compilationUnits[i] = new CompilationUnit(pReader, sourceFile); log.debug("compiling " + sourceFile); } else { // log.error("source not found " + sourceFile); final CompilationProblem problem = new CompilationProblem() { public int getEndColumn() { return 0; } public int getEndLine() { return 0; } public String getFileName() { return sourceFile; } public String getMessage() { return "Source " + sourceFile + " could not be found"; } public int getStartColumn() { return 0; } public int getStartLine() { return 0; } public boolean isError() { return true; } @Override public String toString() { return getMessage(); } }; if (problemHandler != null) { problemHandler.handle(problem); } problems.add(problem); } } if (problems.size() > 0) { final CompilationProblem[] result = new CompilationProblem[problems.size()]; problems.toArray(result); return new org.apache.commons.jci.compilers.CompilationResult(result); } final IErrorHandlingPolicy policy = DefaultErrorHandlingPolicies.proceedWithAllProblems(); final IProblemFactory problemFactory = new DefaultProblemFactory(Locale.getDefault()); final INameEnvironment nameEnvironment = new INameEnvironment() { public NameEnvironmentAnswer findType( final char[][] pCompoundTypeName ) { final StringBuilder result = new StringBuilder(); for (int i = 0; i < pCompoundTypeName.length; i++) { if (i != 0) { result.append('.'); } result.append(pCompoundTypeName[i]); } //log.debug("finding compoundTypeName=" + result.toString()); return findType(result.toString()); } public NameEnvironmentAnswer findType( final char[] pTypeName, final char[][] pPackageName ) { final StringBuilder result = new StringBuilder(); for (int i = 0; i < pPackageName.length; i++) { result.append(pPackageName[i]); result.append('.'); } // log.debug("finding typeName=" + new String(typeName) + " packageName=" + result.toString()); result.append(pTypeName); return findType(result.toString()); } private NameEnvironmentAnswer findType( final String pClazzName ) { if (isPackage(pClazzName)) { return null; } log.debug("finding " + pClazzName); final String resourceName = ConversionUtils.convertClassToResourcePath(pClazzName); final byte[] clazzBytes = pStore.read(resourceName); if (clazzBytes != null) { log.debug("loading from store " + pClazzName); final char[] fileName = pClazzName.toCharArray(); try { final ClassFileReader classFileReader = new ClassFileReader(clazzBytes, fileName, true); return new NameEnvironmentAnswer(classFileReader, null); } catch (final ClassFormatException e) { log.error("wrong class format", e); return null; } } log.debug("not in store " + pClazzName); final InputStream is = pClassLoader.getResourceAsStream(resourceName); if (is == null) { log.debug("class " + pClazzName + " not found"); return null; } final byte[] buffer = new byte[8192]; final ByteArrayOutputStream baos = new ByteArrayOutputStream(buffer.length); int count; try { while ((count = is.read(buffer, 0, buffer.length)) > 0) { baos.write(buffer, 0, count); } baos.flush(); final char[] fileName = pClazzName.toCharArray(); final ClassFileReader classFileReader = new ClassFileReader(baos.toByteArray(), fileName, true); return new NameEnvironmentAnswer(classFileReader, null); } catch (final IOException e) { log.error("could not read class", e); return null; } catch (final ClassFormatException e) { log.error("wrong class format", e); return null; } finally { try { baos.close(); } catch (final IOException oe) { log.error("could not close output stream", oe); } try { is.close(); } catch (final IOException ie) { log.error("could not close input stream", ie); } } } private boolean isPackage( final String pClazzName ) { // reject this early as it is cheap if (pClazzName.contains("-")) { // "-" is not valid in package names return false; } final InputStream is = pClassLoader.getResourceAsStream(ConversionUtils.convertClassToResourcePath(pClazzName)); if (is != null) { log.debug("found the class for " + pClazzName + "- no package"); try { is.close(); } catch (final IOException ie) { log.error("could not close input stream", ie); } return false; } // FIXME: this should not be tied to the extension final String source = pClazzName.replace('.', '/') + ".java"; if (pReader.isAvailable(source)) { log.debug("found the source " + source + " for " + pClazzName + " - no package "); return false; } /* * See https://issues.apache.org/jira/browse/JCI-59 * At present, the code assumes that anything else is a package name * This is wrong, as for example jci.AdditionalTopLevel is not a package name. * It's not clear how to fix this in general. * It would seem to need access to the input classpath and/or the generated classes. */ return true; } public boolean isPackage( char[][] parentPackageName, char[] pPackageName ) { final StringBuilder result = new StringBuilder(); if (parentPackageName != null) { for (int i = 0; i < parentPackageName.length; i++) { if (i != 0) { result.append('.'); } result.append(parentPackageName[i]); } } // log.debug("isPackage parentPackageName=" + result.toString() + " packageName=" + new String(packageName)); if (parentPackageName != null && parentPackageName.length > 0) { result.append('.'); } result.append(pPackageName); return isPackage(result.toString()); } public void cleanup() { log.debug("cleanup"); } }; final ICompilerRequestor compilerRequestor = new ICompilerRequestor() { public void acceptResult( final CompilationResult pResult ) { if (pResult.hasProblems()) { for (IProblem iproblem : pResult.getProblems()) { final CompilationProblem problem = new EclipseCompilationProblem(iproblem); if (problemHandler != null) { problemHandler.handle(problem); } problems.add(problem); } } if (!pResult.hasErrors()) { final ClassFile[] clazzFiles = pResult.getClassFiles(); for (ClassFile clazzFile : clazzFiles) { final char[][] compoundName = clazzFile.getCompoundName(); final StringBuilder clazzName = new StringBuilder(); for (int j = 0; j < compoundName.length; j++) { if (j != 0) { clazzName.append('.'); } clazzName.append(compoundName[j]); } pStore.write(clazzName.toString().replace('.', '/') + ".class", clazzFile.getBytes()); } } } }; final Compiler compiler = new Compiler(nameEnvironment, policy, new CompilerOptions(settingsMap), compilerRequestor, problemFactory); compiler.compile(compilationUnits); final CompilationProblem[] result = new CompilationProblem[problems.size()]; problems.toArray(result); return new org.apache.commons.jci.compilers.CompilationResult(result); } public JavaCompilerSettings createDefaultSettings() { return new EclipseJavaCompilerSettings(defaultSettings); } } ././@LongLink100644 0 0 166 12225263274 10263 Lustar 0 0 commons-jci-1.1-src/compilers/eclipse/src/main/java/org/apache/commons/jci/compilers/EclipseJavaCompilerSettings.javacommons-jci-1.1-src/compilers/eclipse/src/main/java/org/apache/commons/jci/compilers/EclipseJavaComp100644 0 0 7214 12204234514 30740 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.compilers; import java.util.HashMap; import java.util.Map; import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; /** * Native Eclipse compiler settings * * @author tcurdt */ public final class EclipseJavaCompilerSettings extends JavaCompilerSettings { final private Map defaultEclipseSettings = new HashMap(); public EclipseJavaCompilerSettings() { defaultEclipseSettings.put(CompilerOptions.OPTION_LineNumberAttribute, CompilerOptions.GENERATE); defaultEclipseSettings.put(CompilerOptions.OPTION_SourceFileAttribute, CompilerOptions.GENERATE); defaultEclipseSettings.put(CompilerOptions.OPTION_ReportUnusedImport, CompilerOptions.IGNORE); defaultEclipseSettings.put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.GENERATE); } public EclipseJavaCompilerSettings( final JavaCompilerSettings pSettings ) { super(pSettings); if (pSettings instanceof EclipseJavaCompilerSettings) { defaultEclipseSettings.putAll(((EclipseJavaCompilerSettings)pSettings).toNativeSettings()); } } public EclipseJavaCompilerSettings( final Map pMap ) { defaultEclipseSettings.putAll(pMap); } private static Map nativeVersions = new HashMap() { private static final long serialVersionUID = 1L; { put("1.1", CompilerOptions.VERSION_1_1); put("1.2", CompilerOptions.VERSION_1_2); put("1.3", CompilerOptions.VERSION_1_3); put("1.4", CompilerOptions.VERSION_1_4); put("1.5", CompilerOptions.VERSION_1_5); put("1.6", CompilerOptions.VERSION_1_6); put("1.7", CompilerOptions.VERSION_1_7); }}; private String toNativeVersion( final String pVersion ) { final String nativeVersion = nativeVersions.get(pVersion); if (nativeVersion == null) { throw new RuntimeException("unknown version " + pVersion); } return nativeVersion; } Map toNativeSettings() { final Map map = new HashMap(defaultEclipseSettings); map.put(CompilerOptions.OPTION_SuppressWarnings, isWarnings()?CompilerOptions.GENERATE:CompilerOptions.DO_NOT_GENERATE); map.put(CompilerOptions.OPTION_ReportDeprecation, isDeprecations()?CompilerOptions.GENERATE:CompilerOptions.DO_NOT_GENERATE); map.put(CompilerOptions.OPTION_TargetPlatform, toNativeVersion(getTargetVersion())); map.put(CompilerOptions.OPTION_Source, toNativeVersion(getSourceVersion())); map.put(CompilerOptions.OPTION_Encoding, getSourceEncoding()); return map; } @Override public String toString() { return toNativeSettings().toString(); } } commons-jci-1.1-src/compilers/eclipse/src/main/resources/LICENSE.txt100644 0 0 26446 10607602354 22535 0ustar 0 0 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. commons-jci-1.1-src/compilers/eclipse/src/main/resources/NOTICE.txt100644 0 0 323 12225261521 22351 0ustar 0 0 Apache Commons JCI - Eclipse Compiler Implementation Copyright 2004-2013 The Apache Software Foundation This product includes software developed by The Apache Software Foundation (http://www.apache.org/). ././@LongLink100644 0 0 176 12225263274 10264 Lustar 0 0 commons-jci-1.1-src/compilers/eclipse/src/test/java/org/apache/commons/jci/compilers/EclipseJavaCompilerSettingsTestCase.javacommons-jci-1.1-src/compilers/eclipse/src/test/java/org/apache/commons/jci/compilers/EclipseJavaComp100644 0 0 11352 12204235540 31011 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.compilers; import java.util.Map; import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; import junit.framework.TestCase; public final class EclipseJavaCompilerSettingsTestCase extends TestCase { public void testDefaultSettings() { final Map m = new EclipseJavaCompilerSettings().toNativeSettings(); assertEquals(CompilerOptions.DO_NOT_GENERATE, m.get(CompilerOptions.OPTION_SuppressWarnings)); assertEquals(CompilerOptions.DO_NOT_GENERATE, m.get(CompilerOptions.OPTION_ReportDeprecation)); assertEquals(CompilerOptions.VERSION_1_4, m.get(CompilerOptions.OPTION_TargetPlatform)); assertEquals(CompilerOptions.VERSION_1_4, m.get(CompilerOptions.OPTION_Source)); assertEquals("UTF-8", m.get(CompilerOptions.OPTION_Encoding)); } public void testSourceVersion() { final EclipseJavaCompilerSettings s = new EclipseJavaCompilerSettings(); s.setSourceVersion("1.1"); assertEquals(CompilerOptions.VERSION_1_1, s.toNativeSettings().get(CompilerOptions.OPTION_Source)); s.setSourceVersion("1.2"); assertEquals(CompilerOptions.VERSION_1_2, s.toNativeSettings().get(CompilerOptions.OPTION_Source)); s.setSourceVersion("1.3"); assertEquals(CompilerOptions.VERSION_1_3, s.toNativeSettings().get(CompilerOptions.OPTION_Source)); s.setSourceVersion("1.4"); assertEquals(CompilerOptions.VERSION_1_4, s.toNativeSettings().get(CompilerOptions.OPTION_Source)); s.setSourceVersion("1.5"); assertEquals(CompilerOptions.VERSION_1_5, s.toNativeSettings().get(CompilerOptions.OPTION_Source)); s.setSourceVersion("1.6"); assertEquals(CompilerOptions.VERSION_1_6, s.toNativeSettings().get(CompilerOptions.OPTION_Source)); s.setSourceVersion("1.7"); assertEquals(CompilerOptions.VERSION_1_7, s.toNativeSettings().get(CompilerOptions.OPTION_Source)); } public void testTargetVersion() { final EclipseJavaCompilerSettings s = new EclipseJavaCompilerSettings(); s.setTargetVersion("1.1"); assertEquals(CompilerOptions.VERSION_1_1, s.toNativeSettings().get(CompilerOptions.OPTION_TargetPlatform)); s.setTargetVersion("1.2"); assertEquals(CompilerOptions.VERSION_1_2, s.toNativeSettings().get(CompilerOptions.OPTION_TargetPlatform)); s.setTargetVersion("1.3"); assertEquals(CompilerOptions.VERSION_1_3, s.toNativeSettings().get(CompilerOptions.OPTION_TargetPlatform)); s.setTargetVersion("1.4"); assertEquals(CompilerOptions.VERSION_1_4, s.toNativeSettings().get(CompilerOptions.OPTION_TargetPlatform)); s.setTargetVersion("1.5"); assertEquals(CompilerOptions.VERSION_1_5, s.toNativeSettings().get(CompilerOptions.OPTION_TargetPlatform)); s.setTargetVersion("1.6"); assertEquals(CompilerOptions.VERSION_1_6, s.toNativeSettings().get(CompilerOptions.OPTION_TargetPlatform)); s.setTargetVersion("1.7"); assertEquals(CompilerOptions.VERSION_1_7, s.toNativeSettings().get(CompilerOptions.OPTION_TargetPlatform)); } public void testEncoding() { final EclipseJavaCompilerSettings s = new EclipseJavaCompilerSettings(); s.setSourceEncoding("ASCII"); assertEquals("ASCII", s.toNativeSettings().get(CompilerOptions.OPTION_Encoding)); } public void testWarnings() { final EclipseJavaCompilerSettings s = new EclipseJavaCompilerSettings(); s.setWarnings(true); assertEquals(CompilerOptions.GENERATE, s.toNativeSettings().get(CompilerOptions.OPTION_SuppressWarnings)); s.setWarnings(false); assertEquals(CompilerOptions.DO_NOT_GENERATE, s.toNativeSettings().get(CompilerOptions.OPTION_SuppressWarnings)); } public void testDeprecations() { final EclipseJavaCompilerSettings s = new EclipseJavaCompilerSettings(); s.setDeprecations(true); assertEquals(CompilerOptions.GENERATE, s.toNativeSettings().get(CompilerOptions.OPTION_ReportDeprecation)); s.setDeprecations(false); assertEquals(CompilerOptions.DO_NOT_GENERATE, s.toNativeSettings().get(CompilerOptions.OPTION_ReportDeprecation)); } } ././@LongLink100644 0 0 166 12225263274 10263 Lustar 0 0 commons-jci-1.1-src/compilers/eclipse/src/test/java/org/apache/commons/jci/compilers/EclipseJavaCompilerTestCase.javacommons-jci-1.1-src/compilers/eclipse/src/test/java/org/apache/commons/jci/compilers/EclipseJavaComp100644 0 0 3301 12205077627 30777 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.compilers; import junit.framework.AssertionFailedError; public final class EclipseJavaCompilerTestCase extends AbstractCompilerTestCase { @Override public String getCompilerName() { return "eclipse"; } @Override public JavaCompiler createJavaCompiler() { return new EclipseJavaCompiler(); } @Override public void testAdditionalTopLevelClassCompile() throws Exception { try { super.testAdditionalTopLevelClassCompile(); } catch (AssertionFailedError e) { if (e.getMessage().contains("The type AdditionalTopLevel collides")) { System.err.println("WARNING: See JCI-59 - EclipseJavaCompile#isPackage() is not yet working correctly - ignoring the failure for now"); } else { throw e; } } } } commons-jci-1.1-src/compilers/eclipse/src/test/resources/simplelog.properties100644 0 0 155 10573622016 25002 0ustar 0 0 org.apache.commons.logging.simplelog.defaultlog=debug org.apache.commons.logging.simplelog.showdatetime=truecommons-jci-1.1-src/compilers/groovy/src/ 40755 0 0 0 12060700111 15505 5ustar 0 0 commons-jci-1.1-src/compilers/groovy/src/main/ 40755 0 0 0 12060700111 16431 5ustar 0 0 commons-jci-1.1-src/compilers/groovy/src/main/java/ 40755 0 0 0 12060700111 17352 5ustar 0 0 commons-jci-1.1-src/compilers/groovy/src/main/java/org/ 40755 0 0 0 12060700111 20141 5ustar 0 0 commons-jci-1.1-src/compilers/groovy/src/main/java/org/apache/ 40755 0 0 0 12060700111 21362 5ustar 0 0 commons-jci-1.1-src/compilers/groovy/src/main/java/org/apache/commons/ 40755 0 0 0 12060700111 23035 5ustar 0 0 commons-jci-1.1-src/compilers/groovy/src/main/java/org/apache/commons/jci/ 40755 0 0 0 12060700111 23602 5ustar 0 0 commons-jci-1.1-src/compilers/groovy/src/main/java/org/apache/commons/jci/compilers/ 40755 0 0 0 12224752675 25627 5ustar 0 0 commons-jci-1.1-src/compilers/groovy/src/main/resources/ 40755 0 0 0 12225261527 20463 5ustar 0 0 commons-jci-1.1-src/compilers/groovy/src/test/ 40755 0 0 0 12060700111 16464 5ustar 0 0 commons-jci-1.1-src/compilers/groovy/src/test/java/ 40755 0 0 0 12060700111 17405 5ustar 0 0 commons-jci-1.1-src/compilers/groovy/src/test/java/org/ 40755 0 0 0 12060700111 20174 5ustar 0 0 commons-jci-1.1-src/compilers/groovy/src/test/java/org/apache/ 40755 0 0 0 12060700111 21415 5ustar 0 0 commons-jci-1.1-src/compilers/groovy/src/test/java/org/apache/commons/ 40755 0 0 0 12060700111 23070 5ustar 0 0 commons-jci-1.1-src/compilers/groovy/src/test/java/org/apache/commons/jci/ 40755 0 0 0 12060700111 23635 5ustar 0 0 commons-jci-1.1-src/compilers/groovy/src/test/java/org/apache/commons/jci/compilers/ 40755 0 0 0 12224752675 25662 5ustar 0 0 commons-jci-1.1-src/compilers/groovy/src/test/resources/ 40755 0 0 0 12060700111 20476 5ustar 0 0 commons-jci-1.1-src/compilers/groovy/pom.xml100644 0 0 5507 12225250625 16354 0ustar 0 0 4.0.0 org.apache.commons commons-jci 1.1 ../../pom.xml commons-jci-groovy 1.1 Apache Commons JCI compiler-groovy Apache Commons JCI compiler implementation for the Groovy compiler. org.apache.commons commons-jci-core ${project.version} org.codehaus.groovy groovy-all org.apache.commons commons-jci-core ${project.version} test-jar test junit junit test jci-groovy true maven-assembly-plugin true ././@LongLink100644 0 0 162 12225263274 10257 Lustar 0 0 commons-jci-1.1-src/compilers/groovy/src/main/java/org/apache/commons/jci/compilers/GroovyCompilationProblem.javacommons-jci-1.1-src/compilers/groovy/src/main/java/org/apache/commons/jci/compilers/GroovyCompilatio100644 0 0 6700 12204234514 31141 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.compilers; import org.apache.commons.jci.problems.CompilationProblem; import org.codehaus.groovy.control.messages.ExceptionMessage; import org.codehaus.groovy.control.messages.Message; import org.codehaus.groovy.control.messages.SimpleMessage; import org.codehaus.groovy.control.messages.SyntaxErrorMessage; import org.codehaus.groovy.syntax.SyntaxException; /** * Groovy version of a CompilationProblem * * @author tcurdt */ public final class GroovyCompilationProblem implements CompilationProblem { private final String fileName; private final String message; private final boolean error; private final int startLine; private final int startColumn; private final int endLine; private final int endColumn; public GroovyCompilationProblem(final Message pMessage) { if (pMessage instanceof SimpleMessage) { error = false; } else { error = true; } if (pMessage instanceof SyntaxErrorMessage) { SyntaxErrorMessage syntaxErrorMessage = (SyntaxErrorMessage)pMessage; SyntaxException syntaxException = syntaxErrorMessage.getCause(); message = syntaxException.getMessage(); fileName = syntaxException.getSourceLocator(); // FIXME: getStartLine() vs. getLine() startLine = syntaxException.getStartLine(); startColumn = syntaxException.getStartColumn(); endLine = syntaxException.getLine(); endColumn = syntaxException.getEndColumn(); } else { fileName = ""; startLine = 0; startColumn = 0; endLine = 0; endColumn = 0; if (pMessage instanceof ExceptionMessage) { message = ((ExceptionMessage)pMessage).getCause().getMessage(); } else if (pMessage instanceof SimpleMessage) { message = ((SimpleMessage)pMessage).getMessage(); } else { message = pMessage.toString(); } } } public boolean isError() { return error; } public String getFileName() { return fileName; } public int getStartLine() { return startLine; } public int getStartColumn() { return startColumn; } public int getEndLine() { return endLine; } public int getEndColumn() { return endColumn; } public String getMessage() { return message; } @Override public String toString() { return getMessage(); } } ././@LongLink100644 0 0 154 12225263274 10260 Lustar 0 0 commons-jci-1.1-src/compilers/groovy/src/main/java/org/apache/commons/jci/compilers/GroovyJavaCompiler.javacommons-jci-1.1-src/compilers/groovy/src/main/java/org/apache/commons/jci/compilers/GroovyJavaCompil100644 0 0 13200 12204236561 31103 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.compilers; import groovy.lang.GroovyClassLoader; import java.util.ArrayList; import java.util.Collection; import java.util.List; import org.apache.commons.jci.problems.CompilationProblem; import org.apache.commons.jci.readers.ResourceReader; import org.apache.commons.jci.stores.ResourceStore; import org.apache.commons.jci.utils.ConversionUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.codehaus.groovy.control.CompilationFailedException; import org.codehaus.groovy.control.CompilationUnit; import org.codehaus.groovy.control.CompilerConfiguration; import org.codehaus.groovy.control.ErrorCollector; import org.codehaus.groovy.control.MultipleCompilationErrorsException; import org.codehaus.groovy.control.Phases; import org.codehaus.groovy.control.SourceUnit; import org.codehaus.groovy.control.messages.Message; import org.codehaus.groovy.control.messages.WarningMessage; import org.codehaus.groovy.tools.GroovyClass; /** * Groovy implementation of the JavaCompiler interface * * @author tcurdt */ public final class GroovyJavaCompiler extends AbstractJavaCompiler { private final Log log = LogFactory.getLog(GroovyJavaCompiler.class); private final GroovyJavaCompilerSettings defaultSettings; public GroovyJavaCompiler() { defaultSettings = new GroovyJavaCompilerSettings(new CompilerConfiguration()); } public CompilationResult compile( final String[] pResourceNames, final ResourceReader pReader, final ResourceStore pStore, final ClassLoader pClassLoader, final JavaCompilerSettings pSettings ) { final CompilerConfiguration configuration = ((GroovyJavaCompilerSettings) pSettings).getCompilerConfiguration(); final ErrorCollector collector = new ErrorCollector(configuration); final GroovyClassLoader groovyClassLoader = new GroovyClassLoader(pClassLoader); final CompilationUnit unit = new CompilationUnit(configuration, null, groovyClassLoader); final SourceUnit[] source = new SourceUnit[pResourceNames.length]; for (int i = 0; i < source.length; i++) { final String resourceName = pResourceNames[i]; source[i] = new SourceUnit( ConversionUtils.convertResourceToClassName(resourceName), new String(pReader.getBytes(resourceName)), // FIXME delay the read configuration, groovyClassLoader, collector ); unit.addSource(source[i]); } final Collection problems = new ArrayList(); try { log.debug("compiling"); unit.compile(Phases.CLASS_GENERATION); @SuppressWarnings("unchecked") // Groovy library is not yet generic final List classes = unit.getClasses(); for (GroovyClass clazz : classes) { final byte[] bytes = clazz.getBytes(); pStore.write(ConversionUtils.convertClassToResourcePath(clazz.getName()), bytes); } } catch (final MultipleCompilationErrorsException e) { final ErrorCollector col = e.getErrorCollector(); @SuppressWarnings("unchecked") // Groovy library is not yet generic final Collection warnings = col.getWarnings(); if (warnings != null) { for (WarningMessage warning : warnings) { final CompilationProblem problem = new GroovyCompilationProblem(warning); if (problemHandler != null) { problemHandler.handle(problem); } problems.add(problem); } } @SuppressWarnings("unchecked") // Groovy library is not yet generic final Collection errors = col.getErrors(); if (errors != null) { for (Message message : errors) { final CompilationProblem problem = new GroovyCompilationProblem(message); if (problemHandler != null) { problemHandler.handle(problem); } problems.add(problem); } } } catch (CompilationFailedException e) { throw new RuntimeException("no expected"); } final CompilationProblem[] result = new CompilationProblem[problems.size()]; problems.toArray(result); return new CompilationResult(result); } public JavaCompilerSettings createDefaultSettings() { return defaultSettings; } } ././@LongLink100644 0 0 164 12225263274 10261 Lustar 0 0 commons-jci-1.1-src/compilers/groovy/src/main/java/org/apache/commons/jci/compilers/GroovyJavaCompilerSettings.javacommons-jci-1.1-src/compilers/groovy/src/main/java/org/apache/commons/jci/compilers/GroovyJavaCompil100644 0 0 2526 10613666121 31075 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.compilers; import org.codehaus.groovy.control.CompilerConfiguration; /** * Native configuration for the Groovy compiler * * @author tcurdt */ public final class GroovyJavaCompilerSettings extends JavaCompilerSettings { private final CompilerConfiguration settings; public GroovyJavaCompilerSettings( final CompilerConfiguration pSettings ) { settings = pSettings; } public CompilerConfiguration getCompilerConfiguration() { return settings; } } commons-jci-1.1-src/compilers/groovy/src/main/resources/LICENSE.txt100644 0 0 26446 10607602354 22436 0ustar 0 0 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. commons-jci-1.1-src/compilers/groovy/src/main/resources/NOTICE.txt100644 0 0 322 12225261527 22257 0ustar 0 0 Apache Commons JCI - Groovy Compiler Implementation Copyright 2004-2013 The Apache Software Foundation This product includes software developed by The Apache Software Foundation (http://www.apache.org/). ././@LongLink100644 0 0 164 12225263274 10261 Lustar 0 0 commons-jci-1.1-src/compilers/groovy/src/test/java/org/apache/commons/jci/compilers/GroovyJavaCompilerTestCase.javacommons-jci-1.1-src/compilers/groovy/src/test/java/org/apache/commons/jci/compilers/GroovyJavaCompil100644 0 0 2702 12204234514 31117 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.compilers; /** * * @author tcurdt */ public final class GroovyJavaCompilerTestCase extends AbstractCompilerTestCase { @Override public String getCompilerName() { return "groovy"; } @Override public JavaCompiler createJavaCompiler() { return new GroovyJavaCompiler(); } @Override public void testInternalClassCompile() throws Exception { // FIXME: inner classes not supported in groovy? } @Override public void testCrossReferenceCompilation() throws Exception { // FIXME: static imports not supported in groovy? } } commons-jci-1.1-src/compilers/groovy/src/test/resources/simplelog.properties100644 0 0 155 10573622016 24703 0ustar 0 0 org.apache.commons.logging.simplelog.defaultlog=debug org.apache.commons.logging.simplelog.showdatetime=truecommons-jci-1.1-src/compilers/janino/src/ 40755 0 0 0 12060700111 15436 5ustar 0 0 commons-jci-1.1-src/compilers/janino/src/main/ 40755 0 0 0 12060700111 16362 5ustar 0 0 commons-jci-1.1-src/compilers/janino/src/main/java/ 40755 0 0 0 12060700111 17303 5ustar 0 0 commons-jci-1.1-src/compilers/janino/src/main/java/org/ 40755 0 0 0 12060700111 20072 5ustar 0 0 commons-jci-1.1-src/compilers/janino/src/main/java/org/apache/ 40755 0 0 0 12060700111 21313 5ustar 0 0 commons-jci-1.1-src/compilers/janino/src/main/java/org/apache/commons/ 40755 0 0 0 12060700111 22766 5ustar 0 0 commons-jci-1.1-src/compilers/janino/src/main/java/org/apache/commons/jci/ 40755 0 0 0 12060700111 23533 5ustar 0 0 commons-jci-1.1-src/compilers/janino/src/main/java/org/apache/commons/jci/compilers/ 40755 0 0 0 12224752676 25561 5ustar 0 0 commons-jci-1.1-src/compilers/janino/src/main/resources/ 40755 0 0 0 12225261532 20410 5ustar 0 0 commons-jci-1.1-src/compilers/janino/src/test/ 40755 0 0 0 12060700111 16415 5ustar 0 0 commons-jci-1.1-src/compilers/janino/src/test/java/ 40755 0 0 0 12060700111 17336 5ustar 0 0 commons-jci-1.1-src/compilers/janino/src/test/java/org/ 40755 0 0 0 12060700111 20125 5ustar 0 0 commons-jci-1.1-src/compilers/janino/src/test/java/org/apache/ 40755 0 0 0 12060700111 21346 5ustar 0 0 commons-jci-1.1-src/compilers/janino/src/test/java/org/apache/commons/ 40755 0 0 0 12060700111 23021 5ustar 0 0 commons-jci-1.1-src/compilers/janino/src/test/java/org/apache/commons/jci/ 40755 0 0 0 12060700111 23566 5ustar 0 0 commons-jci-1.1-src/compilers/janino/src/test/java/org/apache/commons/jci/compilers/ 40755 0 0 0 12224752676 25614 5ustar 0 0 commons-jci-1.1-src/compilers/janino/src/test/resources/ 40755 0 0 0 12060700111 20427 5ustar 0 0 commons-jci-1.1-src/compilers/janino/pom.xml100644 0 0 5501 12225250625 16277 0ustar 0 0 4.0.0 org.apache.commons commons-jci 1.1 ../../pom.xml commons-jci-janino 1.1 Apache Commons JCI compiler-janino Apache Commons JCI compiler implementation for the Janino compiler. org.apache.commons commons-jci-core ${project.version} org.codehaus.janino janino org.apache.commons commons-jci-core ${project.version} test-jar test junit junit test jci-janino true maven-assembly-plugin true ././@LongLink100644 0 0 162 12225263274 10257 Lustar 0 0 commons-jci-1.1-src/compilers/janino/src/main/java/org/apache/commons/jci/compilers/JaninoCompilationProblem.javacommons-jci-1.1-src/compilers/janino/src/main/java/org/apache/commons/jci/compilers/JaninoCompilatio100644 0 0 6073 12204234514 31026 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.compilers; import org.apache.commons.jci.problems.CompilationProblem; import org.codehaus.commons.compiler.LocatedException; import org.codehaus.commons.compiler.Location; /** * Janino version of a CompilationProblem * * @author tcurdt */ public final class JaninoCompilationProblem implements CompilationProblem { private final Location location; private final String fileName; private final String message; private final boolean error; public JaninoCompilationProblem(final LocatedException pLocatedException) { this(pLocatedException.getLocation(), pLocatedException.getMessage(), true); } public JaninoCompilationProblem(final Location pLocation, final String pMessage, final boolean pError) { this(pLocation.getFileName(), pLocation, pMessage, pError); } public JaninoCompilationProblem(final String pFilename, final String pMessage, final boolean pError) { this(pFilename, null, pMessage, pError); } public JaninoCompilationProblem(final String pFilename, final Location pLocation, final String pMessage, final boolean pError) { location = pLocation; fileName = pFilename; message = pMessage; error = pError; } public boolean isError() { return error; } public String getFileName() { return fileName; } public int getStartLine() { if (location == null) { return 0; } return location.getLineNumber(); } public int getStartColumn() { if (location == null) { return 0; } return location.getColumnNumber(); } public int getEndLine() { return getStartLine(); } public int getEndColumn() { return getStartColumn(); } public String getMessage() { return message; } @Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append(getFileName()).append(" ("); sb.append(getStartLine()); sb.append(":"); sb.append(getStartColumn()); sb.append(") : "); sb.append(getMessage()); return sb.toString(); } } ././@LongLink100644 0 0 154 12225263274 10260 Lustar 0 0 commons-jci-1.1-src/compilers/janino/src/main/java/org/apache/commons/jci/compilers/JaninoJavaCompiler.javacommons-jci-1.1-src/compilers/janino/src/main/java/org/apache/commons/jci/compilers/JaninoJavaCompil100644 0 0 16151 12204234514 30771 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.compilers; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; import java.util.Collection; import org.apache.commons.jci.problems.CompilationProblem; import org.apache.commons.jci.readers.ResourceReader; import org.apache.commons.jci.stores.ResourceStore; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.codehaus.commons.compiler.CompileException; import org.codehaus.commons.compiler.LocatedException; import org.codehaus.commons.compiler.Location; import org.codehaus.janino.ClassLoaderIClassLoader; import org.codehaus.janino.Compiler; import org.codehaus.janino.FilterWarningHandler; import org.codehaus.janino.UnitCompiler.ErrorHandler; import org.codehaus.janino.WarningHandler; import org.codehaus.janino.util.StringPattern; import org.codehaus.janino.util.resource.Resource; import org.codehaus.janino.util.resource.ResourceCreator; import org.codehaus.janino.util.resource.ResourceFinder; /** * @author tcurdt */ public final class JaninoJavaCompiler extends AbstractJavaCompiler { private final Log log = LogFactory.getLog(JaninoJavaCompiler.class); private final JaninoJavaCompilerSettings defaultSettings; public JaninoJavaCompiler() { this(new JaninoJavaCompilerSettings()); } public JaninoJavaCompiler( final JaninoJavaCompilerSettings pSettings ) { defaultSettings = pSettings; } private final static class JciResource implements Resource { private final String name; private final byte[] bytes; public JciResource( final String pName, final byte[] pBytes ) { name = pName; bytes = pBytes; } public String getFileName() { return name; } public long lastModified() { return 0; } public InputStream open() throws IOException { return new ByteArrayInputStream(bytes); } } private final static class JciOutputStream extends ByteArrayOutputStream { private final String name; private final ResourceStore store; public JciOutputStream( final String pName, final ResourceStore pStore ) { name = pName; store = pStore; } @Override public void close() throws IOException { super.close(); final byte[] bytes = toByteArray(); store.write(name, bytes); } } public CompilationResult compile( final String[] pSourceNames, final ResourceReader pResourceReader, final ResourceStore pStore, final ClassLoader pClassLoader, final JavaCompilerSettings pSettings ) { final Collection problems = new ArrayList(); final StringPattern[] pattern = StringPattern.PATTERNS_NONE; final Compiler compiler = new Compiler( new ResourceFinder() { @Override public Resource findResource( final String pSourceName ) { final byte[] bytes = pResourceReader.getBytes(pSourceName); if (bytes == null) { log.debug("failed to find source " + pSourceName); return null; } log.debug("reading " + pSourceName + " (" + bytes.length + ")"); return new JciResource(pSourceName, bytes); } }, new ClassLoaderIClassLoader(pClassLoader), new ResourceFinder() { @Override public Resource findResource( final String pResourceName ) { final byte[] bytes = pStore.read(pResourceName); if (bytes == null) { log.debug("failed to find " + pResourceName); return null; } log.debug("reading " + pResourceName + " (" + bytes.length + ")"); return new JciResource(pResourceName, bytes); } }, new ResourceCreator() { public OutputStream createResource( final String pResourceName ) throws IOException { return new JciOutputStream(pResourceName, pStore); } public boolean deleteResource( final String pResourceName ) { log.debug("removing " + pResourceName); pStore.remove(pResourceName); return true; } }, pSettings.getSourceEncoding(), false, pSettings.isDebug(), pSettings.isDebug(), pSettings.isDebug(), new FilterWarningHandler(pattern, new WarningHandler() { public void handleWarning( final String pHandle, final String pMessage, final Location pLocation ) { final CompilationProblem problem = new JaninoCompilationProblem(pLocation.getFileName(), pLocation, pMessage, false); if (problemHandler != null) { problemHandler.handle(problem); } problems.add(problem); } }) ); compiler.setCompileErrorHandler(new ErrorHandler() { public void handleError( final String pMessage, final Location pLocation ) throws CompileException { final CompilationProblem problem = new JaninoCompilationProblem(pLocation.getFileName(), pLocation, pMessage, true); if (problemHandler != null) { problemHandler.handle(problem); } problems.add(problem); } }); final Resource[] resources = new Resource[pSourceNames.length]; for (int i = 0; i < pSourceNames.length; i++) { log.debug("compiling " + pSourceNames[i]); final byte[] source = pResourceReader.getBytes(pSourceNames[i]); resources[i] = new JciResource(pSourceNames[i], source); } try { compiler.compile(resources); } catch ( LocatedException e ) { problems.add(new JaninoCompilationProblem(e)); } catch ( IOException e ) { // low level problems reading or writing bytes log.error("this error should have been cought before", e); } final CompilationProblem[] result = new CompilationProblem[problems.size()]; problems.toArray(result); return new CompilationResult(result); } public JavaCompilerSettings createDefaultSettings() { return new JaninoJavaCompilerSettings(defaultSettings); } } ././@LongLink100644 0 0 164 12225263274 10261 Lustar 0 0 commons-jci-1.1-src/compilers/janino/src/main/java/org/apache/commons/jci/compilers/JaninoJavaCompilerSettings.javacommons-jci-1.1-src/compilers/janino/src/main/java/org/apache/commons/jci/compilers/JaninoJavaCompil100644 0 0 2224 10657647352 30767 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.compilers; public final class JaninoJavaCompilerSettings extends JavaCompilerSettings { // TODO: implement the native janino compiler settings public JaninoJavaCompilerSettings() { } public JaninoJavaCompilerSettings( final JaninoJavaCompilerSettings pSettings ) { super(pSettings); } } commons-jci-1.1-src/compilers/janino/src/main/resources/LICENSE.txt100644 0 0 26446 10607602354 22367 0ustar 0 0 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. commons-jci-1.1-src/compilers/janino/src/main/resources/NOTICE.txt100644 0 0 322 12225261532 22204 0ustar 0 0 Apache Commons JCI - Janino Compiler Implementation Copyright 2004-2013 The Apache Software Foundation This product includes software developed by The Apache Software Foundation (http://www.apache.org/). ././@LongLink100644 0 0 164 12225263274 10261 Lustar 0 0 commons-jci-1.1-src/compilers/janino/src/test/java/org/apache/commons/jci/compilers/JaninoJavaCompilerTestCase.javacommons-jci-1.1-src/compilers/janino/src/test/java/org/apache/commons/jci/compilers/JaninoJavaCompil100644 0 0 2246 12204234514 31004 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.compilers; /** * * @author tcurdt */ public final class JaninoJavaCompilerTestCase extends AbstractCompilerTestCase { @Override public String getCompilerName() { return "janino"; } @Override public JavaCompiler createJavaCompiler() { return new JaninoJavaCompiler(); } } commons-jci-1.1-src/compilers/janino/src/test/resources/simplelog.properties100644 0 0 155 10573622016 24634 0ustar 0 0 org.apache.commons.logging.simplelog.defaultlog=debug org.apache.commons.logging.simplelog.showdatetime=truecommons-jci-1.1-src/compilers/jsr199/src/ 40755 0 0 0 12060700110 15220 5ustar 0 0 commons-jci-1.1-src/compilers/jsr199/src/main/ 40755 0 0 0 12060700110 16144 5ustar 0 0 commons-jci-1.1-src/compilers/jsr199/src/main/java/ 40755 0 0 0 12060700110 17065 5ustar 0 0 commons-jci-1.1-src/compilers/jsr199/src/main/java/org/ 40755 0 0 0 12060700110 17654 5ustar 0 0 commons-jci-1.1-src/compilers/jsr199/src/main/java/org/apache/ 40755 0 0 0 12060700110 21075 5ustar 0 0 commons-jci-1.1-src/compilers/jsr199/src/main/java/org/apache/commons/ 40755 0 0 0 12060700110 22550 5ustar 0 0 commons-jci-1.1-src/compilers/jsr199/src/main/java/org/apache/commons/jci/ 40755 0 0 0 12060700110 23315 5ustar 0 0 commons-jci-1.1-src/compilers/jsr199/src/main/java/org/apache/commons/jci/compilers/ 40755 0 0 0 12224752676 25344 5ustar 0 0 commons-jci-1.1-src/compilers/jsr199/src/main/resources/ 40755 0 0 0 12225261473 20177 5ustar 0 0 commons-jci-1.1-src/compilers/jsr199/src/test/ 40755 0 0 0 12060700110 16177 5ustar 0 0 commons-jci-1.1-src/compilers/jsr199/src/test/java/ 40755 0 0 0 12060700110 17120 5ustar 0 0 commons-jci-1.1-src/compilers/jsr199/src/test/java/org/ 40755 0 0 0 12060700110 17707 5ustar 0 0 commons-jci-1.1-src/compilers/jsr199/src/test/java/org/apache/ 40755 0 0 0 12060700110 21130 5ustar 0 0 commons-jci-1.1-src/compilers/jsr199/src/test/java/org/apache/commons/ 40755 0 0 0 12060700110 22603 5ustar 0 0 commons-jci-1.1-src/compilers/jsr199/src/test/java/org/apache/commons/jci/ 40755 0 0 0 12060700110 23350 5ustar 0 0 commons-jci-1.1-src/compilers/jsr199/src/test/java/org/apache/commons/jci/compilers/ 40755 0 0 0 12224752676 25377 5ustar 0 0 commons-jci-1.1-src/compilers/jsr199/pom.xml100644 0 0 5441 12225250625 16065 0ustar 0 0 4.0.0 org.apache.commons commons-jci 1.1 ../../pom.xml commons-jci-jsr199 1.1 Apache Commons JCI compiler-jsr199 Apache Commons JCI compiler implementation for JDK 1.6 and up. org.apache.commons commons-jci-core ${project.version} org.apache.commons commons-jci-core ${project.version} test-jar test junit junit test 1.6 1.6 jci-jsr166 true maven-assembly-plugin true ././@LongLink100644 0 0 162 12225263274 10257 Lustar 0 0 commons-jci-1.1-src/compilers/jsr199/src/main/java/org/apache/commons/jci/compilers/Jsr199CompilationProblem.javacommons-jci-1.1-src/compilers/jsr199/src/main/java/org/apache/commons/jci/compilers/Jsr199Compilatio100644 0 0 3734 10613666121 30402 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.compilers; import javax.tools.Diagnostic; import javax.tools.JavaFileObject; import org.apache.commons.jci.problems.CompilationProblem; public class Jsr199CompilationProblem implements CompilationProblem { final Diagnostic problem; public Jsr199CompilationProblem( final Diagnostic pProblem ) { problem = pProblem; } public int getEndColumn() { // TODO Auto-generated method stub return 0; } public int getEndLine() { // TODO Auto-generated method stub return 0; } public String getFileName() { // TODO Auto-generated method stub return null; } public String getMessage() { // TODO Auto-generated method stub return null; } public int getStartColumn() { // TODO Auto-generated method stub return 0; } public int getStartLine() { // TODO Auto-generated method stub return 0; } public boolean isError() { // TODO Auto-generated method stub return false; } } ././@LongLink100644 0 0 154 12225263274 10260 Lustar 0 0 commons-jci-1.1-src/compilers/jsr199/src/main/java/org/apache/commons/jci/compilers/Jsr199JavaCompiler.javacommons-jci-1.1-src/compilers/jsr199/src/main/java/org/apache/commons/jci/compilers/Jsr199JavaCompil100644 0 0 21652 12204477771 30357 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.compilers; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.Reader; import java.io.Writer; import java.net.URI; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.ServiceLoader; import java.util.Set; import javax.tools.Diagnostic; import javax.tools.DiagnosticCollector; import javax.tools.FileObject; import javax.tools.JavaCompiler; import javax.tools.JavaFileManager; import javax.tools.JavaFileObject; import javax.tools.SimpleJavaFileObject; import javax.tools.ToolProvider; import javax.tools.JavaCompiler.CompilationTask; import org.apache.commons.jci.problems.CompilationProblem; import org.apache.commons.jci.readers.ResourceReader; import org.apache.commons.jci.stores.ResourceStore; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; public final class Jsr199JavaCompiler extends AbstractJavaCompiler { private final Log log = LogFactory.getLog(Jsr199JavaCompiler.class); private class CompilationUnit extends SimpleJavaFileObject { final private ResourceReader reader; final private String name; public CompilationUnit( final String pName, final ResourceReader pReader ) { super(URI.create("reader:///" + pName), Kind.SOURCE); reader = pReader; name = pName; } @Override public boolean delete() { log.debug("delete"); return super.delete(); } @Override public CharSequence getCharContent(boolean encodingErrors) throws IOException { log.debug("getCharContent of " + name); byte[] content = reader.getBytes(name); return new String(content); } @Override public long getLastModified() { log.debug("getLastModified"); return super.getLastModified(); } @Override public String getName() { log.debug("getName " + super.getName()); return super.getName(); } @Override public boolean isNameCompatible(String simpleName, Kind kind) { log.debug("isNameCompatible " + simpleName + " " + kind); // return super.isNameCompatible(simpleName, kind); return true; } @Override public InputStream openInputStream() throws IOException { log.debug("openInputStream"); return super.openInputStream(); } @Override public OutputStream openOutputStream() throws IOException { log.debug("openOutputStream"); return super.openOutputStream(); } @Override public Reader openReader(boolean arg0) throws IOException { log.debug("openReader"); return super.openReader(arg0); } @Override public Writer openWriter() throws IOException { log.debug("openWriter"); return super.openWriter(); } @Override public URI toUri() { // log.debug("toUri " + super.toUri()); return super.toUri(); } } private class JciJavaFileManager implements JavaFileManager { // private final ResourceStore store; final Collection units; public JciJavaFileManager( final Collection pUnits, final ResourceStore pStore ) { // store = pStore; units = pUnits; } public void close() { log.debug("close"); } public void flush() { log.debug("flush"); } public ClassLoader getClassLoader(JavaFileManager.Location location) { log.debug("getClassLoader"); return null; } public FileObject getFileForInput(JavaFileManager.Location location, String packageName, String relativeName) { log.debug("getFileForInput"); return null; } public FileObject getFileForOutput(JavaFileManager.Location location, String packageName, String relativeName, FileObject sibling) { log.debug("getFileForOutput"); return null; } public JavaFileObject getJavaFileForInput(JavaFileManager.Location location, String className, JavaFileObject.Kind kind) { log.debug("getJavaFileForInput"); return null; } public JavaFileObject getJavaFileForOutput(JavaFileManager.Location location, String className, JavaFileObject.Kind kind, FileObject sibling) { log.debug("getJavaFileForOutput"); return null; } public int isSupportedOption(String option) { log.debug("isSupportedOption " + option); return 0; } public boolean handleOption(String current, Iterator remaining) { log.debug("handleOption " + current); return false; } public boolean hasLocation(JavaFileManager.Location location) { log.debug("hasLocation " + location); return false; } public String inferBinaryName(JavaFileManager.Location location, JavaFileObject file) { String s = file.getName().replaceFirst(".java", ".class"); log.debug("inferBinaryName " + file.getName() + " -> " + s); return s; } public Iterable list(JavaFileManager.Location location, String packageName, Set kinds, boolean recurse) { if (packageName.startsWith("java.")) { return new ArrayList(); } log.debug("list " + location + packageName + kinds + recurse); return units; } public boolean isSameFile(FileObject fileobject, FileObject fileobject1) { return false; } } private final Jsr199JavaCompilerSettings settings; public Jsr199JavaCompiler() { settings = new Jsr199JavaCompilerSettings(); } public Jsr199JavaCompiler( final Jsr199JavaCompilerSettings pSettings ) { settings = pSettings; } public CompilationResult compile( final String[] pResourcePaths, final ResourceReader pReader, final ResourceStore pStore, final ClassLoader classLoader, JavaCompilerSettings settings) { final Collection units = new ArrayList(); for (int i = 0; i < pResourcePaths.length; i++) { final String sourcePath = pResourcePaths[i]; log.debug("compiling " + sourcePath); units.add(new CompilationUnit(sourcePath, pReader)); } JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); if (compiler == null) { ServiceLoader loader = ServiceLoader.load(javax.tools.JavaCompiler.class); compiler = loader.iterator().next(); } if (compiler == null) { throw new RuntimeException("No java compiler in class path"); } final JavaFileManager fileManager = new JciJavaFileManager(units, pStore); final DiagnosticCollector diagnostics = new DiagnosticCollector(); CompilationTask task = compiler.getTask(null, fileManager, diagnostics, null, null, units); if (task.call().booleanValue()) { log.debug("compiled"); } final List> jsrProblems = diagnostics.getDiagnostics(); final CompilationProblem[] problems = new CompilationProblem[jsrProblems.size()]; int i = 0; for (final Diagnostic jsrProblem : jsrProblems) { problems[i++] = new Jsr199CompilationProblem(jsrProblem); } return new CompilationResult(problems); } public JavaCompilerSettings createDefaultSettings() { return this.settings; } } ././@LongLink100644 0 0 164 12225263274 10261 Lustar 0 0 commons-jci-1.1-src/compilers/jsr199/src/main/java/org/apache/commons/jci/compilers/Jsr199JavaCompilerSettings.javacommons-jci-1.1-src/compilers/jsr199/src/main/java/org/apache/commons/jci/compilers/Jsr199JavaCompil100644 0 0 1655 10654207642 30333 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.compilers; public class Jsr199JavaCompilerSettings extends JavaCompilerSettings { } commons-jci-1.1-src/compilers/jsr199/src/main/resources/LICENSE.txt100644 0 0 26446 10607602354 22152 0ustar 0 0 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. commons-jci-1.1-src/compilers/jsr199/src/main/resources/NOTICE.txt100644 0 0 323 12225261473 21774 0ustar 0 0 Apache Commons JCI - JSR 199 Compiler Implementation Copyright 2004-2013 The Apache Software Foundation This product includes software developed by The Apache Software Foundation (http://www.apache.org/). ././@LongLink100644 0 0 164 12225263274 10261 Lustar 0 0 commons-jci-1.1-src/compilers/jsr199/src/test/java/org/apache/commons/jci/compilers/Jsr199JavaCompilerTestCase.javacommons-jci-1.1-src/compilers/jsr199/src/test/java/org/apache/commons/jci/compilers/Jsr199JavaCompil100644 0 0 2212 12204477650 30355 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.commons.jci.compilers; public final class Jsr199JavaCompilerTestCase extends AbstractCompilerTestCase { @Override public String getCompilerName() { return "jsr199"; } @Override public JavaCompiler createJavaCompiler() { return new Jsr199JavaCompiler(); } } commons-jci-1.1-src/compilers/rhino/src/ 40755 0 0 0 12060700110 15276 5ustar 0 0 commons-jci-1.1-src/compilers/rhino/src/main/ 40755 0 0 0 12060700110 16222 5ustar 0 0 commons-jci-1.1-src/compilers/rhino/src/main/java/ 40755 0 0 0 12060700110 17143 5ustar 0 0 commons-jci-1.1-src/compilers/rhino/src/main/java/org/ 40755 0 0 0 12060700110 17732 5ustar 0 0 commons-jci-1.1-src/compilers/rhino/src/main/java/org/apache/ 40755 0 0 0 12060700110 21153 5ustar 0 0 commons-jci-1.1-src/compilers/rhino/src/main/java/org/apache/commons/ 40755 0 0 0 12060700110 22626 5ustar 0 0 commons-jci-1.1-src/compilers/rhino/src/main/java/org/apache/commons/jci/ 40755 0 0 0 12060700110 23373 5ustar 0 0 commons-jci-1.1-src/compilers/rhino/src/main/java/org/apache/commons/jci/compilers/ 40755 0 0 0 12224752676 25422 5ustar 0 0 commons-jci-1.1-src/compilers/rhino/src/main/resources/ 40755 0 0 0 12225261537 20256 5ustar 0 0 commons-jci-1.1-src/compilers/rhino/src/test/ 40755 0 0 0 12060700110 16255 5ustar 0 0 commons-jci-1.1-src/compilers/rhino/src/test/java/ 40755 0 0 0 12060700110 17176 5ustar 0 0 commons-jci-1.1-src/compilers/rhino/src/test/java/org/ 40755 0 0 0 12060700110 17765 5ustar 0 0 commons-jci-1.1-src/compilers/rhino/src/test/java/org/apache/ 40755 0 0 0 12060700110 21206 5ustar 0 0 commons-jci-1.1-src/compilers/rhino/src/test/java/org/apache/commons/ 40755 0 0 0 12060700110 22661 5ustar 0 0 commons-jci-1.1-src/compilers/rhino/src/test/java/org/apache/commons/jci/ 40755 0 0 0 12060700110 23426 5ustar 0 0 commons-jci-1.1-src/compilers/rhino/src/test/java/org/apache/commons/jci/compilers/ 40755 0 0 0 12224752676 25455 5ustar 0 0 commons-jci-1.1-src/compilers/rhino/pom.xml100644 0 0 5452 12225250625 16145 0ustar 0 0 4.0.0 org.apache.commons commons-jci 1.1 ../../pom.xml commons-jci-rhino 1.1 Apache Commons JCI compiler-rhino Apache Commons JCI compiler implementation for Rhino javascript. org.apache.commons commons-jci-core ${project.version} rhino js org.apache.commons commons-jci-core ${project.version} test-jar test junit junit test jci-rhino true maven-assembly-plugin true ././@LongLink100644 0 0 160 12225263274 10255 Lustar 0 0 commons-jci-1.1-src/compilers/rhino/src/main/java/org/apache/commons/jci/compilers/RhinoCompilationProblem.javacommons-jci-1.1-src/compilers/rhino/src/main/java/org/apache/commons/jci/compilers/RhinoCompilationP100644 0 0 3677 10613666121 31042 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.compilers; import org.apache.commons.jci.problems.CompilationProblem; /** * * @author tcurdt */ public final class RhinoCompilationProblem implements CompilationProblem { private final String message; private final String fileName; private final int line; private final int column; private final boolean error; public RhinoCompilationProblem( final String pMessage, final String pFileName, final int pLine, final String pScript, final int pColumn, final boolean pError ) { message = pMessage; fileName = pFileName; line = pLine; column = pColumn; error = pError; } public int getEndColumn() { return column; } public int getEndLine() { return line; } public String getFileName() { return fileName; } public String getMessage() { return message; } public int getStartColumn() { return column; } public int getStartLine() { return line; } public boolean isError() { return error; } } ././@LongLink100644 0 0 152 12225263274 10256 Lustar 0 0 commons-jci-1.1-src/compilers/rhino/src/main/java/org/apache/commons/jci/compilers/RhinoJavaCompiler.javacommons-jci-1.1-src/compilers/rhino/src/main/java/org/apache/commons/jci/compilers/RhinoJavaCompiler100644 0 0 24233 12204235642 31025 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.compilers; import java.io.ByteArrayInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; import java.util.ArrayList; import java.util.Collection; import java.util.List; import org.apache.commons.jci.problems.CompilationProblem; import org.apache.commons.jci.readers.ResourceReader; import org.apache.commons.jci.stores.ResourceStore; import org.apache.commons.jci.utils.ConversionUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.mozilla.javascript.CompilerEnvirons; import org.mozilla.javascript.Context; import org.mozilla.javascript.ErrorReporter; import org.mozilla.javascript.EvaluatorException; import org.mozilla.javascript.GeneratedClassLoader; import org.mozilla.javascript.ImporterTopLevel; import org.mozilla.javascript.JavaScriptException; import org.mozilla.javascript.NativeArray; import org.mozilla.javascript.Scriptable; import org.mozilla.javascript.ScriptableObject; import org.mozilla.javascript.optimizer.ClassCompiler; /** * @author tcurdt */ public final class RhinoJavaCompiler extends AbstractJavaCompiler { private final Log log = LogFactory.getLog(RhinoJavaCompiler.class); private final JavaCompilerSettings defaultSettings; public RhinoJavaCompiler() { defaultSettings = new RhinoJavaCompilerSettings(); } /** * based on code from dev.helma.org * http://dev.helma.org/source/file/helma/branches/rhinoloader/src/org/helma/javascript/RhinoLoader.java/?revision=95 */ private final class RhinoCompilingClassLoader extends ClassLoader { private final ScriptableObject scope; private final ResourceReader reader; private final ResourceStore store; private final Collection problems = new ArrayList(); private final class ProblemCollector implements ErrorReporter { public void error(String pMessage, String pFileName, int pLine, String pScript, int pColumn) { final CompilationProblem problem = new RhinoCompilationProblem(pMessage, pFileName, pLine, pScript, pColumn, true); if (problemHandler != null) { problemHandler.handle(problem); } problems.add(problem); } public void warning(String pMessage, String pFileName, int pLine, String pScript, int pColumn) { final CompilationProblem problem = new RhinoCompilationProblem(pMessage, pFileName, pLine, pScript, pColumn, false); if (problemHandler != null) { problemHandler.handle(problem); } problems.add(problem); } public EvaluatorException runtimeError(String pMessage, String pFileName, int pLine, String pScript, int pColumn) { return new EvaluatorException(pMessage, pFileName, pLine, pScript, pColumn); } } public RhinoCompilingClassLoader( final ResourceReader pReader, final ResourceStore pStore, final ClassLoader pClassLoader) { super(pClassLoader); reader = pReader; store = pStore; final Context context = Context.enter(); scope = new ImporterTopLevel(context); Context.exit(); } public Collection getProblems() { return problems; } @Override protected Class findClass( final String pName ) throws ClassNotFoundException { final Context context = Context.enter(); context.setErrorReporter(new ProblemCollector()); try { return compileClass(context, pName); } catch( EvaluatorException e ) { throw new ClassNotFoundException(e.getMessage(), e); } catch (IOException e) { throw new ClassNotFoundException(e.getMessage(), e); } finally { Context.exit(); } } private Class compileClass( final Context pContext, final String pClassName) throws IOException, ClassNotFoundException { Class superclass = null; final String pSourceName = pClassName.replace('.', '/') + ".js"; final Scriptable target = evaluate(pContext, pSourceName); final Object baseClassName = ScriptableObject.getProperty(target, "__extends__"); if (baseClassName instanceof String) { superclass = Class.forName((String) baseClassName); } final List> interfaceClasses = new ArrayList>(); final Object interfaceNames = ScriptableObject.getProperty(target, "__implements__"); if (interfaceNames instanceof NativeArray) { final NativeArray interfaceNameArray = (NativeArray) interfaceNames; for (int i=0; i[] interfaces; if (!interfaceClasses.isEmpty()) { interfaces = new Class[interfaceClasses.size()]; interfaceClasses.toArray(interfaces); } else { // FIXME: hm ...really no empty array good enough? interfaces = null; } return compileClass(pContext, pSourceName, pClassName, superclass, interfaces); } private Class compileClass( final Context pContext, final String pSourceName, final String pClassName, final Class pSuperClass, final Class[] pInterfaces) { final CompilerEnvirons environments = new CompilerEnvirons(); environments.initFromContext(pContext); final ClassCompiler compiler = new ClassCompiler(environments); if (pSuperClass != null) { compiler.setTargetExtends(pSuperClass); } if (pInterfaces != null) { compiler.setTargetImplements(pInterfaces); } final byte[] sourceBytes = reader.getBytes(pSourceName); final Object[] classes = compiler.compileToClassFiles(new String(sourceBytes), getName(pSourceName), 1, pClassName); final GeneratedClassLoader loader = pContext.createClassLoader(pContext.getApplicationClassLoader()); Class clazz = null; for (int i = 0; i < classes.length; i += 2) { final String clazzName = (String) classes[i]; final byte[] clazzBytes = (byte[]) classes[i+1]; store.write(clazzName.replace('.', '/') + ".class", clazzBytes); Class c = loader.defineClass(clazzName, clazzBytes); loader.linkClass(c); if (i == 0) { clazz = c; } } return clazz; } private String getName(String s) { final int i = s.lastIndexOf('/'); if (i < 0) { return s; } return s.substring(i + 1); } private Scriptable evaluate( final Context pContext, final String pSourceName) throws JavaScriptException, IOException { if (!reader.isAvailable(pSourceName)) { throw new FileNotFoundException("File " + pSourceName + " not found"); } final Scriptable target = pContext.newObject(scope); final byte[] sourceBytes = reader.getBytes(pSourceName); final Reader reader = new InputStreamReader(new ByteArrayInputStream(sourceBytes)); pContext.evaluateReader(target, reader, getName(pSourceName), 1, null); return target; } } public CompilationResult compile( final String[] pResourcePaths, final ResourceReader pReader, final ResourceStore pStore, final ClassLoader pClassLoader, final JavaCompilerSettings pSettings ) { final RhinoCompilingClassLoader cl = new RhinoCompilingClassLoader(pReader, pStore, pClassLoader); for (int i = 0; i < pResourcePaths.length; i++) { log.debug("compiling " + pResourcePaths[i]); final String clazzName = ConversionUtils.convertResourceToClassName(pResourcePaths[i]); try { cl.loadClass(clazzName); } catch (ClassNotFoundException e) { } } final Collection problems = cl.getProblems(); final CompilationProblem[] result = new CompilationProblem[problems.size()]; problems.toArray(result); return new CompilationResult(result); } public JavaCompilerSettings createDefaultSettings() { return defaultSettings; } } ././@LongLink100644 0 0 162 12225263274 10257 Lustar 0 0 commons-jci-1.1-src/compilers/rhino/src/main/java/org/apache/commons/jci/compilers/RhinoJavaCompilerSettings.javacommons-jci-1.1-src/compilers/rhino/src/main/java/org/apache/commons/jci/compilers/RhinoJavaCompiler100644 0 0 1766 10602276107 31014 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.compilers; /** * @author tcurdt * @todo implement rhino settings */ public final class RhinoJavaCompilerSettings extends JavaCompilerSettings { } commons-jci-1.1-src/compilers/rhino/src/main/resources/LICENSE.txt100644 0 0 26446 10607602354 22230 0ustar 0 0 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. commons-jci-1.1-src/compilers/rhino/src/main/resources/NOTICE.txt100644 0 0 321 12225261537 22051 0ustar 0 0 Apache Commons JCI - Rhino Compiler Implementation Copyright 2004-2013 The Apache Software Foundation This product includes software developed by The Apache Software Foundation (http://www.apache.org/). ././@LongLink100644 0 0 162 12225263274 10257 Lustar 0 0 commons-jci-1.1-src/compilers/rhino/src/test/java/org/apache/commons/jci/compilers/RhinoJavaCompilerTestCase.javacommons-jci-1.1-src/compilers/rhino/src/test/java/org/apache/commons/jci/compilers/RhinoJavaCompiler100644 0 0 10775 12204234514 31063 0ustar 0 0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jci.compilers; import java.util.HashMap; import java.util.Map; import org.apache.commons.jci.readers.ResourceReader; import org.apache.commons.jci.stores.MemoryResourceStore; /** * * @author tcurdt */ public final class RhinoJavaCompilerTestCase extends AbstractCompilerTestCase { @Override public JavaCompiler createJavaCompiler() { return new RhinoJavaCompiler(); } @Override public String getCompilerName() { return "rhino"; } @Override public void testSimpleCompile() throws Exception { final JavaCompiler compiler = createJavaCompiler(); final ResourceReader reader = new ResourceReader() { final private Map sources = new HashMap() { private static final long serialVersionUID = 1L; { put("jci/Simple.js", ( " var i = 0;\n" + "\n" ).getBytes()); }}; public byte[] getBytes( final String pResourceName ) { return sources.get(pResourceName); } public boolean isAvailable( final String pResourceName ) { return sources.containsKey(pResourceName); } }; final MemoryResourceStore store = new MemoryResourceStore(); final CompilationResult result = compiler.compile( new String[] { "jci/Simple.js" }, reader, store); assertEquals(toString(result.getErrors()), 0, result.getErrors().length); assertEquals(toString(result.getWarnings()), 0, result.getWarnings().length); final byte[] clazzBytes = store.read("jci/Simple.class"); assertNotNull(clazzBytes); assertTrue(clazzBytes.length > 0); } @Override public void testExtendedCompile() throws Exception { } @Override public void testInternalClassCompile() throws Exception { } @Override public void testUppercasePackageNameCompile() throws Exception { final JavaCompiler compiler = createJavaCompiler(); final ResourceReader reader = new ResourceReader() { final private Map sources = new HashMap() { private static final long serialVersionUID = 1L; { put("Jci/Simple.js", ( " var i = 0;\n" + "\n" ).getBytes()); }}; public byte[] getBytes( final String pResourceName ) { return sources.get(pResourceName); } public boolean isAvailable( final String pResourceName ) { return sources.containsKey(pResourceName); } }; final MemoryResourceStore store = new MemoryResourceStore(); final CompilationResult result = compiler.compile( new String[] { "Jci/Simple.js" }, reader, store); assertEquals(toString(result.getErrors()), 0, result.getErrors().length); assertEquals(toString(result.getWarnings()), 0, result.getWarnings().length); final byte[] clazzBytes = store.read("Jci/Simple.class"); assertNotNull(clazzBytes); assertTrue(clazzBytes.length > 0); } @Override public void testCrossReferenceCompilation() throws Exception { // NA } @Override public void testAdditionalTopLevelClassCompile() throws Exception { // NA } }