101 Flashcards
(225 cards)
JRE
Acronym for Java Runtime Environment. All you need to run Java programs, but nothing else–notably, no compiler, so you cannot writeJava programs with only a JRE.
A reduced Java bundle that originally had easy redistribution rights. It was intended to be a shippable component for applications and provides a full JVM but no compilation and no utilities. For a long time it was not as commonly used as the JDK, but containerization is changing that as more and more people move toward using lean containers.
JDK
Acronym for Java Development Kit. A JRE plus other tools, most notably a compiler.
A full Java bundle, including compilation (javac) and some useful utilities (tools.jar). It was originally intended for developers but lately more people use a JDK than a JRE because of the utilities.
JVM
a running instance of Java or JRE process; in all of the major operating systems, a JVM is a running process
Native code
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.
Class loader
a Java class with specific native code capabilities that allow code to be loaded into a JVM.
A class loader is also an implied namespace: although there is no human-readable “name” associated with a class loader, a class with the same fully-qualified name in one class loader is different from a class with the same fully-qualified name in a different class loader. Those two classes would have different hashCodes, and they would not be “equals()” to each other.
Classpath
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.
Fully-qualified name
a concatenation of package name, the “.” character, and classname. Also called fully-qualified class name and sometimes abbreviated fqcn.
Hashcode
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 Objectas in java.lang.Object), and that value is typically used as a quick way to determine inequality.
In Java, if equals() == truefor 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)
Class
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 inThe 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.
Superclass
also called a parent class, a superclass has code that is implicitly present in subclasses and is there fore 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. Understanding at least the basics of a class hierarchy directly affects your ability to configure BT detection and backend rules in AppD
Subclass
also called a child class, a subclass has a functionality from the superclass plus additional functionality specified in the subclass itself
Concrete class
a class where all declared methods have implementation code contained within the class. This means a concrete class can be instantiated
Abstract class
a class with declared methods that have no implementations in the class. Instead the class depends on (REQUIRES actually) concrete subclasses to implement the specific methods. An abstract class cannot be directly instantiated.
Enum
a specialised class that can only have very specific values. Enums are often used to describe known things like colour, gender - things th can be (duh!) enumerated
Inner Class
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.
Anonymous 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
Interface
a class method description with no implementations at all. Interfaces are useful in specifications where the actual implementation is left to others.
Package
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
Garbage Collection
a JVM capability for reclaiming memory that is no longer being used.
OSGi
originally formed from the Open Services Gateway initiative, the expansion of the acronym has fallen out of favour, so now it really doesn’t stand for anything, it’s just the short name of the OSGi Alliance.
At a technical level, OSGi isa 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 behaviour 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
JAR
“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.
War
“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
Ear
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
Servlet container
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