The document discusses tailoring Spring for custom usage. It explores extension points in the Spring framework and how to exploit lesser known but powerful hooks. The agenda includes demos of introducing the tool chain, basic dependency injection, BeanPostProcessor, AspectJ, life cycle callbacks, scopes, FactoryBeans, Spring Expression Language, profiles, proxies, resources, object to XML marshalling, REST, transactions, caching, custom views and view resolvers, writing adapters in Spring Integration, and more. QA is also on the agenda.
The document discusses strategies for building scalable applications. It introduces the concept of a "scale cube" with three axes: horizontal duplication for scaling stateless apps, data partitioning, and bounded contexts. It provides examples of using various technologies like RabbitMQ, Redis, MongoDB, Neo4j, Couchbase, Hadoop, and Spring XD to address different areas of the scale cube. The document emphasizes that building adaptive, scalable applications is challenging and recommends approaches like microservices and separating applications into bounded contexts.
This document contains information about Josh Long, including his contact details, links to his work, and information about the Spring IO platform. It includes diagrams showing the architecture of Spring IO and its various modules. It also contains slides from one of Josh Long's presentations promoting Spring IO and its features, including Spring Boot, reactive programming, Java 8 support, REST design, security, and mobile development.
Multi Client Development with Spring for SpringOne 2GX 2013 with Roy ClarksonJoshua Long
The document discusses Representational State Transfer (REST), an architectural style for building distributed hypermedia systems. It describes REST as being based on HTTP and having no hard rules, instead focusing on using HTTP verbs like GET, POST, PUT, DELETE and status codes to transfer representations of resources between clients and servers. It also discusses content negotiation, HATEOAS, the Richardson Maturity Model for grading RESTful implementations, and how Spring frameworks like Spring MVC, Spring Data REST, and Spring Security can be used to build RESTful services and clients.
Eddystone Beacons - Physical Web - Giving a URL to All ObjectsJeff Prestes
More mobile technologies are empowering people and machines to become more autonomous. In the same way as people, machines need ways to be identified to other sources in a connected environment. This begs the question, why not give a URL to objects? With Eddystone, a new Google specification for Beacon data, this is possible, and it works with both Android and iOS based devices.
With it you can implement what physical-web.org stands
HTML5 APIs - Where No Man Has Gone Before! - GothamJSRobert Nyman
The document discusses various HTML5 APIs and their capabilities including web storage, geolocation, canvas, video, and web sockets. It provides code examples for how to use sessionStorage, localStorage, get geolocation data, draw on canvases, and open web sockets. The document is an introduction to exploring HTML5 capabilities on mobile and how no area has been untouched by new possibilities through these emerging APIs.
Introducing RaveJS: Spring Boot concepts for JavaScript applicationsJohn Hann
Modern JavaScript frameworks have become quite sophisticated. Unfortunately, they have also become quite complicated. The demos and sample projects for these frameworks look deceptively simple. However, to build and deploy real applications, developers must scaffold, configure, and maintain a tremendous amount of intricate machinery. Until recently, the Java world wasn't very different. Spring Boot finally made it easy to create stand-alone, production-grade Spring Applications that can you can "just run". Can we do the same for JavaScript? Yes, we can! Introducing RaveJS. Rave eliminates configuration, machinery, and complexity. Stop configuring and tweaking machinery such as file watchers, minifiers, and transpilers just to get to a runnable app. Instead, go from zero to "hello world" in 30 seconds. In the next 30 seconds, easily add capabilities and frameworks to your application simply by installing *Rave Extensions* and *Rave Starter* packages from npm and Bower, the leading JavaScript package managers. Finally, install additional *Rave Extension* packages to apply your favorite build, deploy, and testing patterns.
Presentation on how Meetup tackles web performance. Given on:
- Nov 17th, 2009 for the NY Web Performance Group (http://www.meetup.com/Web-Performance-NY/)
- Jan 26th, 2010 for NYC Tech Talks Meetup Group (http://www.meetup.com/NYC-Tech-Talks/)
The document discusses strategies for building scalable applications. It introduces the concept of a "scale cube" with three axes: horizontal duplication for scaling stateless apps, data partitioning, and bounded contexts. It provides examples of using various technologies like RabbitMQ, Redis, MongoDB, Neo4j, Couchbase, Hadoop, and Spring XD to address different areas of the scale cube. The document emphasizes that building adaptive, scalable applications is challenging and recommends approaches like microservices and separating applications into bounded contexts.
This document contains information about Josh Long, including his contact details, links to his work, and information about the Spring IO platform. It includes diagrams showing the architecture of Spring IO and its various modules. It also contains slides from one of Josh Long's presentations promoting Spring IO and its features, including Spring Boot, reactive programming, Java 8 support, REST design, security, and mobile development.
Multi Client Development with Spring for SpringOne 2GX 2013 with Roy ClarksonJoshua Long
The document discusses Representational State Transfer (REST), an architectural style for building distributed hypermedia systems. It describes REST as being based on HTTP and having no hard rules, instead focusing on using HTTP verbs like GET, POST, PUT, DELETE and status codes to transfer representations of resources between clients and servers. It also discusses content negotiation, HATEOAS, the Richardson Maturity Model for grading RESTful implementations, and how Spring frameworks like Spring MVC, Spring Data REST, and Spring Security can be used to build RESTful services and clients.
Eddystone Beacons - Physical Web - Giving a URL to All ObjectsJeff Prestes
More mobile technologies are empowering people and machines to become more autonomous. In the same way as people, machines need ways to be identified to other sources in a connected environment. This begs the question, why not give a URL to objects? With Eddystone, a new Google specification for Beacon data, this is possible, and it works with both Android and iOS based devices.
With it you can implement what physical-web.org stands
HTML5 APIs - Where No Man Has Gone Before! - GothamJSRobert Nyman
The document discusses various HTML5 APIs and their capabilities including web storage, geolocation, canvas, video, and web sockets. It provides code examples for how to use sessionStorage, localStorage, get geolocation data, draw on canvases, and open web sockets. The document is an introduction to exploring HTML5 capabilities on mobile and how no area has been untouched by new possibilities through these emerging APIs.
Introducing RaveJS: Spring Boot concepts for JavaScript applicationsJohn Hann
Modern JavaScript frameworks have become quite sophisticated. Unfortunately, they have also become quite complicated. The demos and sample projects for these frameworks look deceptively simple. However, to build and deploy real applications, developers must scaffold, configure, and maintain a tremendous amount of intricate machinery. Until recently, the Java world wasn't very different. Spring Boot finally made it easy to create stand-alone, production-grade Spring Applications that can you can "just run". Can we do the same for JavaScript? Yes, we can! Introducing RaveJS. Rave eliminates configuration, machinery, and complexity. Stop configuring and tweaking machinery such as file watchers, minifiers, and transpilers just to get to a runnable app. Instead, go from zero to "hello world" in 30 seconds. In the next 30 seconds, easily add capabilities and frameworks to your application simply by installing *Rave Extensions* and *Rave Starter* packages from npm and Bower, the leading JavaScript package managers. Finally, install additional *Rave Extension* packages to apply your favorite build, deploy, and testing patterns.
Presentation on how Meetup tackles web performance. Given on:
- Nov 17th, 2009 for the NY Web Performance Group (http://www.meetup.com/Web-Performance-NY/)
- Jan 26th, 2010 for NYC Tech Talks Meetup Group (http://www.meetup.com/NYC-Tech-Talks/)
All Things Open 2014 - Day 2
Thursday, October 23rd, 2014
Doug Turnbull
Search & Big Data Architect for OpenSource Connections
Databases
Stop Worrying & Love the SQL - A Case Study
This document discusses optimizing Meetup's performance by reducing page load times. It recommends reducing JavaScript, image, DOM, and CSS files. Specific techniques include externalizing and concatenating JavaScript, lazy loading images and scripts, minimizing DOM elements, writing efficient CSS selectors, and profiling code to optimize loops and DOM manipulation. Reducing page weight through these techniques can improve the user experience by speeding up load times and drop in member activity.
12 core technologies you should learn, love, and hate to be a 'real' technocratJonathan Linowes
1. The document discusses 12 core technologies that one should learn as a technocrat, including the command line, HTML, CSS, HTTP, programming, JavaScript, MVC frameworks, databases, hosting, and media technologies.
2. It provides brief explanations and examples for each technology, such as describing HTML tags and the DOM, CSS selectors and media types, components of an HTTP request and response, concepts in programming like objects and control flow, and basics of media resolution, compression and formats.
3. The document emphasizes learning the technologies through both understanding concepts as well as gaining hands-on experience with examples and tools for each one.
#NoXML: Eliminating XML in Spring Projects - SpringOne 2GX 2015Matt Raible
Many Spring projects exist that leverage XML for their configuration and bean definitions. Most Java web applications use a web.xml to configure their servlets, filters and listeners. This session shows you how you can eliminate XML by configuring your Spring beans with JavaConfig and annotations. It also shows how you can remove your web.xml and configure your web components with Java.
Differential Sync and JSON Patch @ SpringOne2GX 2014Brian Cavalier
Craig Walls and I presented a new approach to client-server communication at SpringOne2GX 2014.
Abstract:
The world of client-server has changed. The traditional application of REST is no longer the best fit. We're depolying applications into a world where users expect responsive UIs, on all their devices, even while disconnected. We're deploying into a world where connection latency, mobile radio usage and battery life have become primary concerns.
Differential Synchronization (DS) is an algorithm that syncs data across N parties, even in the face of dropped connections, offline devices, etc. It makes more efficient use of connections by batching and sending only changes, in both directions, from client to server and from server to client. We’ll look at how it can be used with JSON Patch to synchronize application data between clients and servers over HTTP Patch, WebSocket, and STOMP, and how it can be integrated into the Spring ecosystem.
Get Back in Control of your SQL with jOOQ - GeekOut by ZeroTurnaroundDataGeekery
SQL is a powerful and highly expressive language for queries against relational databases. SQL is established, standardised and hardly challenged by alternative querying languages. Nonetheless, in the Java ecosystem, there had been few relevant steps forward since JDBC to better integrate SQL into Java. All attention was given to object-relational mapping and language abstractions on a higher level, such as OQL, HQL, JPQL, CriteriaQuery. In the meantime, these abstractions have become almost as complex as SQL itself, regardless of the headaches they’re giving to DBAs who can no longer patch the generated SQL.
jOOQ is a dual-licensed Open Source product filling this gap. It implements SQL itself as an internal domain-specific language in Java, allowing for the typesafe construction and execution of SQL statements of arbitrary complexity. This includes nested selects, derived tables, joins, semi-joins, anti-joins, self-joins, aliasing, as well as many vendor-specific extensions such as stored procedures, arrays, user-defined types, recursive SQL, grouping sets, pivot tables, window functions and many other OLAP features. jOOQ also includes a source code generator allowing you to compile queries in modern IDEs such as Eclipse very efficiently.
jOOQ is a good choice in a Java application where SQL and the specific relational database are important. It is an alternative when JPA / Hibernate abstract too much, JDBC too little. It shows, how a modern domain-specific language can greatly increase developer productivity, internalising SQL into Java.
Step by Step Personal Drive to One Drive Migration using SPMTIT Industry
The document provides step-by-step instructions for migrating files from Personal Drives to OneDrive using the SharePoint Migration Tool (SPMT). It details restoring files to a common location, installing SPMT, configuring variables and tasks, running parallel migrations via PowerShell, monitoring performance, and analyzing the migration reports and logs generated upon completion to understand failures, successes, and statistics. Email notifications are also triggered containing personalized migration summaries and lists of skipped files for each user.
In this talk, we’ll discuss the benefits of the document-based data model that MongoDB offers by walking through how one can build a simple app. We'll show you how to design a full-blown RSS Aggregation service to replace the loss the world suffered when Google Reader was shutdown.
We'll dive deeper into topics, such as how to model your data and create your REST API using MongoDB, Express.js and Node.js (core components of the MEAN stack). This session will jumpstart your development knowledge of MongoDB.
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...mfrancis
This document discusses using OSGi and Spring Data to develop simple web applications. It describes using Bndtools for OSGi application development and the enRoute project for getting started with OSGi. It provides an overview of using JPA and Spring Data with OSGi for the persistence layer. It also covers integrating Handlebars templates, Jersey MVC, and AngularJS for the web layer. Testing strategies using Spock and integration tests are presented. The technologies discussed include OSGi, Equinox, Felix, JPA, Spring Data, Jersey, Handlebars, and AngularJS.
HTML5 is all the rage with the cool kids, and although there's a lot of focus on the new language, there's lots of interesting new JavaScript APIs both in the HTML5 spec and separated out. This presentation will take you through demos and code behind the new JavaScript APIs, and explore where these features can be used
This document summarizes upcoming improvements and new features in web browsers, including Firefox 3.1, Safari 4, Internet Explorer 8, Opera 10, and Google Chrome. Many of the browsers are focusing on better JavaScript performance through new engines like TraceMonkey and V8. New features include process per tab, postMessage for cross-domain communication, HTML5 drag and drop, and the Canvas element for offloading rendering to the client. Overall the browsers are aiming to improve speed, compatibility, and the user experience through these new features and technologies.
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...David Kaneda
This document discusses how to build rich mobile user experiences using web standards like HTML5, CSS3, and JavaScript. It covers various HTML5 features such as new elements, forms, video/audio, geolocation and caching. It also discusses CSS techniques including transforms, transitions, animations and vendor-specific properties. Challenges with fixed positioning, touch events and performance are addressed. The document promotes building web apps that are native-like using frameworks like jQTouch and Sencha Touch.
Building Event-Based Systems for the Real-Time Webpauldix
- Event-based systems use events like data updates to trigger actions in real-time, while batch systems periodically process accumulated data
- Building distributed, event-based systems allows applications to scale horizontally by decomposing them into loosely coupled components that communicate asynchronously through messaging
- The publish-subscribe pattern is well-suited for event-based architectures, with systems like RabbitMQ providing message brokers that route events from publishers to subscriber queues based on topics
The slides from Lukas Eder's jOOQ presentation at Topconf 2013.
The slides talk about the history of the Java and SQL integration, starting with JDBC, EJB 2.0, Hibernate, JPA, culminating in the claim that SQL is evolving in an entirely different direction than what is covered by Enterprise Java. This is where jOOQ comes in. jOOQ is currently the only platform in the Java market aiming at making SQL a first-class citizen in Java.
This website depicts what every CTO / software architect should consider at the beginning of every new Java project:
http://www.hibernate-alternative.com
This version of the presentation on Slideshare is licensed under the terms of the CC-BY-SA license 3.0:
http://creativecommons.org/licenses/by-sa/3.0
The jOOQ name, the jOOQ logo and the picture with the harbour worker are trademarks by Data Geekery GmbH. Please contact us if you want to use our trademarks in a derived presentation of yours.
contact@datageekery.com
Tech Webinar: Offline First: Creare un'app Phonegap che funzioni offline e si...Codemotion
The document discusses building applications with an "offline first" approach. It outlines techniques for making apps work offline using tools like the HTML5 AppCache, PouchDB for syncing shared data, imgcache.js for saving images offline, and ydn-db for private user data. The goal is to provide a seamless experience for the user even when offline. Key aspects covered include publishing and reading news content offline, handling shared vs private data storage, and checking network connectivity.
The way JavaScript is standardized and improved is changing this year. Learning how will help you understand why transpilers have become so popular, and why we will likely be using them for a long time.
Ember itself will need to adapt to changes in JavaScript, and we will take a look at how the existing object model might be migrated to a pure EcmaScript solution.
CouchDB is a document-oriented NoSQL database that uses JSON documents with schema-free design. It features a built-in map/reduce function for querying indexes, and uses HTTP for an API and replication. CouchDB is robust, scales well, and is designed for high availability through its append-only writing and multi-version concurrency control.
Forensic Tools for In-Depth Performance InvestigationsNicholas Jansma
Boomerang is a JavaScript library that gathers performance metrics of page loads. When a customer saw periods where nothing progressed on their site, forensic tools were used to investigate. WebPageTest reproduced the issue, and tcpdump, Wireshark, and Chrome Tracing helped dive deeper. Tests showed the problem was not related to Boomerang. Other scenarios involved issues with ready state changes and prematurely expiring CSRF tokens. Various tools like the browser dev tools, Fiddler, and Node.js were used to reproduce problems and validate fixes.
The Spring framework packs a lot of punch, out of the box! The surface-level component model's extraordinarily flexible, and works well with in most situations, but the real power of Spring lays just underneath, in the numerous SPIs that Spring exposes, so that you can tailor the component model to your own use cases. Spring's SPI's are a great example of what Bob Martin describes as the open-closed principle, and it provides the solid underpinnings upon which the other Spring frameworks, including Spring Integration, Spring MVC and Spring Batch are built. In this talk, Josh Long, the Spring developer advocate from SpringSource, provides a walking tour of Spring's extension points.
Spring in the Cloud - using Spring with Cloud FoundryJoshua Long
This talk's about using the power of the Spring framework with Cloud Foundry, the open source PaaS (platform as-a-service) from VMware. This is a bit more deep an introduction than my other Spring and Cloud Foundry talk, and so I've kept both, while encouraging people to check this one out, first.
All Things Open 2014 - Day 2
Thursday, October 23rd, 2014
Doug Turnbull
Search & Big Data Architect for OpenSource Connections
Databases
Stop Worrying & Love the SQL - A Case Study
This document discusses optimizing Meetup's performance by reducing page load times. It recommends reducing JavaScript, image, DOM, and CSS files. Specific techniques include externalizing and concatenating JavaScript, lazy loading images and scripts, minimizing DOM elements, writing efficient CSS selectors, and profiling code to optimize loops and DOM manipulation. Reducing page weight through these techniques can improve the user experience by speeding up load times and drop in member activity.
12 core technologies you should learn, love, and hate to be a 'real' technocratJonathan Linowes
1. The document discusses 12 core technologies that one should learn as a technocrat, including the command line, HTML, CSS, HTTP, programming, JavaScript, MVC frameworks, databases, hosting, and media technologies.
2. It provides brief explanations and examples for each technology, such as describing HTML tags and the DOM, CSS selectors and media types, components of an HTTP request and response, concepts in programming like objects and control flow, and basics of media resolution, compression and formats.
3. The document emphasizes learning the technologies through both understanding concepts as well as gaining hands-on experience with examples and tools for each one.
#NoXML: Eliminating XML in Spring Projects - SpringOne 2GX 2015Matt Raible
Many Spring projects exist that leverage XML for their configuration and bean definitions. Most Java web applications use a web.xml to configure their servlets, filters and listeners. This session shows you how you can eliminate XML by configuring your Spring beans with JavaConfig and annotations. It also shows how you can remove your web.xml and configure your web components with Java.
Differential Sync and JSON Patch @ SpringOne2GX 2014Brian Cavalier
Craig Walls and I presented a new approach to client-server communication at SpringOne2GX 2014.
Abstract:
The world of client-server has changed. The traditional application of REST is no longer the best fit. We're depolying applications into a world where users expect responsive UIs, on all their devices, even while disconnected. We're deploying into a world where connection latency, mobile radio usage and battery life have become primary concerns.
Differential Synchronization (DS) is an algorithm that syncs data across N parties, even in the face of dropped connections, offline devices, etc. It makes more efficient use of connections by batching and sending only changes, in both directions, from client to server and from server to client. We’ll look at how it can be used with JSON Patch to synchronize application data between clients and servers over HTTP Patch, WebSocket, and STOMP, and how it can be integrated into the Spring ecosystem.
Get Back in Control of your SQL with jOOQ - GeekOut by ZeroTurnaroundDataGeekery
SQL is a powerful and highly expressive language for queries against relational databases. SQL is established, standardised and hardly challenged by alternative querying languages. Nonetheless, in the Java ecosystem, there had been few relevant steps forward since JDBC to better integrate SQL into Java. All attention was given to object-relational mapping and language abstractions on a higher level, such as OQL, HQL, JPQL, CriteriaQuery. In the meantime, these abstractions have become almost as complex as SQL itself, regardless of the headaches they’re giving to DBAs who can no longer patch the generated SQL.
jOOQ is a dual-licensed Open Source product filling this gap. It implements SQL itself as an internal domain-specific language in Java, allowing for the typesafe construction and execution of SQL statements of arbitrary complexity. This includes nested selects, derived tables, joins, semi-joins, anti-joins, self-joins, aliasing, as well as many vendor-specific extensions such as stored procedures, arrays, user-defined types, recursive SQL, grouping sets, pivot tables, window functions and many other OLAP features. jOOQ also includes a source code generator allowing you to compile queries in modern IDEs such as Eclipse very efficiently.
jOOQ is a good choice in a Java application where SQL and the specific relational database are important. It is an alternative when JPA / Hibernate abstract too much, JDBC too little. It shows, how a modern domain-specific language can greatly increase developer productivity, internalising SQL into Java.
Step by Step Personal Drive to One Drive Migration using SPMTIT Industry
The document provides step-by-step instructions for migrating files from Personal Drives to OneDrive using the SharePoint Migration Tool (SPMT). It details restoring files to a common location, installing SPMT, configuring variables and tasks, running parallel migrations via PowerShell, monitoring performance, and analyzing the migration reports and logs generated upon completion to understand failures, successes, and statistics. Email notifications are also triggered containing personalized migration summaries and lists of skipped files for each user.
In this talk, we’ll discuss the benefits of the document-based data model that MongoDB offers by walking through how one can build a simple app. We'll show you how to design a full-blown RSS Aggregation service to replace the loss the world suffered when Google Reader was shutdown.
We'll dive deeper into topics, such as how to model your data and create your REST API using MongoDB, Express.js and Node.js (core components of the MEAN stack). This session will jumpstart your development knowledge of MongoDB.
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...mfrancis
This document discusses using OSGi and Spring Data to develop simple web applications. It describes using Bndtools for OSGi application development and the enRoute project for getting started with OSGi. It provides an overview of using JPA and Spring Data with OSGi for the persistence layer. It also covers integrating Handlebars templates, Jersey MVC, and AngularJS for the web layer. Testing strategies using Spock and integration tests are presented. The technologies discussed include OSGi, Equinox, Felix, JPA, Spring Data, Jersey, Handlebars, and AngularJS.
HTML5 is all the rage with the cool kids, and although there's a lot of focus on the new language, there's lots of interesting new JavaScript APIs both in the HTML5 spec and separated out. This presentation will take you through demos and code behind the new JavaScript APIs, and explore where these features can be used
This document summarizes upcoming improvements and new features in web browsers, including Firefox 3.1, Safari 4, Internet Explorer 8, Opera 10, and Google Chrome. Many of the browsers are focusing on better JavaScript performance through new engines like TraceMonkey and V8. New features include process per tab, postMessage for cross-domain communication, HTML5 drag and drop, and the Canvas element for offloading rendering to the client. Overall the browsers are aiming to improve speed, compatibility, and the user experience through these new features and technologies.
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...David Kaneda
This document discusses how to build rich mobile user experiences using web standards like HTML5, CSS3, and JavaScript. It covers various HTML5 features such as new elements, forms, video/audio, geolocation and caching. It also discusses CSS techniques including transforms, transitions, animations and vendor-specific properties. Challenges with fixed positioning, touch events and performance are addressed. The document promotes building web apps that are native-like using frameworks like jQTouch and Sencha Touch.
Building Event-Based Systems for the Real-Time Webpauldix
- Event-based systems use events like data updates to trigger actions in real-time, while batch systems periodically process accumulated data
- Building distributed, event-based systems allows applications to scale horizontally by decomposing them into loosely coupled components that communicate asynchronously through messaging
- The publish-subscribe pattern is well-suited for event-based architectures, with systems like RabbitMQ providing message brokers that route events from publishers to subscriber queues based on topics
The slides from Lukas Eder's jOOQ presentation at Topconf 2013.
The slides talk about the history of the Java and SQL integration, starting with JDBC, EJB 2.0, Hibernate, JPA, culminating in the claim that SQL is evolving in an entirely different direction than what is covered by Enterprise Java. This is where jOOQ comes in. jOOQ is currently the only platform in the Java market aiming at making SQL a first-class citizen in Java.
This website depicts what every CTO / software architect should consider at the beginning of every new Java project:
http://www.hibernate-alternative.com
This version of the presentation on Slideshare is licensed under the terms of the CC-BY-SA license 3.0:
http://creativecommons.org/licenses/by-sa/3.0
The jOOQ name, the jOOQ logo and the picture with the harbour worker are trademarks by Data Geekery GmbH. Please contact us if you want to use our trademarks in a derived presentation of yours.
contact@datageekery.com
Tech Webinar: Offline First: Creare un'app Phonegap che funzioni offline e si...Codemotion
The document discusses building applications with an "offline first" approach. It outlines techniques for making apps work offline using tools like the HTML5 AppCache, PouchDB for syncing shared data, imgcache.js for saving images offline, and ydn-db for private user data. The goal is to provide a seamless experience for the user even when offline. Key aspects covered include publishing and reading news content offline, handling shared vs private data storage, and checking network connectivity.
The way JavaScript is standardized and improved is changing this year. Learning how will help you understand why transpilers have become so popular, and why we will likely be using them for a long time.
Ember itself will need to adapt to changes in JavaScript, and we will take a look at how the existing object model might be migrated to a pure EcmaScript solution.
CouchDB is a document-oriented NoSQL database that uses JSON documents with schema-free design. It features a built-in map/reduce function for querying indexes, and uses HTTP for an API and replication. CouchDB is robust, scales well, and is designed for high availability through its append-only writing and multi-version concurrency control.
Forensic Tools for In-Depth Performance InvestigationsNicholas Jansma
Boomerang is a JavaScript library that gathers performance metrics of page loads. When a customer saw periods where nothing progressed on their site, forensic tools were used to investigate. WebPageTest reproduced the issue, and tcpdump, Wireshark, and Chrome Tracing helped dive deeper. Tests showed the problem was not related to Boomerang. Other scenarios involved issues with ready state changes and prematurely expiring CSRF tokens. Various tools like the browser dev tools, Fiddler, and Node.js were used to reproduce problems and validate fixes.
The Spring framework packs a lot of punch, out of the box! The surface-level component model's extraordinarily flexible, and works well with in most situations, but the real power of Spring lays just underneath, in the numerous SPIs that Spring exposes, so that you can tailor the component model to your own use cases. Spring's SPI's are a great example of what Bob Martin describes as the open-closed principle, and it provides the solid underpinnings upon which the other Spring frameworks, including Spring Integration, Spring MVC and Spring Batch are built. In this talk, Josh Long, the Spring developer advocate from SpringSource, provides a walking tour of Spring's extension points.
Spring in the Cloud - using Spring with Cloud FoundryJoshua Long
This talk's about using the power of the Spring framework with Cloud Foundry, the open source PaaS (platform as-a-service) from VMware. This is a bit more deep an introduction than my other Spring and Cloud Foundry talk, and so I've kept both, while encouraging people to check this one out, first.
The document introduces the Play Framework version 2.1 and highlights its key features. It demonstrates building a sample application in Scala using Play's reactive, non-blocking architecture. Key features discussed include Play's built-in support for Scala, reactive programming, JSON APIs, routing, templates, and testing.
This document discusses moving from host-centric monitoring to fact-based monitoring using Puppet facts. It argues that hosts should not be the center of the monitoring universe, but rather facts should be. Effective monitoring uses queries against existing facts and metrics to express conditions like ensuring web servers respond quickly or PostgreSQL processes are running. This mirrors how Puppet, SQL, and MCollective improved systems management by moving from imperative programming to declarative queries based on available facts and metadata.
Your configuration management is fact-based.
Your orchestration is fact-based.
Is your monitoring fact-based?
What does that even mean? Monitoring is very similar to configuration, at least in its expression. Configuration cares about files, services, and hosts being present and in a certain state (""nginx should be running with the following configuration""). Monitoring cares about services being present, running, and in a certain state. Both describe your infrastructure as it should be (""nginx should be running and respond in less than 200ms"").
Fact-based monitoring is about being able to control monitoring with the same facts that Puppet uses (""monitor nginx latency wherever Puppet says it should run""). This is in contrast with imperative monitoring (""monitor nginx on host a, b and c"") that gets out of sync and leads to mailbox meltdowns from spurious alerts.
Using open source and commercial examples, this talk will help you express your monitoring in a way that will feel very natural to your Puppet configuration.
J1 2015 "Debugging Java Apps in Containers: No Heavy Welding Gear Required"Daniel Bryant
It’s easy to get seduced by being able to quickly deploy and scale applications by using containers. However, when things inevitably go wrong, how do you debug your application? This session covers various pro bug hunting tips and tricks. It shows live demos of tools such as the Docker stats API, Docker exec (and top, vmstat, and netstat), and how to use the ELK stack for centralized logging. It also dives into other more sophisticated tools that operate at the application and (micro)service layer, such as Twitter’s Zipkin tracing app, Spring Boot’s Actuator, and DropWizard’s Metrics library. Keep those container-based nightmares away by ensuring that when the worst does happen, you have the tools, info, and experience to debug containerized applications.
Presented at JavaOne 2015 with Steve Poole
Getting ready for a big event on your website? Re-architecting for better performance or scalability? Releasing a hot new feature? Load testing can help you plan and provision accordingly. In this talk, I'll briefly discuss load testing strategies, then dive into how to DIY with Python using Corey Goldberg's open source library multi-mechanize as well as how to gather performance data from your tests. Real-life examples against a deployment of a popular open-source Python web app (reddit!).
From continuous integration servers to blogging systems, we've all seen and used pluggable applications. Writing our own though can be an elusive task. That need not be the case, though, as the Java EE spec contains all you need to do just that. In this session, we'll see how we can leverage the power of CDI to write, for example, easily extensible JSF applications. When the session is over, you'll have all you need to write the next killer app, and, thanks to Java EE, you'll be surprised to see how little work it really is.
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.
Building Next-Gen Web Applications with the Spring 3 Web StackJeremy Grelle
This document provides an overview of building next-generation web applications using the Spring 3.0 web stack. It discusses how the Spring web stack provides a unified programming model to serve multiple client types from the same code base. It describes the main components of the Spring web stack including Spring Framework, Spring MVC, Spring JavaScript, Spring Web Flow, Spring Security, Spring Faces, and Spring BlazeDS Integration. It also provides examples of using Spring MVC for request mapping and generating responses.
Apache Cayenne is an open source object-relational mapping framework for Java. It has been an Apache project since 2006 and has over 17 committers and 9 project management committee members. Cayenne provides tools for mapping database schemas to Java objects and vice versa, as well as tools for querying, caching query results, and handling object lifecycles. It aims to simplify working with relational databases for Java developers in a similar way to how Enterprise Objects Framework simplified it for Objective-C developers.
Spring Framework 3.0 focuses on embracing REST and the Spring Expression Language (EL). Key features include full-scale REST support in Spring MVC, broad EL support throughout the core framework, enhanced support for Java 5 annotations and Java EE 6 APIs, and refactored modular framework components. Spring 3.0 continues Spring's mission of fully embracing modern Java technologies while maintaining backwards compatibility.
The document discusses asynchronous programming with Spring 4.X and relational database management systems in microservices architectures. It covers asynchronous vs synchronous programming, the C10K problem of handling 10,000 clients simultaneously and its solutions like load balancing, NoSQL databases, and event-driven programming. It provides examples of using Spring's @Async annotation, DeferredResult, and CompletableFuture for asynchronous programming. It also discusses challenges with databases being blocking I/O and solutions like avoiding blocking on database connections, using asynchronous data access with Spring, and transaction management across asynchronous calls.
1) The document introduces Infinispan, an open source in-memory data grid and distributed cache. It discusses Infinispan's architecture as an embedded library or standalone server, clustering modes, persistence, querying, transactions and more.
2) Use cases for Infinispan include sharing data, high performance caching, scalability, and as a database platform in the cloud. Example applications discussed are session clustering and a data grid platform.
3) The document provides a case study of using Infinispan with Spring for HTTP session clustering, describing how to configure Infinispan, implement a custom SecurityContextDao, and integrate it with Spring Security.
Enterprise Java Web Application Frameworks Sample Stack ImplementationMert Çalışkan
This document provides an overview of enterprise Java web application frameworks and sample stack implementations. It discusses choosing between various UI, controller, model, and integration frameworks like JSF, Spring, Hibernate, and Apache CXF. It then demonstrates a sample stack using these technologies along with Maven, Eclipse, and other tools. The aim is to provide a scalable and high-performance MVC architecture using proven open source solutions.
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...HostedbyConfluent
Does your organization struggle with updating of its Kafka Streams application? Releasing a new version of a Kafka Streams application can be challenging, especially if its state has to be preserved between releases. Consider these best-practices and architectural ideas to make this process smoother and improve your release process.
Having experienced accidental removal of change-log topics and needing to expand partitions, it is much easier to handle with some planning. With the proper planning, you can achieve easier application upgrades.
Key take-aways from the session include:
* How do minimize the rebuilding of the state-stores.
* How to change stream topologies without affecting the existing state stores.
* What you can do when you absolutely need to increase the number of partitions within your application.
* How to leveraging schemas for application releases.
* Measures to prevent data corruption, especially if Kafka is not only your system of record but also your source of truth.
* Techniques to support rolling back an application.
* The advantages of splitting apart a Kafka Streams application into multiple applications.
This document provides a summary of a presentation about Full Stack Reactivity using the Meteor framework. It includes a definition of full-stack reactivity as allowing every level of a web application's stack to respond in real-time to changes. The presentation demonstrates a sample Meteor application, discusses key Meteor concepts like publications and subscriptions, and argues that Meteor's approach could help transform how Plone applications are developed. The goal is to integrate Meteor's Distributed Data Protocol into Plone to provide real-time reactivity across the stack using ZODB events.
Java 9 is expected to include several new features and changes, including:
- New collection factory methods like Set.of() and Map.of() that provide immutable collections.
- Enhancements to the Stream API such as takeWhile() and dropWhile().
- Syntax changes like allowing effectively final variables in try-with-resources and @SafeVarargs for private methods.
- The addition of JShell to provide a Java REPL.
- Garbage First (G1) garbage collector becoming the default collector.
- Various performance and logging improvements.
Josh Long presents on Spring Boot, an approach to building stand-alone, production-grade Spring based applications. He discusses how Spring Boot makes it easy to create Spring applications with embedded Tomcat, Jetty or Undertow with minimum fuss. The presentation also covers how to easily add RESTful services, security, production-ready features like metrics, health checks and externalized configuration using Spring Boot.
Josh Long is a Spring Developer Advocate at Pivotal. He discusses various Spring and microservices related topics including:
- The single responsibility principle and how it relates to microservices and Unix tools.
- Exposing services simply using REST which has no strict rules but embraces HTTP verbs and status codes.
- The Richardson Maturity Model for grading APIs on their REST compliance from Level 0 to Level 3.
- Security topics like OAuth, SSL/TLS, and ensuring applications are production ready with monitoring and management.
Slides from my talk introducing Spring Boot. Unfortunately, this talk is 90% live-coding, so I'll post the relevant video recording here when it's available.
Spring, now part of Pivotal, continues to innovate and support next generation workloads. In this talk, I introduce some of the exciting new Spring technologies supporting websockets, Java 8, Java EE 7, data ingestion and stream processing, NoSQL and Hadoop, and production-ready REST, _and_ I introduce tools designed to expedite ramp-up time for teams who want to deliver, quickly.
This talk introduces Spring's REST stack - Spring MVC, Spring HATEOAS, Spring Data REST, Spring Security OAuth and Spring Social - while refining an API to move higher up the Richardson maturity model
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.
The document discusses Spring Framework updates including versions 3.1, 3.2, and 3.3. Key features of Spring 3.1 include environment profiles for activating bean definitions in different environments, Java-based application configuration, and declarative caching. Spring 3.2 will include a Gradle build system and GitHub contributions. Spring 3.3 will add support for Java SE 8 features like lambda expressions and the Java EE 7 API. The document provides code examples of using these new Spring features.
Integration and Batch Processing on Cloud FoundryJoshua Long
This talk explores the new possibilities for scale by using Spring Integration, Spring Batch and RabbitMQ on Cloud Foundry, the open source PaaS from VMWare.
using Spring and MongoDB on Cloud FoundryJoshua Long
This talk introduces how to build MongoDB applications with Spring Data MongoDB on Cloud Foundry. Spring Data provides rich support for easily building applications that work on multiple data stores.
The document provides an overview of getting started with Cloud Foundry. It discusses registering for a Cloud Foundry account, installing the vmc CLI tool on Windows and Mac, and the various ways Cloud Foundry can be used to deploy applications. It also covers key Cloud Foundry features like choice of runtimes, choice of cloud providers, scaling applications, developing applications using Eclipse/STS, and using services in applications.
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.
A Walking Tour of (almost) all of Springdom Joshua Long
this is the deck for my 3+ hour walking tour talk that I give as a workshop at various conferences. This talk introduces practically everything in Spring -- come into the talk unaware of the concepts or frameworks and leave with a working knowledge of all the frameworks, and of all the applications for the technologies.
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.
A Spring Batch bootcamp! Spring Batch is the open source batch processing framework from SpringSource, makes of the Spring framework. http://www.springsource.org/spring-batch
The Cloud Foundry Bootcamp document provides an overview of a Cloud Foundry bootcamp presented in Portland in 2012. It was written by Chris Richardson and presented by Monica Wilkinson and Josh Long. The agenda covers why Platform as a Service (PaaS) matters to developers, an overview of Cloud Foundry, getting started with Cloud Foundry, the Cloud Foundry architecture, using Micro Cloud Foundry, and consuming Cloud Foundry services.
Spring and Cloud Foundry; a Marriage Made in HeavenJoshua Long
Spring and Cloud Foundry: a Marriage Made in Heaven. This talk introduces how to build Spring applications on top of Cloud Foundry, the open source PaaS from VMware
In this talk, originally presented at JavaZone, in Oslo, Norway, I introduce the broad swath of supported inversion-of-control options in Spring's component model, and then introduce some more advanced features of the component model.
Enterprise Integration and Batch Processing on Cloud FoundryJoshua Long
Spring Integration, RabbitMQ and Spring Batch are natural vehicles for building bigger, better, more powerful applications on top of the scale that only Cloud Foundry can provide. This is the deck from my Spring IO 2012 talk.
This was a quick (15 minutes!) tour of Cloud Foundry that I gave at JFokus 2012 introducing Cloud Foundry as the answer to the question, "I've got a working web application and Spring made it easy, but where do I host it?"
1. Tailoring Spring for Custom Usage
• Josh Long, SpringSource, a division of VMware
1
Thursday, January 24, 13
2. About Josh Long (龙
之春)
Spring Developer Advocate
twitter: @starbuxman
weibo: @springsource
josh.long@springsource.com
2
Thursday, January 24, 13
3. Agenda
Explore the value of a framework
Exploit some of the lesser known, but powerful, extension
hooks in the core Spring framework
QA
3
Thursday, January 24, 13
4. Spring’s aim:
bring simplicity to java development
data
web tier integration
batch access
& service tier & mobile
processing / NoSQL /
RIA messaging
Big Data
The Spring framework
the cloud: lightweight traditional
CloudFoundry WebSphere
tc Server
VMForce JBoss AS
Tomcat
Google App Engine WebLogic
Jetty
Amazon Web Services (on legacy versions, too!)
4
Thursday, January 24, 13
5. The Spring ApplicationContext
• Spring Manages the beans you tell it to manage
– use annotations (JSR 250, JSR 330, native)
– XML
– Java configuration
– component scanning
• You can of course use all of them! Mix ‘n match
• All configuration styles tell the ApplicationContext how to
manage your beans
5
Thursday, January 24, 13
6. Spring, a walking tour
• Demos:
– introduce the tool chain
– how to “setup” Spring
– basic dependency injection
• annotations (JSR 250, JSR 330, native)
• xml
• java configuration
6
Thursday, January 24, 13
12. The Open/Closed Principle
"software entities (classes, modules, functions, etc.) should
be open for extension, but closed for modification”
-Bob Martin
12
Thursday, January 24, 13
13. Working with Lots of Beans
• One way to selectively augment beans at the lower level:
– BeanPostProcessor
• are regular beans and are run after the configured beans have
been created, but before the context is finished setting up
– BeanFactoryPostProcessor
• is run before any of the beans definitions are realized
• comes before BPP
• A more natural alternative is Spring’s AOP support
– built on top of AspectJ
– provides a very convenient, powerful way to solve cross
cutting problems
13
Thursday, January 24, 13
14. Spring, a walking tour
• Demos:
– Bean*PostProcessor
– AspectJ
14
Thursday, January 24, 13
15. Life Cycles
• Life Cycles for different folks
– “safe and consistent” - use the interfaces
• InitializingBean, DisposableBean
• correspond to init-method and destroy-method attributes
– Simple and component-centric : use the annotations
• @PostConstruct, @PreDestroy
• correspond to init-method and destroy-method attributes
– More power: SmartLifecycle
• gives you the ability to dynamically start and stop beans in a
certain order as well as to query whether the bean’s been
started or not.
15
Thursday, January 24, 13
16. Scopes
• Spring beans have scopes
– default: singleton
– can be:
• prototype
• HTTP session
• HTTP request
• HTTP application (servlet, basically)
• “step” in Spring batch
• thread-local
• Spring Web Flow “flow” scoped
• Spring Web Flow “conversation scoped”
• Spring Web Flow “view” scoped (in JSF)
• Activiti BPMN2 process-scoped
16
Thursday, January 24, 13
17. Scopes
– Implement o.s.beans.factory.config.Scope
– register the scope with a
o.s.beans.factory.config.CustomScopeConfigurer
public interface Scope {
Object get(String name, ObjectFactory<?> objectFactory);
Object remove(String name);
void registerDestructionCallback(String name, Runnable callback);
Object resolveContextualObject(String key);
String getConversationId();
}
17
Thursday, January 24, 13
18. Scopes
– Implement o.s.beans.factory.config.Scope
– register the scope with a
o.s.beans.factory.config.CustomScopeConfigurer
public interface Scope {
Object get(String name, ObjectFactory<?> objectFactory); map-like lookup
of beans in a
Object remove(String name); given scope
void registerDestructionCallback(String name, Runnable callback);
Object resolveContextualObject(String key);
String getConversationId();
}
17
Thursday, January 24, 13
19. Scopes
– Implement o.s.beans.factory.config.Scope
– register the scope with a
o.s.beans.factory.config.CustomScopeConfigurer
public interface Scope {
Object get(String name, ObjectFactory<?> objectFactory); map-like lookup
of beans in a
Object remove(String name); given scope
void registerDestructionCallback(String name, Runnable callback);
Object resolveContextualObject(String key); well known beans like the
HttpServletRequest ‘request’ for
String getConversationId(); ‘request’ scope
}
17
Thursday, January 24, 13
20. Scopes
– Implement o.s.beans.factory.config.Scope
– register the scope with a
o.s.beans.factory.config.CustomScopeConfigurer
public interface Scope {
Object get(String name, ObjectFactory<?> objectFactory); map-like lookup
of beans in a
Object remove(String name); given scope
void registerDestructionCallback(String name, Runnable callback);
Object resolveContextualObject(String key); well known beans like the
HttpServletRequest ‘request’ for
String getConversationId(); ‘request’ scope
}
null, or storage specific
‘conversation’ ID
17
Thursday, January 24, 13
21. Spring, a walking tour
• Demos:
– life cycle callbacks
– scopes
• using
• creating your own
18
Thursday, January 24, 13
22. Getting Beans from Strange Places
• FactoryBeans
• Spring Expression Language
– convenient way to get at values and inject them
• Spring environment specific beans (profiles)
– introduced in Spring 3.1
– make it easy to conditionally define an object based on
some sort of runtime condition
19
Thursday, January 24, 13
23. Getting Beans from Strange Places
• FactoryBeans
– interface that’s used to provide a reusable definition of how
to create a complicated object with many dependencies
– Related: Java configuration, and builders
• prefer both over FactoryBeans where possible
20
Thursday, January 24, 13
24. Getting Beans from Strange Places
• Spring Expression Language
– convenient way to get at values and inject them
– Andy Clement’s a genius
– like the Unified JSF EL, on steroids
– Can be used in Java, XML
• @Value(“#{ ... }”) or value = “#{ .. }”
21
Thursday, January 24, 13
25. Getting Beans from Strange Places
• Spring profiles
• @Profile(“production”) @Configuration ...
• <beans profile = ‘production’> ... </beans>
– Use System properties or simply specify the active profile on
the environment
– Use ApplicationContextInitializer in web applications
22
Thursday, January 24, 13
26. Getting Beans from Strange Places
• An ApplicationContextInitializer
public interface ApplicationContextInitializer
<C extends ConfigurableApplicationContext> {
void initialize(C applicationContext);
}
23
Thursday, January 24, 13
28. Proxies!
CustomerService cs = new CustomerService();
cs...
ProxyFactory pf = new ProxyFaxctory();
pf.setTarget( cs );
pf.addAdvice(new MethodInterceptor(){
public Object invoke(MethodInvocation mi) {
// ...
}
} );
return (CustomerService) pf.getObject() ;
25
Thursday, January 24, 13
29. Using Spring’s Resources
• Spring supports out of the box ClassPathResource,
FileResource system, etc.
• Writing your own Resource implementations
public interface Resource extends InputStreamSource {
boolean exists();
boolean isReadable();
boolean isOpen();
URL getURL() throws IOException;
URI getURI() throws IOException;
File getFile() throws IOException;
long contentLength() throws IOException;
long lastModified() throws IOException;
Resource createRelative(String relativePath) throws IOException;
String getFilename();
String getDescription();
}
26
Thursday, January 24, 13
30. Object to XML Marshallers
• Easy to add your own Marshaller (and Unmarshaller)
public interface Marshaller {
boolean supports(Class<?> clazz);
void marshal(Object graph, Result result)
throws IOException, XmlMappingException;
}
27
Thursday, January 24, 13
31. Object to XML Marshallers
• Demos:
– a custom object-to-XML marshaller
28
Thursday, January 24, 13
32. REST
• Spring MVC for the server
@RequestMapping( value = “/crm/customers/{id}” ,
method =HttpMethod.GET)
public @ResponseBody Customer lookupCustomerById(
@PathVariable(“id”) long customerId ) {
...
return customer;
}
29
Thursday, January 24, 13
33. REST
• RestTemplate for the client (Android, SE, web
applications, etc.)
RestTemplate rt = new RestTemplate() ;
String url = “http://mysvc.cloudfoundry.com/crm/customer/{id}”;
Customer customer = rt.getForObject( url, Customer.class, 22);
30
Thursday, January 24, 13
34. REST
• Both need o.s.http.converter.HttpMessageConverters
• Spring supports:
– object-to-XML (JAXB as well as any Spring OXM impl)
– object-to-JSON
– binary data (o.s.resource.Resource references or byte[])
– ATOM/RSS
– images
• Easy to add your own
31
Thursday, January 24, 13
35. Registering a custom HttpMessageConverter
@EnableWebMvc
public class WebConfiguration extends WebMvcConfigurerAdapter {
@Override
public void configureMessageConverters(
List<HttpMessageConverter<?>> converters) {
}
}
32
Thursday, January 24, 13
36. REST
• Demos:
– Writing and using a customer HttpMessageConverter
33
Thursday, January 24, 13
37. Transactions
• Spring supports declarative transaction management
– @EnableTransactionManagement or
<tx:annotation-driven/>
• PlatformTransactionManager implementations used to
manage transactions
– lots of options out of the box:
• AMQP, JMS, JTA, JDBC, JDO, JPA, WebLogic-specific,
WebSphere-specific, OC4J-specific, etc.
34
Thursday, January 24, 13
38. Transactions
• PlatformTransactionManager abstracts the notion
of a transactional “unit of work.”
public interface PlatformTransactionManager {
TransactionStatus getTransaction(TransactionDefinition definition)
throws TransactionException;
void commit(TransactionStatus status) throws TransactionException;
void rollback(TransactionStatus status) throws TransactionException;
}
35
Thursday, January 24, 13
39. Caching
• CacheManager’s maintain Caches.
– CacheManagers are like ‘connections’
– Caches are like regions of a cache
public interface CacheManager { public interface Cache {
Cache getCache(String name);
Collection<String> getCacheNames(); interface ValueWrapper {
} Object get();
}
String getName();
Object getNativeCache();
ValueWrapper get(Object key);
void put(Object key, Object value);
void evict(Object key);
void clear();
}
36
Thursday, January 24, 13
40. Writing a custom View and View Resolver
37
Thursday, January 24, 13
41. Writing a custom View and View Resolver
• Easy to add your own View
– supported views out of the box: FreeMarker, Velocity,
Excel, PDFs, JasperReports, XSLT, Jackson, JSTL, etc.
– Lots of contributions from the open source community:
• Thymeleaf
http://www.thymeleaf.org/
• Mustache by Sean Scanlon
https://github.com/sps/mustache-spring-view
38
Thursday, January 24, 13
42. Writing a custom View and View Resolver
public interface ViewResolver {
View resolveViewName(String viewName, Locale locale)
throws Exception;
}
39
Thursday, January 24, 13
43. Writing a custom View and View Resolver
public interface View {
String RESPONSE_STATUS_ATTRIBUTE =
View.class.getName() + ".responseStatus";
String getContentType();
void render(Map<String, ?> model,
HttpServletRequest request,
HttpServletResponse response) throws Exception;
}
40
Thursday, January 24, 13
44. Writing a custom View and View Resolver
@Bean
public ViewResolver myCustomViewResolver(){
...
} if ‘detectAllViewResolvers’ is
true, all ViewResolvers types
will be registered.
@Bean
public MyCustomViewResolver viewResolver()
{
...
}
41
Thursday, January 24, 13
45. Writing a custom View and View Resolver
@Bean
public ViewResolver myCustomViewResolver(){
...
} if ‘detectAllViewResolvers’ is
true, all ViewResolvers types
will be registered.
@Bean
public MyCustomViewResolver viewResolver()
{
... if ‘detectAllViewResolvers’ is
false, it’ll lookup a bean by a
} well known name
41
Thursday, January 24, 13
46. Writing a custom View and View Resolver
• Demo: writing a custom view/view resolver
42
Thursday, January 24, 13
47. A Custom NameSpace
public class ASimpleParser extends AbstractSingleBeanDefinitionParser {
@Override
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
String exchangeName = element.getAttribute(NAME_ATTRIBUTE);
builder.addConstructorArgValue(new TypedStringValue(exchangeName));
Element bindings = DomUtils.getChildElementByTagName(element, BINDINGS_ELE);
if (bindings != null) { }
NamespaceUtils.addConstructorArgBooleanValueIfAttributeDefined(builder, element, DURABLE_ATTRIBUTE, true);
...
}
43
Thursday, January 24, 13
49. Writing Adapters in Spring Integration
• MessageSource for inbound adapters
• MessageHandler for outbound adapters
MessageSource MessageHandler
45
Thursday, January 24, 13
50. Writing Adapters in Spring Integration
• Inbound channel adapter “receives” message from
external system inward relative to Spring Integration code
package org.springframework.integration.core;
public interface MessageSource<T> {
org.springframework.integration.Message<T> receive();
}
<int:channel id = “in” />
<int:inbound-channel-adapter
channel = “in” ref = “myCustomMessageSource” >
<int:cron-trigger ... />
</int:inbound-channel-adapter>
46
Thursday, January 24, 13
51. Writing Adapters in Spring Integration
• Outbound channel adapter “publishes” message from Spring
Integration outward relative to Spring Integration code
package org.springframework.integration.core;
public interface MessageHandler {
void handleMessage(
org.springframework.integration.Message<?> message)
throws org.springframework.integration.MessagingException;
}
<int:channel id = “out” />
<int:outbound-channel-adapter
channel = “out” ref = “myCustomMessageHandler” />
47
Thursday, January 24, 13
52. Spring Integration File System Adapters
• Spring Integration provides rich file system adapters
– FTP, SFTP, FTPS, files in general
– But... what about SMB/CIFS?
48
Thursday, January 24, 13
53. Writing Readers and Writers in Spring Batch
• ItemReader for inbound adapters
• ItemWriters for outbound adapters
49
Thursday, January 24, 13