Write an aspect that counts different kinds of method calls, JAVA Programming

Assignment Help:

 Problem statement Part 1 Write an aspect that counts different kinds of method calls in a Java program. Your aspect should meet the following requirements: 

The aspect should maintain the following counts: (1) calls to public methods, (2) calls to private methods, (3) calls to protected methods, (4) calls to package-private methods (i.e., those that are not public, private, or protected), (5) calls to static methods, calls to (6) non-static methods, (7) calls to all methods. Note that these sets of methods are not mutually exclusive; a method can, for example, be public and non-static.  

Count every method call, excluding the main( ) method that began the program. Be sure to count method calls made within the executions of other methods. (So, if we call a public method x( ) that calls a public method y( ) that calls a public method z( ), that should add 3 to the count of calls to public methods and 3 to the count of calls to all methods.) 

Do not include constructors in the counts. 

Include calls to methods in the Java library, but don't include the method calls that the library methods make to other library methods.  

If the advice in your aspect calls any methods, do not include these method calls in the count.  

As the program is ending, print a message to System.out that indicates the value of each of your counts, in a simple tabular form. The message should appear after any other output generated by the program.

Your aspect should not be specific to a particular program; it should be possible to weave it into any existing Java program. You may not assume that the program will have only one main() method (i.e., only one method with the signature public static void main(String[] args)), nor that main() methods will not call each other, but the output showing the method calls counts should only appear when the last main() method is returning. 

You may assume that the aspect will be compiled together with all of the source code of the program it modifies. However, the other parts of the program must not be dependent upon the contents of the aspect. It should be possible to compile a program with or without the aspect; other than the method counting feature, the program's behavior should not change as a result of include the aspect or leaving it out.

 


Related Discussions:- Write an aspect that counts different kinds of method calls

Write a program to perform multiplication and division, Write a program to ...

Write a program to perform multiplication and division in java? Of course Java could also do multiplication and division. Because most keyboards don't have the times and divisi

Using polymorphism to write a program to display digital clo, using polymor...

using polymorphism to write a program to display digital clock

Write javascript code to convert the number, Write JavaScript code to conve...

Write JavaScript code to convert the number 236.2363611111556 into currency format and JavaScript statement to show output? Var input_amt = 236.2363611111556 ; mid_data = input

Assignments, Define a function that will take a box type of object as argum...

Define a function that will take a box type of object as argument and return a box object whose dimension is 10 times more than the object

Explain what is orm, Object Relational Mapping , its a tool for transaction...

Object Relational Mapping , its a tool for transaction management that requires to be integrated with Spring, Struts etc.Eg : Hibernate, i Batis,JDO etc

What is the use of message object, Message is a light weight message having...

Message is a light weight message having only header and properties and no payload. Therefore if the If the receivers are to be notified about an event, and no data requires to be

Control graphical user interface elements, Introduction In this assign...

Introduction In this assignment you will use Processing to create some geometric objects and graphical user interface (GUI) elements that Processing itself lacks. Processing h

Difference b/w redirecting a request and forwarding request, Both function...

Both functions send you to a new resource like JSP, Servlet etc.     Normal 0 false false false EN-US X-NONE X-NONE

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd