SlideShare a Scribd company logo
1 of 38
Speaker: Oleg Tsal-Tsalko (@tsaltsol)
Next stop: Spring 4
About me
Oleg Tsal-Tsalko
• Senior Java Developer in EPAM Systems.
• Mostly working with enterprise business
applications.
• Member of LJC and JUG KPI communities.
What version of Spring are you using?
Bank
applications
Spring 3.1
(Previous stop)
• Environment abstraction and profiles
• Java-based application configuration
• Overhaul of the test context framework
• Cache abstraction & declarative caching
• Servlet 3.0 based web applications
• @MVC processing & flash attributes
• Support for Java SE 7
And much more…
Exposing entities via REST
XML based configuration
<beans …>
<cache:annotation-driven />
<bean id="cacheManager" class="org.springframework.cache.support.SimpleCacheManager">
…
</bean>
<context:property-placeholder location="classpath:/app-common.properties"/>
<bean id="bookStoreService" class="spring.samples.service.BookStoreService" c:bookStoreDao-
ref="bookStoreDao"/>
<bean id="bookStoreDao" class="spring.samples.dao.BookStoreDao">
<property name="dataSource" ref="dataSource"/>
</bean>
…
</beans>
ApplicationContext context = new ClassPathXmlApplicationContext("bookstore-app-context.xml");
Java based configuration
ApplicationContext context = new AnnotationConfigApplicationContext(BookStoreAppConfig.class);
Test context java based
configuration
Profiles in XML based configuration
<beans>
...
<beans profile="dev">
<jdbc:embedded-database id="dataSource">
<jdbc:script location="classpath:db/schema.sql"/>
<jdbc:script location="classpath:db/test-data.sql"/>
</jdbc:embedded-database>
</beans>
<beans profile="production">
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="oracle.jdbc.OracleDriver"/>
<property name="url" value="jdbc:oracle:thin:@localhost:1521:booklibrary"/>
<property name="username" value="admin"/>
<property name="password" value="admin"/>
</bean>
</beans>
...
</beans>
Profiles in Java based configuration
@Configuration
@Profile("dev")
public class DevProfileConfig {
@Bean(name="dataSource”)
public DataSource dataSource() {…}
}
@Configuration
@Profile("production")
public class ProductionProfileConfig {
@Bean(name="dataSource”)
public DataSource dataSource() {…}
}
@Configuration
@Import( { DevProfileConfig.class, ProductionProfileConfig.class } )
public class BookStoreAppConfig {
@Inject
private DataSource dataSource;
}
How to enable active profile?
1) Using JVM property, which is preferred way:
2) Programmatically in standalone app:
-Dspring.profiles.active=dev
3) In web.xml file:
Cache abstraction
• CacheManager and Cache abstraction in
org.springframework.cache
• Out of the box support for ConcurrentMap
and EhCache
• Ability to plug any Cache implementation (see
Spring GemFire project for GemFile adapter)
Declarative Cache support
Enable caching annotations
@Configuration
@EnableCaching
public class AppConfig {
@Bean
public CacheManager cacheManager() {…}
…
}
<beans …>
<cache:annotation-driven />
<bean id="cacheManager"
class="org.springframework.cache.support.SimpleCacheManager">
…
</bean>
…
</beans>
Servlet 3.0 support
• such as Tomcat 7 and GlassFish 3
Explicit support
for Servlet 3.0
containers
• Servlet 3.0's ServletContainerInitializer mechanism
• Spring 3.1's
AnnotationConfigWebApplicationContext
• Spring 3.1's environment abstraction
Support for XML-
free web
application setup
• such as standard Servlet 3.0 file upload behind
Spring's MultipartResolver abstraction
Exposure of native
Servlet 3.0
functionality in
Spring MVC
Spring MVC without web.xml
Spring 3.2
(Current stop)
• Gradle-based build
• Sources moved to GitHub
• Sources built against Java 7
• Async MVC processing on Servlet 3.0
• Spring MVC test support
• MVC configuration and SpEL refinements
And much more…
Async MVC processing: Callable
- thread managed by Spring MVC
- good for long running database jobs, 3rd party REST API calls, etc
Async MVC Processing: DeferredResult
- thread managed outside of Spring MVC
- JMS or AMQP message listener, another HTTP request, etc.
Async MVC Processing: WebAsyncTask
- same as Callable, with extra features
- override timeout value for async processing
- lets you specify a specific AsyncTaskExecutor
MVC Test Framework Server
MVC Test Framework Client
Spring 4
Engineering works will be held till the end of the year…
Spring 4
(Next stop)
We are expecting to see:
• Comprehensive Java 8 support
• Support for Java EE 7 APIs
• Focus on message-oriented architectures
• Annotation-driven JMS endpoint model
• Revised application event mechanism
• WebSocket support in Spring MVC
• Next-generation Groovy support
And more…
Java 8 & Java EE 7 support
Comprehensive Java 8
support
• Lambdas
• Date and Time API (JSR-310)
• Parameter name discovery
• Repeatable annotations
• Concurrency enhancement
Support for Java EE 7 APIs
• Asynchronous API for RestTemplate
• Bean Validation 1.1 (JSR-349)
• Expression Language 3.0 (JSR-341)
• JMS 2.0 (JSR-343)
• Concurrency Utilities for Java EE (JSR-
236)
• JPA 2.1 (JSR-338)
• Servlet 3.1 (JSR-340)
• JSF 2.2 (JSR-344)
Annotation driven message
endpoints
<jms:annotation-driven>
@JmsListener(destination="myQueue")
public void handleMessage(TextMessage payload);
@JmsListener(destination="myQueue", selector="...")
public void handleMessage(String payload);
@JmsListener(destination="myQueue")
public String handleMessage(String payload);
However this is not implemented yet -
https://jira.springsource.org/browse/SPR-9882
Bean Validation 1.1 support
MethodValidationInterceptor autodetects Bean Validation 1.1's ExecutableValidator API now
and uses it in favor of Hibernate Validator 4.2's native variant.
JMS 2.0 support
What was done already:
• Added "deliveryDelay" property on JmsTemplate
• Added support for "deliveryDelay" and CompletionListener to
CachedMessageProducer
• Added support for the new "create(Shared)DurableConsumer" variants in
Spring’s CachingConnectionFactory
• Added support for the new "createSession" variants with fewer
parameters in Spring’s SingleConnectionFactory
Known constraints:
• There is no special support for the simplified JMSContext API, and likely
never will be, because of different Spring mechanism of managing
connection pools and sessions
• JmsTemplate has no out-of-the-box support for send calls with an async
completion listener.
JEE7 concurrency utilities in Spring 4
This is built into ConcurrentTaskExecutor and ConcurrentTaskScheduler now,
automatically detecting the JSR-236 ExecutorService variants and adapting
to them.
Example of ManagedExecutorService usage introduced in JEE7:
JPA 2.1 support
EntityManagerFactory.createEntityManager(
SynchronizationType.SYNCHRONIZED/UNSYNCHRONIZED, Map)
@PersistenceContext(
synchronizationType=SYNCHRONIZED/UNSYNCHRONIZED)
Support for both transactional and extended EntityManagers
and for both Spring-managed resource transactions and JTA
transactions
WebSockets server side support
WebSockets server side support
WebSockets server side support
WebSockets Client side support
Programatic approach:
Configuration based approach:
JDK8 support in depth
• Implicit use of LinkedHashMap/Set instead of simple
HashMap/Set to preserve ordering diffs in JDK7 and JDK8
• Embed ASM4.1 into Spring codebase to support JDK8
bytecode changes and to keep compatibility with CGLib3.0
• Support for JDK 8 Data & Time (JSR-310) encorporated with
Spring’s Joda Time lib
• Add awaitTerminationSeconds/commonPool properties to
ForkJoinPoolFactoryBean to support JDK8 changes in it.
• Encorporate JDK8 changes in reflection API (such as
java.lang.reflect.Parameter)
Other changes…
• Replace Burlap with Hessian (lightweight binary WS protocol)
• Introduced @Conditional annotation (@Profile annotation
has been refactored)
• Updated to Gradle 1.6
How to track progress?
• Track JIRA -
https://jira.springsource.org/issues/?jql=proje
ct%20%3D%20SPR%20AND%20labels%20%3D
%20%22major-theme-4.0%22
• Check commits to codebase -
https://github.com/SpringSource/spring-
framework/commits/master
Thank you!
Oleg Tsal-Tsalko
Email: oleg.tsalko@gmail.com
Twitter: @tsaltsol
Special thanks to Josh Long (@starbuxman) for
sharing quite useful info…

More Related Content

What's hot

Spring Framework - Core
Spring Framework - CoreSpring Framework - Core
Spring Framework - CoreDzmitry Naskou
 
Spring introduction
Spring introductionSpring introduction
Spring introductionManav Prasad
 
Spring Framework - MVC
Spring Framework - MVCSpring Framework - MVC
Spring Framework - MVCDzmitry Naskou
 
Spring framework in depth
Spring framework in depthSpring framework in depth
Spring framework in depthVinay Kumar
 
Spring Framework 4.0 - The Next Generation - Soft-Shake 2013
Spring Framework 4.0 - The Next Generation - Soft-Shake 2013Spring Framework 4.0 - The Next Generation - Soft-Shake 2013
Spring Framework 4.0 - The Next Generation - Soft-Shake 2013Sam Brannen
 
Java spring framework
Java spring frameworkJava spring framework
Java spring frameworkRajiv Gupta
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring FrameworkRaveendra R
 
Building web applications with Java & Spring
Building web applications with Java & SpringBuilding web applications with Java & Spring
Building web applications with Java & SpringDavid Kiss
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootJosué Neis
 
Java EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVCJava EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVCJosh Juneau
 
Spring bean mod02
Spring bean mod02Spring bean mod02
Spring bean mod02Guo Albert
 
Spring framework
Spring frameworkSpring framework
Spring frameworkAircon Chen
 

What's hot (19)

Spring Framework - Core
Spring Framework - CoreSpring Framework - Core
Spring Framework - Core
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
Spring MVC 5 & Hibernate 5 Integration
Spring MVC 5 & Hibernate 5 IntegrationSpring MVC 5 & Hibernate 5 Integration
Spring MVC 5 & Hibernate 5 Integration
 
Spring introduction
Spring introductionSpring introduction
Spring introduction
 
Spring Framework - MVC
Spring Framework - MVCSpring Framework - MVC
Spring Framework - MVC
 
Spring framework in depth
Spring framework in depthSpring framework in depth
Spring framework in depth
 
Spring Framework 4.0 - The Next Generation - Soft-Shake 2013
Spring Framework 4.0 - The Next Generation - Soft-Shake 2013Spring Framework 4.0 - The Next Generation - Soft-Shake 2013
Spring Framework 4.0 - The Next Generation - Soft-Shake 2013
 
Spring framework core
Spring framework coreSpring framework core
Spring framework core
 
Java spring framework
Java spring frameworkJava spring framework
Java spring framework
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
Building web applications with Java & Spring
Building web applications with Java & SpringBuilding web applications with Java & Spring
Building web applications with Java & Spring
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBoot
 
Java EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVCJava EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVC
 
Spring Framework Rohit
Spring Framework RohitSpring Framework Rohit
Spring Framework Rohit
 
Spring bean mod02
Spring bean mod02Spring bean mod02
Spring bean mod02
 
Spring Framework Training Course
Spring Framework Training Course Spring Framework Training Course
Spring Framework Training Course
 
Jspprogramming
JspprogrammingJspprogramming
Jspprogramming
 
Spring framework
Spring frameworkSpring framework
Spring framework
 

Viewers also liked

Spring 3.x - Spring MVC
Spring 3.x - Spring MVCSpring 3.x - Spring MVC
Spring 3.x - Spring MVCGuy Nir
 
the Spring 4 update
the Spring 4 updatethe Spring 4 update
the Spring 4 updateJoshua Long
 
Spring MVC Annotations
Spring MVC AnnotationsSpring MVC Annotations
Spring MVC AnnotationsJordan Silva
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring FrameworkDineesha Suraweera
 
Introducción al desarrollo web moderno
Introducción al desarrollo web modernoIntroducción al desarrollo web moderno
Introducción al desarrollo web modernoSebastián Rocco
 
Introducción a ASP.NET MVC
Introducción a ASP.NET MVCIntroducción a ASP.NET MVC
Introducción a ASP.NET MVCSebastián Rocco
 
The Spring Framework: A brief introduction to Inversion of Control
The Spring Framework:A brief introduction toInversion of ControlThe Spring Framework:A brief introduction toInversion of Control
The Spring Framework: A brief introduction to Inversion of ControlVisualBee.com
 
Spring mvc my Faviourite Slide
Spring mvc my Faviourite SlideSpring mvc my Faviourite Slide
Spring mvc my Faviourite SlideDaniel Adenew
 
02 java spring-hibernate-experience-questions
02 java spring-hibernate-experience-questions02 java spring-hibernate-experience-questions
02 java spring-hibernate-experience-questionsDhiraj Champawat
 
Spring Web Service, Spring JMS, Eclipse & Maven tutorials
Spring Web Service, Spring JMS, Eclipse & Maven tutorialsSpring Web Service, Spring JMS, Eclipse & Maven tutorials
Spring Web Service, Spring JMS, Eclipse & Maven tutorialsRaghavan Mohan
 
Spring 3 Annotated Development
Spring 3 Annotated DevelopmentSpring 3 Annotated Development
Spring 3 Annotated Developmentkensipe
 
Spring @Transactional Explained
Spring @Transactional ExplainedSpring @Transactional Explained
Spring @Transactional ExplainedSmita Prasad
 
What's new in Spring 3?
What's new in Spring 3?What's new in Spring 3?
What's new in Spring 3?Craig Walls
 
Spring MVC Architecture Tutorial
Spring MVC Architecture TutorialSpring MVC Architecture Tutorial
Spring MVC Architecture TutorialJava Success Point
 

Viewers also liked (17)

Spring 4 - A&BP CC
Spring 4 - A&BP CCSpring 4 - A&BP CC
Spring 4 - A&BP CC
 
Spring 3.x - Spring MVC
Spring 3.x - Spring MVCSpring 3.x - Spring MVC
Spring 3.x - Spring MVC
 
the Spring 4 update
the Spring 4 updatethe Spring 4 update
the Spring 4 update
 
Spring MVC Annotations
Spring MVC AnnotationsSpring MVC Annotations
Spring MVC Annotations
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
Spring MVC Basics
Spring MVC BasicsSpring MVC Basics
Spring MVC Basics
 
Introducción al desarrollo web moderno
Introducción al desarrollo web modernoIntroducción al desarrollo web moderno
Introducción al desarrollo web moderno
 
Introducción a ASP.NET MVC
Introducción a ASP.NET MVCIntroducción a ASP.NET MVC
Introducción a ASP.NET MVC
 
Arquitectura MVC
Arquitectura MVCArquitectura MVC
Arquitectura MVC
 
The Spring Framework: A brief introduction to Inversion of Control
The Spring Framework:A brief introduction toInversion of ControlThe Spring Framework:A brief introduction toInversion of Control
The Spring Framework: A brief introduction to Inversion of Control
 
Spring mvc my Faviourite Slide
Spring mvc my Faviourite SlideSpring mvc my Faviourite Slide
Spring mvc my Faviourite Slide
 
02 java spring-hibernate-experience-questions
02 java spring-hibernate-experience-questions02 java spring-hibernate-experience-questions
02 java spring-hibernate-experience-questions
 
Spring Web Service, Spring JMS, Eclipse & Maven tutorials
Spring Web Service, Spring JMS, Eclipse & Maven tutorialsSpring Web Service, Spring JMS, Eclipse & Maven tutorials
Spring Web Service, Spring JMS, Eclipse & Maven tutorials
 
Spring 3 Annotated Development
Spring 3 Annotated DevelopmentSpring 3 Annotated Development
Spring 3 Annotated Development
 
Spring @Transactional Explained
Spring @Transactional ExplainedSpring @Transactional Explained
Spring @Transactional Explained
 
What's new in Spring 3?
What's new in Spring 3?What's new in Spring 3?
What's new in Spring 3?
 
Spring MVC Architecture Tutorial
Spring MVC Architecture TutorialSpring MVC Architecture Tutorial
Spring MVC Architecture Tutorial
 

Similar to Next stop: Spring 4

Testing Spring MVC and REST Web Applications
Testing Spring MVC and REST Web ApplicationsTesting Spring MVC and REST Web Applications
Testing Spring MVC and REST Web ApplicationsSam Brannen
 
Java EE 8 Update
Java EE 8 UpdateJava EE 8 Update
Java EE 8 UpdateRyan Cuprak
 
Jsp and Servlets
Jsp and ServletsJsp and Servlets
Jsp and ServletsRaghu nath
 
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012Sam Brannen
 
Spring Framework
Spring Framework  Spring Framework
Spring Framework tola99
 
Unit 38 - Spring MVC Introduction.pptx
Unit 38 - Spring MVC Introduction.pptxUnit 38 - Spring MVC Introduction.pptx
Unit 38 - Spring MVC Introduction.pptxAbhijayKulshrestha1
 
Spring 3.1: a Walking Tour
Spring 3.1: a Walking TourSpring 3.1: a Walking Tour
Spring 3.1: a Walking TourJoshua Long
 
Spring 3.1 in a Nutshell - JAX London 2011
Spring 3.1 in a Nutshell - JAX London 2011Spring 3.1 in a Nutshell - JAX London 2011
Spring 3.1 in a Nutshell - JAX London 2011Sam Brannen
 
Spring Day | Spring 3.1 in a Nutshell | Sam Brannen
Spring Day | Spring 3.1 in a Nutshell | Sam BrannenSpring Day | Spring 3.1 in a Nutshell | Sam Brannen
Spring Day | Spring 3.1 in a Nutshell | Sam BrannenJAX London
 
Integrating Servlets and JSP (The MVC Architecture)
Integrating Servlets and JSP  (The MVC Architecture)Integrating Servlets and JSP  (The MVC Architecture)
Integrating Servlets and JSP (The MVC Architecture)Amit Ranjan
 
Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC  Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC vipin kumar
 
Java Server Faces (JSF) - Basics
Java Server Faces (JSF) - BasicsJava Server Faces (JSF) - Basics
Java Server Faces (JSF) - BasicsBG Java EE Course
 
Java EE8 - by Kito Mann
Java EE8 - by Kito Mann Java EE8 - by Kito Mann
Java EE8 - by Kito Mann Kile Niklawski
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2divzi1913
 
Struts 2 - Introduction
Struts 2 - Introduction Struts 2 - Introduction
Struts 2 - Introduction Hitesh-Java
 
Session 41 - Struts 2 Introduction
Session 41 - Struts 2 IntroductionSession 41 - Struts 2 Introduction
Session 41 - Struts 2 IntroductionPawanMM
 
Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Tuna Tore
 
springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892Tuna Tore
 
IP UNIT III PPT.pptx
 IP UNIT III PPT.pptx IP UNIT III PPT.pptx
IP UNIT III PPT.pptxssuser92282c
 

Similar to Next stop: Spring 4 (20)

Testing Spring MVC and REST Web Applications
Testing Spring MVC and REST Web ApplicationsTesting Spring MVC and REST Web Applications
Testing Spring MVC and REST Web Applications
 
Java EE 8 Update
Java EE 8 UpdateJava EE 8 Update
Java EE 8 Update
 
Jsp and Servlets
Jsp and ServletsJsp and Servlets
Jsp and Servlets
 
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012
 
Spring Framework
Spring Framework  Spring Framework
Spring Framework
 
Unit 38 - Spring MVC Introduction.pptx
Unit 38 - Spring MVC Introduction.pptxUnit 38 - Spring MVC Introduction.pptx
Unit 38 - Spring MVC Introduction.pptx
 
Spring 3.1: a Walking Tour
Spring 3.1: a Walking TourSpring 3.1: a Walking Tour
Spring 3.1: a Walking Tour
 
Spring 3.1 in a Nutshell - JAX London 2011
Spring 3.1 in a Nutshell - JAX London 2011Spring 3.1 in a Nutshell - JAX London 2011
Spring 3.1 in a Nutshell - JAX London 2011
 
Spring Day | Spring 3.1 in a Nutshell | Sam Brannen
Spring Day | Spring 3.1 in a Nutshell | Sam BrannenSpring Day | Spring 3.1 in a Nutshell | Sam Brannen
Spring Day | Spring 3.1 in a Nutshell | Sam Brannen
 
Integrating Servlets and JSP (The MVC Architecture)
Integrating Servlets and JSP  (The MVC Architecture)Integrating Servlets and JSP  (The MVC Architecture)
Integrating Servlets and JSP (The MVC Architecture)
 
Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC  Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC
 
Java Server Faces (JSF) - Basics
Java Server Faces (JSF) - BasicsJava Server Faces (JSF) - Basics
Java Server Faces (JSF) - Basics
 
Java EE8 - by Kito Mann
Java EE8 - by Kito Mann Java EE8 - by Kito Mann
Java EE8 - by Kito Mann
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2
 
Struts 2 - Introduction
Struts 2 - Introduction Struts 2 - Introduction
Struts 2 - Introduction
 
Session 41 - Struts 2 Introduction
Session 41 - Struts 2 IntroductionSession 41 - Struts 2 Introduction
Session 41 - Struts 2 Introduction
 
Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5
 
springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892
 
IP UNIT III PPT.pptx
 IP UNIT III PPT.pptx IP UNIT III PPT.pptx
IP UNIT III PPT.pptx
 
Java J2EE Interview Question Part 2
Java J2EE Interview Question Part 2Java J2EE Interview Question Part 2
Java J2EE Interview Question Part 2
 

More from Oleg Tsal-Tsalko

Developer on a mission (Devoxx UA 2021)
Developer on a mission (Devoxx UA 2021)Developer on a mission (Devoxx UA 2021)
Developer on a mission (Devoxx UA 2021)Oleg Tsal-Tsalko
 
From Streams to Reactive Streams
From Streams to Reactive StreamsFrom Streams to Reactive Streams
From Streams to Reactive StreamsOleg Tsal-Tsalko
 
JUG UA AdoptJSR participation
JUG UA AdoptJSR participationJUG UA AdoptJSR participation
JUG UA AdoptJSR participationOleg Tsal-Tsalko
 
Develop modern apps using Spring ecosystem at time of BigData
Develop modern apps using Spring ecosystem at time of BigData Develop modern apps using Spring ecosystem at time of BigData
Develop modern apps using Spring ecosystem at time of BigData Oleg Tsal-Tsalko
 
Java 8 date & time javaday2014
Java 8 date & time javaday2014Java 8 date & time javaday2014
Java 8 date & time javaday2014Oleg Tsal-Tsalko
 
Enterprise Integration Patterns
Enterprise Integration PatternsEnterprise Integration Patterns
Enterprise Integration PatternsOleg Tsal-Tsalko
 
Distributed systems and scalability rules
Distributed systems and scalability rulesDistributed systems and scalability rules
Distributed systems and scalability rulesOleg Tsal-Tsalko
 
JUG involvment in JCP and AdopJSR program
JUG involvment in JCP and AdopJSR programJUG involvment in JCP and AdopJSR program
JUG involvment in JCP and AdopJSR programOleg Tsal-Tsalko
 

More from Oleg Tsal-Tsalko (14)

Developer on a mission (Devoxx UA 2021)
Developer on a mission (Devoxx UA 2021)Developer on a mission (Devoxx UA 2021)
Developer on a mission (Devoxx UA 2021)
 
Developer on a mission
Developer on a missionDeveloper on a mission
Developer on a mission
 
From Streams to Reactive Streams
From Streams to Reactive StreamsFrom Streams to Reactive Streams
From Streams to Reactive Streams
 
Java 9 Jigsaw HackDay
Java 9 Jigsaw HackDayJava 9 Jigsaw HackDay
Java 9 Jigsaw HackDay
 
JUG UA AdoptJSR participation
JUG UA AdoptJSR participationJUG UA AdoptJSR participation
JUG UA AdoptJSR participation
 
Develop modern apps using Spring ecosystem at time of BigData
Develop modern apps using Spring ecosystem at time of BigData Develop modern apps using Spring ecosystem at time of BigData
Develop modern apps using Spring ecosystem at time of BigData
 
Java 8 features
Java 8 featuresJava 8 features
Java 8 features
 
Lambdas HOL
Lambdas HOLLambdas HOL
Lambdas HOL
 
Java 8 date & time javaday2014
Java 8 date & time javaday2014Java 8 date & time javaday2014
Java 8 date & time javaday2014
 
Java 8 date & time
Java 8 date & timeJava 8 date & time
Java 8 date & time
 
Get ready for spring 4
Get ready for spring 4Get ready for spring 4
Get ready for spring 4
 
Enterprise Integration Patterns
Enterprise Integration PatternsEnterprise Integration Patterns
Enterprise Integration Patterns
 
Distributed systems and scalability rules
Distributed systems and scalability rulesDistributed systems and scalability rules
Distributed systems and scalability rules
 
JUG involvment in JCP and AdopJSR program
JUG involvment in JCP and AdopJSR programJUG involvment in JCP and AdopJSR program
JUG involvment in JCP and AdopJSR program
 

Recently uploaded

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
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
 
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
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
[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
 
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
 
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
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
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
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 

Recently uploaded (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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
 
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
 
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 ...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
[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
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
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...
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Next stop: Spring 4

  • 1. Speaker: Oleg Tsal-Tsalko (@tsaltsol) Next stop: Spring 4
  • 2. About me Oleg Tsal-Tsalko • Senior Java Developer in EPAM Systems. • Mostly working with enterprise business applications. • Member of LJC and JUG KPI communities.
  • 3. What version of Spring are you using? Bank applications
  • 4. Spring 3.1 (Previous stop) • Environment abstraction and profiles • Java-based application configuration • Overhaul of the test context framework • Cache abstraction & declarative caching • Servlet 3.0 based web applications • @MVC processing & flash attributes • Support for Java SE 7 And much more…
  • 6. XML based configuration <beans …> <cache:annotation-driven /> <bean id="cacheManager" class="org.springframework.cache.support.SimpleCacheManager"> … </bean> <context:property-placeholder location="classpath:/app-common.properties"/> <bean id="bookStoreService" class="spring.samples.service.BookStoreService" c:bookStoreDao- ref="bookStoreDao"/> <bean id="bookStoreDao" class="spring.samples.dao.BookStoreDao"> <property name="dataSource" ref="dataSource"/> </bean> … </beans> ApplicationContext context = new ClassPathXmlApplicationContext("bookstore-app-context.xml");
  • 7. Java based configuration ApplicationContext context = new AnnotationConfigApplicationContext(BookStoreAppConfig.class);
  • 8. Test context java based configuration
  • 9. Profiles in XML based configuration <beans> ... <beans profile="dev"> <jdbc:embedded-database id="dataSource"> <jdbc:script location="classpath:db/schema.sql"/> <jdbc:script location="classpath:db/test-data.sql"/> </jdbc:embedded-database> </beans> <beans profile="production"> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="oracle.jdbc.OracleDriver"/> <property name="url" value="jdbc:oracle:thin:@localhost:1521:booklibrary"/> <property name="username" value="admin"/> <property name="password" value="admin"/> </bean> </beans> ... </beans>
  • 10. Profiles in Java based configuration @Configuration @Profile("dev") public class DevProfileConfig { @Bean(name="dataSource”) public DataSource dataSource() {…} } @Configuration @Profile("production") public class ProductionProfileConfig { @Bean(name="dataSource”) public DataSource dataSource() {…} } @Configuration @Import( { DevProfileConfig.class, ProductionProfileConfig.class } ) public class BookStoreAppConfig { @Inject private DataSource dataSource; }
  • 11. How to enable active profile? 1) Using JVM property, which is preferred way: 2) Programmatically in standalone app: -Dspring.profiles.active=dev 3) In web.xml file:
  • 12. Cache abstraction • CacheManager and Cache abstraction in org.springframework.cache • Out of the box support for ConcurrentMap and EhCache • Ability to plug any Cache implementation (see Spring GemFire project for GemFile adapter)
  • 14. Enable caching annotations @Configuration @EnableCaching public class AppConfig { @Bean public CacheManager cacheManager() {…} … } <beans …> <cache:annotation-driven /> <bean id="cacheManager" class="org.springframework.cache.support.SimpleCacheManager"> … </bean> … </beans>
  • 15. Servlet 3.0 support • such as Tomcat 7 and GlassFish 3 Explicit support for Servlet 3.0 containers • Servlet 3.0's ServletContainerInitializer mechanism • Spring 3.1's AnnotationConfigWebApplicationContext • Spring 3.1's environment abstraction Support for XML- free web application setup • such as standard Servlet 3.0 file upload behind Spring's MultipartResolver abstraction Exposure of native Servlet 3.0 functionality in Spring MVC
  • 17. Spring 3.2 (Current stop) • Gradle-based build • Sources moved to GitHub • Sources built against Java 7 • Async MVC processing on Servlet 3.0 • Spring MVC test support • MVC configuration and SpEL refinements And much more…
  • 18. Async MVC processing: Callable - thread managed by Spring MVC - good for long running database jobs, 3rd party REST API calls, etc
  • 19. Async MVC Processing: DeferredResult - thread managed outside of Spring MVC - JMS or AMQP message listener, another HTTP request, etc.
  • 20. Async MVC Processing: WebAsyncTask - same as Callable, with extra features - override timeout value for async processing - lets you specify a specific AsyncTaskExecutor
  • 23. Spring 4 Engineering works will be held till the end of the year…
  • 24. Spring 4 (Next stop) We are expecting to see: • Comprehensive Java 8 support • Support for Java EE 7 APIs • Focus on message-oriented architectures • Annotation-driven JMS endpoint model • Revised application event mechanism • WebSocket support in Spring MVC • Next-generation Groovy support And more…
  • 25. Java 8 & Java EE 7 support Comprehensive Java 8 support • Lambdas • Date and Time API (JSR-310) • Parameter name discovery • Repeatable annotations • Concurrency enhancement Support for Java EE 7 APIs • Asynchronous API for RestTemplate • Bean Validation 1.1 (JSR-349) • Expression Language 3.0 (JSR-341) • JMS 2.0 (JSR-343) • Concurrency Utilities for Java EE (JSR- 236) • JPA 2.1 (JSR-338) • Servlet 3.1 (JSR-340) • JSF 2.2 (JSR-344)
  • 26. Annotation driven message endpoints <jms:annotation-driven> @JmsListener(destination="myQueue") public void handleMessage(TextMessage payload); @JmsListener(destination="myQueue", selector="...") public void handleMessage(String payload); @JmsListener(destination="myQueue") public String handleMessage(String payload); However this is not implemented yet - https://jira.springsource.org/browse/SPR-9882
  • 27. Bean Validation 1.1 support MethodValidationInterceptor autodetects Bean Validation 1.1's ExecutableValidator API now and uses it in favor of Hibernate Validator 4.2's native variant.
  • 28. JMS 2.0 support What was done already: • Added "deliveryDelay" property on JmsTemplate • Added support for "deliveryDelay" and CompletionListener to CachedMessageProducer • Added support for the new "create(Shared)DurableConsumer" variants in Spring’s CachingConnectionFactory • Added support for the new "createSession" variants with fewer parameters in Spring’s SingleConnectionFactory Known constraints: • There is no special support for the simplified JMSContext API, and likely never will be, because of different Spring mechanism of managing connection pools and sessions • JmsTemplate has no out-of-the-box support for send calls with an async completion listener.
  • 29. JEE7 concurrency utilities in Spring 4 This is built into ConcurrentTaskExecutor and ConcurrentTaskScheduler now, automatically detecting the JSR-236 ExecutorService variants and adapting to them. Example of ManagedExecutorService usage introduced in JEE7:
  • 30. JPA 2.1 support EntityManagerFactory.createEntityManager( SynchronizationType.SYNCHRONIZED/UNSYNCHRONIZED, Map) @PersistenceContext( synchronizationType=SYNCHRONIZED/UNSYNCHRONIZED) Support for both transactional and extended EntityManagers and for both Spring-managed resource transactions and JTA transactions
  • 34. WebSockets Client side support Programatic approach: Configuration based approach:
  • 35. JDK8 support in depth • Implicit use of LinkedHashMap/Set instead of simple HashMap/Set to preserve ordering diffs in JDK7 and JDK8 • Embed ASM4.1 into Spring codebase to support JDK8 bytecode changes and to keep compatibility with CGLib3.0 • Support for JDK 8 Data & Time (JSR-310) encorporated with Spring’s Joda Time lib • Add awaitTerminationSeconds/commonPool properties to ForkJoinPoolFactoryBean to support JDK8 changes in it. • Encorporate JDK8 changes in reflection API (such as java.lang.reflect.Parameter)
  • 36. Other changes… • Replace Burlap with Hessian (lightweight binary WS protocol) • Introduced @Conditional annotation (@Profile annotation has been refactored) • Updated to Gradle 1.6
  • 37. How to track progress? • Track JIRA - https://jira.springsource.org/issues/?jql=proje ct%20%3D%20SPR%20AND%20labels%20%3D %20%22major-theme-4.0%22 • Check commits to codebase - https://github.com/SpringSource/spring- framework/commits/master
  • 38. Thank you! Oleg Tsal-Tsalko Email: oleg.tsalko@gmail.com Twitter: @tsaltsol Special thanks to Josh Long (@starbuxman) for sharing quite useful info…