SlideShare a Scribd company logo
 
Boosting Productivity using Embedded GlassFish Prasad Subramanian Software Engineering Manager
The following is intended to outline our general product direction. It is intended for information purposes only,  and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle
Agenda Demo
What did we do here ?
How did we do it
What is Embedded GlassFish API
Distributions
Maven plugin Use case for Embedded GlassFish
State of Embedded GlassFish
What did we do here Started GlassFish within our test program
Deployed an application which was not in an archive form
Access the Servlet from the test program
Undeployed  the application
Stopped GlassFish
All this happened in the VM in which the test program was runnning
How did we do that ? We  “embedded”  GlassFish in our test program using a set of APIs collectively known as Embedded GlassFish APIs Embedded GlassFish allows us to start GlassFish within a JVM  or bundle GlassFish as a library along with our  applications
What is Embedded GlassFish A set of APIs To configure, manage GlassFish and its container from a host program A distribution To provide the GlassFish runtime to the users Plugins for maven Tooling support for embedding GlassFish using maven
API
The Embedded APIs Bootstrap API An API to manage the lifecycle of GlassFish and configure it Scattered Archive API to abstract an archive out of distributed content Web Container API API to manage and configure the Web Container specific artifacts Advanced Plugabbility SPI to allow plugging in of custom GlassFish runtime Embedded EJB API API exposed by the EJB specification to manage an Embedded EJB container alone
Bootstrap API Scope Obtain an instance of a GlassFish runtime
Manage the lifecycle ( start / stop)
Allow configuration
Allow deploy and undeploy operations Package org.glassfish.embeddable
Bootstrap API Key interfaces Glassfish Represents a GlassFish instance  & allows lifecycle operations Deployer Provides the deployer to deploy applications CommandRunner Programmatic interface for the CLI 'asadmin' CommandResult Encapsulates the result of the command run via CommandRunner
Bootstrap API Key classes GlassFishRuntime Represents the runtime environment.  Factory class for GlassFish instances BootstrapProperties Encapsulates the properties for configuring the GlassFishRuntime GlassFishProperties Encapsulates the properties for configuring GlassFish instance
Code sample A code sample sums it up  // Set the properties to configure GlassFish instance GlassFishProperties gfProps = new GlassFishProperties(); gfProps.setPort("http-listener", 8080);  // Get the GlassFishRuntime and get a GlassFish instance GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish(gfProps); //Start the GlassFish glassfish.start(); //get a Deployer instance and deploy the application Deployer deployer = glassfish.getDeployer(); deployer.deploy(new File("simple.war"));  // Stops the GlassFish instance glassfish.stop();
Code Sample Use of the CommandRunner // Set the properties to configure GlassFish instance CommandRunner commandRunner = glassfish.getCommandRunner(); CommandResult commandResult =  commandRunner.run("create-jdbc-resource", "--connectionpoolid=DerbyPool", "jdbc/DerbyPool");
Setting Install Root and Instance Root Install Root -  location of GlassFish binaries Instance Root – location of domain specific configuration // Bootstrap the GlassFish runtime pointing to 3.1 installation BootstrapProperties bsProps = new BootstrapProperties(); bsProps.setInstallRoot(System.getenv("GF_INSTALLATION")); GlassFishRuntime gfRuntime = GlassFishRuntime.bootstrap(bsProps); // Point the GlassFish instance to the domain named domain1 GlassFishProperties gfProps = new GlassFishProperties(); gfProps.setInstanceRoot(System.getEnv("GF_INSTALLATION") + "/domains/domain1"); GlassFish glassfish = gfRuntime.newGlassFish(gfProps);
Key methods in GlassFish  getService(ServiceType, ServiceName) Returns an instance of a service like web container or deployer getStatus() Returns the status of GlassFish instance
Valid values DISPOSED, INIT, STARTED, STARTIN, STOPPED, STOPPING dispose() Cleans up any temporary files created by GlassFish
Once dispose() is called, further invocations of start() throw an exception
Scattered Archive API Package :  org.glassfish.embeddable.archive

More Related Content

What's hot (20)

Introduction to maven
Introduction to mavenIntroduction to maven
Introduction to maven
Manos Georgopoulos
 
Spring - CDI Interop
Spring - CDI InteropSpring - CDI Interop
Spring - CDI Interop
Ray Ploski
 
JavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオンJavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオン
haruki ueno
 
Arquillian
ArquillianArquillian
Arquillian
nukeevry1
 
Spring Boot and Microservices
Spring Boot and MicroservicesSpring Boot and Microservices
Spring Boot and Microservices
seges
 
How to customize Spring Boot?
How to customize Spring Boot?How to customize Spring Boot?
How to customize Spring Boot?
GilWon Oh
 
Spring boot入門ハンズオン第二回
Spring boot入門ハンズオン第二回Spring boot入門ハンズオン第二回
Spring boot入門ハンズオン第二回
haruki ueno
 
Maven
MavenMaven
Maven
Марія Русин
 
JVMs in Containers
JVMs in ContainersJVMs in Containers
JVMs in Containers
David Delabassee
 
Ingress? That’s So 2020! Introducing the Kubernetes Gateway API
Ingress? That’s So 2020! Introducing the Kubernetes Gateway APIIngress? That’s So 2020! Introducing the Kubernetes Gateway API
Ingress? That’s So 2020! Introducing the Kubernetes Gateway API
VMware Tanzu
 
Spring Boot Loves K8s
Spring Boot Loves K8sSpring Boot Loves K8s
Spring Boot Loves K8s
VMware Tanzu
 
Command Box ColdFusion Package Manager, Automation
Command Box ColdFusion Package Manager, AutomationCommand Box ColdFusion Package Manager, Automation
Command Box ColdFusion Package Manager, Automation
ColdFusionConference
 
Unleashing Docker with Pipelines in Bitbucket Cloud
Unleashing Docker with Pipelines in Bitbucket CloudUnleashing Docker with Pipelines in Bitbucket Cloud
Unleashing Docker with Pipelines in Bitbucket Cloud
Atlassian
 
우아한 모노리스
우아한 모노리스우아한 모노리스
우아한 모노리스
Arawn Park
 
不只自動化而且更敏捷的Android開發工具 gradle mopcon
不只自動化而且更敏捷的Android開發工具 gradle mopcon不只自動化而且更敏捷的Android開發工具 gradle mopcon
不只自動化而且更敏捷的Android開發工具 gradle mopcon
sam chiu
 
Docker for (Java) Developers
Docker for (Java) DevelopersDocker for (Java) Developers
Docker for (Java) Developers
Rafael Benevides
 
Spring5 New Features - Nov, 2017
Spring5 New Features - Nov, 2017Spring5 New Features - Nov, 2017
Spring5 New Features - Nov, 2017
VMware Tanzu Korea
 
Advanced Debugging Techniques
Advanced Debugging TechniquesAdvanced Debugging Techniques
Advanced Debugging Techniques
David Szöke
 
Apache Maven for SoftServe IT Academy
Apache Maven for SoftServe IT AcademyApache Maven for SoftServe IT Academy
Apache Maven for SoftServe IT Academy
Volodymyr Ostapiv
 
Spring Boot
Spring BootSpring Boot
Spring Boot
HongSeong Jeon
 
Spring - CDI Interop
Spring - CDI InteropSpring - CDI Interop
Spring - CDI Interop
Ray Ploski
 
JavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオンJavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオン
haruki ueno
 
Spring Boot and Microservices
Spring Boot and MicroservicesSpring Boot and Microservices
Spring Boot and Microservices
seges
 
How to customize Spring Boot?
How to customize Spring Boot?How to customize Spring Boot?
How to customize Spring Boot?
GilWon Oh
 
Spring boot入門ハンズオン第二回
Spring boot入門ハンズオン第二回Spring boot入門ハンズオン第二回
Spring boot入門ハンズオン第二回
haruki ueno
 
Ingress? That’s So 2020! Introducing the Kubernetes Gateway API
Ingress? That’s So 2020! Introducing the Kubernetes Gateway APIIngress? That’s So 2020! Introducing the Kubernetes Gateway API
Ingress? That’s So 2020! Introducing the Kubernetes Gateway API
VMware Tanzu
 
Spring Boot Loves K8s
Spring Boot Loves K8sSpring Boot Loves K8s
Spring Boot Loves K8s
VMware Tanzu
 
Command Box ColdFusion Package Manager, Automation
Command Box ColdFusion Package Manager, AutomationCommand Box ColdFusion Package Manager, Automation
Command Box ColdFusion Package Manager, Automation
ColdFusionConference
 
Unleashing Docker with Pipelines in Bitbucket Cloud
Unleashing Docker with Pipelines in Bitbucket CloudUnleashing Docker with Pipelines in Bitbucket Cloud
Unleashing Docker with Pipelines in Bitbucket Cloud
Atlassian
 
우아한 모노리스
우아한 모노리스우아한 모노리스
우아한 모노리스
Arawn Park
 
不只自動化而且更敏捷的Android開發工具 gradle mopcon
不只自動化而且更敏捷的Android開發工具 gradle mopcon不只自動化而且更敏捷的Android開發工具 gradle mopcon
不只自動化而且更敏捷的Android開發工具 gradle mopcon
sam chiu
 
Docker for (Java) Developers
Docker for (Java) DevelopersDocker for (Java) Developers
Docker for (Java) Developers
Rafael Benevides
 
Spring5 New Features - Nov, 2017
Spring5 New Features - Nov, 2017Spring5 New Features - Nov, 2017
Spring5 New Features - Nov, 2017
VMware Tanzu Korea
 
Advanced Debugging Techniques
Advanced Debugging TechniquesAdvanced Debugging Techniques
Advanced Debugging Techniques
David Szöke
 
Apache Maven for SoftServe IT Academy
Apache Maven for SoftServe IT AcademyApache Maven for SoftServe IT Academy
Apache Maven for SoftServe IT Academy
Volodymyr Ostapiv
 

Similar to EmbbededGF@JavaOneHyd (20)

GlassFish Embedded API
GlassFish Embedded APIGlassFish Embedded API
GlassFish Embedded API
Eduardo Pelegri-Llopart
 
GlassFish OSGi Server
GlassFish OSGi ServerGlassFish OSGi Server
GlassFish OSGi Server
Artur Alves
 
JBoss AS7 OSDC 2011
JBoss AS7 OSDC 2011JBoss AS7 OSDC 2011
JBoss AS7 OSDC 2011
Jason Shepherd
 
Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2
Abhishek Gupta
 
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
chrisb206 chrisb206
 
Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2
Abhishek Gupta
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With SeleniumTesting Java Web Apps With Selenium
Testing Java Web Apps With Selenium
Marakana Inc.
 
HTTP Session Replication with Oracle Coherence, GlassFish, WebLogic
HTTP Session Replication with Oracle Coherence, GlassFish, WebLogicHTTP Session Replication with Oracle Coherence, GlassFish, WebLogic
HTTP Session Replication with Oracle Coherence, GlassFish, WebLogic
Oracle
 
Java and windows azure cloud service
Java and windows azure cloud serviceJava and windows azure cloud service
Java and windows azure cloud service
Jeffray Huang
 
Andrei Niculae - glassfish - 24mai2011
Andrei Niculae - glassfish - 24mai2011Andrei Niculae - glassfish - 24mai2011
Andrei Niculae - glassfish - 24mai2011
Agora Group
 
GlassFish 3.1 – Simplifying your Java EE 6 Development and Deployment @ JAX L...
GlassFish 3.1 – Simplifying your Java EE 6 Development and Deployment @ JAX L...GlassFish 3.1 – Simplifying your Java EE 6 Development and Deployment @ JAX L...
GlassFish 3.1 – Simplifying your Java EE 6 Development and Deployment @ JAX L...
Arun Gupta
 
Deploying Java EE 6 Apps in a Cluster: GlassFish 3.1 at Dallas Tech Fest 2011
Deploying Java EE 6 Apps in a Cluster: GlassFish 3.1 at Dallas Tech Fest 2011Deploying Java EE 6 Apps in a Cluster: GlassFish 3.1 at Dallas Tech Fest 2011
Deploying Java EE 6 Apps in a Cluster: GlassFish 3.1 at Dallas Tech Fest 2011
Arun Gupta
 
Boston 2011 OTN Developer Days - GlassFish
Boston 2011 OTN Developer Days - GlassFishBoston 2011 OTN Developer Days - GlassFish
Boston 2011 OTN Developer Days - GlassFish
Arun Gupta
 
Play Support in Cloud Foundry
Play Support in Cloud FoundryPlay Support in Cloud Foundry
Play Support in Cloud Foundry
rajdeep
 
Project Presentation on Advance Java
Project Presentation on Advance JavaProject Presentation on Advance Java
Project Presentation on Advance Java
Vikas Goyal
 
Ibm web sphere application server interview questions
Ibm web sphere application server interview questionsIbm web sphere application server interview questions
Ibm web sphere application server interview questions
praveen_guda
 
Java 6 [Mustang] - Features and Enchantments
Java 6 [Mustang] - Features and Enchantments Java 6 [Mustang] - Features and Enchantments
Java 6 [Mustang] - Features and Enchantments
Pavel Kaminsky
 
GlassFish Server 3.1: Deploying your Java EE 6 Applications
GlassFish Server 3.1: Deploying your Java EE 6 ApplicationsGlassFish Server 3.1: Deploying your Java EE 6 Applications
GlassFish Server 3.1: Deploying your Java EE 6 Applications
Arun Gupta
 
GlassFish 3.1 at JCertif 2011
GlassFish 3.1 at JCertif 2011GlassFish 3.1 at JCertif 2011
GlassFish 3.1 at JCertif 2011
Arun Gupta
 
Arquillian in a nutshell
Arquillian in a nutshellArquillian in a nutshell
Arquillian in a nutshell
Brockhaus Group
 
GlassFish OSGi Server
GlassFish OSGi ServerGlassFish OSGi Server
GlassFish OSGi Server
Artur Alves
 
Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2
Abhishek Gupta
 
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
chrisb206 chrisb206
 
Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2
Abhishek Gupta
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With SeleniumTesting Java Web Apps With Selenium
Testing Java Web Apps With Selenium
Marakana Inc.
 
HTTP Session Replication with Oracle Coherence, GlassFish, WebLogic
HTTP Session Replication with Oracle Coherence, GlassFish, WebLogicHTTP Session Replication with Oracle Coherence, GlassFish, WebLogic
HTTP Session Replication with Oracle Coherence, GlassFish, WebLogic
Oracle
 
Java and windows azure cloud service
Java and windows azure cloud serviceJava and windows azure cloud service
Java and windows azure cloud service
Jeffray Huang
 
Andrei Niculae - glassfish - 24mai2011
Andrei Niculae - glassfish - 24mai2011Andrei Niculae - glassfish - 24mai2011
Andrei Niculae - glassfish - 24mai2011
Agora Group
 
GlassFish 3.1 – Simplifying your Java EE 6 Development and Deployment @ JAX L...
GlassFish 3.1 – Simplifying your Java EE 6 Development and Deployment @ JAX L...GlassFish 3.1 – Simplifying your Java EE 6 Development and Deployment @ JAX L...
GlassFish 3.1 – Simplifying your Java EE 6 Development and Deployment @ JAX L...
Arun Gupta
 
Deploying Java EE 6 Apps in a Cluster: GlassFish 3.1 at Dallas Tech Fest 2011
Deploying Java EE 6 Apps in a Cluster: GlassFish 3.1 at Dallas Tech Fest 2011Deploying Java EE 6 Apps in a Cluster: GlassFish 3.1 at Dallas Tech Fest 2011
Deploying Java EE 6 Apps in a Cluster: GlassFish 3.1 at Dallas Tech Fest 2011
Arun Gupta
 
Boston 2011 OTN Developer Days - GlassFish
Boston 2011 OTN Developer Days - GlassFishBoston 2011 OTN Developer Days - GlassFish
Boston 2011 OTN Developer Days - GlassFish
Arun Gupta
 
Play Support in Cloud Foundry
Play Support in Cloud FoundryPlay Support in Cloud Foundry
Play Support in Cloud Foundry
rajdeep
 
Project Presentation on Advance Java
Project Presentation on Advance JavaProject Presentation on Advance Java
Project Presentation on Advance Java
Vikas Goyal
 
Ibm web sphere application server interview questions
Ibm web sphere application server interview questionsIbm web sphere application server interview questions
Ibm web sphere application server interview questions
praveen_guda
 
Java 6 [Mustang] - Features and Enchantments
Java 6 [Mustang] - Features and Enchantments Java 6 [Mustang] - Features and Enchantments
Java 6 [Mustang] - Features and Enchantments
Pavel Kaminsky
 
GlassFish Server 3.1: Deploying your Java EE 6 Applications
GlassFish Server 3.1: Deploying your Java EE 6 ApplicationsGlassFish Server 3.1: Deploying your Java EE 6 Applications
GlassFish Server 3.1: Deploying your Java EE 6 Applications
Arun Gupta
 
GlassFish 3.1 at JCertif 2011
GlassFish 3.1 at JCertif 2011GlassFish 3.1 at JCertif 2011
GlassFish 3.1 at JCertif 2011
Arun Gupta
 
Arquillian in a nutshell
Arquillian in a nutshellArquillian in a nutshell
Arquillian in a nutshell
Brockhaus Group
 

Recently uploaded (20)

Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 

EmbbededGF@JavaOneHyd

  • 1.  
  • 2. Boosting Productivity using Embedded GlassFish Prasad Subramanian Software Engineering Manager
  • 3. The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle
  • 5. What did we do here ?
  • 6. How did we do it
  • 7. What is Embedded GlassFish API
  • 9. Maven plugin Use case for Embedded GlassFish
  • 10. State of Embedded GlassFish
  • 11. What did we do here Started GlassFish within our test program
  • 12. Deployed an application which was not in an archive form
  • 13. Access the Servlet from the test program
  • 14. Undeployed the application
  • 16. All this happened in the VM in which the test program was runnning
  • 17. How did we do that ? We “embedded” GlassFish in our test program using a set of APIs collectively known as Embedded GlassFish APIs Embedded GlassFish allows us to start GlassFish within a JVM or bundle GlassFish as a library along with our applications
  • 18. What is Embedded GlassFish A set of APIs To configure, manage GlassFish and its container from a host program A distribution To provide the GlassFish runtime to the users Plugins for maven Tooling support for embedding GlassFish using maven
  • 19. API
  • 20. The Embedded APIs Bootstrap API An API to manage the lifecycle of GlassFish and configure it Scattered Archive API to abstract an archive out of distributed content Web Container API API to manage and configure the Web Container specific artifacts Advanced Plugabbility SPI to allow plugging in of custom GlassFish runtime Embedded EJB API API exposed by the EJB specification to manage an Embedded EJB container alone
  • 21. Bootstrap API Scope Obtain an instance of a GlassFish runtime
  • 22. Manage the lifecycle ( start / stop)
  • 24. Allow deploy and undeploy operations Package org.glassfish.embeddable
  • 25. Bootstrap API Key interfaces Glassfish Represents a GlassFish instance & allows lifecycle operations Deployer Provides the deployer to deploy applications CommandRunner Programmatic interface for the CLI 'asadmin' CommandResult Encapsulates the result of the command run via CommandRunner
  • 26. Bootstrap API Key classes GlassFishRuntime Represents the runtime environment. Factory class for GlassFish instances BootstrapProperties Encapsulates the properties for configuring the GlassFishRuntime GlassFishProperties Encapsulates the properties for configuring GlassFish instance
  • 27. Code sample A code sample sums it up // Set the properties to configure GlassFish instance GlassFishProperties gfProps = new GlassFishProperties(); gfProps.setPort("http-listener", 8080); // Get the GlassFishRuntime and get a GlassFish instance GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish(gfProps); //Start the GlassFish glassfish.start(); //get a Deployer instance and deploy the application Deployer deployer = glassfish.getDeployer(); deployer.deploy(new File("simple.war")); // Stops the GlassFish instance glassfish.stop();
  • 28. Code Sample Use of the CommandRunner // Set the properties to configure GlassFish instance CommandRunner commandRunner = glassfish.getCommandRunner(); CommandResult commandResult = commandRunner.run("create-jdbc-resource", "--connectionpoolid=DerbyPool", "jdbc/DerbyPool");
  • 29. Setting Install Root and Instance Root Install Root - location of GlassFish binaries Instance Root – location of domain specific configuration // Bootstrap the GlassFish runtime pointing to 3.1 installation BootstrapProperties bsProps = new BootstrapProperties(); bsProps.setInstallRoot(System.getenv("GF_INSTALLATION")); GlassFishRuntime gfRuntime = GlassFishRuntime.bootstrap(bsProps); // Point the GlassFish instance to the domain named domain1 GlassFishProperties gfProps = new GlassFishProperties(); gfProps.setInstanceRoot(System.getEnv("GF_INSTALLATION") + "/domains/domain1"); GlassFish glassfish = gfRuntime.newGlassFish(gfProps);
  • 30. Key methods in GlassFish getService(ServiceType, ServiceName) Returns an instance of a service like web container or deployer getStatus() Returns the status of GlassFish instance
  • 31. Valid values DISPOSED, INIT, STARTED, STARTIN, STOPPED, STOPPING dispose() Cleans up any temporary files created by GlassFish
  • 32. Once dispose() is called, further invocations of start() throw an exception
  • 33. Scattered Archive API Package : org.glassfish.embeddable.archive
  • 34. Abstracts archive contents distributed across directories.
  • 35. Key classes ScatteredArchive Abstraction for a Scattered Java EE module ScatteredEnterprise Archive Abstraction for a Scattered Java EE application ScatteredArchiveType Enumeration values for the scattered Java EE module types
  • 36. Valid values are RAR | WAR | JAR
  • 37. Web Container API Package org.glassfish.embeddable.web
  • 38. Set of classes and interfaces that represent an embeddable web container
  • 39. Allows for configuration of virtual servers, context and protocol listeners
  • 40. Web Container API Key interfaces WebContainer Represents embedded web container, which supports the programmatic creation of web protocol listeners
  • 42. static and dynamic web resources VirtualServer Representation of a virtual server WebListener Interface for protocol listeners Context Representation of a web application Lifecycle Interface for lifecycle event
  • 43. Web Container API Key classes WebListenerBase
  • 47. Pluggability SPI Package org.glassfish.embeddable.spi
  • 48. Support for plugging in custom runtime
  • 49. Key interface RuntimeBuilder Allows users to plugin a custom runtime for GlassFish // Returns a custom GlassFish runtime GlassFishRuntime gfr = runtimeBuilder.build(bsProps);
  • 50. EJB Container API Support for an Embedded EJB container
  • 53. Distributions How do I get GlassFish in an Embedded mode ?
  • 55. Distributed as a self contained jars Implanted Uses an existing GlassFish installation
  • 56. Distributions Autonomous Add the jar in your classpath
  • 57. Standalone distribution different from GlassFish distributions
  • 58. Unzips to a temporary directory where the binaries and domain data are installed
  • 59. A custom domain.xml can be specified glassfish-embedded-all.jar glassfish-embedded-web.jar glassfish-embedded-nucleus.jar
  • 60. Distributions Implanted Uses glassfish-embedded-static-shell.jar
  • 62. glassfish-embedded-static-shell.jar is available with standard GlassFish distributions
  • 63. Domain data and application data are stored in the installation
  • 64. A custom domain.xml can be specified
  • 66. Maven plugin Maven plugins for running glassfish within a test
  • 68. start
  • 69. stop
  • 72. admin Artifact id – org.glassfish:maven-embedded-glassfish-plugin:3.1
  • 73. Use cases Did you say boost in the productivity ? Leaner and faster unit tests that require an application server
  • 74. Maven plugin eliminates the need for Java code for standard operations
  • 75. Facilitates GlassFish embedded in an IDE Applications that need to bundle GlassFish OEMs
  • 76. State of Embedded GlassFish API design is done
  • 78. Shipped to the community as a part of the 3.1 community release
  • 79. Adding tests to verify fidelity with standalone GlassFish
  • 80. Working on passing TCKs to claim compliance fidelity with standalone GlassFish
  • 81. Resources Blogs http://www.java.net/author/bhavanishankar-s One Pager ( technical specification) http://wikis.sun.com/display/glassfish/3.1EmbeddedOnePager Documentation http://download.oracle.com/docs/cd/E18930_01/html/821-2424/index.html Javadocs http://embedded-glassfish.java.net/nonav/apidocs/
  • 82. Boosting your productivity using Embedded GlassFish
  • 83.