Skip to main content
Last updated March 28, 2011 13:33, by Amanj Sherwany
Feedicon  
<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. [http://types.cs.washington.edu/checker-framework/current/checkers-manual.html#type-inference-tools Type inference tools] exist to help you annotate your code. Loci uses the annotation compiler from [http://types.cs.washington.edu/jsr308/ 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 [http://lucene.apache.org 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 [http://loci.java.net/files/evaluatingLoci.pdf 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 [http://www.gnu.org/licenses/gpl-3.0.txt 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 [http://java.net/projects/loci/downloads/directory/Loci-0.1 here]. * Download the Manual [http://loci.java.net/manual/manual.pdf here] or view the HTML version [http://loci.java.net/manual here] * To grab the source code, please click [http://java.net/projects/loci/sources/main/show here] * The Loci API documentation can be found [http://loci.java.net/api here] * A presentation about Loci 0.1 can be found [http://loci.java.net/files/evaluatingLoci.pdf 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 [http://types.cs.washington.edu/checker-framework/#installation 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 [http://types.cs.washington.edu/checker-framework/#external-tools 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 HelloWorld.java</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 BadHelloWorld.java</code><br/><br/> The above program will report some message similar to:<br/><br/> <code>BadHelloWorld.java:3: 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 [http://java.net/projects/loci/forums/help 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 [http://www.amanj.me Amanj Sherwany], the project is a [http://www.it.uu.se/research/upmarc/research/pl/facile subproject] of [http://www.it.uu.se/research/upmarc UPMARC] research group at the [http://www.it.uu.se Information Technology Department] at [http://www.uu.se Uppsala University]. The project was designed and supervised by [http://www.wrigstad.com 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: [http://www.it.uu.se/research/upmarc/loci] * Loci's Forum: [http://java.net/projects/loci/forums/] * Loci's Issue Tracking: [http://java.net/bugzilla/buglist.cgi?product=loci&order=Importance&limit=25] * Loci's Users Mailing List: [http://java.net/projects/loci/lists/users-mailing-list/archive] * Loci's Developers Mailing List: [http://java.net/projects/loci/lists/developers-mailing-list/archive] ==Other Useful Links== * The Checker Framework's homepage: [http://types.cs.washington.edu/checker-framework/] * The homepage of the JSR308: [http://types.cs.washington.edu/jsr308/] * The homepage of UPMARC project: [http://www.it.uu.se/research/upmarc] * Loci's research homepage: [http://www.it.uu.se/research/upmarc/research/pl/facile]
 
 
Close
loading
Please Confirm
Close