12.07.2015 Views

Beginning Java EE 6 with GlassFish 3, Second Edition

Beginning Java EE 6 with GlassFish 3, Second Edition

Beginning Java EE 6 with GlassFish 3, Second Edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 1 ■ JAVA <strong>EE</strong> 6 AT A GLANCEstraight on top of the Apache Felix implementation. It also runs <strong>with</strong> Equinox or Knopflerfish OSGiruntimes. HK2 (the Hundred-Kilobyte Kernel) abstracts the OSGi module system to providecomponents, which can also be viewed as services. Such services can be discovered and injected atruntime. OSGi is not exposed to <strong>Java</strong> <strong>EE</strong> developers for the time being but it is quite possible to injectOSGi Declarative Services into <strong>Java</strong> <strong>EE</strong> components using the standard @Resource annotation.■ Note OSGi is a standard for dynamic component management and discovery. Applications or components canbe remotely installed, started, stopped, updated, and uninstalled <strong>with</strong>out requiring a reboot. Components can alsodetect the addition or removal of new services dynamically and adapt accordingly. Apache Felix, Equinox, andKnopflerfish are OSGi implementations.This modularity and extensibility is how <strong>GlassFish</strong> v3 can grow from a simple web server listening toadministrative commands to a more capable runtime by simply deploying artifacts such as war files (aweb container is loaded and started, and the application deployed) or EJB jar files (which willdynamically load and start the EJB container). Additionally, the bare-bones server starts in just a fewseconds (less than 5 seconds on reasonably modern hardware), and you only pay for what you use interms of startup time and memory consumption. Starting the web container on the fly takes about 3more seconds, and deployments are often less than 1 second. This all makes <strong>GlassFish</strong> v3 a verydeveloper-friendly environment.No matter how many modules <strong>GlassFish</strong> v3 dynamically loads, the administration console, thecommand-line interface, and the centralized configuration file are all extensible, and each remainsunique. Also worth mentioning is the Grizzly framework, which started out as a nonblocking, I/O-basedHTTP server to become one of the key elements in <strong>GlassFish</strong> as shown in Figure 1-15.Figure 1-15. <strong>GlassFish</strong> v3 architecture35

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!