Java 1 Cert Flashcards
JRE
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.
JDK
Acronym for Java Development Kit. A JRE plus other tools, most notably a compiler.
JVM
a running instance of Java; 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.
Classloader
(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.
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 class name. 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 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).
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 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.
Superclass
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.
Subclass
also called a child class, a subclass has 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 specified methods. An abstract class cannot be directly instantiated.
Enum
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.
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
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.
Jar
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.
War
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.
Ear
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.
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. The two most common servlet containers are Tomcat and Jetty.
Application server
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.
J2EE
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.
J2SE
Acronym for Java 2, Standard Edition. This refers to all of the functionality and code that exists in a JDK download bundle.
Servlet
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.