the spring update from javaone 2013

Post on 10-May-2015

1.635 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Spring, now part of Pivotal, continues to innovate and support next generation workloads. In this talk, I introduce some of the exciting new Spring technologies supporting websockets, Java 8, Java EE 7, data ingestion and stream processing, NoSQL and Hadoop, and production-ready REST, _and_ I introduce tools designed to expedite ramp-up time for teams who want to deliver, quickly.

TRANSCRIPT

Josh Long (⻰龙之春)@starbuxman joshlong.com

josh.long@springsource.com slideshare.net/joshlong

github.com/joshlonghttp://spring.io

T H E U P D AT E

ABOUT ME

interested in big data, the open web, cloud and all things Spring.

About Josh Long @Starbuxman josh@joshlong.com josh.long@springsource.com

Developer Advocate

SPRING IS.. SPRING.IO

WEB

Controllers, REST,WebSocket

INTEGRATION

Channels, Adapters,Filters, Transformers

BATCH

Jobs, Steps,Readers, Writers

BIG DATA

Ingestion, Export,Orchestration, Hadoop

DATA

NON-RELATIONALRELATIONAL

CORE

GROOVYFRAMEWORK SECURITY REACTOR

GRAILS

Full-stack, Web

XD

Stream, Taps, Jobs

BOOT

Bootable, Minimal, Ops-Ready

SPRING IS.. SPRING.IO

SPRING IS.. SPRING.IO

SPRING IS.. SPRING.IO

SPRING IS.. SPRING.IO

SPRING IS.. SPRING.IO

SPRING.IO IS REFERENCE IN ACTION

REST DESIGN WITH SPRING

H T T P : / / S P R I N G . I O

Demo

SPRING IS.. GITHUB

SPRING WORKS IN MANY LANGUAGES

Spring loves the JVM: Java (5,6,7, and 8), Groovy, Scala, etc.

SPRING WORKS IN MANY LANGUAGES

val applicationContext = new FunctionalConfigApplicationContext( classOf[ServiceConfiguration])

// ServiceConfiguration.scala class ServiceConfiguration extends FunctionalConfiguration { importClass(classOf[DataSourceConfiguration])

val dataSource : DataSource = getBean(“dataSource”)

val jdbcTemplate = bean() { new JdbcTemplate( dataSource ) } val jdbcTransactionManager = bean(“txManager”) { new JdbcTransactionManager(dataSource) }}

Scala

SPRING WORKS IN MANY LANGUAGES

def bb = new BeanBuilder() bb.loadBeans("classpath:*SpringBeans.groovy") def applicationContext = bb.createApplicationContext()

// MySpringBeans.groovy import o.sf.jdbc.core.JdbcTemplateimport o.sf.jdbc.datasource.DataSourceTransactionManager

beans {

jdbcTemplate(JdbcTemplate) { dataSource = dataSource }

transactionManager(DataSourceTransactionManager) { dataSource = dataSource }}

Groovy

SPRING WORKS IN MANY LANGUAGES

ApplicationContext applicationContext = new AnnotationConfigApplicationContext( ServiceConfiguration.class);

// ServiceConfiguration.java @Configuration@ComponentScan@Import(DataSourceConfiguration.class) @EnableTransactionManagementclass ServiceConfiguration { @Bean public JdbcTemplate jdbcTemplate(DataSource dataSource) throws Exception { return new JdbcTemplate( dataSource ); }

@Bean public PlatformTransactionManager jdbcTransactionManager(DataSource dataSource){ return new JdbcTransactionManager (dataSource ); } }

Java

SPRING WORKS IN MANY LANGUAGES

Java 8a quick note on Delayed again! from 09/2013 to as late as 03/2014!

Meanwhile, even has lambas...

...C++

SPRING WORKS IN MANY LANGUAGES

Java 8a quick note on IDE Support:

IntelliJ IDEA has had Java 8 support for a year Eclipse won’t have any until June 2014 (..!!) Eclipse-based Spring Tool Suite (STS) has beta Java 8 support.

SPRING WORKS IN MANY LANGUAGES

Java 8a quick note on Spring 4.0 to be GA against Developer Preview by end of 2013.

Method references are a great fit for Spring!

JdbcTemplate jdbcTemplate;

// method references private Customer map(ResultSet rs, int rowNum) throws SQLException { return new Customer( rs.getString("name"), rs.getInt("age") );}

// let it satisfy the `RowMapper` functional interfaceCustomer customer = jdbcTemplate.queryForObject( "select name, age from customers ", this::map);

SPRING WORKS IN MANY LANGUAGES

Java 8a quick note on Spring 4.0 to be GA against Developer Preview by end of 2014.

lambas are a great fit for Spring!

JdbcTemplate jdbc;

Customer customer = jdbc.queryForObject(sql, (rs, rowNum) -> new Customer(rs.getLong("id")));

SPRING WORKS IN MANY LANGUAGES

Java 8a quick note on Spring 4.0 to be GA against Developer Preview by end of 2014.

lambas are a great fit for Spring and Twitter!

SPRING WORKS IN MANY LANGUAGES

Java 8a quick note on JSR-310 - Date and Time

// declarative date format import java.time.*;import org.springframework.format.annotation.*;

public class Customer {

@DateTimeFormat(iso=ISO.DATE) private LocalDate birthDate;

@DateTimeFormat(pattern="M/d/yy h:mm") private LocalDateTime lastContact;

}

SPRING WORKS IN MANY LANGUAGES

Java 8a quick note on Repeatable Annotations

@Scheduled(cron = "0 0 12 * * ?")@Scheduled(cron = "0 0 18 * * ?")public void performTempFileCleanup() { ... }

SPRING WORKS IN MANY LANGUAGES

Java 8a quick note on Spring 4.0

JDK 6 -> JDK 8 Java EE 5 (with JPA 2.0 feature pack) -> Java EE 7

SPRING RUNS WELL ON JAVA EE 7

Spring works well in Java EE environmentsSupports Java EE 7: Date/Time API, JTA 1.2, JMS 2.0, JPA 2.1, Bean Validation 1.1, the new concurrency API in JSR-236, Servlet 3.1, and WebSockets (JSR 356)

Even participated in a few JSRs: the websocket JSR (356) and the Batch JSR (352)

SPRING IS WHERE YOU ARE

SPRING IS WHERE YOU ARE

SPRING IS WHERE YOU ARE

SPRING IS WHERE YOU ARE

S P R I N G C L O U D A N D

Demo

SPRING SUPPORTS NOSQL

Spring supports all the SQLs: NoSQL, NOSQL, and SQL

SIMPLIFIED DATA ACCESS++

Spring Data offers conventional repositories, *Template implementations, unified data access exception handling

S P R I N G D ATA J PA R E P O S I T O R I E S

Demo

S P R I N G D ATA R E D I S C A C H E :

Demo

SPRING SUPPORTS

Surviving the Big DataWild-West withSpring for Hadoop

SPRING SUPPORTS

But How Do You Process Data Realtime?@metamarkets founder Michael E. Driscoll:

SPRING SUPPORTS

Introducing Spring XD

sources

sinks

S P R I N G X D A N D P I V O TA L H D

Demo

SPRING IS.. MESSAGING AND INTEGRATION FRIENDLY

Spring’s REST and Security support

AsyncRestTemplateHypermedia Links

@RestController

Websocket

S P R I N G C R M R E S T D E M O

Demo

SPRING IS EASY TO GET STARTED WITH

Boot

Autoconfigure

Starters

CLI

Actuator

Tools

Samples

Bootstrap your productivity

SPRING SUPPORTS CONVENTION OVER CONFIGURATION

SPRING SUPPORTS CONVENTION OVER CONFIGURATION

S P R I N G B O O T T O M C AT S A M P L E

Demo

SPRING IS.. MESSAGING AND INTEGRATION FRIENDLY

Spring gets (and sends!) websocketsWebSockets delegating to implementations on app servers like GlassFish, Tomcat, and Jetty

Supports Sock.js server, superset of WS.

higher level STOMP supported on WS

supports JSR 356 (javax.websocket.*) support.

W E B S O C K E T T R A D E R

Demo

Any Questions

@starbuxman josh.long@springsource.com

josh@joshlong.comgithub.com/joshlong

slideshare.net/joshlong

?

top related