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

Non-final functions in java object class, Normal 0 false fals...

Normal 0 false false false EN-US X-NONE X-NONE

What is jms administered object, A preconfigured JMS object (a resource man...

A preconfigured JMS object (a resource manager connection factory or a destination) formed by an administrator for the use of JMS clients and placed in a JNDI namespace

Toward privacy preserving and collusion resistance, Need Toward Privacy Pre...

Need Toward Privacy Preserving and Collusion Resistance in a Location Proof Updating System Project Description: Today's location-sensitive service relies on user's mobile de

HOW TO MAKE A TRANSCRIPT, Write a java program that computes the scores of ...

Write a java program that computes the scores of 10 students in the following units; 1.Java 2.PHP 3.Python 4.C++ 5.Perl Generate a transcript.

Explain instance variable, What will be the default values of all the eleme...

What will be the default values of all the elements of an array explained as an instance variable? If the array is an array of primitive types, then all the elements of the arr

How are this () and super() used with constructors, How are this () and sup...

How are this () and super() used with constructors? this() Constructors: is used to pointing current class instance. Can be used with methods or variables. Used to call

Explain the for loop in java, Explain the for loop in java? // This is ...

Explain the for loop in java? // This is the Hello program in Java class Hello { public static void main (String args[]) { System.out.print("Hello "); // Say Hello

Describe validate() and reset() methods, Validate() : Used to validate prop...

Validate() : Used to validate properties after they have been populated; known as before FormBean is handed to Action. Returns a collection of ActionError as ActionErrors. Followin

Java class loaders , Classes are attached into the JVM as they are referenc...

Classes are attached into the JVM as they are referenced by name in a class that is already running in the JVM. So, how is the staring class loaded? The very first class is espec

How can you define a consistent web design, How can you define a consistent...

How can you define a consistent web design? Why is it needed? A consistent excellent designed website is generated for common public which permits users to attain what they nee

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