Distributed Dynamic Weaving is a Crosscutting Concern

Slides:



Advertisements
Similar presentations
Message Passing Vs Distributed Objects
Advertisements

Multiple Processor Systems
Construction process lasts until coding and testing is completed consists of design and implementation reasons for this phase –analysis model is not sufficiently.
Mobile Agents Mouse House Creative Technologies Mike OBrien.
Web Service Ahmed Gamal Ahmed Nile University Bioinformatics Group
Pontus Boström and Marina Waldén Åbo Akademi University/ TUCS Development of Fault Tolerant Grid Applications Using Distributed B.
RPC Robert Grimm New York University Remote Procedure Calls.
Aspect Oriented Programming. AOP Contents 1 Overview 2 Terminology 3 The Problem 4 The Solution 4 Join point models 5 Implementation 6 Terminology Review.
1 JAC : Aspect Oriented Programming in Java An article review by Yuval Nir and Limor Lahiani.
Aspect Oriented Programming - AspectJ Radhika Rajput.
Secure Systems Research Group - FAU Aspect Oriented Programming Carlos Oviedo Secure Systems Research Group.
Distributed components
Tutorials 2 A programmer can use two approaches when designing a distributed application. Describe what are they? Communication-Oriented Design Begin with.
ASPECT ORIENTED SOFTWARE DEVELOPMENT Prepared By: Ebru Doğan.
Comparison of the RMI and the socket APIs
University of British Columbia Software Practices Lab CAS Seminar 06 Fluid AJ - A Simple Fluid AOP Tool Terry Hon Gregor Kiczales.
Centralized Architectures
Communication in Distributed Systems –Part 2
Introducing the Common Language Runtime for.NET. The Common Language Runtime The Common Language Runtime (CLR) The Common Language Runtime (CLR) –Execution.
16: Distributed Systems1 DISTRIBUTED SYSTEM STRUCTURES NETWORK OPERATING SYSTEMS The users are aware of the physical structure of the network. Each site.
Introducing the Common Language Runtime. The Common Language Runtime The Common Language Runtime (CLR) The Common Language Runtime (CLR) –Execution engine.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
1 Chapter Client-Server Interaction. 2 Functionality  Transport layer and layers below  Basic communication  Reliability  Application layer.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 12 Communicating over.
Introduction to Aspect Oriented Programming Presented By: Kotaiah Choudary. Ravipati M.Tech IInd Year. School of Info. Tech.
Multiple Processor Systems. Multiprocessor Systems Continuous need for faster and powerful computers –shared memory model ( access nsec) –message passing.
SALSA: Language and Architecture for Widely Distributed Actor Systems. Carlos Varela, Abe Stephens, Department of.
Aspect Oriented Programming Razieh Asadi University of Science & Technology Mazandran Babol Aspect Component Based Software Engineering (ACBSE)
J-OCM is a system for monitoring distributed Java applications conforming to OMIS specification with J-OMIS extensions. It is used to: gather information.
Tool support for crosscutting concerns of API documentation Michihiro Horie, Shigeru Chiba Tokyo Institute of Technology, Japan.
Composing Adaptive Software Authors Philip K. McKinley, Seyed Masoud Sadjadi, Eric P. Kasten, Betty H.C. Cheng Presented by Ana Rodriguez June 21, 2006.
Modularizing Web Services Management with AOP María Agustina Cibrán, Bart Verheecke { Maria.Cibran, System and Software Engineering.
1 Model Compiler Construction Based on Aspect-oriented Mechanisms Naoyasu Ubayashi (Kyushu Institute of Technology) Tetsuo Tamai (University of Tokyo)
1 Model Evolution with Aspect-oriented Mechanisms Naoyasu Ubayashi (Kyushu Institute of Technology) Tetsuo Tamai (University of Tokyo) Shinji Sano, Yusaku.
Methodology: The AOP Refactoring Process Aspect-Oriented Refactoring of the Apache Cocoon Shared-Object Resource Allocation System Jeff Dalton Advisor:
A Distributed Aspect-Oriented System for J2EE Applications Muga Nishizawa and Shigeru Chiba (Tokyo Institute of Technology, Japan) Background - As benefits.
Virtual Support for Dynamic Join Points C. Bockisch, M. Haupt, M. Mezini, K. Ostermann Presented by Itai Sharon
Dynamic Architectures (Component Reconfiguration) with Fractal.
The Complexity of Distributed Algorithms. Common measures Space complexity How much space is needed per process to run an algorithm? (measured in terms.
Hwajung Lee.  Interprocess Communication (IPC) is at the heart of distributed computing.  Processes and Threads  Process is the execution of a program.
Region Pointcut for AspectJ Shumpei Akai Shigeru Chiba Muga Nishizawa.
Aspect-oriented Application-level Scheduling for J2EE Servers Kenichi Kourai, Hideaki Hibino, and Shigeru Chiba Tokyo Institute of Technology.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
Remote Procedure Call Andy Wang Operating Systems COP 4610 / CGS 5765.
Mark Stanovich Operating Systems COP Primitives to Build Distributed Applications send and receive Used to synchronize cooperating processes running.
AOSD'04, Lancaster, UK 1 Remote Pointcut - A Language Construct for Distributed AOP Muga Nishizawa (Tokyo Tech) Shigeru Chiba (Tokyo Tech) Michiaki Tatsubori.
AspectScope: An Outline Viewer for AspectJ Programs Michihiro Horie, Shigeru Chiba Tokyo Institute of Technology, Japan.
1 An AOP Implementation Framework for Extending Join Point Models Naoyasu Ubayashi(Kyushu Institute of Technology, Japan) Hidehiko Masuhara(University.
Distributed programming in Java Faculty:Nguyen Ngoc Tu Session 5 - RMI.
PPL 2004, Gamagori, AICHI1 Remote Pointcut - A Language Construct for Distributed AOP Muga Nishizawa (Tokyo Tech, Japan) Shigeru Chiba (Tokyo Tech, Japan)
MACS 2005 First International Workshop on the Modeling and Analysis of Concerns in Software Concern Management for Constructing Model Compilers -- Towards.
Distributed Shared Memory
Web Programming Developing Web Applications including Servlets, and Web Services using NetBeans 6.5 with GlassFish.V3.
Chapter 1 Introduction to Computers, Programs, and Java
CSE 486/586 Distributed Systems Remote Procedure Call
Aspect-Oriented Generation of the API Documentation for AspectJ
Types of Programming Languages
Distributed OS.
Sarah Diesburg Operating Systems COP 4610
Chapter 4 Writing Classes.
Units with – James tedder
Chapter 7 –Implementation Issues
Remote Procedure Call Hank Levy 1.
Lecture 6: RPC (exercises/questions)
AspectAda Aspect-Oriented Programming for Ada95
Remote Procedure Call Hank Levy 1.
Lecture 6: RPC (exercises/questions)
Lecture 7: RPC (exercises/questions)
Distributed System using Web Services
Remote Procedure Call Hank Levy 1.
Presentation transcript:

Distributed Dynamic Weaving is a Crosscutting Concern Michihiro Horie, Satoshi Morita, Shigeru Chiba Tokyo Institute of Technology, Japan

Aspect Oriented Programming (AOP) AOP languages enable to modularize crosscutting concerns into aspects Distributed dynamic AOP languages Extended for a distributed and running program Weaving encryption/decryption aspects to a running program Crosscutting concerns Must be woven simultaneously Client Server messages Encrypt Decrypt Client Server encrypted messages

An example of woven aspects Advice Pointcut Aspect public aspect Encrypter { void around (String msg): call(void Client.send(String))&& args(msg) { String cipher = encrypt(msg); // encryption proceed(cipher); // original method invocation } 号 description class Client { void send (String msg) { … }} Joinpoint Server Encryption

Weaving fails without a consistency mechanism An experiment in InTrigger grid computing platform Encryption/decryption with a message service application Sending 1 message/ms Chiba to Hakodate The network latency was 27 msec. Results 10 times failure in Java-based language 1 failure in CaesarJ [Mezini et.al. 03]

Existing approaches: Barrier synchronization Client Server Which tick do we suspend the program at? Needs another aspect to control weaving Difficult to define This aspect should be also woven dynamically… message Client Server suspend encrypt decrypt Client Server restart Client Server Encrypted message

Existing approaches: Atomic weaving [Truyen et.al. 06] deploy Client Server An aspect weaving is split into two phases Deploy An aspect is delivered to a remote host Activate Only when it is explicitly activated No language support No single atomic weaving mechanism for all applications Decreases reusability of control aspects STOP message encrypt decrypt Client Server message deploy Client Server message activate Client Server Encrypted message activate

DandyJ New distributed Dynamic AOP language Three language constructs Distributed dynamic weaving can be written by aspects Control weaving depends on each application An aspect to control weaving can be independent Reusable Three language constructs First-class aspects with two-phase weaving Remote pointcuts One-time aspects

First-class and two-phase weaving Dynamic aspect Can be woven during runtime dynamic modifier A subtype of DAspect It has to be explicitly instantiated Can be assigned to a variable and passed as a method parameter Reusable library code Two-phase weaving Deploy and activate dynamic aspect Encrypter { …. } Encrypter enc = new Encrypter (); enc.deploy(); enc.activate(); ... enc.undeploy();

Methods available on dynamic aspects The asynchronous deploy and synchronous activate Allows us to minimize the duration of the “stop the world” time for dynamic weaving Methods Description void deploy() Deploy a dynamic aspect with being inactive void undeploy() Undeploy an aspect void activate() Activate an aspect void unactivate() Inactivate an aspect boolean isDeployed() Returns true if an aspect has been deployed boolean isActivated() Returns true if an aspect is active Deployment is performed asynchronously

Remote pointcut [Nishizawa et.al. 04] Selects execution events on a remote machine Method calls etc. local modifier for locally deploying aspects Useful to implement an action that has to be performed on the same machine Aspect node00: node00 ... send (); Pointcut designator Joinpoint hosts(hostName1, hostName2 ..) Selects joinpoints on hostName1, hostName2, … hostName(hostName) Binds a variable hostName to the name of the host machine where the selected joinpoint exists.

Onetime aspect Client Server message Automatically undeployed after all its advices are executed Useful to implement a program for controlling distributed weaving Need not write undeploy explicitly onetime modifier Control weaving encrypt decrypt Client Server Encrypted message undeploy Client Server Encrypted message

Encryption aspects in DandyJ public dynamic aspect Encrypter { local void around (String msg): client() && args(msg) { // encrypt the message proceed (msg); }} public abstract dynamic onetime aspect ServerClient { … before (): server() && if (openPort.isDeployed() && server.isDeployed()) { openPort.activate(); server.activate(); } before (): client() && if(server.isActivated() && changePort.isDeployed() && client.isWoven()) { changePort.activate(); client.activate(); }} public dynamic aspect Decrypter { local void around (String msg, Server s): server() && args(msg) && this(s){ if ( /* */ ) { // decrypt the message proceed (msg); } else { proceed(msg); }}}

Another example: a logging aspect with a n-body problem solver Weaving along the barrier synchronization Deploys two aspects One for the preparation Another for logging deploy node00 node01 node02 sync activation t = 101 t = 102 t = 103 Do not activate Join point Calculation Data sending

A reusable aspect for barrier synchronization public abstract aspect BarrierSync { … abstract pointcut sync(); before(String host): sync() && hostName(host) { map.put(host, true); } after(String host): sync() && hostName(host) && if(dAspect.isDeployed()) { synchronized(this) { if (!map.containsValue(false)) { dAspect.activate(); this.undeploy(); map.put(host, false); }}}

Experiment Encryption/decryption aspects for a message service application Uses two remote clusters Chiba Sending messages Control weaving Mirai: Receiving messages Four scenarios (A) Deploy and activate aspects without any consideration of atomicity (B) Suspend the application, weave aspects, and then restart it (C) Deploy and activate aspects by our DandyJ aspect (D) The same as (C) but the aspect is not one-time Environment InTrigger chiba & mirai OS: Debian Chiba CPU: Core2Duo 2.13GHz, memory: 4GB Mirai CPU: Xeon 2.33GHz, memory: 16GB

Results Onetime aspect contributes to response time and consistency Weave an aspect Delay for barrier sync. Response time ◎ Consistency × Response time × Consistency ○ Response (ms) Max: 69 Ave: 45.4 Max: 133 Ave: 47.5 Message sent (times) Response time ○ Consistency ○ Response time △(7%) Consistency ○ Max: 71 Ave: 46.6 Max: 75 Ave: 49.6

Concluding remarks Illustrates that distributed dynamic weaving is a crosscutting concern DandyJ New distributed dynamic AOP language Three language constructs First-class aspect with two-phase weaving Remote pointcut Onetime-aspect Experiment with the InTrigger grid computing platform

Related work DyReS [Truyen et.al. 08] CaesarJ [Mezini et.al. 03] Uses XML script to describe activation of aspects Difficult to understand procedures in remote hosts Scripts tend to be complicated CaesarJ [Mezini et.al. 03] Activates an aspect through deploy instruction Cannot control procedures in remote hosts DJAsCo [Navarro et.al. 06] Available for remote pointcut Cannot describe an activation code by an advice Lasagne [truyen et.al. 06] Atomic weaving

Implementation of DandyJ ddjc: Compiler based on JastAdd-version of Aspect- Bench Compiler Extended by aspects Added 5,000 Lines of codes ddj: Runtime system Executes dynamic weaving Uses Javassist 3,000 Lines of codes

The port changes Deploy encryption/decryption aspects by the deploy method in the control aspect Confirm deployment by the isDeployed method Activate deployed aspects Uses the different port