The document discusses Spring Session, which provides a way to store and configure session data handling in a platform-independent manner. It introduces Spring Session's architecture and components, including the SessionRepositoryFilter, SessionRepository implementations, and HttpSession wrappers. It then outlines the steps to use Spring Session with Redis for session persistence, including configuration of the RedisConnectionFactory, session usage, and bootstrap of SpringSession.
The Past Year in Spring for Apache GeodeVMware Tanzu
The document provides an overview of developments in the Spring for Apache Geode project over the past year. It discusses improvements and new features for Spring Test, Spring Data, Spring Session, and Spring Boot integration with Apache Geode. Key updates include enhanced mocking support in Spring Test, transaction event publishing in Spring Data, disabling indexes for Spring Session, and examples of caching patterns and configurations using the Spring and Geode frameworks.
This document introduces GradleFx, a Flex build tool that uses Gradle. It discusses key features of GradleFx such as supporting SWC, SWF, and AIR compilation; tasks for cleaning, compiling, packaging, and testing; and conventions for project structure and dependencies. Advanced topics covered include compiler options, JVM arguments, dependency configurations, and additional steps for AIR projects and FlexUnit testing. An example Gradle build script is provided.
Today's applications don't live in a vacuum - you need to take the applications to where your users are. Let Spring's REST support along with its powerful client-side technology support, help you get there faster.
The document describes how to configure Spring MVC to resolve method arguments from the HTTP session. It defines a SessionAttributeArgumentResolver class that implements HandlerMethodArgumentResolver to retrieve attributes from the session based on a key. It also shows how to register the resolver with the WebMvcConfigurer to make it available to controller methods. Finally, it provides an example of how to configure method security in Spring using annotations or Java configuration.
The document discusses servlets and how they work. Servlets are server-side Java programs that generate responses, usually in the form of HTML pages, to requests from web clients. Servlets run within a servlet container, which manages loading and executing servlets in response to requests. Servlets can access request parameters and session information, generate dynamic content, connect to databases, and more. Common methods include doGet() and doPost() to handle different HTTP request types.
This document discusses new features and improvements in Spring 4. It covers Java 8 support including lambda expressions, date/time API updates, and optional types. It also summarizes core container improvements like meta annotations, generic qualifiers, and conditional bean configuration. General web improvements involving the @RestController annotation and Jackson serialization views are outlined. Testing improvements such as active profile resolution and the SocketUtils class are also mentioned.
The document discusses improvements to caching in Spring 4.1, including support for JSR-107 annotations. Some key points:
- Spring now supports JCache (JSR-107) annotations like @CacheResult, which maps to Spring's @Cacheable.
- Examples show how to rewrite Spring caching code to use JSR-107 annotations, including customizing cache names and keys.
- Support for caching exceptions, cache resolvers, and default caching configurations are described.
- Enabling JSR-107 support requires adding the JCache API and spring-context-support dependencies.
This document summarizes Josh Long's presentation on updates to the Spring framework. It discusses:
- Spring Framework versions 3.1, 3.2, and the upcoming 4.0 release
- New features in Spring 3.1 including environment profiles, Java-based configuration, caching, and Servlet 3.0 support
- Plans for Spring 3.2 including a Gradle build, contribution model on GitHub, and asynchronous MVC processing
- Changes to plans for Spring 3.2 where support for Java EE 7 and Java SE 8 was postponed due to delays in those projects. Spring 3.2 will instead focus on core framework refinements with Java 8 and EE 7 features planned for Spring 3.
Spring provides tools for building multi-client web applications, including support for mobile clients and REST APIs. It includes the Spring MVC framework for building web UIs, the RestTemplate for consuming REST services, and tools like Spring Android for building native Android apps that integrate with REST backends. Demos show consuming a Spring REST service from a web UI, Android app, and HTML5 app to demonstrate support for multiple client types from a single backend.
This document provides an overview of using Dropwizard, an open-source Java framework, to build RESTful web services. It discusses REST concepts like resources and representations, REST verbs like GET and POST, and architectures for REST APIs. It then introduces Dropwizard and its components for building HTTP services with features like Jetty, Jersey, Jackson, and metrics support. The document demonstrates a sample Dropwizard TODO list application with REST endpoints and resources and discusses considerations for development, testing, and deployment.
Bring your Spring knowledge up-to-date by attending this workshop.
Instead of diving into functionality which was already there in older Spring versions, we will focus on the new Spring 4 features. We will however point out small API differences.
The structure of the Workshop will be as follows:
1. Java SE & Java EE support
2. Spring Core
3. Spring WebMVC
4. WebSockets & Messaging
5. Testing Improvements
Slides accompanying a presentation on Dropwizard I gave at the DevIgnition conference ( www.devignition.com ) on April 29, 2016. The sample code is on GitHub at https://github.com/sleberknight/dropwizard-devignition-2016
This document provides an overview of Java web programming and building a simple web application using Java technologies. It discusses using JDBC for database access, implementing servlets and filters, using JSP for views, and different web programming models including Model 1 where business logic is in JSPs and Model 2 where it is separated out to servlets. Code examples and links to GitHub repositories are provided for a TODO list application built using these techniques.
Java Web Programming [9/9] : Web Application SecurityIMC Institute
This document provides an overview of web application security. It discusses general security issues like authentication, authorization, data integrity and confidentiality. It then describes different web-tier authentication schemes like BASIC, DIGEST, FORM and CLIENT-CERT. Finally, it covers declarative and programmatic authorization approaches for access control at the web-tier.
The Web and Spring MVC continue to be one of the most active areas of the
Spring Framework with each new release adding plenty of features and refinements
requested by the community. Furthermore version 4 added a significant choice
for web applications to build WebSocket-style architectures.
This talk provides an overview of the areas in which the framework has evolved
along with highlights of specific noteworthy features from the most recent
releases.
This talk introduces the role that Spring MVC and REST can play as a service-side endpoint model that can be connected to from mobile, rich, and desktop applications.
This document provides an overview of web application development and servlet technology. It discusses the history and evolution of web pages to dynamic web applications. It then defines web applications and the request-response model. Common Gateway Interface (CGI) is introduced as the first technique for dynamic content, along with its limitations which led to the creation of servlets. Key servlet concepts like the servlet interface, generic servlet, HTTP servlet, and servlet lifecycle methods are covered. The document also examines the HttpServletRequest and HttpServletResponse interfaces and their various methods. Finally, it discusses session tracking approaches including cookies and the session API.
The document discusses Java web services and RESTful web services. It provides an overview of JAX-WS for implementing SOAP-based web services and JAX-RS for implementing RESTful web services. Key points include how JAX-WS uses annotations to simplify web service development, the SOAP protocol for exchanging messages, and how JAX-RS leverages HTTP methods and URIs to access resources on the web.
Spring Boot Revisited with KoFu and JaFuVMware Tanzu
This document summarizes a presentation on Spring Boot revisited with KoFu and JaFu. KoFu and JaFu are new flavors of Spring Boot that use functional programming approaches. KoFu uses Kotlin and functional bean registration, while JaFu uses Java and a lambda-based infrastructure. The presentation discusses the benefits of Kotlin and Java evolutions, an overview of Spring Fu which is an incubator for KoFu and JaFu, examples of applications written in each flavor, efficiency gains from using Kotlin and KoFu, the team working on the project, and a roadmap for upcoming features including native application support and automated transformation between configurations.
Single Page App (SPA) frameworks offer many benefits over traditional web apps which do all of their HTML generation on the server side. Popular SPA frameworks include Vue, React and Angular. Micronaut is very well suited for publishing REST APIs and is a terrific fit for implementing backend logic for SPAs.
The document provides an overview of servlets, including:
- What servlets are and how they work
- The lifecycle of a servlet from initialization to handling requests to destruction
- Options for server-side development like CGI, FastCGI, PHP
- Advantages of using servlets like performance, portability, and security
Take a look at what Rails 5 has in store for you. We go through all the new features and improvements across development, testing, caching and much more. So let's dive in.
Gradle is a flexible general purpose build system with a build-by-convention framework a la Maven on top. It uses Apache Ivy under the hood for its dependency management. Its build scripts are written in Groovy.
Servlets are Java classes that extend the functionality of a web server by dynamically generating web pages. Servlets use the Java programming language and are managed by a servlet container that handles loading, unloading, and directing requests. Servlets provide advantages over older technologies like CGI scripts such as better performance, portability, security, and access to full Java features. The basic servlet lifecycle involves initialization, handling requests, and destruction. Servlets can be generic or HTTP-specific, with HTTP servlets providing specialized methods for different HTTP request types. Sessions allow servlets to maintain state across multiple requests.
Santiago Pericas-Geertsen presented on new features in JAX-RS 2.1 including reactive extensions, server-sent events, and non-blocking I/O. He demonstrated the new reactive client API using CompletionStage and how it can compose asynchronous requests. He also showed how to implement server-sent events on the client and server side to enable one-way messaging. Finally, he proposed a new approach to non-blocking I/O in JAX-RS based on Java 9 Flows to allow processing collections of POJOs asynchronously.
The document discusses servlet session management. It covers servlet filters which can intercept and modify requests and responses. It also discusses the servlet context and configuration parameters, as well as the session object and APIs. Session attributes allow data to be stored and shared across requests from the same client, while context attributes are shared across the entire application. Session tracking allows associating requests from the same client, typically using cookies or URL rewriting to pass the session identifier.
The easy way to develop Java applications has always been the standard stack (Spring, JEE, SQL) that confirms the LAMP equivalent in Java-speak. This presentation compares this model with a real use case based on Guice, Jersey and AppEngine.
Le temps est révolu où Java EE ne serait qu’à développer des applications de mise à jour de données, avec JSF / EJB / JPA. Aujourd’hui Java EE s’est assoupli et s’est ouvert sur le monde, avec CDI comme clé de voûte et a repoussé nos limites grâce à des capacités d’extension puissantes et faciles d’utilisation comme JCA.
Dans un premier temps, nous reviendrons rapidement sur la place de CDI dans JavaEE 7 et sur ses mécanismes d’extension. Dans un deuxième temps, nous verrons les techniques de connecteurs JCA et comment ils peuvent aussi constituer une possibilité d’ouverture simple à mettre en œuvre. JCA fournit des techniques pour gérer des connexions sortantes ou entrantes, sur des formats ou protocoles variés.
This document summarizes Josh Long's presentation on updates to the Spring framework. It discusses:
- Spring Framework versions 3.1, 3.2, and the upcoming 4.0 release
- New features in Spring 3.1 including environment profiles, Java-based configuration, caching, and Servlet 3.0 support
- Plans for Spring 3.2 including a Gradle build, contribution model on GitHub, and asynchronous MVC processing
- Changes to plans for Spring 3.2 where support for Java EE 7 and Java SE 8 was postponed due to delays in those projects. Spring 3.2 will instead focus on core framework refinements with Java 8 and EE 7 features planned for Spring 3.
Spring provides tools for building multi-client web applications, including support for mobile clients and REST APIs. It includes the Spring MVC framework for building web UIs, the RestTemplate for consuming REST services, and tools like Spring Android for building native Android apps that integrate with REST backends. Demos show consuming a Spring REST service from a web UI, Android app, and HTML5 app to demonstrate support for multiple client types from a single backend.
This document provides an overview of using Dropwizard, an open-source Java framework, to build RESTful web services. It discusses REST concepts like resources and representations, REST verbs like GET and POST, and architectures for REST APIs. It then introduces Dropwizard and its components for building HTTP services with features like Jetty, Jersey, Jackson, and metrics support. The document demonstrates a sample Dropwizard TODO list application with REST endpoints and resources and discusses considerations for development, testing, and deployment.
Bring your Spring knowledge up-to-date by attending this workshop.
Instead of diving into functionality which was already there in older Spring versions, we will focus on the new Spring 4 features. We will however point out small API differences.
The structure of the Workshop will be as follows:
1. Java SE & Java EE support
2. Spring Core
3. Spring WebMVC
4. WebSockets & Messaging
5. Testing Improvements
Slides accompanying a presentation on Dropwizard I gave at the DevIgnition conference ( www.devignition.com ) on April 29, 2016. The sample code is on GitHub at https://github.com/sleberknight/dropwizard-devignition-2016
This document provides an overview of Java web programming and building a simple web application using Java technologies. It discusses using JDBC for database access, implementing servlets and filters, using JSP for views, and different web programming models including Model 1 where business logic is in JSPs and Model 2 where it is separated out to servlets. Code examples and links to GitHub repositories are provided for a TODO list application built using these techniques.
Java Web Programming [9/9] : Web Application SecurityIMC Institute
This document provides an overview of web application security. It discusses general security issues like authentication, authorization, data integrity and confidentiality. It then describes different web-tier authentication schemes like BASIC, DIGEST, FORM and CLIENT-CERT. Finally, it covers declarative and programmatic authorization approaches for access control at the web-tier.
The Web and Spring MVC continue to be one of the most active areas of the
Spring Framework with each new release adding plenty of features and refinements
requested by the community. Furthermore version 4 added a significant choice
for web applications to build WebSocket-style architectures.
This talk provides an overview of the areas in which the framework has evolved
along with highlights of specific noteworthy features from the most recent
releases.
This talk introduces the role that Spring MVC and REST can play as a service-side endpoint model that can be connected to from mobile, rich, and desktop applications.
This document provides an overview of web application development and servlet technology. It discusses the history and evolution of web pages to dynamic web applications. It then defines web applications and the request-response model. Common Gateway Interface (CGI) is introduced as the first technique for dynamic content, along with its limitations which led to the creation of servlets. Key servlet concepts like the servlet interface, generic servlet, HTTP servlet, and servlet lifecycle methods are covered. The document also examines the HttpServletRequest and HttpServletResponse interfaces and their various methods. Finally, it discusses session tracking approaches including cookies and the session API.
The document discusses Java web services and RESTful web services. It provides an overview of JAX-WS for implementing SOAP-based web services and JAX-RS for implementing RESTful web services. Key points include how JAX-WS uses annotations to simplify web service development, the SOAP protocol for exchanging messages, and how JAX-RS leverages HTTP methods and URIs to access resources on the web.
Spring Boot Revisited with KoFu and JaFuVMware Tanzu
This document summarizes a presentation on Spring Boot revisited with KoFu and JaFu. KoFu and JaFu are new flavors of Spring Boot that use functional programming approaches. KoFu uses Kotlin and functional bean registration, while JaFu uses Java and a lambda-based infrastructure. The presentation discusses the benefits of Kotlin and Java evolutions, an overview of Spring Fu which is an incubator for KoFu and JaFu, examples of applications written in each flavor, efficiency gains from using Kotlin and KoFu, the team working on the project, and a roadmap for upcoming features including native application support and automated transformation between configurations.
Single Page App (SPA) frameworks offer many benefits over traditional web apps which do all of their HTML generation on the server side. Popular SPA frameworks include Vue, React and Angular. Micronaut is very well suited for publishing REST APIs and is a terrific fit for implementing backend logic for SPAs.
The document provides an overview of servlets, including:
- What servlets are and how they work
- The lifecycle of a servlet from initialization to handling requests to destruction
- Options for server-side development like CGI, FastCGI, PHP
- Advantages of using servlets like performance, portability, and security
Take a look at what Rails 5 has in store for you. We go through all the new features and improvements across development, testing, caching and much more. So let's dive in.
Gradle is a flexible general purpose build system with a build-by-convention framework a la Maven on top. It uses Apache Ivy under the hood for its dependency management. Its build scripts are written in Groovy.
Servlets are Java classes that extend the functionality of a web server by dynamically generating web pages. Servlets use the Java programming language and are managed by a servlet container that handles loading, unloading, and directing requests. Servlets provide advantages over older technologies like CGI scripts such as better performance, portability, security, and access to full Java features. The basic servlet lifecycle involves initialization, handling requests, and destruction. Servlets can be generic or HTTP-specific, with HTTP servlets providing specialized methods for different HTTP request types. Sessions allow servlets to maintain state across multiple requests.
Santiago Pericas-Geertsen presented on new features in JAX-RS 2.1 including reactive extensions, server-sent events, and non-blocking I/O. He demonstrated the new reactive client API using CompletionStage and how it can compose asynchronous requests. He also showed how to implement server-sent events on the client and server side to enable one-way messaging. Finally, he proposed a new approach to non-blocking I/O in JAX-RS based on Java 9 Flows to allow processing collections of POJOs asynchronously.
The document discusses servlet session management. It covers servlet filters which can intercept and modify requests and responses. It also discusses the servlet context and configuration parameters, as well as the session object and APIs. Session attributes allow data to be stored and shared across requests from the same client, while context attributes are shared across the entire application. Session tracking allows associating requests from the same client, typically using cookies or URL rewriting to pass the session identifier.
The easy way to develop Java applications has always been the standard stack (Spring, JEE, SQL) that confirms the LAMP equivalent in Java-speak. This presentation compares this model with a real use case based on Guice, Jersey and AppEngine.
Le temps est révolu où Java EE ne serait qu’à développer des applications de mise à jour de données, avec JSF / EJB / JPA. Aujourd’hui Java EE s’est assoupli et s’est ouvert sur le monde, avec CDI comme clé de voûte et a repoussé nos limites grâce à des capacités d’extension puissantes et faciles d’utilisation comme JCA.
Dans un premier temps, nous reviendrons rapidement sur la place de CDI dans JavaEE 7 et sur ses mécanismes d’extension. Dans un deuxième temps, nous verrons les techniques de connecteurs JCA et comment ils peuvent aussi constituer une possibilité d’ouverture simple à mettre en œuvre. JCA fournit des techniques pour gérer des connexions sortantes ou entrantes, sur des formats ou protocoles variés.
This document provides an introduction to Contexts and Dependency Injection (CDI) in Java EE. It discusses what CDI is, including dependency injection, context management, and the observer pattern. It covers the history and implementations of CDI. It then describes the basics of CDI including bean activation, qualifiers to distinguish beans, producers, contexts, events, decorators, interceptors, and more.
This document provides an overview of REST (Representational State Transfer), including the key aspects of RESTful architectures such as:
- Resources are addressed through URIs
- Standard HTTP methods like GET, PUT, POST, DELETE are used to manipulate resources
- Data is represented in various formats like JSON, XML, HTML
- Communication is stateless between client and server
It then discusses how these REST principles are implemented in RESTEasy, the JBoss RESTful Web Services framework, through annotations and APIs. Features like content negotiation, interceptors, asynchronous calls and caching are also covered.
The document discusses using annotations in Java, providing examples of annotations for servlets, EJBs, web services, CDI, and using frameworks like JUnit, Spring, Javassist, and ASM. It presents code samples to define servlets, session beans, RESTful and SOAP web services, and component injection using annotations instead of XML configurations. The document also demonstrates how to programmatically read annotation values and metadata using reflection, Javassist, and ASM.
RESTEasy is a framework for building RESTful web services in Java. It allows developers to write JAX-RS annotated Java classes to define resources and their representations. Resources are addressable via URIs and support standard HTTP methods like GET, PUT, POST, and DELETE. Resources return representations in formats like JSON, XML, and HTML. Communication is stateless and driven by hypermedia links between resources. RESTEasy supports features like interceptors, asynchronous jobs, caching, GZIP compression, and integration with Spring and other frameworks.
TDC2017 | São Paulo - Trilha Android How we figured out we had a SRE team at ...tdc-globalcode
The document discusses reactive architectures for mobile applications. It introduces common mobile architectures like MVP, MVVM, VIPER and compares them. It then describes how to incorporate RxJava to improve these architectures by replacing callbacks with observable sequences. This improves testability and manages threading and errors better. It provides an example of using RxJava in the data and presentation layers to stream asynchronous events and update the UI reactively.
Cloud native programming model comparisonEmily Jiang
Emily Jiang is a senior technical staff member at IBM and advocate for MicroProfile and CDI. She presented on choosing between MicroProfile and Spring for building cloud-native microservices. Some key points from the document include:
- MicroProfile is an open specification for enterprise Java microservices that includes specifications for REST services, configuration, fault tolerance, security and more. It has seen 9 platform releases since 2016.
- Spring is a popular framework for building microservices that includes features like REST, dependency injection, API documentation, reactive programming and more.
- Both MicroProfile and Spring provide options for building cloud-native microservices in Java, with MicroProfile being more standards-based while Spring is a
1/3 : introduction to CDI - Antoine Sabot-DurandSOAT
Allez plus Loin avec CDI
En moins de 5 ans d’existence, Contexts and Dependency Injection (CDI) est devenue l’une des principale spécification de Java EE. Néanmoins, CDI est bien souvent perçu comme une simple solution d’injection de dépendance enrichie alors que cette spécification est bien plus riche que ça. Lors de cette présentation, après un rapide rappel des fonctionnalités de base de CDI, nous montrerons comment son utilisation avancée permet Java EE en intégrant des technologies legacy ou plus récent de manière naturelle. Nous finirons avec le travail en cours sur CDI 2.0 qui a commencé début septembre.
This document discusses architecture components for building modern Android applications. It covers common app architecture problems and principles like separation of concerns. It introduces key Architecture Components like Activities, Fragments, Services, ContentProviders, ViewModels and LiveData. It also discusses architectural patterns like MVC, MVP, MVVM and recommendations like clean architecture. The document emphasizes principles like modularity, separation of concerns, and testability. It provides an overview of alternatives like Room, Paging Library, and recommendations for legacy apps.
This document discusses architecture components for building modern Android applications. It covers common app architecture problems and principles like separation of concerns. It introduces key Architecture Components like Activities, Fragments, Services, ContentProviders, ViewModels and LiveData. It also discusses architectural patterns like MVC, MVP, MVVM and recommendations like clean architecture. The document emphasizes principles like modularity, separation of concerns, and testability. It provides an overview of alternatives like Room, Paging Library, and recommendations for legacy apps.
This is a part of an online Codename One course published around 2017 see it all for free at https://debugagent.com/series/cn1
This document discusses using the VRaptor web framework with CDI in a Java EE environment. It covers how to configure VRaptor controllers using CDI annotations, inject dependencies, handle requests and responses, validate user input, manage transactions and persistence with JPA, and leverage other Java EE features like EJBs. It also describes how VRaptor integrates with the Java EE platform and additional functionality provided by VRaptor plugins.
At upday, we’ve been successfully using the Model-View-ViewModel pattern together with RxJava for more than a year and half. After sharing with the community a very high level overview of what this pattern entails, we decided that it’s time to go deeper in the implementation details.
I will present our way of handling Android classes and other 3rd party dependencies, and how we make sure that our code is as unit-testable as possible. I’ll speak about our decision process on how to split classes, may they be Views, ViewModels or DataModels, and the benefits and drawbacks of these separations.
Any non-”Hello World” app will most likely have two things: multiple Activities/Fragments, of which at least one will contain a ListView/RecyclerView. I will show how we decided to implement the navigation between Views and how we test it. Then I’ll show how we handle lists: how is the data added to the list, and how and who listens and reacts to list items taps.
Battle Of The Microservice Frameworks: Micronaut versus Quarkus edition! Michel Schudel
Micronaut and Quarkus are two cool emerging Java backend frameworks that aim to solve some problems that exist in current frameworks, like faster startup, low memory footprint, and support for ahead-of-time compilation using GraalVM. In this session, we'll square off both frameworks against each other.
How do they compare, what are the stronger and weaker points of both frameworks?
We'll compare the following features:
Initializing your project
Building your first restcontroller / programming model
Startup time
Database support
Integration test support
Building native images
Memory usage and JAR sizes
Ease of cloud deployment
In the end, we might have a clear winner! ... or will we?
This document discusses integrating GWT with Vaadin. It covers various transport mechanisms for communicating between the client and server like RequestBuilder, JSON, and Jackson. It also discusses Vaadin connectors which use shared state and RPC with JSON to keep the UI state synchronized on the server. Finally, it discusses how Polymer allows exposing Vaadin widgets as reusable web components using shadow DOM and JavaScript interop from GWT.
Spring Boot is a framework for building stand-alone, production-grade Spring based Applications that can be "just run". It takes an opinionated view of the Spring platform and third-party libraries so developers can get started with minimum fuss. Some key features include an embedded HTTP server and automatic configuration support. Spring Boot applications can be started using Java -jar or executed using Gradle/Maven and can be packaged as an executable jar or war file for deployment. The document also discusses using Spring Boot with databases, profiles, Spring Data, GORM, views and some miscellaneous topics.
Android Architecture Components - Guy Bar on, VonageDroidConTLV
The Android Architecture Components help developers write robust Android apps by providing libraries for common patterns like lifecycles, data access, and navigation. Specifically, it introduces Room for database access, LiveData as a lifecycle-aware data holder, ViewModel for storing UI-related data, and Paging to handle pagination of large data sets efficiently from a database. These libraries work together to support best practices like separation of concerns and lifecycle-aware data management in Android apps.
Implement Service Broker with Spring Boot #cf_tokyoToshiaki Maki
This document discusses implementing a service broker with Spring Boot to provide services to applications running on Cloud Foundry. It provides an overview of service brokers and their APIs in Cloud Foundry. It then demonstrates how to build a sample fake service broker using Spring Boot and the Spring Cloud CloudFoundry Service Broker library by implementing the broker APIs and services. The broker is deployed locally to PCF Dev and services are created and bound to applications.
Leverage CompletableFutures to handle async queries. DevNexus 2022David Gómez García
Slides used at DevNexus 22 talk.
Completable futures were introduced in Java 8, and they are a powerful mechanism to add concurrency (not parallelism) to your application logic, and it may be handy when dealing with multiple queries to different systems.
If you are a developer, you may make your code more performant by using CompletableFutures where it makes sense.
If you are a library developer, it may be a good thing to offer an API that returns CompletableFutures so that your users will be able to benefit from it.
Building Modular monliths that could scale to microservices (only if they nee...David Gómez García
It’s easy these days to fall into the trap of starting to design your whole application with a microservices architecture…. Because, you know, that’s what everyone is doing, right?
But no, no. I’m not going to deny that Microservices have their advantages, specifically in a distributed and scalable world like the one we need to deal with. The problem may be in the approach we are taking. Are we considering the microservices architecture as a goal, or as a means to a purpose?
In this talk we will think in a different approach: we will go back to the basics, and see how following DDD, CQRS and Event-Sourcing practices will drive our application design and evolution in such a way that we will start with a monolith but we will have the ability to scale into a microservices architecture more or less easily when (and more importantly: if) we need to.
Building modular monoliths that could scale to microservices (only if they ne...David Gómez García
It’s easy these days to fall into the trap of starting to design your whole application with a microservices architecture…. Because, you know, that’s what everyone is doing. Aren't they?
But, are we considering the microservices architecture as a goal or as a means to a purpose?
In this talk, we will go back to the basics and see how DDD, CQRS and EventSourcing practices drive our application design and evolution so that we will start with a monolith. Still, we will have the ability to scale into microservices more or less easily when (and more importantly: if) we need to.
Leveraging Completable Futures to handle your query results AsynchrhonouslyDavid Gómez García
The document discusses leveraging CompletableFutures to handle asynchronous query results in Java. It begins with an overview of concurrency vs parallelism and tools in Java for concurrency. It then covers using ExecutorServices and Futures to run tasks asynchronously before introducing CompletableFutures, which allow fluent chaining and composition of dependent asynchronous tasks. Examples are provided of using CompletableFutures to run database queries asynchronously and maximize performance. Considerations for using CompletableFutures in APIs are also discussed.
Builiding Modular monoliths that can scale to microservices. JBCNConf 2021David Gómez García
It’s easy these days to fall into the trap of starting to design your whole application with a microservices architecture…. Because, you know, that’s what everyone is doing. Aren't they?
But, are we considering the microservices architecture as a goal or as a means to a purpose?
In this talk, we will go back to the basics and see how DDD, CQRS and EventSourcing practices drive our application design and evolution so that we will start with a monolith. Still, we will have the ability to scale into microservices more or less easily when (and more importantly: if) we need to.
These are the slides I used in my talk at JBCNConf 2021.
Cdm mil-18 - hypermedia ap is for headless platforms and data integrationDavid Gómez García
Slides from my talk at Codemotion Milan 2018. Speaking about how Headess and Hypermedia REST APIs can leverage the way . we integrate different platforms and share date between them
The document discusses the importance of communities for open source projects like Liferay. It describes the different facets of the Liferay community, including forums, chat rooms, local user groups, and opportunities for engagement at different levels from consumer to contributor to creator. It outlines the benefits communities provide, such as helping to shape the future of the product by providing feedback, new contributions and uses. The key message is that strong communities are valuable for open source projects and users.
Java9 Beyond Modularity - Java 9 más allá de la modularidadDavid Gómez García
These are the slides I used for my "Java 9 beyond modularity" at several different local meetups and conferences in Spain during 2017
Java 9 is about to reach its public release scheduled for September 2017. If we ask what are the new features that this new version will include, probably the first that comes to our head is modularity.
But java 9 brings with a lot of features beyound Jigsaw, JPMS or modularity. In this talk we will talk about at least 9 other new features that include this new version of Java that are interesting and maybe will end up being more used than the modularity itself for those who embrace the new version.
Those are changes that come to complement and improve even more the set of new tools (like Streams, Optionals, etc...) that Java 8 brought to us.
We'll take a look at small changes in language syntax (such as new ways of using try-with-resources), changes in Collections APIs and Streams, new tools like VarHandles, new APIs such as the Flow API, and As we allow the inclusion of reactive programming with Java.
Do you want to see in Java 9 beyond modularity? Do you want to have a more complete view of what you can provide? Let's take a look toghether!
The slides from the talk I gave at Oracle III #JuevesTecnológicos in Madrid.
A review of how the ParallelStreams Work in Java 8 and some considerations we must know in order to get the better performance from the concurrent data processing in #Java8
Estas son las slides que utilicé en la charla de la reunión de Septiembre de 2014 del GDG de Madrid.
Desde hace tiempo, los desarrolladores venimos utilizando scripts para automatizar y facilitarnos la construcción automática de nuestros proyectos.
En los intentos de estandarización de esos Scripts, la primera herramienta fue Ant, muy flexible, pero muy tediosa por lo verboso y por que siempre había que empezar desde cero.
La llegada de Maven supuso una cierta convención en las tareas y fases de construcción de un proyecto. Pero también incluía una tremenda facilidad para la gestión de librerías y dependencias. A cambio, impone una cierta rigidez en la estructura del script.
Gradle ha venido a buscar lo mejor de los dos mundos: la fexibilidad de Ant, la convención de Maven, la gestión de librerías de Ivy o Mvn.... y todo ello con un lenguaje de scripting más parecido al código que al XML en el que se basan las dos precedesoras.
Desde hace meses, Google ya ha apostado por Gradle como sistema de construcción de proyectos para Android en su Android Studio.
En esta charla, haremos una introducción a Gradle como herramienta de construcción de proyectos.
Java 8 Stream API. A different way to process collections.David Gómez García
A look on one of the features of Java 8 hidden behind the lambdas. A different way to iterate Collections. You'll never see the Collecions the same way.
These are the slides I used on my talk at the "Tech Thursday" by Oracle in June in Madrid.
Midiendo la calidad de código en WTF/Min (Revisado EUI Abril 2014)David Gómez García
The document discusses various examples of poor code quality, such as unnecessary comments, overly complex code, poor naming conventions, and unnecessary code. It provides examples of real code snippets that demonstrate these issues. It also discusses principles of good code quality like keeping code simple, avoiding duplication, and separation of concerns. Finally, it discusses tools and techniques for measuring and ensuring code quality like unit testing, code reviews, quality metrics, and issue tracking dashboards.
With code examples from the real world that could give you a stroke.
The slides I used on my talk at t3chFest Madrid 2014.
A talk about Code Quality, Clean Code, and good and bad practices when writing code. A fun walk through the experiences from the real world with some advices and introducing some principles that will help you to write better code.
This document discusses different build tools including Ant, Maven, and Gradle. It provides examples of build files for each tool and compares their characteristics such as flexibility, conventions, dependencies management, and extensibility. Ant is described as very flexible but verbose and complex to write and maintain. Maven enforces conventions but has a rigid structure. Gradle combines flexibility, conventions, and extensibility through its Groovy DSL.
El poder del creador de Software. Entre la ingeniería y la artesaníaDavid Gómez García
El documento presenta una serie de diapositivas de una charla sobre el poder del desarrollador de software. La charla enfatiza la necesidad de mantenerse actualizado continuamente aprendiendo nuevos lenguajes y técnicas, practicando a través de ejercicios y participando en eventos y comunidades. También advierte sobre los peligros de depender demasiado de frameworks sin comprenderlos a profundidad y la importancia de trabajar en equipo compartiendo conocimientos.
How to track an Event, trademark, company or subject to know not only how much people is talking about it, but also analizying sentimentally what is being said to know whether people is talking positive or negative.
An example mixing public APIs from Twitter, Google Maps and APICulture.
This is the slides set I used for my talk at Mediterranea APIDays held in Madrid in
The process of creating HDTR images from the photographic shot to the processing via a Photoshop JS script explained.
This is the slide I used for my talk at the monthly MadridJS meeting held on May, 23rd 2013.
The document discusses various ways to measure and improve code quality, including avoiding poor practices that can decrease code quality. It provides examples of real-world code with quality issues, such as unnecessary comments, exceptions handled poorly, and unclear naming. The document emphasizes writing code for readability and maintainability by future developers. It also promotes principles like keeping code simple, avoiding repetition, and separating concerns.
Presentación utilizada en el Codemotion 2012 en Madrid.
Integración de un sistema Real utilizando Google Protobuf, Spring, REST, JMS y MongoDB
La experiencia de un proyecto real para control de tráfico marítimo, sus requisitos, las tecnologías que se utilizarón y el porqué de cada una de ellas.
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveScyllaDB
Want to learn practical tips for designing systems that can scale efficiently without compromising speed?
Join us for a workshop where we’ll address these challenges head-on and explore how to architect low-latency systems using Rust. During this free interactive workshop oriented for developers, engineers, and architects, we’ll cover how Rust’s unique language features and the Tokio async runtime enable high-performance application development.
As you explore key principles of designing low-latency systems with Rust, you will learn how to:
- Create and compile a real-world app with Rust
- Connect the application to ScyllaDB (NoSQL data store)
- Negotiate tradeoffs related to data modeling and querying
- Manage and monitor the database for consistently low latencies
AI and Data Privacy in 2025: Global TrendsInData Labs
In this infographic, we explore how businesses can implement effective governance frameworks to address AI data privacy. Understanding it is crucial for developing effective strategies that ensure compliance, safeguard customer trust, and leverage AI responsibly. Equip yourself with insights that can drive informed decision-making and position your organization for success in the future of data privacy.
This infographic contains:
-AI and data privacy: Key findings
-Statistics on AI data privacy in the today’s world
-Tips on how to overcome data privacy challenges
-Benefits of AI data security investments.
Keep up-to-date on how AI is reshaping privacy standards and what this entails for both individuals and organizations.
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025BookNet Canada
Book industry standards are evolving rapidly. In the first part of this session, we’ll share an overview of key developments from 2024 and the early months of 2025. Then, BookNet’s resident standards expert, Tom Richardson, and CEO, Lauren Stewart, have a forward-looking conversation about what’s next.
Link to recording, transcript, and accompanying resource: https://bnctechforum.ca/sessions/standardsgoals-for-2025-standards-certification-roundup/
Presented by BookNet Canada on May 6, 2025 with support from the Department of Canadian Heritage.
Role of Data Annotation Services in AI-Powered ManufacturingAndrew Leo
From predictive maintenance to robotic automation, AI is driving the future of manufacturing. But without high-quality annotated data, even the smartest models fall short.
Discover how data annotation services are powering accuracy, safety, and efficiency in AI-driven manufacturing systems.
Precision in data labeling = Precision on the production floor.
What is Model Context Protocol(MCP) - The new technology for communication bw...Vishnu Singh Chundawat
The MCP (Model Context Protocol) is a framework designed to manage context and interaction within complex systems. This SlideShare presentation will provide a detailed overview of the MCP Model, its applications, and how it plays a crucial role in improving communication and decision-making in distributed systems. We will explore the key concepts behind the protocol, including the importance of context, data management, and how this model enhances system adaptability and responsiveness. Ideal for software developers, system architects, and IT professionals, this presentation will offer valuable insights into how the MCP Model can streamline workflows, improve efficiency, and create more intuitive systems for a wide range of use cases.
Artificial Intelligence is providing benefits in many areas of work within the heritage sector, from image analysis, to ideas generation, and new research tools. However, it is more critical than ever for people, with analogue intelligence, to ensure the integrity and ethical use of AI. Including real people can improve the use of AI by identifying potential biases, cross-checking results, refining workflows, and providing contextual relevance to AI-driven results.
News about the impact of AI often paints a rosy picture. In practice, there are many potential pitfalls. This presentation discusses these issues and looks at the role of analogue intelligence and analogue interfaces in providing the best results to our audiences. How do we deal with factually incorrect results? How do we get content generated that better reflects the diversity of our communities? What roles are there for physical, in-person experiences in the digital world?
Big Data Analytics Quick Research Guide by Arthur MorganArthur Morgan
This is a Quick Research Guide (QRG).
QRGs include the following:
- A brief, high-level overview of the QRG topic.
- A milestone timeline for the QRG topic.
- Links to various free online resource materials to provide a deeper dive into the QRG topic.
- Conclusion and a recommendation for at least two books available in the SJPL system on the QRG topic.
QRGs planned for the series:
- Artificial Intelligence QRG
- Quantum Computing QRG
- Big Data Analytics QRG
- Spacecraft Guidance, Navigation & Control QRG (coming 2026)
- UK Home Computing & The Birth of ARM QRG (coming 2027)
Any questions or comments?
- Please contact Arthur Morgan at [email protected].
100% human made.
How Can I use the AI Hype in my Business Context?Daniel Lehner
𝙄𝙨 𝘼𝙄 𝙟𝙪𝙨𝙩 𝙝𝙮𝙥𝙚? 𝙊𝙧 𝙞𝙨 𝙞𝙩 𝙩𝙝𝙚 𝙜𝙖𝙢𝙚 𝙘𝙝𝙖𝙣𝙜𝙚𝙧 𝙮𝙤𝙪𝙧 𝙗𝙪𝙨𝙞𝙣𝙚𝙨𝙨 𝙣𝙚𝙚𝙙𝙨?
Everyone’s talking about AI but is anyone really using it to create real value?
Most companies want to leverage AI. Few know 𝗵𝗼𝘄.
✅ What exactly should you ask to find real AI opportunities?
✅ Which AI techniques actually fit your business?
✅ Is your data even ready for AI?
If you’re not sure, you’re not alone. This is a condensed version of the slides I presented at a Linkedin webinar for Tecnovy on 28.04.2025.
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc
Most consumers believe they’re making informed decisions about their personal data—adjusting privacy settings, blocking trackers, and opting out where they can. However, our new research reveals that while awareness is high, taking meaningful action is still lacking. On the corporate side, many organizations report strong policies for managing third-party data and consumer consent yet fall short when it comes to consistency, accountability and transparency.
This session will explore the research findings from TrustArc’s Privacy Pulse Survey, examining consumer attitudes toward personal data collection and practical suggestions for corporate practices around purchasing third-party data.
Attendees will learn:
- Consumer awareness around data brokers and what consumers are doing to limit data collection
- How businesses assess third-party vendors and their consent management operations
- Where business preparedness needs improvement
- What these trends mean for the future of privacy governance and public trust
This discussion is essential for privacy, risk, and compliance professionals who want to ground their strategies in current data and prepare for what’s next in the privacy landscape.
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Aqusag Technologies
In late April 2025, a significant portion of Europe, particularly Spain, Portugal, and parts of southern France, experienced widespread, rolling power outages that continue to affect millions of residents, businesses, and infrastructure systems.
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul
Artificial intelligence is changing how businesses operate. Companies are using AI agents to automate tasks, reduce time spent on repetitive work, and focus more on high-value activities. Noah Loul, an AI strategist and entrepreneur, has helped dozens of companies streamline their operations using smart automation. He believes AI agents aren't just tools—they're workers that take on repeatable tasks so your human team can focus on what matters. If you want to reduce time waste and increase output, AI agents are the next move.
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfSoftware Company
Explore the benefits and features of advanced logistics management software for businesses in Riyadh. This guide delves into the latest technologies, from real-time tracking and route optimization to warehouse management and inventory control, helping businesses streamline their logistics operations and reduce costs. Learn how implementing the right software solution can enhance efficiency, improve customer satisfaction, and provide a competitive edge in the growing logistics sector of Riyadh.
Dev Dives: Automate and orchestrate your processes with UiPath MaestroUiPathCommunity
This session is designed to equip developers with the skills needed to build mission-critical, end-to-end processes that seamlessly orchestrate agents, people, and robots.
📕 Here's what you can expect:
- Modeling: Build end-to-end processes using BPMN.
- Implementing: Integrate agentic tasks, RPA, APIs, and advanced decisioning into processes.
- Operating: Control process instances with rewind, replay, pause, and stop functions.
- Monitoring: Use dashboards and embedded analytics for real-time insights into process instances.
This webinar is a must-attend for developers looking to enhance their agentic automation skills and orchestrate robust, mission-critical processes.
👨🏫 Speaker:
Andrei Vintila, Principal Product Manager @UiPath
This session streamed live on April 29, 2025, 16:00 CET.
Check out all our upcoming Dev Dives sessions at https://community.uipath.com/dev-dives-automation-developer-2025/.
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfAbi john
Analyze the growth of meme coins from mere online jokes to potential assets in the digital economy. Explore the community, culture, and utility as they elevate themselves to a new era in cryptocurrency.
Mobile App Development Company in Saudi ArabiaSteve Jonas
EmizenTech is a globally recognized software development company, proudly serving businesses since 2013. With over 11+ years of industry experience and a team of 200+ skilled professionals, we have successfully delivered 1200+ projects across various sectors. As a leading Mobile App Development Company In Saudi Arabia we offer end-to-end solutions for iOS, Android, and cross-platform applications. Our apps are known for their user-friendly interfaces, scalability, high performance, and strong security features. We tailor each mobile application to meet the unique needs of different industries, ensuring a seamless user experience. EmizenTech is committed to turning your vision into a powerful digital product that drives growth, innovation, and long-term success in the competitive mobile landscape of Saudi Arabia.
Semantic Cultivators : The Critical Future Role to Enable AIartmondano
By 2026, AI agents will consume 10x more enterprise data than humans, but with none of the contextual understanding that prevents catastrophic misinterpretations.
3. Spring 4 core improvements
Generics in Qualifiers
Exposing attributes in Meta-annotations
Autowiring Lists and Arrays
@Description on @Configuration classes
@Conditional (user-defined @Profiles)
Time Zone support on Locale Context
4. Generics in Qualifiers
En Spring 3.2….
public interface MessageService {
!
!
public String getMessage();
}
public class GeneralWaver
implements MessageService{
@Override
public String getMessage() {
return "Hello world!";
}
public class PersonWaver
implements MessageService {
!
!
!
}
@Autowired
public PersonRepository personRepository;
@Override
public String getMessage() {
...
}
}
public class MultiMessagePrinter {
!
!
!
}
//All Message Services are injected
@Autowired
private List<MessageService> messageServices;
public void printMessage() {
for (MessageService messageService: messageServices) {
System.out.println(messageService.getMessage());
}
}
5. Generics in Qualifiers
En Spring 3.2….
<?xml version="1.0" encoding="UTF-8"?>
<beans ...>
!
!
!
!
<context:annotation-config/>
<!-- Database config -->
<jdbc:embedded-database id="dataSource">
<jdbc:script location="classpath:sql/schema.ddl"/>
<jdbc:script location="classpath:sql/data.sql"/>
</jdbc:embedded-database>
<bean id=“personRepository"
class="com.autentia.playground.spring4.helloWorld.db.JdbcPersonRepository"/>
<!-- Wavers (MessageService implementations) -->
<bean id="personWaver" class="com.autentia.playground.spring4.helloWorld.messages.PersonWaver"/>
<bean id="generalWaver" class="com.autentia.playground.spring4.helloWorld.messages.GeneralWaver"/>
<!-- Printer : waves to everybody using available MessageServices -->
<bean id="messagePrinter"
class="com.autentia.playground.spring4.helloWorld.messages.MultiMessagePrinter"/>
!
</beans>
6. Generics in Qualifiers
En Spring 4 also….
public interface MessageService<T> {
!
!
public T getMessage();
}
public class GeneralWaver
implements MessageService<String>{
@Override
public String getMessage() {
return "Hello world!";
}
public class PersonWaver
implements MessageService<Person> {
!
!
!
}
@Autowired
public PersonRepository personRepository;
@Override
public Person getMessage() {
...
}
}
public class MultiMessagePrinter {
!
!
!
}
@Autowired
private MessageService<Person> messageServices;
public void printMessage() {
System.out.println(messageService.getMessage().toString());
}
7. Autowiring ordered Lists and Arrays
In Spring 3.2….
public interface MessageService {
!
!
public String getMessage();
}
public class GeneralWaver
implements MessageService{
@Override
public String getMessage() {
return "Hello world!";
}
public class PersonWaver
implements MessageService {
!
!
!
}
@Autowired
public PersonRepository personRepository;
@Override
public String getMessage() {
...
}
}
public class MultiMessagePrinter {
!
!
!
}
//All Message Services are injected
@Autowired
private List<MessageService> messageServices;
public void printMessage() {
for (MessageService messageService: messageServices) {
System.out.println(messageService.getMessage());
}
Hello Sr. David Gomez G.
}
Hello world!
8. Autowiring ordered Lists and Arrays
In Spring 4….
public interface MessageService {
!
!
public String getMessage();
public class GeneralWaver }
implements MessageService, Ordered {
!
!
!
}
@Override
public String getMessage() {
return "Hello world!";
}
@Override
public int getOrder() {
return Integer.MIN_VALUE;
}
public class MultiMessagePrinter {
!
!
!
}
public class PersonWaver
implements MessageService {
!
!
@Autowired
public PersonRepository personRepository;
@Override
public int getOrder() {
return 0;
}
}
//All Message Services are injected
@Autowired
private List<MessageService> messageServices;
public void printMessage() {
for (MessageService messageService: messageServices) {
System.out.println(messageService.getMessage());
}
Hello world!
}
Hello Sr. David Gomez G.
9. Exposing attributes in Meta-annotations
In Spring 3.2….
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Component
public @interface Service {
String[] value();
}
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Service
@Transactional(timeout=60)
public @interface MyTransactionalService {
String[] value();
}
@MyTransactionalService
public class PersonWaver
implements MessageService {
!
!
}
@Autowired
public PersonRepository personRepository;
@Override
public String getMessage() {
...
}
10. Exposing attributes in Meta-annotations
In Spring 4….
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Service
@Transactional
public @interface MyTransactionalService {
String[] value();
Propagation propagation() default Propagation.REQUIRED;
int timeout() default TransactionDefinition.TIMEOUT_DEFAULT;
!
}
@MyTransactionalService(propagation=Propagation.REQUIRES_NEW)
public class PersonWaver
implements MessageService {
!
!
}
@Autowired
public PersonRepository personRepository;
@Override
public String getMessage() {
...
}
11. @Description on @Configuration classes
In Spring 4….
@Configuration
@ComponentScan
public class Application {
!
@Bean
@Description("This is a mock implementation of MockService")
MessageService mockMessageService() {
return new MessageService() {
@Override
public String getMessage() {
return "Hello world!";
}
};
}
}
Useful when beans are exposed, !
for example, as JMX beans
12. @Profiles and @Conditional
In Spring 3.2….
!
<beans profile="dev">
<jdbc:embedded-database id="dataSource">
<jdbc:script location="classpath:sql/schema.ddl"/>
<jdbc:script location="classpath:sql/data.sql"/>
</jdbc:embedded-database>
</beans>
<beans profile="prod">
<jee:jndi-lookup id="dataSource" jndi-name="jdbc/LiveDataSource"/>
</beans>
-Dspring.profiles.active=“dev"
@Configuration
@ComponentScan
@Profile(“test”)
public class Application {
!
}
@Bean
@Description("This is a mock implementation of MockService")
MessageService mockMessageService() {
return new MessageService() {
@Override
public String getMessage() {
return "Hello world!";
}
};
}
13. @Profiles and @Conditional
In Spring 4….
@Configuration
@ComponentScan
public class Application {
!
@Bean
@Description("This is a mock implementation of MockService”)
@Conditional(NoMessageServiceDefined.class)
MessageService mockMessageService() {
return new MessageService() {
@Override
public String getMessage() {
return "Hello world!";
}
};
}
}
!
public class NoMessageServiceDefined implements Condition {
!
}
@Override
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
return context.getBeanFactory().getBeansOfType(MessageService.class)
.isEmpty();
}
15. Spring 4 web improvements
Support for Servlet 3.0
(Servlet 2.5 still supported for GAE compatibility)
(servlet 3.0 jar needed for SPRING MVC Tests)
@RestController (@RequestMapping + @ResponseBody)
@AsyncRestTemplate (Non-blocking REST clients)
!
16. @RestController
In Spring 3.2….
@Controller
public class WaverController {
!
!
!
}
@RequestMapping("/person")
public @ResponseBody Person showPersonalMessage() {
return personWaver.getMessage();
}
@RequestMapping("/message")
public @ResponseBody String showMessage() {
return genericWaver.getMessage();
}
17. @RestController
In Spring 4…
@RestController = @Controller + @ResponseBody
@RestController
public class WaverController {
!
!
!
}
@RequestMapping("/person")
public Person showPersonalMessage() {
return personWaver.getMessage();
}
@RequestMapping("/message")
public String showMessage() {
return genericWaver.getMessage();
}
18. @AsyncRestTemplate (Non-blocking REST clients)
RestTemplate
public class RestTemplate {
public <T> T getForObject(String url, Class<T> responseType, Object... urlVariables) {}
public <T> ResponseEntity<T> getForEntity(String url, Class<T> responseType, Object...
urlVariables) {}
public <T> T postForObject(String url, Object request, Class<T> responseType, Object...
uriVariables) {}
public void put(String url, Object request, Object... urlVariables) {}
}
public class RestTemplate {
public <T> T getForObject(String url, Class<T> responseType, Object... urlVariables) {}
public <T> ResponseEntity<T> getForEntity(String url, Class<T> responseType, Object...
urlVariables) {}
public <T> T postForObject(String url, Object request, Class<T> responseType, Object...
uriVariables) {}
public void put(String url, Object request, Object... urlVariables) {}
}
19. @AsyncRestTemplate (Non-blocking REST clients)
AsyncRestTemplate
public class AsyncRestTemplate {
!
public <T> ListenableFuture<ResponseEntity<T>>
getForEntity(String url, Class<T> responseType, Object... uriVariables) {}
public ListenableFuture<URI>
postForLocation(String url, HttpEntity<?> request, Object... uriVariables) {}
}
public ListenableFuture<?>
put(String url, HttpEntity<?> request, Object... uriVariables) {}
!
!
public interface ListenableFuture<T> extends Future<T> {
!
!
}
void addCallback(ListenableFutureCallback<? super T> callback);
22. Support for lambdas on callbacks
In Spring 3.2
public Person findById(int id) {
return jdbcTemplate.query("select * from persons where id = ?",
new RowMapper<Person>() {
@Override
public Person mapRow(ResultSet rs, int rowNum) throws SQLException {
return new Person(rs.getInt("id"),
rs.getString("treatment"),
rs.getString("name"),
rs.getString("surname"),
new Date(rs.getDate("birthDate").getTime()));
}
},
id)
.get(0);
}
23. Support for lambdas on callbacks
In Spring 4
public Person findById(int id) {
return jdbcTemplate.queryForObject(
"select * from persons where id = ?",
(rs, rowNum) -> new Person(rs.getInt("id"),
rs.getString("treatment"),
rs.getString("name"),
rs.getString("surname"),
new Date(rs.getDate("birthDate").getTime())),
id);
}
24. Support for lambdas on callbacks
In Spring 4
@Override
@Transactional
public Person getMessage() {
final Person person;
!
!
}
txTemplate.execute((txStatus) -> {
person = messageRepository.findById(1);
txStatus.setRollbackOnly();
return null;
});
return person;
26. JSR-310
package java.time
Amounts of Time
Duration (nanosecond resolution)
Amounts of Days
Period (years, months, and days)
TimeZones
ZonedDateTime
OffsetDateTime
27. JSR-310 in Spring 4
In web handler Methods
import java.time.Clock;
import java.time.ZoneId;
!
@RestController
public class WaverController {
!
!
}
@RequestMapping("/person")
public Person showPersonalMessage(ZoneId zoneId) {
Clock clock = Clock.of(zoneId)
LocalTime time = LocalTime.now(clock);
return personWaver.getMessageFor(time);
}
33. WebSocket Support
WebSocket server support via JSR-356 runtimes
(Tomcat 7.0.7 -Jetty 9)
Fallback option using SockJS
(SockJsHttpRequestHandler)
k on
tal
g 4”
ed
prin
icat
ed
ith S
D
ts w
ocke
ebS
“W
soon
ming
co