Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Building Modular Cloud Apps with OSGi
Dedication
Preface
Who Should Read This Book
How This Book Is Organized
Conventions Used in This Book
Using Code Examples
Safari® Books Online
How to Contact Us
Acknowledgments
I. Introducing Modularity in Java
1. Modularity Introduction
Dealing with Increasing Complexity
Divide and Conquer
Service Oriented Architecture All Over Again?
A Better Look at Modularity and What It Really Means
Design Time Modularity
Runtime Modularity
Modularity Solutions
OSGi
Jigsaw
JBoss Modules
Maven
Choosing a Solution: OSGi
What Is OSGi?
OSGi in the Real World
Tooling
Bndtools
Maven with the BND Maven Plug-in
Eclipse Tycho
NetBeans and IntelliJ
2. Basic Concepts of OSGi
Hiding Implementations
Import Package Myths
Depending on Other Modules
Service Dynamics
The Bundle Format
Bundle-SymbolicName
Bundle-Name
Bundle-Version
Import-Package
Export-Package
Bundle-Activator
Running an OSGi Application
The Framework Lifecycle
3. Creating the First OSGi Application
Prerequisites
Getting Started
Creating an API Bundle
Creating an OSGi Service
Running the Code
Using the Agenda Service
Service Instances
Understanding Service Dynamics
Services and Bundle States
Debugging Services
Having Multiple Service Implementations
Service Properties
Service Ranking
Service Registration and Deregistration Callbacks
Injecting Multiple Service Implementations and the Whiteboard Pattern
Lifecycle Callbacks
Injecting BundleContext and DependencyManager
4. Advanced OSGi
Semantic Versioning
Provider and Consumer Types
Baselining in Bndtools
Semantic Bundle Versioning
Integration Testing
Writing Integration Tests
Running Integration Tests
Configuring Services
Managed Services
Configuring a Managed Service
Required Configuration
Managed Service Factories
MetaType
Providing Configuration
Log Service
Installing and Using the LogService
Logging Performance
Extender Pattern
Event Admin
Using Event Admin
Aspect Services
The Bundle Cache
5. Pointers and Pitfalls
Better Understanding OSGi Specifications
Require Bundle
Fragment Bundles
Loading Extra System Packages
Profilers, Coverage Tools, and Bootpath Delegation
Dealing with Non-OSGi Libraries
Transitive Dependencies
Classloading Problems in Libraries and Frameworks
Passing the Bundle Classloader Manually
Handling Classpath Scanning
The Low-Level Service API
Registering Services
Using Services
Service Tracker
Dynamic Classloading
DynamicImport-Package
Optional Import-Package
II. Developing Cloud Applications
6. Cloud Application Architecture
Technology Stack
The Amdatu Project
The Layered Architecture
Inside a Bundle
API Bundles
Separation of Concerns
Services Are Responsible for Their Own Data
Bndtools Project Structure
Comparing with SOA Again
Remoting
7. Architectural Capabilities
Maintainability
Extensibility
Scalability
Testability
8. Creating Web Applications
Modular Web Applications
HTTP Service
Taking It One Step Further with Servlets
Adding Filters into the Mix
Handling Web Resources Automatically
Rethinking Web Applications
RESTful Web Services
Getting Started
Implementing an Agenda Resource
Extending the Agenda Resource
Simplified Object Mapping
Self-Documenting RESTful Endpoints
Modularizing RESTful Resources
Modular User Interfaces Using HTML 5
Token Based Security
Using the Token Provider
Web Application Bundles
OpenSocial
Getting Started
Creating Gadgets
9. Persistence
Relational Databases
JDBC
Object Relational Mapping with JPA
NoSQL
Document Stores
Using MongoDB as a Document Store
Getting Started
Implementing a Persistent Service
Using the MongoDB Query System
Taking It Back to the Web
III. Deploying Applications in the Cloud
10. Deployment
Understanding OSGi Runtimes
Choosing an OSGi Framework for Deployment
IaaS versus PaaS versus SaaS
A Modular PaaS
Apache ACE
Installing Apache ACE
Starting Deployment Targets
Creating a Deployment
Incremental Updates
Deploying Configuration
Parameterized Configuration
Solving Deployment Issues
Configuring the Apache ACE Launcher
Autoscaling
11. Alternative Deployment Methods
Packaging an Application as an Executable JAR
Application Servers
Oracle GlassFish Application Server
Using Apache ACE to provision GlassFish
Using the OSGi shell
Interacting with GlassFish Java EE APIs
EJB and JPA
Web Application Bundles and JAX-RS
GlassFish versus a plain OSGi container
RedHat JBoss Application Server
IBM WebSphere® Application Server
Apache Karaf
Eclipse Virgo
A. Example Application
Introduction
Finding and Running the Source Code
Layered View
Component View
Development View
Modularized Frontend
Authentication
Configuration Admin
Scheduled Jobs
Event Admin
Testing
Index
About the Authors
Colophon
Copyright
← Prev
Back
Next →
← Prev
Back
Next →