David Tiller
Feb 21 2011
Not-So-Secret Java Agents - Part 4
by David Tiller
In previous installments of this series I've concentrated on the -javaagent parameter for agent access. In this installment I'll introduce another way to access the inner workings of a JVM via an undercover agent; the -agentpath and -agentlib parameters.
As prevously presented, agent access was obtained via a Java class that was loaded early in the JVM startup sequence. This class had access to many areas of the JVM, but not all. By using an 'undercover' agent, access to much more fine-grained behavior can be obtained - but at a price.
Tagged: agent, bytecode, classloader, dynamic code modification, Java, java agent, Java VM Tool Interface, javaagent, JVM, JVMTI, log4j, stace trace, thread dump
Feb 15 2011
Not-So-Secret Java Agents - Part 3
by David Tiller
In part 1 of this series, I gave an overview of Java agents and bytecode manipulation and provided a simple agent that adds a System.out.println() message to a method. In part 2, I provided an agent that eliminates calls to log4j log methods in designated packages and log levels. In part 3, I'll show how to augment code to help analyze stack traces by introducing an agent that keeps track of how many instrumented methods are called by each thread.
Tagged: agent, bytecode, classloader, dynamic code modification, Java, java agent, javaagent, JVM, log4j, stace trace, thread dump
Feb 15 2011
Not-So-Secret Java Agents - Part 2
by David Tiller
In my previous blog entry Not-So-Secret Java Agents, Part 1, I gave an introduction to the concepts behind Java agents and provided a simple example that dynamically added a System.out.println() message to a method. In this installment I'll amp up the complexity by implementing an agent that dynamically and selectively eliminates log4j calls.
Tagged: agent, bytecode, classloader, dynamic code modification, Java, java agent, javaagent, JVM, log4j, stace trace, thread dump
Feb 12 2011
Not-So-Secret Java Agents - Part 1
by David Tiller
A little-known option to recent Java VMs holds a fair amount of mystery and quite a lot of power. That option is 'javaagent', and it holds the key to monitoring and profiling JVMs and being able to dynamically modify Java classes as they're being loaded.
Tagged: agent, bytecode, classloader, dynamic code modification, Java, java agent, javaagent, JVM, log4j, stace trace, thread dump
Jun 28 2010
A Riff on the RefFSContextFactory
by David Tiller
As mentioned in my previous blog entry on MQ and Weblogic interoperability titled "Oracle Weblogic 10.3 and IBM MQ - Can They Play Nicely?", the RefFSContextFactory JNDI classes provide the logical link between those two normally separate worlds. Having never delved into the inner workings of this part of the javax class hierarchy, I decided to see what was happening under the covers.
Tagged: javax.naming, JNDI, Reference, Referenceable, RefFSContextFactory
Categories
Popular Tags
Disclaimer
The words and opinions expressed here are those of each article's respective author, and do not necessarily represent the views of CapTech Ventures.