1 javier ocasio pérez mentor: masoud sadjadi graduate students: fernando trigoso ana m. sanchez...

17
1 Javier Ocasio Pérez Javier Ocasio Pérez Mentor: Masoud Sadjadi Mentor: Masoud Sadjadi Graduate Students: Graduate Students: Fernando Trigoso Fernando Trigoso Ana M. Sanchez Ana M. Sanchez Tuan Cameron Tuan Cameron Allen Lee Allen Lee A Remote Composer for A Remote Composer for TRAP.NET TRAP.NET

Upload: vanessa-melton

Post on 01-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Javier Ocasio Pérez Mentor: Masoud Sadjadi Graduate Students: Fernando Trigoso Ana M. Sanchez Tuan Cameron Allen Lee A Remote Composer for TRAP.NET

1

Javier Ocasio PérezJavier Ocasio PérezMentor: Masoud SadjadiMentor: Masoud Sadjadi

Graduate Students: Graduate Students: Fernando TrigosoFernando TrigosoAna M. SanchezAna M. SanchezTuan Cameron Tuan Cameron

Allen LeeAllen Lee

A Remote Composer for A Remote Composer for TRAP.NETTRAP.NET

Page 2: 1 Javier Ocasio Pérez Mentor: Masoud Sadjadi Graduate Students: Fernando Trigoso Ana M. Sanchez Tuan Cameron Allen Lee A Remote Composer for TRAP.NET

2

Need for dynamic adaptation Need for dynamic adaptation Software that can respond to changing Software that can respond to changing

conditions conditions Software faultsSoftware faults Security attacksSecurity attacks Survive hardware failuresSurvive hardware failures

Re-use existing software Re-use existing software With already desired functionality With already desired functionality Bring it to new platform or environment.Bring it to new platform or environment.

Autonomic ComputingAutonomic Computing Grid computing Grid computing Mobile computingMobile computing

Reference: Introduction to Autonomic Computing, S. Masoud Sadjadi

MotivationMotivation

Page 3: 1 Javier Ocasio Pérez Mentor: Masoud Sadjadi Graduate Students: Fernando Trigoso Ana M. Sanchez Tuan Cameron Allen Lee A Remote Composer for TRAP.NET

3

MotivationMotivation

Autonomic computingAutonomic computing Automatically change behavior Automatically change behavior

based on based on environmental environmental conditionsconditions in accordance to predefined policiesin accordance to predefined policies

Self-managed, long-running systemsSelf-managed, long-running systems self-configuringself-configuring self-healingself-healing self-optimizingself-optimizing self-protectingself-protecting

Require limited human guidanceRequire limited human guidance

Reference: Introduction to Autonomic Computing, S. Masoud Sadjadi

Page 4: 1 Javier Ocasio Pérez Mentor: Masoud Sadjadi Graduate Students: Fernando Trigoso Ana M. Sanchez Tuan Cameron Allen Lee A Remote Composer for TRAP.NET

4

Project OverviewProject Overview

TRAP.NETTRAP.NET Stands for:Stands for:

Transparent Reflective Aspect Programming Transparent Reflective Aspect Programming in .NET Frameworkin .NET Framework

Purpose Purpose Have a software package that allows a user to Have a software package that allows a user to

modify a program’s behavior at runtime modify a program’s behavior at runtime Ability to insert and remove new code from an Ability to insert and remove new code from an

executing .NET application. executing .NET application. No need to stop software, recompile, and No need to stop software, recompile, and

redistribute new code. redistribute new code. Basis for autonomic applicationsBasis for autonomic applications

Automatically change behavior by inserting and Automatically change behavior by inserting and removing code to and from (running) applicationremoving code to and from (running) application

Page 5: 1 Javier Ocasio Pérez Mentor: Masoud Sadjadi Graduate Students: Fernando Trigoso Ana M. Sanchez Tuan Cameron Allen Lee A Remote Composer for TRAP.NET

5

Project OverviewProject Overview

ConceptsConcepts Transparent ShapingTransparent Shaping

a new programming model that supports dynamic a new programming model that supports dynamic adaptation in existing programs without the need adaptation in existing programs without the need to modify their source code directlyto modify their source code directly

ReflectionReflection allows an object to have information about its allows an object to have information about its

structure and its implementation so that it can structure and its implementation so that it can reason about its own computationreason about its own computation

Aspect-Oriented ProgrammingAspect-Oriented Programming provides separation of concernsprovides separation of concerns allows breaking down a program into distinct parts, allows breaking down a program into distinct parts,

which otherwise would have crosscutting which otherwise would have crosscutting implementationimplementation

Reference: http://www.cs.fiu.edu/~sadjadi/Publications/TransparentShaping-ICSE-DEAS-2005.pdf

Page 6: 1 Javier Ocasio Pérez Mentor: Masoud Sadjadi Graduate Students: Fernando Trigoso Ana M. Sanchez Tuan Cameron Allen Lee A Remote Composer for TRAP.NET

6

Project OverviewProject Overview

.NET advantages.NET advantages Language-independent solution to the Language-independent solution to the

adaptive software problem adaptive software problem any existing .NET application can be made any existing .NET application can be made

adaptableadaptable C# C# J# J# Visual Basic Visual Basic C++C++

Solution can be implemented without the Solution can be implemented without the need to look at the original code need to look at the original code

disassembling and decompiling .NET assembly into disassembling and decompiling .NET assembly into intermediate language (MSIL)intermediate language (MSIL)

Reference: Transparent Reflective Aspect Programming in .NET (TRAP.NET) System Design Document, L. Millo A. Rodriguez

Page 7: 1 Javier Ocasio Pérez Mentor: Masoud Sadjadi Graduate Students: Fernando Trigoso Ana M. Sanchez Tuan Cameron Allen Lee A Remote Composer for TRAP.NET

7

Project OverviewProject Overview Major Components:Major Components:

GeneratorGenerator Make a .Net assembly adapt-ready (contain the Make a .Net assembly adapt-ready (contain the

necessary facilities for incorporating new behavior at necessary facilities for incorporating new behavior at runtime)runtime)

ComposerComposer Ability to (dynamically) change the behavior of Ability to (dynamically) change the behavior of

executing adapt-ready assemblyexecuting adapt-ready assembly

Development teamDevelopment team Previous developersPrevious developers

Masoud Sadjadi, Lazaro Millo, Alain Rodriguez, and Masoud Sadjadi, Lazaro Millo, Alain Rodriguez, and Jose HumbertoJose Humberto

Current developersCurrent developers Fernando Trigoso, Ana Sanchez, Allen Lee, Tuan Fernando Trigoso, Ana Sanchez, Allen Lee, Tuan

Cameron, and Javier Ocasio PérezCameron, and Javier Ocasio Pérez

Page 8: 1 Javier Ocasio Pérez Mentor: Masoud Sadjadi Graduate Students: Fernando Trigoso Ana M. Sanchez Tuan Cameron Allen Lee A Remote Composer for TRAP.NET

8

Adapting an applicationAdapting an application

Original .NET ApplicationAssembly

Generator Interface

Adapt-ready .NET ApplicationAssembly

Composer Interface

Run Adapt-ready Application

Adapt-ready Application with selected behavior

Extracts assembly information from a Extracts assembly information from a compiled .NET assemblycompiled .NET assembly

Allows the user to select which methods Allows the user to select which methods should be made adapt-readyshould be made adapt-ready

Generates a new .Net assembly that Generates a new .Net assembly that contains generic “hooks” on the selected contains generic “hooks” on the selected methodsmethods

Sample adapt-ready method with hooks :

public ReturnType OriginalMethod (ParameterList){ if (adaptation_enabled) { [Extended Behavior] } else { [Original Behavior] }}

Loads delegate assembly (.exe Loads delegate assembly (.exe or .dll)or .dll)

Allows user to select which methods Allows user to select which methods are going to be replacedare going to be replaced

Adapts applicationAdapts application

Page 9: 1 Javier Ocasio Pérez Mentor: Masoud Sadjadi Graduate Students: Fernando Trigoso Ana M. Sanchez Tuan Cameron Allen Lee A Remote Composer for TRAP.NET

9

Focus in Project Focus in Project

Composer side:Composer side: CommunicationCommunication

.NET Remoting.NET Remoting ComposerComposer Running ApplicationRunning Application

Composer User InterfaceComposer User Interface Re-designRe-design ImplementationImplementation

Page 10: 1 Javier Ocasio Pérez Mentor: Masoud Sadjadi Graduate Students: Fernando Trigoso Ana M. Sanchez Tuan Cameron Allen Lee A Remote Composer for TRAP.NET

10

Focus in Project Focus in Project

.NET Remoting.NET Remoting

Client Method

Proxy

Formatter

Channel

Client Process

Remote Object

Proxy

Formatter

Channel

Server Process

Page 11: 1 Javier Ocasio Pérez Mentor: Masoud Sadjadi Graduate Students: Fernando Trigoso Ana M. Sanchez Tuan Cameron Allen Lee A Remote Composer for TRAP.NET

11

Focus in Project Focus in Project

CommunicationCommunication

TRAP .NETComposer Interface

Application Server

Adapt-ready Application

Client Computer

Server Computer

.NET Remoting

Remote object: ServerEngine.csRemote object: ServerEngine.cs Data passed: stream of bytes (as Data passed: stream of bytes (as

byte arrays), whose content is a byte arrays), whose content is a configuration XML file.configuration XML file.

Page 12: 1 Javier Ocasio Pérez Mentor: Masoud Sadjadi Graduate Students: Fernando Trigoso Ana M. Sanchez Tuan Cameron Allen Lee A Remote Composer for TRAP.NET

12

Focus & ContributionFocus & Contribution

Composer InterfaceComposer Interface URL of Adapt-ready application URL of Adapt-ready application

(assembly) in server (assembly) in server

Loads adapt-ready methods from Loads adapt-ready methods from serverserver

Activates the remote object indicated Activates the remote object indicated by the specified type (ServerEngine by the specified type (ServerEngine object) and URLobject) and URL

Calls GetStatus method from serverCalls GetStatus method from server Examine the adapt-ready Examine the adapt-ready

assembly and find the adapt-assembly and find the adapt-ready methodsready methods

Save the findings as an XML file Save the findings as an XML file and return content as a byte and return content as a byte arrayarray

Process byte array, convert to XML Process byte array, convert to XML file and update display with adapt-file and update display with adapt-ready methodsready methods

Page 13: 1 Javier Ocasio Pérez Mentor: Masoud Sadjadi Graduate Students: Fernando Trigoso Ana M. Sanchez Tuan Cameron Allen Lee A Remote Composer for TRAP.NET

13

Focus & ContributionFocus & Contribution

Composer InterfaceComposer Interface browse button browse button

open up an Open File Dialog to select a delegate assemblyopen up an Open File Dialog to select a delegate assembly display delegate assembly path in textboxdisplay delegate assembly path in textbox

Loads delegate assembly and sends it to the Loads delegate assembly and sends it to the server (as a byte array)server (as a byte array)

Calls LoadDelegate method from serverCalls LoadDelegate method from server For each adapt-ready method it will try to find a For each adapt-ready method it will try to find a

possible delegate method on the loaded delegate possible delegate method on the loaded delegate assemblyassembly

return an XML file (as a byte array) with the return an XML file (as a byte array) with the delegate candidates for each adapt-ready methoddelegate candidates for each adapt-ready method

Process byte array, convert to XML file and Process byte array, convert to XML file and update display with adapt-ready methods and update display with adapt-ready methods and delegatesdelegates

Page 14: 1 Javier Ocasio Pérez Mentor: Masoud Sadjadi Graduate Students: Fernando Trigoso Ana M. Sanchez Tuan Cameron Allen Lee A Remote Composer for TRAP.NET

14

Focus & ContributionFocus & Contribution

Composer InterfaceComposer Interface Tree view DisplayTree view Display

Displays tree hierarchyDisplays tree hierarchy Based on Xml file configuration file sent remotelyBased on Xml file configuration file sent remotely

AssemblyAssembly NamespaceNamespace ClassClass Methods (adapt-ready)Methods (adapt-ready) Delegates (when loaded)Delegates (when loaded)

Adapts those adapt-ready methods Adapts those adapt-ready methods as indicated by the useras indicated by the user

Sends updated Xml file with user Sends updated Xml file with user selections (as byte[]) to the serverselections (as byte[]) to the server

Calls Adapt method from serverCalls Adapt method from server Read the updated XML and flag the Read the updated XML and flag the

methods that will be adapted so they methods that will be adapted so they can use the delegate methodscan use the delegate methods

Add the selected behavior to adapt-Add the selected behavior to adapt-ready assemblyready assembly

Page 15: 1 Javier Ocasio Pérez Mentor: Masoud Sadjadi Graduate Students: Fernando Trigoso Ana M. Sanchez Tuan Cameron Allen Lee A Remote Composer for TRAP.NET

15

Focus & ContributionFocus & Contribution

Implementation: Implementation: TRAP.NET Composer InterfaceTRAP.NET Composer Interface

ComposerForm classComposerForm class CheckControl classCheckControl class

TRAP.NET ServerPrototypeTRAP.NET ServerPrototype ServerApplication classServerApplication class ServerEngineStub classServerEngineStub class

UtilitiesUtilities IServerEngine interfaceIServerEngine interface StreamProcessing classStreamProcessing class

Page 16: 1 Javier Ocasio Pérez Mentor: Masoud Sadjadi Graduate Students: Fernando Trigoso Ana M. Sanchez Tuan Cameron Allen Lee A Remote Composer for TRAP.NET

16

Future DirectionsFuture Directions

Continuing the Development of ToolsContinuing the Development of Tools GeneratorGenerator

Enhance Generator Enhance Generator ComposerComposer

The Server Side (The Composer Engine)The Server Side (The Composer Engine) The Client Side (The Composer Interface)The Client Side (The Composer Interface)

Incorporate autonomic behaviorIncorporate autonomic behavior Replace/combined human composer Replace/combined human composer

interface with an automated program interface with an automated program (autonomic element)(autonomic element)

Adapting Existing Applications to Grid Adapting Existing Applications to Grid ComputingComputing

Page 17: 1 Javier Ocasio Pérez Mentor: Masoud Sadjadi Graduate Students: Fernando Trigoso Ana M. Sanchez Tuan Cameron Allen Lee A Remote Composer for TRAP.NET

17

ReferencesReferences Remoting with C# and .NET: Remote Objects for Distributed Remoting with C# and .NET: Remote Objects for Distributed

Applications, David CongerApplications, David Conger Transparent Reflective Aspect Programming in .NET (TRAP.NET) Transparent Reflective Aspect Programming in .NET (TRAP.NET)

Requirements Analysis Document, Requirements Analysis Document, Lazaro Millo,Lazaro Millo, Alain RodriguezAlain Rodriguez Transparent Reflective Aspect Programming in .NET (TRAP.NET) Transparent Reflective Aspect Programming in .NET (TRAP.NET)

System Design Document, Lazaro Millo, Alain Rodriguez System Design Document, Lazaro Millo, Alain Rodriguez Trap .NET Enhancements, Ana RodriguezTrap .NET Enhancements, Ana Rodriguez Trap .NET Trap .NET COP 4009 - Fall 2005 document, COP 4009 - Fall 2005 document, Frank Suero, Edwin Garcia, Frank Suero, Edwin Garcia,

Etnan Gonzalez, Enrique E. VillaEtnan Gonzalez, Enrique E. Villa Trap .NET Trap .NET CEN 4015 -Spring 2005 document, CEN 4015 -Spring 2005 document, Jose H CifuentesJose H Cifuentes Transparent shaping of existing software to support pervasive and Transparent shaping of existing software to support pervasive and

autonomic computing, S. Masoud Sadjadi, Philip K. McKinley, and autonomic computing, S. Masoud Sadjadi, Philip K. McKinley, and Betty H.C. Cheng. Betty H.C. Cheng. http://www.cs.fiu.edu/~sadjadi/Publications/TransparentShaping-ICSE-http://www.cs.fiu.edu/~sadjadi/Publications/TransparentShaping-ICSE-DEAS-2005.pdfDEAS-2005.pdf

TRAP/J: Transparent generation of adaptable Java programs, S. TRAP/J: Transparent generation of adaptable Java programs, S. Masoud Sadjadi, Philip K. McKinley, Betty H.C. Cheng, and R.E. Masoud Sadjadi, Philip K. McKinley, Betty H.C. Cheng, and R.E. Kurthttp://www.cs.fiu.edu/~sadjadi/Publications/TRAP-DOA-2004.pdfKurthttp://www.cs.fiu.edu/~sadjadi/Publications/TRAP-DOA-2004.pdf

Introduction to Autonomic Computing, S. Masoud Sadjadi Introduction to Autonomic Computing, S. Masoud Sadjadi http://www.cs.fiu.edu/~sadjadi/presentations/Intro2AC-Sadjadi-http://www.cs.fiu.edu/~sadjadi/presentations/Intro2AC-Sadjadi-2006.ppt2006.ppt