Table of Contents

Performance

Concurrency

Taxonomy of how to achieve good concurrency:

  1. Immutable objects are inherently thread-safe
  2. Prefer high level abstractions: java.util.concurrent
  3. Or resort to low level locking with synchronized blocks and java.util.concurrent.locks
  4. Rarely use low level primitives: volatile variables or java.util.concurrent.atomic classes (This allows for non-blocking synchonization!)
  5. Never do deliberate undersynchronization

General hints

Finding the right JAR

Frameworks like JBoss come with a great number of .jar Files on which your application can depend. Often you know which class you need but you dont know in which jar the class hides. To help you find the jar file you need to include in your build path change to the directory where you expect the .jar and use the command (replace ServiceMBeanSupport with the class you are looking for)

find . -name "*.jar" -exec bash -c "echo {} && jar tvf {} | grep ServiceMBeanSupport " \;