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

What is actionform, An ActionForm is a JavaBean that extends org.apache.str...

An ActionForm is a JavaBean that extends org.apache.struts.action.ActionForm.  ActionForm handles the session state for web application and the ActionForm object is automatically p

Difference between stringbuffer and string class, Define the difference be...

Define the difference between StringBuffer and String class?

Spring MVC Controllers, I want to upload an item object with it''s image is...

I want to upload an item object with it''s image is it possible that i pass a complete object of my Item along with it''s image from my Controller if yes then how may i Do it? an

Arrays, Prompt the user for an int between an upper and lower boundary. Reu...

Prompt the user for an int between an upper and lower boundary. Reuse the validateInput() method from project 2 to validate if the input is in bounds. If it is not, print an error

I need integrate template to java system, I need integrate template to Java...

I need integrate template to Java system Project Description: We have around 60 files for a java backend and want to implement a template, the system is complete it requires

Tictactoe, write complete application to play game tictactoe

write complete application to play game tictactoe

What is aop module, The AOP module is used for developing aspects for our S...

The AOP module is used for developing aspects for our Spring-enabled application. Much of the support has been given by the AOP Alliance in order to ensure the interoperability amo

Mine craft plug-in coder, Mine craft plug-in Coder Project Description: ...

Mine craft plug-in Coder Project Description: Some custom plugging for my Mine craft server. Skills required: Java, Editing

What is setter methods explain with an example, What is Setter Methods expl...

What is Setter Methods explain with an example? Setter methods, also called as mutator methods, merely set the value of a field to a value specified through the argument to the

Help, I can''t figure out how to do this question: "Given two linear equati...

I can''t figure out how to do this question: "Given two linear equations: ax + by + c = 0 and dx + ey + f = 0" solve for x and y. A, b, c, d, e, and f being inputted from the user.

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