Presentation is loading. Please wait.

Presentation is loading. Please wait.

A SENS Internal Presentation on Friday, October 3, 2003 TRAP Transparent Reflective Aspect Programming SeyedMasoud Sadjadi Supervised by Dr. McKinley

Similar presentations


Presentation on theme: "A SENS Internal Presentation on Friday, October 3, 2003 TRAP Transparent Reflective Aspect Programming SeyedMasoud Sadjadi Supervised by Dr. McKinley"— Presentation transcript:

1 A SENS Internal Presentation on Friday, October 3, 2003 TRAP Transparent Reflective Aspect Programming SeyedMasoud Sadjadi Supervised by Dr. McKinley http://www.cse.msu.edu/~{sadjadis,mckinley}/ Software Engineering and Networking Systems Laboratory Department of Computer Science and Engineering Michigan State University http://www.cse.msu.edu/sens/

2 A SENS Presentation on Oct. e, 2003Transparent Reflection by S. M. Sadjadi 2 Acknowledgement  Dr. Cheng  Dr. Stirewalt  Eric Kasten  Zhenxiao Yang  Jesse Sowell  Zhinan Zhou  Farshad Samimi  Peng Ge

3 A SENS Presentation on Oct. e, 2003Transparent Reflection by S. M. Sadjadi 3 Agenda Motivation Running Example Architecture Implementation Related Work Architecture Running Example Motivation ImplementationOverview: Related Work Conclusion & Future Work Conclusion

4 A SENS Presentation on Oct. e, 2003Transparent Reflection by S. M. Sadjadi 4 Motivation  Separation of Concerns –Development –Maintenance –Dynamic adaptation  Selective Reflection –On demand overhead  Supporting Legacy Applications –Change of requirement  Adding Security –Change of execution environment  Wired to wireless  Dynamic Adaptation –Long running and critical applications (availability)  Promoting Assurance Analysis –A systematic (principled) approach to adaptation Architecture Running Example Motivation ImplementationOverview: Related Work Conclusion

5 A SENS Presentation on Oct. e, 2003Transparent Reflection by S. M. Sadjadi 5 Agenda Running Example Motivation Architecture Implementation Transparent Reflection Related Work Architecture Motivation Running Example ImplementationOverview: Related Work Conclusion & Future Work Conclusion

6 A SENS Presentation on Oct. e, 2003Transparent Reflection by S. M. Sadjadi 6 Interactive Video Multicast  Interactive Video Multicast in Wireless LANs by Peng Ge  Proxy-based solution –The proxy serves a subgroup of wireless system  Extra processing power  Localize error correction Wired receivers Proxy Sender Wired receivers Access point Wireless receivers Architecture Motivation Running Example ImplementationOverview: Related Work Conclusion Ad-Hoc Network Hori. vs. Vertical Video Multicast

7 A SENS Presentation on Oct. e, 2003Transparent Reflection by S. M. Sadjadi 7 Ad-Hoc Network  Original Execution Environment –One hop wireless network using access point. –specified by Peng.  New Execution Environment –Multi-hop ad-hoc wireless network –Specified by Farshad. Ad-Hoc Proxy1 SenderReceiver Wireless Ad-Hoc Network 11 Mbps Ethernet Ad-Hoc Proxy2 Low loss rate High loss rate Architecture Motivation Running Example ImplementationOverview: Related Work Conclusion Video Multicast Hori. vs. Vertical Ad-Hoc Network Low loss rate

8 A SENS Presentation on Oct. e, 2003Transparent Reflection by S. M. Sadjadi 8 Ad-Hoc Proxy 2 Domain-Specific Services Common Services Distribution Host-Infrastructure OS and Protocols Hardware Devices Horizontal vs. Vertical Adaptation  Horizontal Adaptation –Multi-Tier Adaptation  Vertical Adaptation –Multi-Layer (Cross-Layer) Adaptation Architecture Motivation Running Example ImplementationOverview: Related Work Conclusion Ad-Hoc Network Video Multicast Hori. vs. Vertical Middleware Layers Sender Domain-Specific Services Common Services Distribution Host-Infrastructure OS and Protocols Hardware Devices System Platform Ad-Hoc Proxy 1 Domain-Specific Services Common Services Distribution Host-Infrastructure OS and Protocols Hardware Devices Receiver Domain-Specific Services Common Services Distribution Host-Infrastructure OS and Protocols Hardware Devices Layers defined by Schmidt [2]

9 A SENS Presentation on Oct. e, 2003Transparent Reflection by S. M. Sadjadi 9 Agenda Architecture Motivation Running Example Implementation Related Work Running Example Motivation Architecture ImplementationOverview: Related Work Conclusion & Future Work Conclusion

10 A SENS Presentation on Oct. e, 2003Transparent Reflection by S. M. Sadjadi 10 A Simple Generic Ad-Hoc Proxy … public class relay { DatagramSocket rs; DatagramSocket ss; public void run() { … rs = new DatagramSocket(recv_port); ss = new DatagramSocket(); while (!EndOfStream) { rs.receive(packet); byte[] buf = Bytes.copy(packet.getData(), 0, packet.getLength()); DatagramPacket packetToSend = new DatagramPacket(buf, buf.length, target_address, target_port); ss.send(packetToSend); } // end while … } … } // end relay Running Example Motivation Architecture ImplementationOverview: Related Work Conclusion Run-Time Model Layered Class Gr. Ad-Hoc Proxy

11 A SENS Presentation on Oct. e, 2003Transparent Reflection by S. M. Sadjadi 11 Run-Time Class Graph Model Running Example Motivation Architecture ImplementationOverview: Related Work Conclusion Ad-Hoc Proxy Layered Class Gr Run-Time Model … public class relay { DatagramSocket rs; DatagramSocket ss; public void run() { … DatagramSocket rs = new DatagramSocket( recv_port); DatagramSocket ss = new DatagramSocket(); while (!EndOfStream) { rs.receive(packet); … ss.send(packetToSend); } // end while … } … } // end relay relay class DatagraSocket class relay object rsss Class Library Heap Simplified Run-Time Class Graph

12 A SENS Presentation on Oct. e, 2003Transparent Reflection by S. M. Sadjadi 12 Layered Class Graph Running Example Motivation Architecture ImplementationOverview: Related Work Conclusion Ad-Hoc Proxy Run-Time Model Layered Class GrApplicationLevel BaseLevel MetaLevel DelegateLevel Class Library Heap DatagramSocketrelay rs & ss relay BaseLevel_DatagramSocket re & ss MetaLevel_DatagramSocket rs & ss Del 1 Del 2 Del 3 del 1 del 2 del 3

13 A SENS Presentation on Oct. e, 2003Transparent Reflection by S. M. Sadjadi 13 Agenda Implementation Motivation Running Example Architecture Related Work Running Example Motivation Implementation ArchitectureOverview: Related Work Conclusion & Future Work Conclusion

14 A SENS Presentation on Oct. e, 2003Transparent Reflection by S. M. Sadjadi 14 Compiling Steps Running Example Motivation Implementation ArchitectureOverview: Related Work Conclusion Admin. Consoles Delegate Class Gen. Aspect Base-Level Class Meta-Level Class Compiling Steps Generating Reflective Classes Generating Aspect BaseLevel_ DatagramSocket.java “java.net. DatagramSocket” MetaLevel_ DatagramSocket.java Absorbing_ DatagramSocket.aj relay.java Application Source in Java Files AspectJ Compiler (ajc) relay.class Executable Application Class Files

15 A SENS Presentation on Oct. e, 2003Transparent Reflection by S. M. Sadjadi 15 Generated Aspect Running Example Motivation Implementation ArchitectureOverview: Related Work Conclusion Admin. Consoles Delegate Class Compiling Steps Base-Level Class Meta-Level Class Gen. Aspect public aspect Absorbing_DatagramSocket { pointcut DatagramSocket() : call(java.net.DatagramSocket.new()) && …; java.net.DatagramSocket around() throws java.net.SocketException : DatagramSocket() { return new BaseLevel_DatagramSocket(); } pointcut DatagramSocket_int(int p0) : call(java.net.DatagramSocket.new(int)) && args(p0) && …; java.net.DatagramSocket around(int p0) throws java.net.SocketException : DatagramSocket_int(p0) { return new BaseLevel_DatagramSocket(p0); } … // Pointcuts and advices around the static public methods … // Pointcuts and advices around the final public mehtods pointcut getClass(BaseLevel_DatagramSocket targetObj) : …; }

16 A SENS Presentation on Oct. e, 2003Transparent Reflection by S. M. Sadjadi 16 Generated Base-Level Class Running Example Motivation Implementation ArchitectureOverview: Related Work Conclusion Admin. Consoles Delegate Class Gen. Aspect Compiling Steps Meta-Level Class Base-Level Class public class BaseLevel_DatagramSocket extends DatagramSocket implements BaseLevel_Interface { public BaseLevel_DatagramSocket() throws SocketException { super(); initMetaObject(); } public BaseLevel_DatagramSocket(int p0)throws SocketException { super(p0); initMetaObject(); } // Overriding the original methods. public void send(java.net.DatagramPacket p0) throws IOException { if(metaObject == null) { super.send(p0); return; } … Class[] paramType = new Class[1]; paramType[0] = java.net.DatagramPacket.class; Method method = BaseLevel_DatagramSocket.class.getDeclaredMethod( "send", paramType); ChangeableBoolean isReplyReady = new ChangeableBoolean(false); metaObject.invokeMetaMethod(method, tempArgs, isReplyReady); if(!isReplyReady.booleanValue()) super.send(p0); } // Original methods, but with "__Orig" appended to their names. public void Orig_send(java.net.DatagramPacket p0) throws IOException { super.send(p0); return; } }

17 A SENS Presentation on Oct. e, 2003Transparent Reflection by S. M. Sadjadi 17 Generated Meta-Level Class Running Example Motivation Implementation ArchitectureOverview: Related Work Conclusion Admin. Consoles Delegate Class Gen. Aspect Base-Level Class Compiling Steps Meta-Level Class public class MetaLevel_DatagramSocket extends UnicastRemoteObject implements MetaLevel_Interface, DelegateManagement { private Vector delegates = new Vector(); … public synchronized Object invokeMetaMethod(Method method, Object[] args, ChangeableBoolean isReplyReady) throws Throwable { if (isReplyReady.value) return null; if (delegates.size() == 0) throw new MetaMethodIsNotAvailable(method.toString()); Class[] paramType = method.getParameterTypes(); Class[] newParamType = new Class[paramType.length + 1]; for (int i = 0; i < paramType.length; i++) newParamType[i] = paramType[i]; newParamType[paramType.length] = ChangeableBoolean.class; Object[] tempArgs = new Object[args.length + 1]; for(int i=0; i<args.length; i++) tempArgs[i] = args[i]; tempArgs[args.length] = isReplyReady; … if(!delegateFound) // No meta-level method available throw new MetaMethodIsNotAvailable(method.toString()); else return newMethod.invoke(delegates.get(i-1), tempArgs); }

18 A SENS Presentation on Oct. e, 2003Transparent Reflection by S. M. Sadjadi 18 Administrative Consoles Running Example Motivation Implementation ArchitectureOverview: Related Work Conclusion Compiling Steps Delegate Class Gen. Aspect Base-Level Class Meta-Level Class Admin. Consoles

19 A SENS Presentation on Oct. e, 2003Transparent Reflection by S. M. Sadjadi 19 Delegate Class Running Example Motivation Implementation ArchitectureOverview: Related Work Conclusion Admin. Consoles Compiling Steps Gen. Aspect Base-Level Class Meta-Level Class Delegate Class public class Delegate_DatagramSocket_send extends UnicastRemoteObject implements Delegate_Interface, FilterManagement { private Vector filters = null; … public synchronized void send(DatagramPacket datagramPacket, ChangeableBoolean isReplyReady) throws IOException { if (isReplyReady.value) return; Packet packet = new Packet(0, new byte[0], datagramPacket.getData()); Packet[] packetList = new Packet[1]; packetList[0] = packet; int filterCounter = 0; while (filterCounter < filters.size()) { Filter filter = (Filter)filters.get(filterCounter); try { packetList = filter.process(packetList); } catch (FilterMismatchException e) { EventMediator.instance().notify(new FilterMismatchEvent(this, e)); filterCounter--; } filterCounter++; } … isReplyReady.value = true; }

20 A SENS Presentation on Oct. e, 2003Transparent Reflection by S. M. Sadjadi 20 Agenda Related Work Motivation Running Example Architecture Implementation Running Example Motivation Related Work Architecture ImplementationOverview: Conclusion & Future Work Conclusion

21 A SENS Presentation on Oct. e, 2003Transparent Reflection by S. M. Sadjadi 21 Related Work  Our Previous Work in SENS –Adaptive Java & MetaSockets –An Aspect-Oriented Approach to Dynamic Adaptation –SpartanJ  Other Work –Meta Java  Behavioral reflection  Java RMI –Iguana/J  Modifying the JVM –Reflective Java Running Example Motivation Related Work Architecture ImplementationOverview: Conclusion

22 A SENS Presentation on Oct. e, 2003Transparent Reflection by S. M. Sadjadi 22 Conclusion  On-Demand Overhead  Selective Reflection  Transparent Adaptation  Legacy Application  Promoting Separation of Concerns Running Example Motivation Conclusion Architecture ImplementationOverview: Related Work Conclusion Related Work

23 A SENS Presentation on Oct. e, 2003Transparent Reflection by S. M. Sadjadi 23 Future Work  Finishing Remaining Parts –Supporting fields –Test “static” –Test “final”  Applying to “Java RMI”  Dynamic Adaptation of Java Reflection  Toward Multi-Tier and Multi-Layer Adaptation Running Example Motivation Conclusion Architecture ImplementationOverview: Related Work Conclusion

24 A SENS Presentation on Oct. e, 2003Transparent Reflection by S. M. Sadjadi 24 References [1] E. Kasten, P. K. McKinley, S. Sadjadi, and R. Stirewalt. Separating introspection and intercession in metamorphic distributed systems. In Proceedings of the IEEE Workshop on Aspect-Oriented Programming for Distributed Computing (with ICDCS'02), Vienna, Austia, July 2002. [2] Z. Yang, B. Cheng, R. Stirewalt, J. Sowell, S. Sadjadi, and P. McKinley. An aspect-oriented approach to dynamic adaptation. In Proceedings of Workshop On Self-healing Software, Nov. 2002. [3] S. M. Sadjadi, P. K. McKinley, and E. P. Kasten. Architecture and operation of an adaptable communication substrate. In The 9th International Workshop on Future Trends of Distributed Computing Systems (FTDCS '03), May 2003. [4] Douglas C. Schmidt. Middleware for real-time and embedded systems. Communications of the ACM, 45(6), June 2002. Running Example Motivation Architecture ImplementationOverview: Conclusion Related Work

25 A SENS Presentation on Oct. e, 2003Transparent Reflection by S. M. Sadjadi 25 Questions? Thank you! Running Example Motivation Architecture ImplementationOverview: Conclusion Related Work


Download ppt "A SENS Internal Presentation on Friday, October 3, 2003 TRAP Transparent Reflective Aspect Programming SeyedMasoud Sadjadi Supervised by Dr. McKinley"

Similar presentations


Ads by Google