160 likes | 171 Views
Create an adaptive software package for modifying Trap music behavior at runtime without modifying the source code directly. Re-use existing software and bring it to new platforms or environments.
E N D
A Remote Composer for TRAP.NET Javier Ocasio Pérez Mentor: Masoud Sadjadi Graduate Students: Fernando Trigoso Ana M. Sanchez Tuan Cameron Allen Lee
Motivation • Need for dynamic adaptation • Software that can respond to changing conditions • Software faults • Security attacks • Survive hardware failures • Re-use existing software • With already desired functionality • Bring it to new platform or environment. • Autonomic Computing • Grid computing • Mobile computing Reference: Introduction to Autonomic Computing, S. Masoud Sadjadi
Motivation • Autonomic computing • Automatically change behavior • Self-managed, long-running systems • Require limited human guidance Reference: Introduction to Autonomic Computing, S. Masoud Sadjadi
Project Overview • TRAP.NET • Stands for: • Transparent Reflective Aspect Programming in .NET Framework • Purpose • Have a software package that allows a user to modify a program’s behavior at runtime • Ability to insert and remove new code from an executing .NET application. • No need to stop software, recompile, and redistribute new code. • Transparently - dynamic adaptation without need to modify source code directly • Basis for autonomic applications • Automatically change behavior of running application
Project Overview • .NET advantages • Language-independent solution to the adaptive software problem • any existing .NET application can be made adaptable • C# • J# • Visual Basic • C++ • Solution can be implemented without the need to look at the original code • disassembling and decompiling .NET assembly into intermediate language (MSIL) Reference: Transparent Reflective Aspect Programming in .NET (TRAP.NET) System Design Document, L. Millo A. Rodriguez
Project Overview • Major Components: • Generator • Make a .Net assembly adapt-ready (contain the necessary facilities for incorporating new behavior at runtime) • Composer • Ability to (dynamically) change the behavior of executing adapt-ready assembly • Development team • Previous developers • Masoud Sadjadi, Lazaro Millo, Alain Rodriguez, and Jose Humberto • Current developers • Fernando Trigoso, Ana Sanchez, Allen Lee, Tuan Cameron, and Javier Ocasio Pérez
Sample adapt-ready method with hooks : public ReturnType OriginalMethod (ParameterList) { if (adaptation_enabled) { [Extended Behavior] } else { [Original Behavior] } } Adapting an application Adapt-ready .NET Application Assembly Original .NET Application Assembly Generator Interface • 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 Composer Interface Run Adapt-ready Application Adapt-ready Application with selected behavior • Loads delegate assembly (.exe or .dll) • Allows user to select which methods are going to be replaced • Adapts application
Focus in Project • Composer side: • Communication • .NET Remoting • Composer • Running Application • Composer User Interface • Re-design • Implementation
Client Process Server Process Client Method Remote Object Proxy Proxy Formatter Formatter Channel Channel Focus in Project • .NET Remoting
Focus in Project • Communication Server Computer Client Computer Application Server TRAP .NET Composer Interface .NET Remoting Adapt-ready Application • Remote object: ServerEngine.cs • Data passed: stream of bytes (as byte arrays), whose content is a configuration XML file.
Focus & Contribution • Composer Interface • URL of Adapt-ready application (assembly) in server • Loads adapt-ready methods from server • Activates the remote object indicated by the specified type (ServerEngine object) and URL • Calls GetStatus method from server • Examine the adapt-ready assembly and find the adapt-ready methods • 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
Focus & Contribution • Composer Interface • browse button • 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) • Calls LoadDelegate method from server • 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 adapt-ready method • Process byte array, convert to XML file and update display with adapt-ready methods and delegates
Focus & Contribution • Composer Interface • Tree view Display • Displays tree hierarchy • Based on Xml configuration file sent remotely • Assembly • Namespace • Class • Methods (adapt-ready) • Delegates (when loaded) • Adapts those adapt-ready methods as indicated by the user • Sends updated Xml file with user selections (as byte[]) to the server • Calls Adapt method from server • Read the updated XML and flag the methods that will be adapted so they can use the delegate methods • Add the selected behavior to adapt-ready assembly
Focus & Contribution • Implementation: • TRAP.NET Composer Interface • ComposerForm class • CheckControl class • TRAP.NET ServerPrototype • ServerApplication class • ServerEngineStub class • Utilities • IServerEngine interface • StreamProcessing class
Future Directions • Continuing the Development of Tools • Generator • Enhance Generator • Composer • The Server Side (The Composer Engine) • The Client Side (The Composer Interface) • Incorporate autonomic behavior • Replace/combined human composer interface with an automated program (autonomic element) • Adapting Existing Applications to Grid Computing
References • 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. McKinley, and Betty H.C. Cheng. http://www.cs.fiu.edu/~sadjadi/Publications/TransparentShaping-ICSE-DEAS-2005.pdf • TRAP/J: Transparent generation of adaptable Java programs, S. Masoud Sadjadi, Philip K. McKinley, 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/Intro2AC-Sadjadi-2006.ppt