Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/1028976.1028994acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
Article

Transparent proxies for java futures

Published: 01 October 2004 Publication History

Abstract

A <i>proxy</i> object is a surrogate or placeholder that controls access to another target object. Proxies can be used to support distributed programming, lazy or parallel evaluation, access control, and other simple forms of behavioral reflection. However, <i>wrapper proxies</i> (like <i>futures</i> or <i>suspensions</i> for yet-to-be-computed results) can require significant code changes to be used in statically-typed languages, while proxies more generally can inadvertently violate assumptions of transparency, resulting in subtle bugs.
To solve these problems, we have designed and implemented a simple framework for proxy programming that employs a static analysis based on qualifier inference, but with additional novelties. Code for using wrapper proxies is automatically introduced via a classfile-to-classfile transformation, and potential violations of transparency are signaled to the programmer. We have formalized our analysis and proven it sound. Our framework has a variety of applications, including support for asynchronous method calls returning futures. Experimental results demonstrate the benefits of our framework: programmers are relieved of managing and/or checking proxy usage, analysis times are reasonably fast, overheads introduced by added dynamic checks are negligible, and performance improvements can be significant. For example, changing two lines in a simple RMI-based peer-to-peer application and then using our framework resulted in a large performance gain.

References

[1]
Alexander Aiken. Introduction to set constraint-based program analysis. Science of Computer Programming (SCP), 35(2):79--111, 1999.
[2]
Lars Ole Andersen. Program Analysis and Specialization for the C Programming Language. PhD thesis, DIKU, University of Copenhagen, May 1994. (DIKU report 94/19).
[3]
Nick Benton, Luca Cardelli, and Cédric Fournet. Modern concurrency abstractions for C#. ACM Transactions on Programming Languages and Systems (TOPLAS), 2003. Special Issue of papers from FOOL 9.
[4]
Gregory Biegel, Vinny Cahill, and Mads Haahr. A dynamic proxy based architecture to support distributed Java objects in a mobile environment. In Proceedings of the CoopIS/DOA/ODBASE, pages 809--826, 2002.
[5]
Gavin M. Bierman, Matthew J. Parkinson, and Andrew M. Pitts. An imperative core calculus for Java and Java with effects. Technical Report 563, University of Cambridge Computer Laboratory, April 2003.
[6]
Gilad Bracha, Martin Odersky, David Stoutamire, and Philip Wadler. Making the future safe for the past: adding genericity to the Java programming language. In Proceedings of the ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 183--200, Vancouver, British Columbia, Canada, 1998.
[7]
Michael James Compton. SCOOP: An investigation of concurrency in Eiffel. Master's thesis, Department of Computer Science, The Australian National University, December 2000.
[8]
Xianghua Deng, Matthew B. Dwyer, John Hatcliff, and Masaaki Mizuno. Invariant-based specification, synthesis, and verification of synchronization in concurrent programs. In Proceedings of the IEEE International Conference on Software Engineering (ICSE), pages 442--452, Orlando, Florida, USA, 2002.
[9]
Dynamic proxy classes. http://java.sun.com/j2se/1.5.0/docs/guide/reflection/proxy.html. JDK 1.5 documentation.
[10]
Maryam Emami, Rakesh Ghiya, and Laurie J. Hendren. Context-sensitive interprocedural points-to analysis in the presence of function pointers. In Proceedings of the ACM Conference on Programming Language Design and Implementation (PLDI), pages 242--256, Orlando, Florida, USA, 1994.
[11]
Éric Tanter, Jacques Noyé, Denis Caromel, and Pierre Cointe. Partial behavioral reflection: spatial and temporal selection of reification. In Proceedings of the ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 27--46, Anaheim, California, USA, 2003.
[12]
Executor examples. http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/etc/notes/tim-execu%tor-examples.html?rev=1.5.
[13]
Manuel Fähndrich and K. Rustan M. Leino. Declaring and checking non-null types in an object-oriented language. In Proceedings of the ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 302--312, Anaheim, California, USA, 2003.
[14]
Cormac Flanagan and Matthias Felleisen. The semantics of Future and its use in program optimizations. In Proceedings of the ACM Symposium on Principles of Programming Languages (POPL), pages 209--220, San Francisco, CA, January 1995.
[15]
Jeffrey S. Foster, Manuel Fähndrich, and Alexander Aiken. A theory of type qualifiers. In Proceedings of the ACM Conference on Programming Language Design and Implementation (PLDI), pages 192--203, May 1999.
[16]
Jeffrey S. Foster, Tachio Terauchi, and Alex Aiken. Flow-sensitive type qualifiers. In Proceedings of the ACM Conference on Programming Language Design and Implementation (PLDI), pages 1--12, Berlin, Germany, June 2002.
[17]
Matteo Frigo, Charles E. Leiserson, and Keith H. Randall. The implementation of the Cilk-5 multithreaded language. In Proceedings of the ACM Conference on Programming Language Design and Implementation (PLDI), pages 212--223, Montreal, Canada, 1998.
[18]
Erich Gamma, Richard Helm, Ralph E. Johnson, and John Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, 1995.
[19]
Tim Harris and Keir Fraser. Language support for lightweight transactions. In Proceedings of the ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 388--402, Anaheim, California, USA, 2003.
[20]
Claude Hussenet. Personal Communication. Describes the use of JSR 166 futures for an enterprise application.
[21]
Atsushi Igarashi, Benjamin C. Pierce, and Philip Wadler. Featherweight Java: a minimal core calculus for Java and GJ. ACM Transactions on Programming Languages and Systems (TOPLAS), 23(3):396--450, 2001.
[22]
Io: A small programming language. http://www.iolanguage.com/.
[23]
Robert H. Halstead Jr. Multilisp - a language for concurrent symbolic computation. ACM Transactions on Programming Languages and Systems (TOPLAS), 7(4):501--538, 1985.
[24]
JSR 166: Concurrency utilities. http://www.jcp.org/en/jsr/detail?id=166.
[25]
Gregor Kiczales, Erik Hilsdale, Jim Hugunin, Mik Kersen, Jeffrey Palm, and William G. Griswold. An overview of AspectJ. In Proceedings of the European Conference on Object-Oriented Programming (ECOOP), volume 2072 of Lecture Notes in Computer Science, pages 327--353, Budapest, Hungary, 2001. Springer-Verlag.
[26]
R. Greg Lavender and Douglas C. Schmidt. Active object: an object behavioral pattern for concurrent programming. In Proceedings of the Pattern Languages of Programs, September 1995.
[27]
Ondrej Lhoták and Laurie Hendren. Scaling Java points-to analysis using SPARK. In Proceedings of the International Conference on Compiler Construction (CC), volume 2622 of Lecture Notes in Computer Science, pages 153--169, Warsaw, Poland, 2003.
[28]
Barbara Liskov and Liuba Shrira. Promises: linguistic support for efficient asynchronous procedure calls in distributed systems. In Proceedings of the ACM Conference on Programming Language Design and Implementation (PLDI), pages 260--267, Atlanta, Georgia, USA, July 1988.
[29]
Cristina Videira Lopes and Karl J. Lieberherr. Abstracting process-to-function relations in concurrency object-oriented applications. In Proceedings of the European Conference on Object-Oriented Programming (ECOOP), volume 821 of Lecture Notes in Computer Science, pages 81--99, Bologna, Italy, July 1994. Springer.
[30]
Mandala. http://sourceforge.net/projects/mandala/.
[31]
Dragos A. Manolescu. Workflow enactment with continuation and future objects. In Proceedings of the ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 40--51, Seattle, Washington, USA, 2002.
[32]
Eric Mohr, David A. Kranz, and Robert H. Halstead Jr. Lazy task creation: A technique for increasing the granularity of parallel programs. IEEE Transactions on Parallel and Distributed Systems, 2(3):264--280, 1991.
[33]
Greg Morrisett, Matthias Felleisen, and Robert Harper. Abstract models of memory management. In Proceedings of the International Conference on Functional Programming Languages and Computer Architecture (FPCA), pages 66--77, La Jolla, California, USA, 1995.
[34]
Polyvios Pratikakis, Jaime Spacco, and Michael Hicks. Transparent proxies for Java futures. Technical Report CS-TR-4574, Department of Computer Science, University of Maryland, College Park, March 2004.
[35]
Rajeev R. Raje, Joseph I. William, and Michael Boyles. An asynchronous remote method invocation (ARMI ) mechanism for Java. In Proceedings of the ACM Workshop on Java for Science and Engineering Computation, Las Vegas, Nevada, 1997.
[36]
Jakob Rehof and Torben Mogensen. Tractable constraints in finite semilattices. Science of Computer Programming, 35(2--3):191--221, 1999.
[37]
Umesh Shankar, Kunal Talwar, Jeffrey S. Foster, and David Wagner. Detecting format string vulnerabilities with type qualifiers. In Proceedings of the 10th Usenix Security Symposium, Washington, D.C., August 2001.
[38]
Aleksander Slominski, Madhusudhan Govindaraju, Dennis Gannon, and Randall Bramley. Design of an XML based interoperable RMI system: SoapRMI C++/Java 1.1. In Proceedings of the International Conference on Parallel and Distributed Processing Techniques and Applications, pages 1661--1667, Las Vegas, Nevada, June 2001.
[39]
Tomás Sysala and Jan Janecek. Optimizing remote method invocation in Java. In Proceedings of the International Workshop on Database and Expert Systems Applications (DEXA), pages 29--35, Aix-en-Provence, France, September 2002.
[40]
Raja Vallée-Rai, Laurie Hendren, Vijay Sundaresan, Patrick Lam, Etienne Gagnon, and Phong Co. Soot--a Java optimization framework. In Proceedings of the IBM Centers for Advanced Studies Conference (CASCON), pages 125--135, 1999.
[41]
Adam Welc, Suresh Jagannathan, and Antony L. Hosking. Transactional monitors for concurrent objects. In Proceedings of the European Conference on Object-Oriented Programming (ECOOP), Oslo, Norway, 2004.

Cited By

View all
  • (2019)Type-Driven Cross-Programming for Android and LEGO Mindstorms InteroperabilityComputer Information Systems and Industrial Management10.1007/978-3-030-28957-7_17(191-209)Online publication date: 11-Aug-2019
  • (2018)Static analysis of Java dynamic proxiesProceedings of the 27th ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3213846.3213864(209-220)Online publication date: 12-Jul-2018
  • (2018)Unobtrusive Asynchronous Exception Handling with Standard Java Try/Catch Blocks2018 IEEE International Parallel and Distributed Processing Symposium (IPDPS)10.1109/IPDPS.2018.00095(855-864)Online publication date: May-2018
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
OOPSLA '04: Proceedings of the 19th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
October 2004
462 pages
ISBN:1581138318
DOI:10.1145/1028976
  • cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 39, Issue 10
    OOPSLA '04
    October 2004
    448 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/1035292
    Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 October 2004

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Java
  2. future
  3. proxy
  4. type inference
  5. type qualifier

Qualifiers

  • Article

Conference

OOPSLA04

Acceptance Rates

Overall Acceptance Rate 268 of 1,244 submissions, 22%

Upcoming Conference

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)3
  • Downloads (Last 6 weeks)2
Reflects downloads up to 20 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2019)Type-Driven Cross-Programming for Android and LEGO Mindstorms InteroperabilityComputer Information Systems and Industrial Management10.1007/978-3-030-28957-7_17(191-209)Online publication date: 11-Aug-2019
  • (2018)Static analysis of Java dynamic proxiesProceedings of the 27th ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3213846.3213864(209-220)Online publication date: 12-Jul-2018
  • (2018)Unobtrusive Asynchronous Exception Handling with Standard Java Try/Catch Blocks2018 IEEE International Parallel and Distributed Processing Symposium (IPDPS)10.1109/IPDPS.2018.00095(855-864)Online publication date: May-2018
  • (2016)Automatic parallelization of pure method calls via conditional future synthesisACM SIGPLAN Notices10.1145/3022671.298403551:10(20-38)Online publication date: 19-Oct-2016
  • (2016)Reactive Async: expressive deterministic concurrencyProceedings of the 2016 7th ACM SIGPLAN Symposium on Scala10.1145/2998392.2998396(11-20)Online publication date: 30-Oct-2016
  • (2016)Automatic parallelization of pure method calls via conditional future synthesisProceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications10.1145/2983990.2984035(20-38)Online publication date: 19-Oct-2016
  • (2015)GhostScience of Computer Programming10.1016/j.scico.2014.05.01598:P3(339-359)Online publication date: 1-Feb-2015
  • (2013)Variant-Frequency Semantics for Green FuturesElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.109.1109(1-6)Online publication date: 23-Feb-2013
  • (2013)Safe uniform proxies for JavaScience of Computer Programming10.1016/j.scico.2012.10.01278:9(1490-1520)Online publication date: Sep-2013
  • (2013)Trustworthy proxiesProceedings of the 27th European conference on Object-Oriented Programming10.1007/978-3-642-39038-8_7(154-178)Online publication date: 1-Jul-2013
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media