Was wondering if it is possible to to deploy an applet that will listen to every instances of methods on a server.

For example:
When a message enters the server, i would like to know
1: where it is coming from,
2: who is sending it,
3: which method/s is being invoked
4: and how long it took.

can an applet like this be deployed on the server and attached itself to the runtime? or the server application? or the OS?