A Remote Composer for TRAP NET Javier Ocasio

















- Slides: 17
A Remote Composer for TRAP. NET Javier Ocasio Pérez Mentor: Masoud Sadjadi Graduate Students: Fernando Trigoso Ana M. Sanchez Tuan Cameron Allen Lee 1
Motivation n Need for dynamic adaptation n Software that can respond to changing conditions n Software faults n Security attacks n Survive hardware failures n Re-use existing software n With already desired functionality n Bring it to new platform or environment. Autonomic Computing n Grid computing n Mobile computing n Reference: Introduction to Autonomic Computing, S. Masoud Sadjadi 2
Motivation n Autonomic computing n Automatically change behavior n based on environmental conditions n in accordance to predefined policies n Self-managed, long-running systems n self-configuring n self-healing n self-optimizing n self-protecting n Require limited human guidance 3 Reference: Introduction to Autonomic Computing, S. Masoud Sadjadi
Project Overview n TRAP. NET n Stands for: n n Transparent Reflective Aspect Programming in. NET Framework Purpose Have a software package that allows a user to modify a program’s behavior at runtime n Ability to insert and remove new code from an executing. NET application. n No need to stop software, recompile, and redistribute new code. n n Basis for autonomic applications n Automatically change behavior by inserting and removing code to and from (running) application 4
Project Overview n Concepts n Transparent Shaping n n Reflection n n a new programming model that supports dynamic adaptation in existing programs without the need to modify their source code directly allows an object to have information about its structure and its implementation so that it can reason about its own computation Aspect-Oriented Programming provides separation of concerns n allows breaking down a program into distinct parts, which otherwise would have crosscutting implementation n 5 Reference: http: //www. cs. fiu. edu/~sadjadi/Publications/Transparent. Shaping-ICSE-DEAS-2005. pdf
Project Overview n . NET advantages n Language-independent solution to the adaptive software problem n any existing. NET application can be made adaptable n n n C# J# Visual Basic C++ Solution can be implemented without the need to look at the original code n disassembling and decompiling. NET assembly into intermediate language (MSIL) 6 Reference: Transparent Reflective Aspect Programming in. NET (TRAP. NET) System Design Document, L. Millo A. Rodriguez
Project Overview n Major Components: n Generator n n Composer n n Make a. Net assembly adapt-ready (contain the necessary facilities for incorporating new behavior at runtime) Ability to (dynamically) change the behavior of executing adapt-ready assembly Development team n Previous developers n n Masoud Sadjadi, Lazaro Millo, Alain Rodriguez, and Jose Humberto Current developers n Fernando Trigoso, Ana Sanchez, Allen Lee, Tuan Cameron, and Javier Ocasio Pérez 7
Adapting an application Original. NET Application Assembly Adapt-ready. NET Application Assembly Generator Interface n n n Extracts assembly information from a compiled. NET assembly Allows the user to select which methods should be made adapt-ready Generates a new. Net assembly that contains generic “hooks” on the selected methods n n n Sample adapt-ready method with hooks : Run Adapt-ready Application Loads delegate assembly (. exe or. dll) Allows user to select which methods are going to be replaced Adapts application public Return. Type Original. Method (Parameter. List) { if (adaptation_enabled) { [Extended Behavior] } else { [Original Behavior] } } Composer Interface Adapt-ready Application with selected behavior 8
Focus in Project n Composer side: n Communication n. NET Remoting Composer n Running Application n n Composer User Interface n Re-design n Implementation 9
Focus in Project n . NET Remoting Client Process Server Process Client Method Remote Object Proxy Formatter Channel 10
Focus in Project n Communication Server Computer Client Computer TRAP. NET Composer Interface Application Server. NET Remoting Adapt-ready Application n n Remote object: Server. Engine. cs Data passed: stream of bytes (as byte arrays), whose content is a configuration XML file. 11
Focus & Contribution n Composer Interface n URL of Adapt-ready application (assembly) in server n Loads adapt-ready methods from server n n n Activates the remote object indicated by the specified type (Server. Engine object) and URL Calls Get. Status method from server n Examine the adapt-ready assembly and find the adaptready methods n Save the findings as an XML file and return content as a byte array Process byte array, convert to XML file and update display with adapt-ready methods 12
Focus & Contribution Composer Interface n n browse button n open up an Open File Dialog to select a delegate assembly display delegate assembly path in textbox Loads delegate assembly and sends it to the server (as a byte array) n Calls Load. Delegate method from server n n n For each adapt-ready method it will try to find a possible delegate method on the loaded delegate assembly return an XML file (as a byte array) with the delegate candidates for each adaptready method Process byte array, convert to XML file and update display with adapt-ready methods and delegates 13
Focus & Contribution Composer Interface n n Tree view Display n n Displays tree hierarchy Based on Xml file configuration file sent remotely n n n Assembly Namespace Class Methods (adapt-ready) Delegates (when loaded) Adapts those adapt-ready methods as indicated by the user n n Sends updated Xml file with user selections (as byte[]) to the server Calls Adapt method from server n n Read the updated XML and flag the methods that will be adapted so they can use the delegate methods Add the selected behavior to adaptready assembly 14
Focus & Contribution n Implementation: n TRAP. NET Composer Interface n Composer. Form class n Check. Control class n TRAP. NET Server. Prototype n Server. Application class n Server. Engine. Stub class n Utilities n IServer. Engine interface n Stream. Processing class 15
Future Directions n Continuing the Development of Tools n Generator n n Enhance Generator Composer The Server Side (The Composer Engine) n The Client Side (The Composer Interface) n n Incorporate autonomic behavior n n Replace/combined human composer interface with an automated program (autonomic element) Adapting Existing Applications to Grid Computing 16
References n n n n n Remoting with C# and. NET: Remote Objects for Distributed Applications, David Conger Transparent Reflective Aspect Programming in. NET (TRAP. NET) Requirements Analysis Document, Lazaro Millo, Alain Rodriguez Transparent Reflective Aspect Programming in. NET (TRAP. NET) System Design Document, Lazaro Millo, Alain Rodriguez Trap. NET Enhancements, Ana Rodriguez Trap. NET COP 4009 - Fall 2005 document, Frank Suero, Edwin Garcia, Etnan Gonzalez, Enrique E. Villa Trap. NET CEN 4015 -Spring 2005 document, Jose H Cifuentes Transparent shaping of existing software to support pervasive and autonomic computing, S. Masoud Sadjadi, Philip K. Mc. Kinley, and Betty H. C. Cheng. http: //www. cs. fiu. edu/~sadjadi/Publications/Transparent. Shaping. ICSE-DEAS-2005. pdf TRAP/J: Transparent generation of adaptable Java programs, S. Masoud Sadjadi, Philip K. Mc. Kinley, Betty H. C. Cheng, and R. E. Kurthttp: //www. cs. fiu. edu/~sadjadi/Publications/TRAP-DOA-2004. pdf Introduction to Autonomic Computing, S. Masoud Sadjadi http: //www. cs. fiu. edu/~sadjadi/presentations/Intro 2 AC-Sadjadi-2006. ppt 17

















