Kohsuke Kawaguchi Sun Microsystems, Inc. hk2.dev.java.net, glassfish.dev.java.net. Session ID



Similar documents
GlassFish v3. Building an ex tensible modular Java EE application server. Jerome Dochez and Ludovic Champenois Sun Microsystems, Inc.

Ruby on Rails in GlassFish Sun Microsystems

<Insert Picture Here> GlassFish v3 - A Taste of a Next Generation Application Server

Build management & Continuous integration. with Maven & Hudson

Case Studies of Running the Platform. NetBeans UML Servlet JSP GlassFish EJB

Java EE 6 development with Eclipse, Netbeans, IntelliJ and GlassFish. Ludovic Champenois Oracle Corporation

Learning GlassFish for Tomcat Users

JBI and OpenESB. Introduction to Technology. Michael Czapski Advanced Solutions Architect, SOA/BI/Java CAPS Sun Microsystems, ANZ

WebSphere v5 Administration, Network Deployment Edition

Operations and Monitoring with Spring

OUR COURSES 19 November All prices are per person in Swedish Krona. Solid Beans AB Kungsgatan Göteborg Sweden

APAC WebLogic Suite Workshop Oracle Parcel Service Overview. Jeffrey West Application Grid Product Management

White Paper: Why Upgrade from WebSphere Application Server (WAS) v7 to v8.x?

Glassfish, JAVA EE, Servlets, JSP, EJB

Content. Development Tools 2(63)

OpenShift is FanPaaStic For Java EE. By Shekhar Gulati Promo Code JUDCON.IN

FUSE-ESB4 An open-source OSGi based platform for EAI and SOA

Building a Modular Server Platform with OSGi. Dileepa Jayakody Software Engineer SSWSO2 Inc.

Developing modular Java applications

The Java EE 6 Platform. Alexis Moussine-Pouchkine GlassFish Team

Tomcat 5 New Features

Developing Eclipse Plug-ins* Learning Objectives. Any Eclipse product is composed of plug-ins

Server-side OSGi with Apache Sling. Felix Meschberger Day Management AG 124

IBM WebSphere Server Administration

Chapter 2 SYSTEM MANAGEMENT. SYS-ED/ Computer Education Techniques, Inc.

CI/CD Cheatsheet. Lars Fabian Tuchel Date: 18.March 2014 DOC:

Oracle WebLogic Server

ITG Software Engineering

Oracle WebLogic Foundation of Oracle Fusion Middleware. Lawrence Manickam Toyork Systems Inc

This presentation will provide a brief introduction to Rational Application Developer V7.5.

Project SailFin: Building and Hosting Your Own Communication Server.

Drupal CMS for marketing sites

Meister Going Beyond Maven

An Oracle White Paper May Ready for Business: Oracle GlassFish Server

WebSphere Server Administration Course

<Insert Picture Here> What's New in NetBeans IDE 7.2

Sonatype CLM for Maven. Sonatype CLM for Maven

Glassfish Architecture.

Maven or how to automate java builds, tests and version management with open source tools

JBS-102: Jboss Application Server Administration. Course Length: 4 days

Converting Java EE Applications into OSGi Applications

Oracle im Open Source Kontext Abgrenzung GlassFish vs. JBoss und wozu noch WebLogic?

WEBLOGIC ADMINISTRATION

OSGi Application Development using GlassFish Server. Version 1.5. By: Sanjeeb Sahoo

OpenSSO: Simplify Your Single-Sign-On Needs. Sang Shin Java Technology Architect Sun Microsystems, inc. javapassion.com

Continuous Integration Multi-Stage Builds for Quality Assurance

by Charles Souillard CTO and co-founder, BonitaSoft

Workshop for WebLogic introduces new tools in support of Java EE 5.0 standards. The support for Java EE5 includes the following technologies:

Apache Sling A REST-based Web Application Framework Carsten Ziegeler cziegeler@apache.org ApacheCon NA 2014

GlassFish. Developing an Application Server in Open Source

JBoss JEE5 with EJB3.0 on NonStop. JAVA SIG, San Jose

Service Governance and Virtualization For SOA

Developer s Guide. How to Develop a Communiqué Digital Asset Management Solution

Running and Testing Java EE Applications in Embedded Mode with JupEEter Framework

Creating an application with the Virgo Web Server

PEtALS Quick Start. PEtALS Team Roland NAUDIN - February

Introduction to Sun ONE Application Server 7

Sonatype CLM Enforcement Points - Continuous Integration (CI) Sonatype CLM Enforcement Points - Continuous Integration (CI)

Course Description. Course Audience. Course Outline. Course Page - Page 1 of 5

Integrating VoltDB with Hadoop

Introduction to OSGi and Modularity. InfoSphere MDM, Version 11.x Dany Drouin, Senior Software Engineer MDM

EMC Documentum Content Services for SAP Repository Manager

Mind The Gap! Setting Up A Code Structure Building Bridges

As you learned about in Chapter 1, WebSphere Application Server V6 supports the

SPRING INTERVIEW QUESTIONS

APACHE SLING & FRIENDS TECH MEETUP BERLIN, SEPTEMBER APACHE SLING & SCALA Jochen Fliedner

JBoss Enterprise App. Platforms Roadmap. Rich Sharples Director of Product Management, Red Hat 4th April 2011

An Oracle White Paper March Integrating the SharePoint 2007 Adapter with WebCenter Spaces ( & )

<Insert Picture Here> Java, the language for the future

Building a Service Oriented Architecture with ServiceMix. Jeff Genender CTO Savoir Technologies, Inc

Java EE 6 Ce qui vous attends

Module 13 Implementing Java EE Web Services with JAX-WS

Oracle Fusion Middleware

ARM-BASED PERFORMANCE MONITORING FOR THE ECLIPSE PLATFORM

WebLogic Server Administration

Secure the Web: OpenSSO

Apache Jakarta Tomcat

Top Weblogic Tasks You can Automate Now

Don t get it right, just get it written.

The end. Carl Nettelblad

Continuous integration in OSGi projects using Maven (v:0.1) Sergio Blanco Diez

Jenkins Continuous Build System. Jesse Bowes CSCI-5828 Spring 2012

Java EE Introduction, Content. Component Architecture: Why and How Java EE: Enterprise Java

A Beginners Guide to Fusion Middleware

IBM Boston Technical Exploration Center 404 Wyman Street, Boston MA IBM Corporation

Metastorm BPM Interwoven Integration. Process Mapping solutions. Metastorm BPM Interwoven Integration. Introduction. The solution

Why IBM WebSphere Application Server V8.0?

EclipseLink. Solutions Guide for EclipseLink Release 2.5

InfoSphere Master Data Management operational server v11.x OSGi best practices and troubleshooting guide

Hudson configuration manual

IKAN ALM Architecture. Closing the Gap Enterprise-wide Application Lifecycle Management

Scaling Web Applications in a Cloud Environment using Resin 4.0

This training is targeted at System Administrators and developers wanting to understand more about administering a WebLogic instance.

Rapid Application Development. and Application Generation Tools. Walter Knesel

Witango Application Server 6. Installation Guide for OS X

WebSphere Training Outline

Transcription:

1 Kohsuke Kawaguchi Sun Microsystems, Inc. hk2.dev.java.net, glassfish.dev.java.net Session ID

2 What s GlassFish v3? JavaEE 6 API for REST (JAX-RS) Better web framework support (Servlet 3.0) WebBeans, JSF 2.0, JPA 2.0, JAXB/WS 2.2,... Great development experience Continue great IDE integrations Fast start-up Embed into Maven/Ant Automation support for testing

3 What s GlassFish v3? Scripting Language support Run your RoR apps, Phobos apps, PHP apps, etc. Take advantage of clustering, management, monitoring features built into GlassFish Take advantage of script language support in NetBeans and develop/deploy smoothly into GlassFish Role-based access control in administration A lot more features planned

4 What s GlassFish v3? Modularization Start small, and add modules as you need We offer several tested-together configurations, but you can deviate and add more Single code base to scale from simple servlet container to highly-available clustered application server Foundation for middleware like JBI, SIP service, etc.

5 What s GlassFish v3? Extensibility Repeat what happened to IDEs to application servers Invest in mechanisms to define extensibility Significant infrastructure improvements Make it easier for us to deliver better quality, quickly

6

7

8 Module Subsystem : HK2 Loosely based on the work of JSR 277 Due in Java SE 7 Expert group still evolving the APIs Added hooks to provide extensibility points for other module types : maven OSGi Runs on Java SE 5.

9 What is a Module? Much like NetBeans module system Identified by a name and version Classloaders set up according to dependencies Exports a subset of its content (SPI). Imports other modules identified by name&version Manifest file to represent these information

10 Module Instances At runtime, modules are identified by Module instances. Each Module has 2 ClassLoaders ( facade ) public that users have access to private that load all the module's classes Modules have a list of other module's class loaders to load imported classes. Garbage collection happens when all references to the public class loader are released.

11 Repository Repositories hold modules Can be added and removed at run time Different types supported directory based maven OSGi? Allows GFv3 to boot in many ways From single uber-jar From modules in your maven repository

12 Bootstrapping No more classpath at invocation HK2 bootstraps the module world and hand-over execution into GFv3 to run : java -jar glassfish.jar

13 Build system : maven 2 ( pom.xml ) Each module is built from a maven project pom.xml describes the module s name version dependencies Module metadata created automatically from POM No need to repeat yourself

14 Module Example Declare your module like: <groupid>com.sun.enterprise.glassfish</groupid> <artifactid>gf-web-connector</artifactid> <packaging>hk2-jar</packaging> Module dependency = Maven dependency <dependency> <groupid>com.sun.enterprise.glassfish</groupid> <artifactid>webtier</artifactid> <version>...</version> </dependency>

15 Resulting definition Jar file manifest file Built-By : hudson Created-By : Apache Maven Implementation-Title : gf-web-connector Manifest-Version : 1.0 Extension-Name : gf-web-connector Implementation-Version : 10.0-SNAPSHOT Import-Bundles : com.sun.enterprise.glassfish:webtier, com.sun.enterprise.glassfish:v3-core...

16 Taking more advantages of Maven 2 People no longer need to build the whole thing Just build what you are changing Fetch the rest from Maven repositories Sophisticated build-time processing is easier Code generation Byte-code post processing Annotation processing Metadata generation Running tools like findbugs is easier

17 Better OEM/Customization Possibility Create different distributions of GlassFish easily I want basic servlet container + Web Service I want such and such version of JRuby/Spring/Hibernate with GFv3 Custom branding Useful for specialized use, or large scale deployment

18 Build Repositories HK2 repository has been implemented using a maven repository backend. Build system puts modules in the maven repository. Running GlassFish gets the modules from the maven repository Once we got passed the maven bugs and quirks, build got a lot simpler than in V1/V2 leading to developer productivity.

When you get IoC, why can t we? 19

20 Services, services Service loader pattern on steroid Used extensively to identify extension points like: (... JRuby Application containers (like servlets, Phobos, Administrative commands Admin console

21 Services in V3 Interfaces are declared with @Contract Implementations are declared with @Service Build system generates metadata for runtime @Contract public interface Startup {...} @Service public class ConfigService implements Startup {... }

22 Services can be named @Contract public interface AdminCommand {...} ( Service(name= deploy @ public class DeployCommand implements AdminCommand {... }

23 Dependency Injection Declaratively inject components to fields/methods @Inject ConfigService config; Programmatic retrieval AdminCommand cmd = habitat.get(admincommand.class, list-domains );

24 Configuration Injection Parse configuration XML file as component wiring description (somewhat like XBean or Ant tasks) But JavaEE based Validate XML as we parse it Handle referential integrity JMX integration for management Extensibility built-in Other modules can extend syntax Careful lazy loading

25 @Service life-cycle methods PostContruct interface () postconstruct one method : called after injection is performed and before it is made publicly available PreDestroy interface () predestroy one method : called after the service is removed from public access. Available to all @Service annotated class Handled by the HK2 Runtime.

26 Components Instantiation stages Components Creation () new injection of all @Inject annotated resources () postconstruct extraction of all @Extract annotated resources extraction of the instance Components Destruction removed from public all @Extract annotated resources removed from public predestroy() called

27 Instantiation cascading @Contract public interface Startup {...} Iterable<Startup> startups; startups = componentmgr.getcomponents(startup.class); DeploymentService:java @Service public class DeploymentService implements Startup { @Inject ConfigService config; } Injection of that resource ConfigService.java: @Service public Class ConfigService implements... {...} will trigger instantiation of the service impl

28 Components Scopes Components have scopes. @Service(scope=Singleton.class) public class ConfigService implements Startup {...} Scopes are components... therefore extensible @Service public MyScope implements Scope {...} Scopes defines the boundaries of components visibility.

29

30 Application container life-cycle Each container ship with a connector module containing at least one Sniffer @Contract public interface Sniffer { public boolean handles(file location); public String getmoduletype(); public void setup(string containerhome, Logger logger) throws IOException; public void teardown(); } Each sniffer gets called on deployment request handles() return true when they recognize a module type

31 Application container life-cycle Once a Sniffer is selected : Sniffer::setup() is responsible for the container s installation (eventually from the internet). Sniffer::setup() is also adding HK2 Repositories to the module subsystems. Deployer service is looked up from the new Repositories with the right module type (obtained from Sniffer::getModuleType()). Deployer service is invoked.

32 Application container life-cycle When last application is undeployed Sniffer:tearDown() will be called : should remove any repositories added to the module system. must return in a state where setup() can be called successfully Glassfish v3 will release all references to the container s runtime. Container should be garbage collected.

33 Application Server startup GlassFish v3 startup implemented by Startup interfaces. AppServerStartup.java is a component itself @Inject Startup[] startups;

34 GlassFish shutdown ( Service(name= stop-domain @ public class StopDomainCommand implements AdminCommand, PostConstruct{ @Inject Startup[] startupsvcs; @Inject Habitat habitat; } public void postconstruct() { habitat.removecomponents(startupsvcs); }

35

36 Summary : GlassFish V3 Decomposition of the Java EE application server Fast edit/build/debug cycle Extensible: host all types of containers on JVM Embeddable ( HK2 ) Based on module subsystem Use innovative and reusable components technology Available today in preview

37 For More Information Links http://hk2.dev.java.net/ http://glassfish.dev.java.net/ http://wiki.glassfish.java.net/ Emails jerome.dochez@sun.com kohsuke.kawaguchi@sun.com

38

Back up slides 39

40 Runtime network of class loaders x.jar y.jar z.jar t.jar u.jar v.jar Private CL private CL private CL public CL public CL public CL Module Definitions Name : A Imports: B, C Name : B Imports: Name : C Imports: B Runtime reference

41 Extraction All @Service annotated classes are extracted and available using an @Inject annotation. @Extract to declare extra values extraction On any @Service annotated class Field : @Extract ConfigService config; Getter method : @Extract public ConfigService getconfigservice() {..}