Top Banner
37

OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

Feb 01, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability
Page 2: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

OpenShift is FanPaaSticFor Java EE

By Shekhar GulatiPromo Code – JUDCON.IN

Page 3: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

About Me ~ Shekhar Gulati

• OpenShift Evangelist at Red Hat• Hands on developer• Speaker• Writer and Blogger• Twitter @ shekhargulati

Page 4: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

Agenda

Page 5: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability
Page 6: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability
Page 7: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

PaaS == Platform as a Service

A Cloud Application Platform

Code Deploy Enjoy

Save Time and MoneyCode your app

Push-button Deploy, and your App is

running in the Cloud!

Page 8: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

Why PaaS?

• Lets developer focus on his job i.e. to write code.

• Improves developer productivity.

• Brings agility to product development.

• Gives developers the power to prototype their ideas quickly and rapidly.

Page 9: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

OpenShiftis

PaaS by Red Hat

Page 10: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

OpenShift – Open PaaS

• Polyglot – supports multiple programming languages

• Support multiple databases• Auto scales• Developer friendly

• Flexible• Open source – OpenShift Origin

Page 11: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability
Page 12: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

Why OpenShift?• Strength. OpenShift is built on proven Red Hat

technologies.

• Freedom. In OpenShift, work the way you want.– Choice of Interface: Web Console, Command-line, or IDE

– Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, Python, and Perl

– Choice of Cloud: Public, Private, or Hybrid Cloud

– Choice of Elasticity: Automatic application scaling when needed

• Openness. OpenShift’s open source software stack ensures application portability and No Lock-In.

Page 13: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

OpenShift is the BEST Platform for Java Developers

Page 14: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

Why I think OpenShift is Best?• Can run any thing that's Java – Java EE or

Spring does not matter.

• Supports both Java 6 and Java 7

• Supports JBoss AS7, JBoss EAP 6.0, and Tomcat

• Ability to write to persistent file system

• Debugging support

• Hot deployment

• Eclipse support

Page 15: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

Getting Started with OpenShift

1) Sign up with Promo Code

JUDCON.IN

2) Verify Email

https://openshift.redhat.com/app/account/new

Page 16: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

What I get after sign up?

• OpenShift is free-as-in-beer & free-as-in-freedom

• You get three free gears, each with 512MB memory and 1GB of disk space.

• Need more resources, just ask!

• The catch is we are in developer preview right now

Page 17: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

Sign up at OpenShift Booth and get an OpenShift T-Shirt

Page 18: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

How To Work with OpenShift

Developer IDEIntegrations

Web BrowserConsole

Command LineTooling

REST APIs

Page 19: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

Demo 1 – Web Console

• Log in to OpenShift Web console• Walkthrough various application types• Creating Domain Name• Wordpress Blog in less than 2 minutes• Credentials admin/OpenShiftAdmin

Page 20: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

Install Client Tools and Setup Account

• Install the client tools – Install Ruby 1.8.7 or above

– sudo gem install rhc

• Install Git

• rhc setup -l <openshift_login>– Upload ssh keys– Check if git is installed

– Create domain if not exists

Page 21: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

Look at Java EE 6• Java EE 6 provides a platform to write enterprise

applications in Java

• Consists of 28 specifications (Thousands of pages)

• Convention over configuration

• Less boilerplate code

• Promotes POJO programming model

• Annotations and types over XML

• Introduced EJB Lite

• Simplified Packaging

• Introduced concept of Profiles

Page 22: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

Java EE 6 – The simplest possible and most lightweight platform you

can currently get

Adam Bien

Page 23: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

Java EE 6 Specifications

• JSF 2.0

• Servlet 3.0

• JSP 2.2

• EL, JSTL 2.0, etc.

• EJB 3.1

• JPA 2.0

• JTA 1.1

• JavaMail etc.

• JAX-RS 2.0

• JAX-WS 2.2

• etc...

• JAX-WS 2.2

• JAXB 2.2

• JDBC 4.0

• JNDI 1.5

• SAAJ 1.3

• Common 1.1

• CDI (JSR 299)1.0

• @Inject 1.0

• Bean Validation 1.0

• Interceptor 1.1

• Managed Bean 1.0

• JACC 1.0

Java SE 6

Note : This is not a full list

Page 24: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

Let's now look at some specs

• Servlet 3.0• JPA 2.0• EJB 3.1

Page 25: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

Servlet 3.0

• Ease of development via annotations• Pluggability• Async support• File upload support• And many more..

Page 26: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

JPA 2.0

• Evolved separately from EJB now– JSR 317

• Richer mappings• Richer JPQL

• Standard config options• Criteria API• And many more..

Page 27: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

EJB 3.1• Optional local interface

– Use @Local and @Remote

• Packaged in war• Asynchronous calls using

@Asynchronous annotation• Timer Service supports cron like syntax• And many more @Singleton,

Embeddable container,etc.

Page 28: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

Demo 2 Servlet 3.0, JPA 2.0, EJB 3.1

• Todo Application– JPA 2.0 for persistence– Servlet 3.0 as controller– EJB 3.1 as business service

Github repo of demo applicationhttps://github.com/shekhargulati/judcon-todo-servlet3-jpa2-ejb31-demo

Page 29: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

Demo 2 Steps• Create JBoss EAP 6.0 OpenShift Application

• Add PostgreSQL support

• Create domain model – TodoList 1->n Todo

• Add persistence.xml

• Create EJB service TodoService

• Create TodoServlet to create and find TodoList

• Create FileUploadServlet

• Add page.jsp to WEB-INF/pages folder

• git add .

• git commit -am “Todo Application created”

• git push

Page 30: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

Let's now look at some other specifications

• CDI • Bean Validation• JSF 2.0• Interceptors

Page 31: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

Bean Validation 1.0

• Enable declarative validation in your applications

• Constrain Once and Validate Anywhere– restriction on a bean, field or property– not null, size between 1 and 7, valid

email...

• Standard way to validate constraints

• Integration with JPA 2.0 & JSF 2.0

Page 32: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

CDI

• Stands for Context and Dependency Injection

• Glues the platform in a way never done before

• Provide two main things– Dependency Injection– Manages components in scope

• Leads to loose coupling and strong typing using annotations

Page 33: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

Interceptors 1.1

• Address cross-cutting concerns in Java EE

• Separate spec shipped with EJB 3.1

• Can be used with EJBs as well as ManagedBeans

• @AroundInvoke

• @AroundTimeout for EJB timers

Page 34: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

Demo 3 JSF 2.0, CDI, Bean Validation, Events, Interceptors

git rm -rf src/ pom.xml

git commit -am "removed demo 2"

git remote add demo2 -m master git://github.com/shekhargulati/judcon-todo-jsf2-cdi-jsr303-events-interceptor-demo.git

git pull -s recursive -X theirs demo2 master

Page 35: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

Demo 3

• Extending Todo application– CDI for dependency injection– JPA 2.0 Criteria API for querying– EJB 3.1 for writing business service– Interceptor for logging– JAX RS for Restful web services

Page 36: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

3 More Sessions ~ All Different• Polyglot Persistence Apps on OpenShift - Today

• Building Java MongoDB application using Hibernate OGM - Tomorrow

• JBoss Forge + OpenShift = Rapid Enterprise Application Development for Cloud – Tomorrow

Page 37: OpenShift is FanPaaStic - JBossOpenShift is FanPaaStic ... – Choice of Middleware: Java(EE6), Ruby, Node.js, PHP, ... • Supports JBoss AS7, JBoss EAP 6.0, and Tomcat • Ability

Conclusion

• OpenShift is very easy to use and makes life great for developers

• Java EE 6 is easy• OpenShift is best platform for Java

developers

• Did I mention – Free• Sign up with promo code JUDCON.IN