SlideShare a Scribd company logo
1 of 13
Download to read offline
Embedded GlassFish




Byron Nevins, November 6, 2008
History
●   If embedded is so useful – why didn't we
    offer it in 7, 8, or 9?
●   The Launcher was really an integral/ensnarled part of the
    AppServer. Launcher figured out runtime properties in
    domain.xml and other config files and then passed this info to
    the server JVM.
●   That has changed. Now the launcher is responsible mainly for
    setting JVM startup options. GF itself figures out its own
    configuration.
●   As a result the AppServer can be started from any JVM
Highlights
●   Who?
Development: Kohsuke Kawaguchi, Byron Nevins

Management: Nazrul Islam

●   When?
November 6, 2008

●   What?
Embedded GlassFish Initial Rollout

●   Where?
https://embedded-glassfish.dev.java.net/
Why?

✔   Very fast startup
✔   No GF installation needed.
✔   Able to run inside of a Maven JVM
✔   Support deployment and running of Web Applications
✔   Allow easy HTTP port setting
How?
Embedded means that a very special type of
 GlassFish is run.

●   No fancy class loading frameworks are used.
●   No GF installation is needed or used
●   No persistent Domain is needed or used
Use Cases
●   Ability to run a web application like a regular java application
●   Unit Tests. A servlet can define unit tests that will automatically start an
    embedded GF, deploy the servlet, run and test the servlet and then
    shutdown GF.
●   Fast Jetty-like development
●   Use as a tiny web container. E.g. Hudson
●   Large complex testing frameworks do not require a separate AppServer
    domain to be configured and run.
Examples - API
    A simple Maven project that uses Embedded GlassFish

This is needed inside pom.xml of your project:


    <dependencies>
        <dependency>
            <groupId>org.glassfish.embedded</groupId>
            <artifactId>glassfish-embedded-all</artifactId>
            <version>3.0-Prelude-SNAPSHOT</version>
        </dependency>
    </dependencies>


That's all you need in order to use Embedded GlassFish in your code!
Examples - API
        A simple Maven project that uses Embedded GlassFish
Now create a main Java class and add this (no error checking for clarity):
import org.glassfish.embed.*;

public static void Main(String[] myWarFiles) {
        try {
            Server myGF = new Server(9999);

              for(String fname : myWarFiles)
                    myGF.deploy(new File(fname));

              myGF.start();


              // do stuff here!

             myGF.stop();
         }
         catch(Exception e) {
             System.out.println(quot;Got an Exception: quot; + e);
         }
    }


The Web Applications will be available and listening for HTTP traffic at port 9999 (remove
  the stop() call of course!)
You can look at an actual smoketest that we use that does exactly this:
Ref: https://svn.dev.java.net/svn/glassfish-svn/branches/v3_prelude_release/embedded/packager/smoketests
Examples - API
           A non-Maven project that uses Embedded GlassFish
In this case you need to get the all-in-one Embedded jar here:

Nightly: http://download.java.net/glassfish/v3-prelude/embedded/nightly/

Promoted: http://download.java.net/glassfish/v3-prelude/embedded/promoted/

Let's say you download the latest nightly which is named “latest.jar”

You write code exactly as in the previous slide except you need to add latest.jar to the classpath of your Java compiler.
You run your code simply by adding latest.jar to the classpath.
Here is a simple example Windows script:

setlocal
set CP=myEmbeddedApp.jar;latest.jar
set DEBUG=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1322

java %DEBUG% -cp quot;%CP%quot; com.yourCompany.Main %*

endlocal
Examples - API-Helper
You can go one level higher than the Embedded GlassFish API. We have a few helper classes that make it even simpler.


Sample Code


ScatteredWar swar = new ScatteredWar(.....);
EmbeddedInfo info = new EmbeddedInfo();
info.addScatteredWar(swar);
info.addArchive(new File(“myOtherApp.war”);
info.setHttpPort(12345);

EmbeddedRunner runner = new EmbeddedRunner(info);
runner.run();
Examples – No Java
Would you like to try Embedded GlassFish but you don't want to write any Java code?

No Problem!
Say you have downloaded the Embedded GlassFish jar file as “latest.jar”


java -jar latest.jar -p 3456 myapp1.war myapp2.war
This will start Embedded GlassFish listening at port 3456 with the 2 applications
   deployed.
Java -jar latest.jar –help (or no argument at all) will show helpful information.
Schedule
Immediate:
JDBC/JavaDB support has just been added. An API for configuring JDBC will be in
  place this week.
Support for supplying your own configuration in domain.xml will be added this week.

November 14, 2008
Support for
●   Servlet 2.5
●   JSP 2.1
●   JSF 1.2
●   JSTL 1.1
●   JPA
●   JDBC 4.0
References
●   The Embedded GlassFish project: https://embedded-glassfish.dev.java.net
●
    Schedule:       http://wiki.java.net/bin/view/Projects/EmbeddedGlassFishSchedule

●
    Source Code:     https://svn.dev.java.net/svn/glassfish-svn/branches/v3_prelude_release/embedded

●
    Arun Gupta's Blog on Embedded
    http://weblogs.java.net/blog/arungupta/archive/2008/05/embeddable_glas.html

●   API JAVADOC: https://embedded-glassfish.dev.java.net/nonav/gf-embedded-api/apidocs/
●   Build Instructions: http://wiki.java.net/bin/view/Projects/BuildInstructions
●   Issue Tracker: https://embedded-glassfish.dev.java.net/servlets/ProjectIssues
●   Mailing Lists: https://embedded-glassfish.dev.java.net/servlets/ProjectMailingListList
●   Promoted Builds: http://download.java.net/glassfish/v3-prelude/embedded/promoted/
●   Nightly Builds: http://download.java.net/glassfish/v3-prelude/embedded/nightly/

More Related Content

What's hot

Docker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationDocker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationGiacomo Vacca
 
Deploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
Deploying 3 times a day without a downtime @ Rocket Tech Summit in BerlinDeploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
Deploying 3 times a day without a downtime @ Rocket Tech Summit in BerlinAlessandro Nadalin
 
Continuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
Continuous Delivery in Enterprise Environments using Docker, Ansible and JenkinsContinuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
Continuous Delivery in Enterprise Environments using Docker, Ansible and JenkinsMarcel Birkner
 
jbang: Unleash the power of Java for shell scripting
jbang: Unleash the power of Java for shell scriptingjbang: Unleash the power of Java for shell scripting
jbang: Unleash the power of Java for shell scriptingRed Hat Developers
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for DevelopersAntons Kranga
 
JCConf 2015 workshop 動手玩 Java 專案建置工具
JCConf 2015 workshop 動手玩 Java 專案建置工具JCConf 2015 workshop 動手玩 Java 專案建置工具
JCConf 2015 workshop 動手玩 Java 專案建置工具謝 宗穎
 
How To Set a Vagrant Development System
How To Set a Vagrant Development SystemHow To Set a Vagrant Development System
How To Set a Vagrant Development SystemPaul Bearne
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins UsersJules Pierre-Louis
 
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)Andrew Bayer
 
Continuous delivery with jenkins, docker and exoscale
Continuous delivery with jenkins, docker and exoscaleContinuous delivery with jenkins, docker and exoscale
Continuous delivery with jenkins, docker and exoscaleJulia Mateo
 
State of the Jenkins Automation
State of the Jenkins AutomationState of the Jenkins Automation
State of the Jenkins AutomationJulien Pivotto
 
OpenShift: Java EE in the clouds
OpenShift: Java EE in the cloudsOpenShift: Java EE in the clouds
OpenShift: Java EE in the cloudsMax Andersen
 
Modern Infrastructure from Scratch with Puppet
Modern Infrastructure from Scratch with PuppetModern Infrastructure from Scratch with Puppet
Modern Infrastructure from Scratch with PuppetPuppet
 
Improve your Java Environment with Docker
Improve your Java Environment with DockerImprove your Java Environment with Docker
Improve your Java Environment with DockerHanoiJUG
 
Deploy Node.js application in Heroku using Eclipse
Deploy Node.js application in Heroku using EclipseDeploy Node.js application in Heroku using Eclipse
Deploy Node.js application in Heroku using EclipseJitendra Zaa
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesLarry Cai
 
Devops Boise - Israel Shirk - Pragmatic Migration to Infrastructure As Code
Devops Boise - Israel Shirk - Pragmatic Migration to Infrastructure As CodeDevops Boise - Israel Shirk - Pragmatic Migration to Infrastructure As Code
Devops Boise - Israel Shirk - Pragmatic Migration to Infrastructure As CodeIsrael Shirk
 
Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment Arun prasath
 
Jenkins 101: Continuos Integration with Jenkins
Jenkins 101: Continuos Integration with JenkinsJenkins 101: Continuos Integration with Jenkins
Jenkins 101: Continuos Integration with JenkinsAll Things Open
 

What's hot (20)

Docker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationDocker and Puppet for Continuous Integration
Docker and Puppet for Continuous Integration
 
Deploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
Deploying 3 times a day without a downtime @ Rocket Tech Summit in BerlinDeploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
Deploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
 
Continuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
Continuous Delivery in Enterprise Environments using Docker, Ansible and JenkinsContinuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
Continuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
 
jbang: Unleash the power of Java for shell scripting
jbang: Unleash the power of Java for shell scriptingjbang: Unleash the power of Java for shell scripting
jbang: Unleash the power of Java for shell scripting
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for Developers
 
JCConf 2015 workshop 動手玩 Java 專案建置工具
JCConf 2015 workshop 動手玩 Java 專案建置工具JCConf 2015 workshop 動手玩 Java 專案建置工具
JCConf 2015 workshop 動手玩 Java 專案建置工具
 
How To Set a Vagrant Development System
How To Set a Vagrant Development SystemHow To Set a Vagrant Development System
How To Set a Vagrant Development System
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users
 
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
 
Continuous delivery with jenkins, docker and exoscale
Continuous delivery with jenkins, docker and exoscaleContinuous delivery with jenkins, docker and exoscale
Continuous delivery with jenkins, docker and exoscale
 
Vagrant
VagrantVagrant
Vagrant
 
State of the Jenkins Automation
State of the Jenkins AutomationState of the Jenkins Automation
State of the Jenkins Automation
 
OpenShift: Java EE in the clouds
OpenShift: Java EE in the cloudsOpenShift: Java EE in the clouds
OpenShift: Java EE in the clouds
 
Modern Infrastructure from Scratch with Puppet
Modern Infrastructure from Scratch with PuppetModern Infrastructure from Scratch with Puppet
Modern Infrastructure from Scratch with Puppet
 
Improve your Java Environment with Docker
Improve your Java Environment with DockerImprove your Java Environment with Docker
Improve your Java Environment with Docker
 
Deploy Node.js application in Heroku using Eclipse
Deploy Node.js application in Heroku using EclipseDeploy Node.js application in Heroku using Eclipse
Deploy Node.js application in Heroku using Eclipse
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutes
 
Devops Boise - Israel Shirk - Pragmatic Migration to Infrastructure As Code
Devops Boise - Israel Shirk - Pragmatic Migration to Infrastructure As CodeDevops Boise - Israel Shirk - Pragmatic Migration to Infrastructure As Code
Devops Boise - Israel Shirk - Pragmatic Migration to Infrastructure As Code
 
Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment
 
Jenkins 101: Continuos Integration with Jenkins
Jenkins 101: Continuos Integration with JenkinsJenkins 101: Continuos Integration with Jenkins
Jenkins 101: Continuos Integration with Jenkins
 

Viewers also liked

Viewers also liked (7)

Pelegri Desarrollando en una nueva era de software
Pelegri   Desarrollando en una nueva era de software Pelegri   Desarrollando en una nueva era de software
Pelegri Desarrollando en una nueva era de software
 
Csumb capstone-fall2016
Csumb capstone-fall2016Csumb capstone-fall2016
Csumb capstone-fall2016
 
Digital activitymanagement
Digital activitymanagementDigital activitymanagement
Digital activitymanagement
 
Progress next iot_pelegri
Progress next iot_pelegriProgress next iot_pelegri
Progress next iot_pelegri
 
Market trends in IT - exchange cala - October 2015
Market trends in IT - exchange cala - October 2015Market trends in IT - exchange cala - October 2015
Market trends in IT - exchange cala - October 2015
 
My experience with embedding PostgreSQL
 My experience with embedding PostgreSQL My experience with embedding PostgreSQL
My experience with embedding PostgreSQL
 
The impact of IOT - exchange cala - 2015
The impact of IOT - exchange cala - 2015The impact of IOT - exchange cala - 2015
The impact of IOT - exchange cala - 2015
 

Similar to GlassFish Embedded API

Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-AppsSelenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-Appschrisb206 chrisb206
 
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...Jesse Gallagher
 
What's New in AppFuse 2.0
What's New in AppFuse 2.0What's New in AppFuse 2.0
What's New in AppFuse 2.0Matt Raible
 
Enterprise Build And Test In The Cloud
Enterprise Build And Test In The CloudEnterprise Build And Test In The Cloud
Enterprise Build And Test In The CloudCarlos Sanchez
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With SeleniumTesting Java Web Apps With Selenium
Testing Java Web Apps With SeleniumMarakana Inc.
 
eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introductionvstorm83
 
Andy Bosch - JavaServer Faces in the cloud
Andy Bosch -  JavaServer Faces in the cloudAndy Bosch -  JavaServer Faces in the cloud
Andy Bosch - JavaServer Faces in the cloudAndy Bosch
 
Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2Abhishek Gupta
 
Java, Eclipse, Maven & JSF tutorial
Java, Eclipse, Maven & JSF tutorialJava, Eclipse, Maven & JSF tutorial
Java, Eclipse, Maven & JSF tutorialRaghavan Mohan
 
Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010
Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010
Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010JUG Lausanne
 
Play Support in Cloud Foundry
Play Support in Cloud FoundryPlay Support in Cloud Foundry
Play Support in Cloud Foundryrajdeep
 
Building a Spring Boot Application - Ask the Audience!
Building a Spring Boot Application - Ask the Audience!Building a Spring Boot Application - Ask the Audience!
Building a Spring Boot Application - Ask the Audience!🎤 Hanno Embregts 🎸
 
Java servlet technology
Java servlet technologyJava servlet technology
Java servlet technologyMinal Maniar
 
Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2Abhishek Gupta
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applicationshchen1
 

Similar to GlassFish Embedded API (20)

EmbbededGF@JavaOneHyd
EmbbededGF@JavaOneHydEmbbededGF@JavaOneHyd
EmbbededGF@JavaOneHyd
 
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-AppsSelenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
 
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
 
What's New in AppFuse 2.0
What's New in AppFuse 2.0What's New in AppFuse 2.0
What's New in AppFuse 2.0
 
Enterprise Build And Test In The Cloud
Enterprise Build And Test In The CloudEnterprise Build And Test In The Cloud
Enterprise Build And Test In The Cloud
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With SeleniumTesting Java Web Apps With Selenium
Testing Java Web Apps With Selenium
 
eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introduction
 
Using Maven2
Using Maven2Using Maven2
Using Maven2
 
Andy Bosch - JavaServer Faces in the cloud
Andy Bosch -  JavaServer Faces in the cloudAndy Bosch -  JavaServer Faces in the cloud
Andy Bosch - JavaServer Faces in the cloud
 
Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2
 
Jsp and jstl
Jsp and jstlJsp and jstl
Jsp and jstl
 
GlassFish and JavaEE, Today and Future
GlassFish and JavaEE, Today and FutureGlassFish and JavaEE, Today and Future
GlassFish and JavaEE, Today and Future
 
Java, Eclipse, Maven & JSF tutorial
Java, Eclipse, Maven & JSF tutorialJava, Eclipse, Maven & JSF tutorial
Java, Eclipse, Maven & JSF tutorial
 
Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010
Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010
Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010
 
Play Support in Cloud Foundry
Play Support in Cloud FoundryPlay Support in Cloud Foundry
Play Support in Cloud Foundry
 
Spring boot
Spring bootSpring boot
Spring boot
 
Building a Spring Boot Application - Ask the Audience!
Building a Spring Boot Application - Ask the Audience!Building a Spring Boot Application - Ask the Audience!
Building a Spring Boot Application - Ask the Audience!
 
Java servlet technology
Java servlet technologyJava servlet technology
Java servlet technology
 
Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 

More from Eduardo Pelegri-Llopart

What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...
What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...
What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...Eduardo Pelegri-Llopart
 
What is the Internet of Things and How it Impacts You
What is the Internet of Things and How it Impacts YouWhat is the Internet of Things and How it Impacts You
What is the Internet of Things and How it Impacts YouEduardo Pelegri-Llopart
 
Ehcache Architecture, Features And Usage Patterns
Ehcache Architecture, Features And Usage PatternsEhcache Architecture, Features And Usage Patterns
Ehcache Architecture, Features And Usage PatternsEduardo Pelegri-Llopart
 

More from Eduardo Pelegri-Llopart (20)

Juggling at freenome
Juggling   at freenomeJuggling   at freenome
Juggling at freenome
 
IOT - Presentation to PEP @ Progress
IOT - Presentation to PEP @ ProgressIOT - Presentation to PEP @ Progress
IOT - Presentation to PEP @ Progress
 
Node.js as an IOT Bridge
Node.js as an IOT BridgeNode.js as an IOT Bridge
Node.js as an IOT Bridge
 
What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...
What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...
What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...
 
What is the Internet of Things and How it Impacts You
What is the Internet of Things and How it Impacts YouWhat is the Internet of Things and How it Impacts You
What is the Internet of Things and How it Impacts You
 
Community Update 25 Mar2010 - English
Community Update 25 Mar2010 - EnglishCommunity Update 25 Mar2010 - English
Community Update 25 Mar2010 - English
 
GlassFish Community Update 25 Mar2010
GlassFish Community Update 25 Mar2010GlassFish Community Update 25 Mar2010
GlassFish Community Update 25 Mar2010
 
Glass Fish Portfolio C1 West V3.Mini
Glass Fish Portfolio C1 West V3.MiniGlass Fish Portfolio C1 West V3.Mini
Glass Fish Portfolio C1 West V3.Mini
 
Virtual Box Aquarium May09
Virtual Box Aquarium May09Virtual Box Aquarium May09
Virtual Box Aquarium May09
 
Introduction To Web Beans
Introduction To Web BeansIntroduction To Web Beans
Introduction To Web Beans
 
Ehcache Architecture, Features And Usage Patterns
Ehcache Architecture, Features And Usage PatternsEhcache Architecture, Features And Usage Patterns
Ehcache Architecture, Features And Usage Patterns
 
OpenDS Primer Aquarium
OpenDS Primer AquariumOpenDS Primer Aquarium
OpenDS Primer Aquarium
 
Fuji Overview
Fuji OverviewFuji Overview
Fuji Overview
 
Nuxeo 5.2 Glassfish
Nuxeo 5.2 GlassfishNuxeo 5.2 Glassfish
Nuxeo 5.2 Glassfish
 
OpenSSO Deployments
OpenSSO DeploymentsOpenSSO Deployments
OpenSSO Deployments
 
OpenSSO Tech Overview Aquarium
OpenSSO Tech Overview AquariumOpenSSO Tech Overview Aquarium
OpenSSO Tech Overview Aquarium
 
OpenSSO Roadmap Aquarium
OpenSSO Roadmap AquariumOpenSSO Roadmap Aquarium
OpenSSO Roadmap Aquarium
 
ICEfaces and JSF 2.0 on GlassFish
ICEfaces and JSF 2.0 on GlassFishICEfaces and JSF 2.0 on GlassFish
ICEfaces and JSF 2.0 on GlassFish
 
20090315 Comet
20090315 Comet20090315 Comet
20090315 Comet
 
2009 02 26 Metro Glass Fish Webinar
2009 02 26 Metro Glass Fish Webinar2009 02 26 Metro Glass Fish Webinar
2009 02 26 Metro Glass Fish Webinar
 

Recently uploaded

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 

Recently uploaded (20)

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 

GlassFish Embedded API

  • 2. History ● If embedded is so useful – why didn't we offer it in 7, 8, or 9? ● The Launcher was really an integral/ensnarled part of the AppServer. Launcher figured out runtime properties in domain.xml and other config files and then passed this info to the server JVM. ● That has changed. Now the launcher is responsible mainly for setting JVM startup options. GF itself figures out its own configuration. ● As a result the AppServer can be started from any JVM
  • 3. Highlights ● Who? Development: Kohsuke Kawaguchi, Byron Nevins Management: Nazrul Islam ● When? November 6, 2008 ● What? Embedded GlassFish Initial Rollout ● Where? https://embedded-glassfish.dev.java.net/
  • 4. Why? ✔ Very fast startup ✔ No GF installation needed. ✔ Able to run inside of a Maven JVM ✔ Support deployment and running of Web Applications ✔ Allow easy HTTP port setting
  • 5. How? Embedded means that a very special type of GlassFish is run. ● No fancy class loading frameworks are used. ● No GF installation is needed or used ● No persistent Domain is needed or used
  • 6. Use Cases ● Ability to run a web application like a regular java application ● Unit Tests. A servlet can define unit tests that will automatically start an embedded GF, deploy the servlet, run and test the servlet and then shutdown GF. ● Fast Jetty-like development ● Use as a tiny web container. E.g. Hudson ● Large complex testing frameworks do not require a separate AppServer domain to be configured and run.
  • 7. Examples - API A simple Maven project that uses Embedded GlassFish This is needed inside pom.xml of your project: <dependencies> <dependency> <groupId>org.glassfish.embedded</groupId> <artifactId>glassfish-embedded-all</artifactId> <version>3.0-Prelude-SNAPSHOT</version> </dependency> </dependencies> That's all you need in order to use Embedded GlassFish in your code!
  • 8. Examples - API A simple Maven project that uses Embedded GlassFish Now create a main Java class and add this (no error checking for clarity): import org.glassfish.embed.*; public static void Main(String[] myWarFiles) { try { Server myGF = new Server(9999); for(String fname : myWarFiles) myGF.deploy(new File(fname)); myGF.start(); // do stuff here! myGF.stop(); } catch(Exception e) { System.out.println(quot;Got an Exception: quot; + e); } } The Web Applications will be available and listening for HTTP traffic at port 9999 (remove the stop() call of course!) You can look at an actual smoketest that we use that does exactly this: Ref: https://svn.dev.java.net/svn/glassfish-svn/branches/v3_prelude_release/embedded/packager/smoketests
  • 9. Examples - API A non-Maven project that uses Embedded GlassFish In this case you need to get the all-in-one Embedded jar here: Nightly: http://download.java.net/glassfish/v3-prelude/embedded/nightly/ Promoted: http://download.java.net/glassfish/v3-prelude/embedded/promoted/ Let's say you download the latest nightly which is named “latest.jar” You write code exactly as in the previous slide except you need to add latest.jar to the classpath of your Java compiler. You run your code simply by adding latest.jar to the classpath. Here is a simple example Windows script: setlocal set CP=myEmbeddedApp.jar;latest.jar set DEBUG=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1322 java %DEBUG% -cp quot;%CP%quot; com.yourCompany.Main %* endlocal
  • 10. Examples - API-Helper You can go one level higher than the Embedded GlassFish API. We have a few helper classes that make it even simpler. Sample Code ScatteredWar swar = new ScatteredWar(.....); EmbeddedInfo info = new EmbeddedInfo(); info.addScatteredWar(swar); info.addArchive(new File(“myOtherApp.war”); info.setHttpPort(12345); EmbeddedRunner runner = new EmbeddedRunner(info); runner.run();
  • 11. Examples – No Java Would you like to try Embedded GlassFish but you don't want to write any Java code? No Problem! Say you have downloaded the Embedded GlassFish jar file as “latest.jar” java -jar latest.jar -p 3456 myapp1.war myapp2.war This will start Embedded GlassFish listening at port 3456 with the 2 applications deployed. Java -jar latest.jar –help (or no argument at all) will show helpful information.
  • 12. Schedule Immediate: JDBC/JavaDB support has just been added. An API for configuring JDBC will be in place this week. Support for supplying your own configuration in domain.xml will be added this week. November 14, 2008 Support for ● Servlet 2.5 ● JSP 2.1 ● JSF 1.2 ● JSTL 1.1 ● JPA ● JDBC 4.0
  • 13. References ● The Embedded GlassFish project: https://embedded-glassfish.dev.java.net ● Schedule: http://wiki.java.net/bin/view/Projects/EmbeddedGlassFishSchedule ● Source Code: https://svn.dev.java.net/svn/glassfish-svn/branches/v3_prelude_release/embedded ● Arun Gupta's Blog on Embedded http://weblogs.java.net/blog/arungupta/archive/2008/05/embeddable_glas.html ● API JAVADOC: https://embedded-glassfish.dev.java.net/nonav/gf-embedded-api/apidocs/ ● Build Instructions: http://wiki.java.net/bin/view/Projects/BuildInstructions ● Issue Tracker: https://embedded-glassfish.dev.java.net/servlets/ProjectIssues ● Mailing Lists: https://embedded-glassfish.dev.java.net/servlets/ProjectMailingListList ● Promoted Builds: http://download.java.net/glassfish/v3-prelude/embedded/promoted/ ● Nightly Builds: http://download.java.net/glassfish/v3-prelude/embedded/nightly/