Skip to main content
Last updated March 28, 2011 13:33, by Amanj Sherwany
<h1 align="center">Loci 0.1 <br/>A Pluggable Type Checker for Expressing Thread Locality in Java<sup style="font-size:10px">TM</sup></h1> __TOC__ ==What is Loci?== Loci is a pluggable type checker, helps the programmer to check the correctness of the thread locality in their programs. It uses a simple statically checkable set of annotations. The current implementation of Loci only supports Java programming language, but we hope to deliver support for other programming languages as well (especially porting to other Java-like programming languages should be straight forward). Loci is 100% compatible with legacy Java programs, any Java code compiled with standard Java compiler can also be compiled with Loci checker. If you apply Loci on your legacy Java code, it still stays completely backward compatible: your code compiles with any Java compiler, it runs on any JVM, and your coworkers don't have to use the enhanced type system if they don't want to. You can check only part of your program. [ Type inference tools] exist to help you annotate your code. Loci uses the annotation compiler from [ JSR308], therefore it has a wide support for annotations. Loci is also built on top of the checker framework, which makes Loci very easy to use and install once Java 8 is out. But that doesn't mean you cannot already use it with your Java 6 or Java 7 installation, Loci is compatible with them too, and you can install it almost effortlessly, please see the installation section below. ==Backward Compatibility== We proved that Loci is backward compatible, by applying Loci on an old and huge version of [ lucene] search library (version 2.4.1), and Loci didn't have any incompatibility problem with the library. You can see the results of our annotating process [ here] (<u>''BTW, it is a bit old''</u>). We also annotated several other benchmarks. And in neither cases we had any incompatibility problem. ==Downloading Loci== Loci is distributed in both binary and source code format, as it is an open source tool, and [ GPLv3.0] licensed. Loci just like Java is platform independent and you can install and run it, under any platform which is supported by Java. * The binary version of Loci (version 0.1) is available [ here]. * Download the Manual [ here] or view the HTML version [ here] * To grab the source code, please click [ here] * The Loci API documentation can be found [ here] * A presentation about Loci 0.1 can be found [ here] (<u>''BTW, it is a bit old''</u>) ==Installing Loci== In order to use Loci, you should have the enhanced Java compiler, you can download and install it by following the instructions mentioned [ here]. Once you Installed the enhanced <code>javac</code> you can install and use Loci easily, by adding it to your <code>CLASSPATH</code>, like: * '''Unix:''' <code>$ export CLASSPATH=Path/To/Loci/dist/loci-0.1.jar:$CLASSPATH</code> * '''Windows:''' <code>C:> set CLASSPATH=Path\To\Loci\dist\loci-0.1.jar;classpath2...</code> You can also use this plugin, with Ant and Maven, as well as with different IDEs, for more details about Maven installation refer to [[maven|here]], and for Ant and named IDEs please visit this [ page] ==A Simple Example== Whenever you want to use Loci, you have to import <code>loci.quals.*</code> package. In the following listing, we show you a simple Java program and apply Loci on it.<br/> <br/> <pre name="java"> import loci.quals.*; //import loci qualifiers @Local public class HelloWorld{ //a thread local class @Shared Object b; //a shared field public static void main(String... args){ System.out.println("Example"); } }</pre><br/> <br/> To compile the above program using the Loci checker plugin: <br/><br/> <code>$ javac -processor loci.LociChecker</code><br/><br/> The above program, should not report any problem. But, the below program should do:<br/> <pre name="java"> import loci.quals.*; @Local public class BadHelloWorld{ @Shared Object b = new @Local Object(); public static void main(String... args){ System.out.println("Example"); } }</pre><br/><br/> <code>$ javac -processor loci.LociChecker</code><br/><br/> The above program will report some message similar to:<br/><br/> <code> incompatible types.<br/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@Shared Object b = new @Local Object();<br/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;^<br/> &nbsp;&nbsp;found : @Local Object<br/> &nbsp;&nbsp;required: @Shared Object<br/> 1 error </code><br/><br/> ==Getting more Help== Loci has got a Forum, which is publicly accessible through, this [ forum]. Feel free to post your questions, suggestions, bug fixes, new features and even annotated libraries. ==Credits== Loci 0.1 is a master project by [ Amanj Sherwany], the project is a [ subproject] of [ UPMARC] research group at the [ Information Technology Department] at [ Uppsala University]. The project was designed and supervised by [ Tobias Wrigstad] an assistant professor at the same department. ==FAQ== Please refer to [[FAQ]]. ==Licensing== Please refer to this [[licenses|page]] ==Internal Links== * Loci's Homepage: [] * Loci's Forum: [] * Loci's Issue Tracking: [] * Loci's Users Mailing List: [] * Loci's Developers Mailing List: [] ==Other Useful Links== * The Checker Framework's homepage: [] * The homepage of the JSR308: [] * The homepage of UPMARC project: [] * Loci's research homepage: []
Please Confirm