Flashcards in Java 1 Cert Deck (71):
Acronym for Java Runtime Environment. All you need to run Java programs, but nothing else – notably, no compiler, so you cannot write Java programs with only a JRE.
Acronym for Java Development Kit. A JRE plus other tools, most notably a compiler.
a running instance of Java; in all of the major operating systems, a JVM is a running process.
code running in a JVM that is not Java code (typically it is written in a C variant). This code typically implements functionality that requires knowledge of underlying operating system capabilities, and therefore is not portable from (for example) Windows to Linux.
(alternatively: class loader) a Java class with specific native code capabilities that allow code to be loaded into a JVM. A classloader is also an implied namespace: although there is no human-readable "name" associated with a classloader, a class with the same fully-qualified name in one classloader is different from a class with the same fully-qualified name in a different classloader. Those two classes would have different hashCodes, and they would not be "equals()" to each other.
similar to a PATH in Unix variants, a classpath is a concatenated set of file paths that form a precedence rule for loading Java code. In Unix variants, if your PATH environment variable includes two entries where a command will be found, the command in the first entry in the PATH is the one used. The same is true for a classpath: if your classpath includes multiple entries containing the same fully-qualified class name, the one that appears first will be used. A lack of understanding of what code exists in each path entry can lead to confusion and also to using unexpected code.
a concatenation of package name, the "." character, and class name. Also called fully-qualified class name and sometimes abbreviated fqcn.
a Java hashcode is fundamentally no different than a hashcode in other languages – i.e. it describes an integer value calculated from attributes of a language construct (in Java, that's an Object as in java.lang.Object), and that value is typically used as a quick way to determine inequality. In Java, if equals() == true for any two objects, then it also MUST be true that the hashCode() values from the two objects are equal. The reverse is NOT NECESSARILY true: if two objects have the same hashCode() values, it is still possible (but unlikely, for a reasonably good hashing function) that the equals() is not true. NOTE: in Java code, the method name is always hashCode() (i.e. camel-case).
a Java object description. In Java, there is a base java.lang.Object class from which every other class is extended. A class is represented on disk in a file format described in The Java Virtual Machine Specification (Java 8 PDF version link). Classes have a simple name and a fully-qualified name. A class can be exactly one of abstract, concrete, or an interface. A class may also be an inner class or an anonymous inner class, those are orthogonal to whether the class is abstract, concrete or an interface. Finally, a class may also be an Enum class.
also called a parent class, a superclass has code that is implicitly present in subclasses and is therefore a building block for more complex functionality. Since superclasses and subclasses form the foundation of object-oriented programming, it is absolutely critical that the concept of class hierarchies is understood in Level 1 certification. Understanding at least the basics of a classes hierarchy directly affects your ability to configure BT detection and backend rules in AppDynamics.
also called a child class, a subclass has functionality from the superclass plus additional functionality specified in the subclass itself.
a class where all declared methods have implementation code contained within the class. This means a concrete class can be instantiated.
a class with declared methods that have no implementations in the class. Instead the class depends on (requires, actually) concrete subclasses to implement the specified methods. An abstract class cannot be directly instantiated.
a specialized class that can only have very specific values. Enums are often used to describe known things like color, gender, states, countries, a set of company locations – things that can be (duh!) enumerated.
a class whose definition lives in another class. This is typically a code style choice done when the developer wants to separate some functionality, but that functionality is only related to a single other class – sort of a helper scenario. By using the inner class construct, the developer signals to others reading the code that the scope of the usefulness of the inner class is limited, so nobody needs to go off reading all sorts of other code to understand how the inner class is used. Inner class names have a "$" character separating the containing class name from the inner class name, so inner class FileParser in containing class Book would have the full name of Book$FileParser – you would need to know that in order to create any type of rule (BT, backend, MIDC, info point) rule using the inner class.
a class with no name. This is done in source code by specifying the code directly inline, with no containing class definition. This is a programming convention often used for callback-type functionality. An anonymous class is always inner, since there is no way to create one without some containing code structure. Anonymous inner class names are generated using an increasing numeric counter, so the first anonymous inner class (reading down from the top in source code) in class Book would be Book$1, then Book$2, etc. It is perfectly legal to use anonymous inner classes in AppDynamics rules, but doing so is inherently fragile: if you declared a rule on inner class Book$3, and then some code was updated so that the Book source code added an anonymous inner class above (reading down from the top) the one you instrumented, then your instrumentation would break when the new code is compiled and deployed. Because of that, it is best to avoid using anonymous inner classes in rules if at all possible.
a class method description with no implementations at all. Interfaces are useful in specifications where the actual implementation is left to others.
a namespace for classes. Classes in the same package are compiled from source code in the same source directory structure on disk, and the package name is typically created from the last few segments of the directory path. This means that it is possible for classes in the same package to come from source code in different directories, as long as the directory names match from the sources root on downward.
a JVM capability for reclaiming memory that is no longer being used.
an acronym originally formed from the Open Services Gateway initiative, the expansion of the acronym has fallen out of favor, so now it really doesn't stand for anything, it's just the short name of the OSGi Alliance. At a technical level, OSGi is a specification for bundling Java code that creates an alternative scheme to the standard classloading capabilities. OSGi was created out of frustration with the default Java classloading functionality and changes some default behavior for what code is visible to other code. For AppDynamics purposes, awareness of OSGi is important because it puts additional requirements on how our Java agent must be configured, and sometimes for what we can do in getter chains. Remember, the very purpose of OSGi was to create an alternate scheme for class bundling and loading; what this means in practice is that the standard rules of classpath resolution and classloader are being changed. OSGi was never bundled into standard JDK functionality, but a similar capability is going into Java 9 in the form of what is being called Modules.
alternatively JAR, a contraction of "Java archive" – a specification for bundling Java code based on the Zip file format. A Jar file minimally contains Java classes and a Manifest.mf file containing meta-information. It may optionally contain other resources such as flat files, images, etc.
a contraction of "Web archive" – a specification for bundling Java code based on the Zip file format. A War file typically contains one or more Jar files, plus other descriptive information. A War file is the unit of deployment for a servlet container. In addition to Jar file contents, a War file contains a web deployment descriptor called web.xml, which maps Java servlet code to URL paths in the servlet container.
a contraction of "Enterprise archive" – a specification for bundling Java code based on the Zip file format. An Ear file typically contains one or more War and/or Jar files, plus other descriptive information. An Ear file is the unit of deployment for a J2EE-compliant application server. In addition to War file components, an Ear file may contain descriptors for EJB deployment.
a program whose primary functionality is to run Java servlets, but typically has less bundled features than a fully-compliant J2EE application server. A servlet container supports war files, but not ear files. The two most common servlet containers are Tomcat and Jetty.
a program with all the functionality of a servlet container, plus support for ear files, EJBs, database connection pools, and (often, but not required) Java messaging. An application server typically does not have enterprise implementations of databases (e.g. Oracle) or JMS brokers (e.g. ActiveMQ), but does have API support for them.
Acronym for Java 2, Enterprise Edition. This refers to all of the functionality and code that exists in J2SE, plus some extension specifications that are typically in the javax package namespace. The entire J2EE ecosystem is roughly comparable to the entire .NET ecosystem, whereas J2SE is more comparable to the core C# platform, without ASP, WCF, WPF, etc.
Acronym for Java 2, Standard Edition. This refers to all of the functionality and code that exists in a JDK download bundle.
an early specification for standard web functionality. Servlets still dominate as the standard of choice for existing Java web functionality, but that is mostly a reflection of how long they have been around. Modern implementations bypass the servlet specification in favor of more efficient web implementations, which gives rise to the current explosion of alternate Java web platforms. Servlets are detected OOTB by AppDynamics with default naming rules and a lot of flexibility for configuring custom naming schemes.
Acronym for Enterprise Java Beans, a specification for creating components that have common capabilities for deployment and interoperability. EJB was the first specification for distributed Java computing, but has fallen out of favor to more modern, efficient implementations.
The term "thread" in Java is a little nuanced, be very clear when you use it. A Thread (capitalized) refers to the java.lang.Thread object, so it is a Java class. But a thread is also a hardware construct (processors can support threads), an operating system construct (all modern operating systems support threads at the operating system level) and even a JVM construct (especially true in earlier JVMs, which appeared at a time when operating system support for threads was lackluster). In practice you will probably never have to differentiate between hardware, OS or Java threads, so it is safe to simplify and view threads as two different things: Threads (the Java object) and threads (the hardware/OS/Java capability). It is very possible for a Thread class object to exist in a running state in several threads at the same time.
a java.lang interface that is mostly used to implement thread behavior. The Thread class itself implements Runnable. The interface specifies exactly one method: run(), which is a void method (has no return value).
Very similar to Runnable. Runnable was the original interface for threads that appeared in the very first JDK. After some time it was realized that there are many situations where it would be more convenient to return a value from the equivalent of the run() method, otherwise people were required to write too much boilerplate code. The solution was the java.util.concurrent.Callable interface, whose only method is call() – but unlike run(), call() returns a value.
the capability to interrogate the Java runtime to find out class names, method names and basic schematic information about Java classes. Introspection is used hand-in-hand with reflection.
the ability to invoke Java operations (i.e. methods) using information gained from introspection. This capability is fundamental to the ability in AppDynamics to use getter chains. An AppDynamics getter chain is simply a text string that is used to find the corresponding Java class/method information (introspection) and then to use that information to invoke operations (reflection). In turn, getter chains are the fundamental building block used to create real-time business metrics, method invocation data collectors, BT and backend split rules, and ultimately Analytics information. Thus is the use of reflection that is behind all of the most powerful features in AppDynamics.
Acronym for Plain Old Java Object, used to refer to any generic object, vs. an object related to a specific framework. For example, "servlet rules" refer to BT detection using Java objects that conform to the servlet framework, whereas "POJO rules" refer to BT detection using any arbitrary Java object.
When you execute something synchronously, you wait for it to finish before moving on to another task. When you execute something asynchronously, you can move on to another task before it finishes.
That being said, in the context of computers this translates into executing a process or task on another "thread." A thread is a series of commands (a block of code) that exists as a unit of work. The operating system can manage multiple threads and assign a thread a piece ("slice") of processor time before switching to another thread to give it a turn to do some work. At its core (pardon the pun), a processor can simply execute a command, it has no concept of doing two things at one time. The operating system simulates this by allocating slices of time to different threads.
Now, if you introduce multiple cores/processors into the mix, then things CAN actually happen at the same time. The operating system can allocate time to one thread on the first processor, then allocate the same block of time to another thread on a different processor. All of this is about allowing the operating system to manage the completion of your task while you can go on in your code and do other things.
Asynchronous programming is a complicated topic because of the semantics of how things tie together when you can do them at the same time. There are numerous articles and books on the subject; have a look!
A specific Java implementation of asynchronous behavior in the JDK. In the JDK an ExecutorService provides Executors, which are different implementations of thread pools.
Publish/Subscribe or Pub/Sub
A loose coupling of two or more components whereby one "publishes" events or messages to some named service, and other components "subscribe" to the service, which means they receive events as they are published. Publishers and subscribers need not (and typically don't) know anything about each other.
Producer/consumer or blocking queue
BlockingQueue is the name of a specific Java class, but the general term is equivalent to producer/consumer: this describes a tighter coupling than Pub/Sub, whereby the provider ("producer") of some resource feeds instances of the resource into some queue, whose size is typically capped. Consumers pull resources out of the queue. In the event of a full queue producers wait until one or more consumers creates space by consuming the resource. In the event of an empty queue consumers wait until one or more producers supply more resources needed.
A construct in a code runtime that enables waiting and notification in asynchronous environments. In Java, any Object can act as the semaphore.
Suspension of code execution that happens when a thread of execution needs to acquire a semaphore, but cannot because other threads are doing the same thing. Blocking is distinct from waiting: when blocking occurs it is typically because there are too many threads trying to acquire the same semaphore. This may be an issue with code architecture, but it can also be a configuration problem if a threadpool size is configurable and set to a high value.
Suspension of code execution that happens when a thread of execution needs to acquire a resource that is limited and currently not available. Waiting is distinct from blocking: when waiting occurs it is typically because too few critical resources are available. A very common cause of waiting is an undersized JDBC connection pool, or any other type of resource pool.
ystems built as Reactive Systems are more flexible, loosely-coupled and scalable. This makes them easier to develop and amenable to change. They are significantly more tolerant of failure and when failure does occur they meet it with elegance rather than disaster. Reactive Systems are highly responsive, giving users effective interactive feedback.
Fire and forget
A style of asynchronous programming whereby the instigator of an action "fires" (i.e. initiates the action) and then does not track execution or completion of the action ("forgets").
A style of asynchronous programming whereby the instigator of an action fires the action ("forks"), then does some other activity while the action is also completing independently, then waits for notification that the action is complete ("joins").
A dynamic service in the Java agent (described here) that is useful for understanding the behavior of individual threads in an asynchronous environment. Using the Thread Profiler Dynamic Service early in a POV with asynchronous functionality can greatly shorten the POV time.
a.k.a. the ByteCodeTransformer log, this log shows every class loaded into the JVM and what (if any) instrumentation was applied. Understanding this log is crucial to diagnosing and fixing problems with over-instrumentation of asynchronous behavior.
The AppDynamics instrumentor for Runnable and Callable classes in Java. The BCT log has entries for async interceptors.
Similar to the Async interceptor, but more general-case: the AppDynamics instrumentor for general asynchronous or cross-process behavior. The BCT log has entries for activity interceptors.
The section of app-agent-config.xml where adjustments to async interceptor config may be done – for example, in a situation where the goal is to exclude some classes from being instrumented with async interceptors.
A JVM language (see the page for JVM languages) that is the language of choice for reactive programming. It is next to impossible to write any Scala code that is not asynchronous.
A package in Scala (also Java) that supports reactive programming semantics using components called Actors.
An asynchronous REST/HTTP framework for Akka actors.
An asynchronous web framework with Java and Scala APIs.
A JVM language popularized by SpringSource (now Pivotal) that is more natural for async functionality than Java (but less so than Scala).
An HTTP, websocket and messaging framework that supports Reactive Programming styles.
A low-level communications framework that supports some ESB semantics, plus web and messaging. Often other frameworks build on top of Netty, using it for the underlying network functionality (both Play and Vert.x do this).
A reactive programming framework for Java. RxNetty is just RxJava enhanced with Netty functionality.
Programming model for big data. A MapReduce program is composed of a Map() procedure (method) that performs filtering and sorting (such as sorting students by first name into queues, one queue for each name) and a Reduce() method that performs a summary operation (such as counting the number of students in each queue, yielding name frequencies).
project develops open-source software for reliable, scalable, distributed computing.
Apache Spark has as its architectural foundation the resilient distributed dataset (RDD), a read-only multiset of data items distributed over a cluster of machines, that is maintained in a fault-tolerant way.
s a distributed stream processing computation framework written predominantly in the Clojure programming language.
he project aims to provide a unified, high-throughput, low-latency platform for handling real-time data feeds. Its storage layer is essentially a "massively scalable pub/sub message queue architected as a distributed transaction log," making it highly valuable for enterprise infrastructures to process streaming data.
is essentially a distributed hierarchical key-value store, which is used to provide a distributed configuration service, synchronization service, and naming registry for large distributed systems.
row-oriented databases. Strictly speaking, relational databases do not have to support SQL, but in practice all of them do.
Structured Query Language, the language of all of the relevant relational databases
on-relational databases, which come in many forms: Column oriented, Document, Key/value, Graph, and Bigtable.
the dominant object/relational mapper, used to accelerate application development with relational databases. The two most important things to know about Hibernate are
AppDynamics works very well with Hibernate, and
Customers using Hibernate frequently have performance problems caused by sub-optimal Hibernate configurations, which AppDynamics solves nicely
a node property. The value is a fully-qualified class name, followed by a forward slash, followed by a method name. Example:
a node property. The value is a fully-qualified class name, followed by a forward slash, followed by a method name. Example:
The interceptor will cause a thread stack trace to appear in the agent log every time the instrumented method is invoked. This gives the following useful information:
the name of the thread running when the method was invoked
the code path to the method call