Introduction to Glassfish Peter Doschkinow Senior Java Architect

Introduction to Glassfish Peter Doschkinow Senior Java Architect

<Insert Picture Here> Introduction to GlassFish Peter Doschkinow Senior Java Architect Agenda • GlassFish Overview – History – Adoption • GlassFish Details – GlassFish v2 and v3 architecture – GlassFish v3 differentiators 2 Project Glassfish • Java EE RI – Java EE 5.0, Java EE 6.0 – Included in Java EE SDK • Strong Developer Adoption • Production Quality • Open Source • Strong Community – Sources, bug DBs, discussions at Java.Net – Roadmaps, Architecture Documents GlassFish History © 2010 Oracle Corporation – Proprietary GlassFish Adoption Y/Y Download Growth 12,000,000 Over 24M Downloads since '06 10,000,000 8,000,000 Downloads 6,000,000 4,000,000 2,000,000 0 FY 06 FY 07 FY 08 FY 09 © 2010 Oracle Corporation – Proprietary GlassFish Deployment blogs.sun.com/stories GlassFish Available Today • GlassFish Server Open Source Edition 3.0.1 – The Java EE 6 Reference Implementation • Oracle GlassFish Server 3.0.1 – Based on the Java EE 6 Reference Implementation – Includes enhancements for Enterprise Users – Certified on JRockit – Support by Oracle • GlassFish Server Open Source Edition 2.1.1 • Oracle GlassFish Server 2.1.1 – Includes enhancements for Enterprise Users – Support by Oracle © 2010 Oracle Corporation – Proprietary GlassFish v2 Architecture Admin Client Admin (UI, CLI, JMX) EJB JBI Console Container Container Web Client Web Container Web Server Plugin Grizzly HTTP ORB JMS Other Clients (IIOP, JMS) Admin Infrastructure Java SE 5 or 6 MBean Server • implements Java EE 5 8 GlassFish v2 Profiles • Developer Profile – Single client JVM for Apps, Admin, JMS – No clustering, HA – Faster startup, less resources needed • Enterprise Profile – Distributed Domain Architecture • Domain Administration Server, Node Agents, Instances – Support for clustering and HA – Session replication and Load Balancing – Server JVM, separate JMS broker per instance – Cluster vs. HADB 9 GlassFish v2 Administration Architecture Your RESTfulAMX/JMX AdminAPI Client 10 GlassFish v3 Administration Architecture Your HTTP RESTfulRESTful AdminAPI Client Your RESTfulAMX/JMX AdminAPI Client 11 GlassFish v3 Java EE 6 Themes GlassFish v3 Flexibility Flexible Extensibility Extensible Productivity Productive … … High Developer Productivity Bleeding Edge Technologies Enterprise Quality 12 GlassFish v3 Features • Java EE 6 reference implementation • Beyond Java EE 6 – Developer productivity – Modular – Extensible – Embeddable – Observable – Hot technologies • Metro (Web Services) • Update Center • Scripting 13 GlassFish v3 Architecture Services Container Hundred Kilobyte Kernel 14 Developer Productivity • Getting Started – Small download – Fast startup time – Admin console with intuitive user interface • Using GlassFish – Lightweight – Low resource utilization – Command Line Interface – Maven support – Rapid iterative development – Extensive IDE support 15 GlassFish v3 Tooling • As usual, vi/emacs are Java EE 6 certified – Simpler to use: less code to type, less XML, less Interfaces to synchronized, more default values,... • NetBeans 6.9 Java EE 6 ready • Eclipse GlassFish Plugin 1.50 and above • GlassFish Tools Bundle for Eclipse 1.2 • Oracle Enterprise Pack for Eclipse 11g • IntelliJ IDEA 9 • Build your own: using GlassFish REST Admin APIs 16 Deploying Applications and Components Tools and Options • GlassFish Server Administration Console (web GUI) • asadmin • ant • IDE Plugins • Java Webstart (to deploy Java EE application client SW to client systems) • Automatic deployment • Dynamic Reloading (great during development) © 2010 Oracle Corporation – Proprietary Session Retention • Deployment option to maintain stateful sessions across re-deployments • asadmin redeploy –properties keepSessions=true myapp.war • Greatly simplifies the development paradigm • Integrated in tools 18 GlassFish v3 Modularization and Extensibility • Based on OSGi • Extensible – Extensive APIs to replace or extend features – OSGi also provides extensions capabilities • SOA based architecture – Services implement different types of interfaces • Java SE style with a META-INF/services file • OSGi style • HK2 style – Lazy loading based on usage patterns • Makes it easier to provide support for new container types 19 GlassFish and OSGi • OSGi services can be used in any Java EE application @Resource(mappedName=”checkOsgiService”) CheckService checkService; – Client code portable, does not use any OSGi specific API • Converged applications possible – Dependencies in OSGi – Lifecycle still governed by Java EE • OSGi visibility extended from GlassFish developers to GlassFish users 20 Extending GlassFish v3 with OSGi http://blogs.sun.com/dochez/entry/glassfish_v3_extensions_part_4 • Extend GlassFish with an unmodified Spring dm container • Simple Spring bean implementing the service • Invoke the service from a servlet using standard @Resource injection • Still no use of a GlassFish API • Single runtime for both Spring and full Java EE 21 GlassFish v3 Extensibility – Plugable Console Additional functionality appears when EJB (full) package is installed on top of EJB Lite 22 GlassFish v3 Extensibility – Adding Scripting Frameworks JSF Grails ... Rails Merb ... Django ... Servlet Spec Rack WSGI Web JRuby Jython Container Container Container V3 Kernel Grizzly JVM Key GlassFish v3 Modules Java Framework Python Framework Web Framework Ruby Framework Interface 23 Embedded Glassfish • Start GlassFish inside your Java Application – API for life-cycle, configuration and deployment • Use cases – In Unit Tests (without a GlassFish installation) – As a plugin for Maven 2 project • glassfish-embedded goals: run, start, stop, deploy, ... – As a “custom” app server • Distribution – Standalone jars for web and full profile without a GF installation – Standalone jar for an existing GF installation – Maven plugin: http//download.java.net/maven/glassfish/ 24 Embedded Glassfish @BeforeClass public static void initContainer() { Server.Builder builder = new Server.Builder(); Server server = builder.build(); ContainerBuilder b = server.createConfig(ContainerBuilder.Type.web); server.addContainer(b); File archive = new File("hello.war"); server.getDeployer().deploy(archive); } @Test public static void pingApplication() { ... } 25 RESTful Administration Ready for the Cloud • JAX-RS/Jersey offers REST-Interface to – Runtime configuration (via GET, POST, DELETE) – admin command execution (restart, stop, deploy, etc..) – Monitoring (GET only) • Start at – http://localhost:4848/management/domain http://localhost:4848/monitoring/domain • Use of REST-Clients instead of Admin-GUI – build on your preferred scripting language or tool • Data format as XML, HTML or JSON • Extensible 26 GlassFish v3 Monitoring – based on probes, similar to DTrace – new: client-side scrtipting, REST and DTrace monitoring support 27 Update Center 28 What is Metro? • SOAP Web services stack • Part of GlassFish™ project community • Open Source of production-quality • Built into Glassfish, OpenESB, OpenSSO • Works with any servlet 2.5 compliant web container – WebLogic, WebSphere, JBoss, Tomcat, … • Advanced Interoperability with .Net 3.x/4.0 platform 29 Metro Main Features • JAX-WS 2.2 (new version) • Atomic Transactions – autogen JAXB beans (new) • Centralized config (new) • Security • Monitoring (new) – password derived keys (new) • NetBeans support • Identity • Eclipse support (new) – SSO for services (new) Extensible – Identity delegation (new) • • Reliable Messaging • Standards-based – persistent (new) – addressing metadata (new) – WS-MakeConnection (new) 30 Metro Interoperability Metro .NET 3.x/4.0 Client Client Endpoint Endpoint 31 Metro SOAP Web Services Stack JAX-WS Tooling, NetBeans & Studio Support Software Security Reliability Transactions Metadata Secure Conv. Reliable- Atomic- WSDL Trust Messaging Transactions MEX XWSS Coordination Policy SOAP Based Messaging (WSA, MTOM) JAXB Based XML Data Binding (XSD, XPATH) HTTP TCP SMTP 32 Creating a Web Service package foo; import javax.jws.WebService; @WebService() public class MyService { public String echo(final String x) { return "echo: " + x; } } 33 Adding Security Using NetBeans 34 Metro Interoperability via Standards • Basic Web Services – JCP: JAX-WS 2.2 & JAXB 2.2 – W3C: SOAP 1.1/1.2, WSDL 1.1, WS-Addressing, MTOM – WS-I: Basic Profile 1.x, 2.0, SSBP 1.0, AP 1.0, BSP 1.0 • Enterprise Web Services – Oasis: WS-Security, WS-SecureConversation, WS-Trust, WS-SecurityPolicy, WS-ReliableMessaging, WS-MakeConnection, WS-AtomicTransactions, WS-Coordintation – W3C: WS-Addressing, WS-Policy, WS-Transfer – WS-MetadataExchange • Same specs implemented by MS .NET 35 Why Scripting • Growing popularity of scripting technologies like JRuby, Groovy, Jython, Scala • Reasons – Easy and fast development – Short learning curve – Powerful frameworks – Quick and good enough architectures are often preferred – Focus on specific domain 36 Why Scripting Frameworks on GlassFish • Easier Installation through GF Update Center • Run in native scripting container without overhead • Reuse the high scalability of GF – JDBC connection pooling – Thread pooling – Special benefits for JRuby/RoR • Deploy multiple RoR apps on a single GF instance • Handling of multiple reQuests possible • Reuse the management and monitoring capabilities of GF and GF scripting container • Reuse GF security 37 GlassFish and Groovy/Grails http://wiki.glassfish.java.net/Wiki.jsp?page=GrailsGettingStarted • Installation – Select Grails package from Glassfish Update Center 38 GlassFish and Groovy/Grails • Development of a Grails application – Use Groovy/Grails

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    42 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us