SlideShare a Scribd company logo
1 of 22
hSenid Lanka: Spring Services
hSenid Lanka: Spring Services
 What is Spring?
 What Does Spring Offer?
 Spring Services
 Task Execution and Scheduling
 Demo-Scheduling
 Email
2
hSenid Lanka: Spring Services
3
 Demo-Email
 Data Access With JDBC
 Demo-Data Access
 Transaction Management
 Demo-Database Transaction
hSenid Lanka: Spring Services
4
• Spring is an open source layered Java/J2EE application
framework.
• Philosophy: J2EE should be easier to use,
“Lightweight Container” concept
• Spring performs two major roles for a Java
application.
hSenid Lanka: Spring Services
5
• A Container
o Creates objects and makes them available to your
application.
 First Spring is a container that manages all or
some of the objects used by the application.
Behind the scenes Spring configures your objects
with what they need to in order to perform their
roles in the application.
hSenid Lanka: Spring Services
6
• A Framework
o Provides an infrastructure of classes that make
it easier to accomplish tasks.
 Spring is also a framework because it provides
libraries of classes that make it easier to
accomplish common tasks such as transaction
management, database integration, email, and web
applications.
hSenid Lanka: Spring Services
7
• Lightweight container and framework.
• Manages dependencies between your objects.
o Encourages use of interfaces
o Lessens “coupling” between objects
• Providing services to simplify tasks.
o Task scheduling
o Email sending
o Data access
o Database Transaction
hSenid Lanka: Spring Services
8
• Where to use scheduling?
o Generate periodic reports
o Invoke batch process
o Execute periodic application maintenance tasks
• Spring provides support for scheduling
• Quartz: Open source solution by OpenSymphony
• Trigger: SimpleTrigger, CronTrigger, etc.
hSenid Lanka: Spring Services
9
1.Using the MethodInvokingJobDetailFactoryObject
2.Using Annotations
3.Using Quartz Scheduler
4.Using Trigger (SimpleTrigger, CronTrigger)
hSenid Lanka: Spring Services
10
• The Spring Framework provides a helpful utility library for sending
email.
• The org.springframework.mail package is the root level package for
the Spring Framework’s email support.Timers: Java's built in
scheduler
• The central interface for sending emails is the MailSender
interface; a simple value object encapsulating the properties of a
simple mail such as from and to (plus many others) is the
SimpleMailMessage class.
hSenid Lanka: Spring Services
11
1.Textual Email
2.Email with attachment
hSenid Lanka: Spring Services
12
Action Spring You
Define connection parameters. X
Open the connection. X
Specify the SQL statement. X
Declare parameters and provide parameter values X
Prepare and execute the statement. X
Set up the loop to iterate through the results (if any). X
Do the work for each iteration. X
Process any exception. X
Handle transactions. X
Close the connection, statement and resultset. X
hSenid Lanka: Spring Services
13
• The JdbcTemplate class is the central class in the JDBC core
package.
• It simplifies the use of JDBC since it handles the creation and
release of resources.
• This helps to avoid common errors such as forgetting to always
close the connection.
• It executes the core JDBC workflow like statement creation and
execution, leaving application code to provide SQL and extract
results.
hSenid Lanka: Spring Services
14
hSenid Lanka: Spring Services
15
• Data Integrity.
• Consistency.
• Data and Resources may be corrupted and left in an
inconsistent state.
• Important for recovering from unexpected errors in a
concurrent and distributed environment.
hSenid Lanka: Spring Services
16
• The concept of transactions can be described with
following four key properties.
 Atomicity
 Consistency
 Isolation
 Durability
hSenid Lanka: Spring Services
17
• Atomicity
o A transaction should be treated as a single unit of operation
which means either the entire sequence of operations is
successful or unsuccessful.
• Consistency
o Once all actions of a transaction have completed, the
transaction is committed. Then your data and resources will be
in a consistent state that confirms to business rules.
hSenid Lanka: Spring Services
18
• Isolation
o Because there may be many transactions processing with the same
data set at the same time, each transaction should be isolated
from others to prevent data corruption.
hSenid Lanka: Spring Services
19
• Durability
o Once a transaction has completed, the results of this
transaction have to be made permanent and cannot be erased
from the database due to system failure.(imagine if the
power to your machine was cut right in the middle of a
transaction’s commit). Usually, the result of a
transaction is written to persistent storage.
hSenid Lanka: Spring Services
20
hSenid Lanka: Spring Services
21
• Brief Introduction to Spring
• Spring Services
• Scheduling (Annotations, Quartz, Trigger,
MethodInvokingJobDetailFactoryObject)
• Email (With and without an attachment)
• Data Accessing
• Database Transaction
hSenid Lanka: Spring Services
Demo projects can be found in GitHub
• Spring Scheduling - MethodInvokingTimerTaskFactoryBean
• Spring Scheduling – Annotation based
• Spring Scheduling – Simple, Quartz and Cron triggers
• Spring JDBC Template with Transaction Management

More Related Content

What's hot

Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean ArchitectureMattia Battiston
 
Netty Cookbook - Chapter 1
Netty Cookbook - Chapter 1Netty Cookbook - Chapter 1
Netty Cookbook - Chapter 1Trieu Nguyen
 
Lecture 6. ADO.NET Overview.
Lecture 6. ADO.NET Overview.Lecture 6. ADO.NET Overview.
Lecture 6. ADO.NET Overview.Alexey Furmanov
 
JPA Optimistic Locking With @Version
JPA Optimistic Locking With @VersionJPA Optimistic Locking With @Version
JPA Optimistic Locking With @VersionGuo Albert
 
Developing Blockchain Applications
Developing Blockchain Applications Developing Blockchain Applications
Developing Blockchain Applications malikmayank
 
Sap bodi bods online training course
Sap bodi bods online training courseSap bodi bods online training course
Sap bodi bods online training courseNewyorksys.com
 

What's hot (6)

Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean Architecture
 
Netty Cookbook - Chapter 1
Netty Cookbook - Chapter 1Netty Cookbook - Chapter 1
Netty Cookbook - Chapter 1
 
Lecture 6. ADO.NET Overview.
Lecture 6. ADO.NET Overview.Lecture 6. ADO.NET Overview.
Lecture 6. ADO.NET Overview.
 
JPA Optimistic Locking With @Version
JPA Optimistic Locking With @VersionJPA Optimistic Locking With @Version
JPA Optimistic Locking With @Version
 
Developing Blockchain Applications
Developing Blockchain Applications Developing Blockchain Applications
Developing Blockchain Applications
 
Sap bodi bods online training course
Sap bodi bods online training courseSap bodi bods online training course
Sap bodi bods online training course
 

Viewers also liked

使用 Quartz
使用 Quartz使用 Quartz
使用 QuartzGelis Wu
 
Quartz connector
Quartz connectorQuartz connector
Quartz connectorRahul Kumar
 
Quartz.NET - Enterprise Job Scheduler for .NET Platform
Quartz.NET - Enterprise Job Scheduler for .NET PlatformQuartz.NET - Enterprise Job Scheduler for .NET Platform
Quartz.NET - Enterprise Job Scheduler for .NET PlatformGuo Albert
 
Quartzでcronを範囲検索したい
Quartzでcronを範囲検索したいQuartzでcronを範囲検索したい
Quartzでcronを範囲検索したいchibochibo
 
Using spring scheduler mule
Using spring scheduler muleUsing spring scheduler mule
Using spring scheduler muleSon Nguyen
 
White Belt DMAIC Project Line G MTTR
White Belt DMAIC Project Line G  MTTRWhite Belt DMAIC Project Line G  MTTR
White Belt DMAIC Project Line G MTTRIrfan Rasheed Rana
 

Viewers also liked (7)

使用 Quartz
使用 Quartz使用 Quartz
使用 Quartz
 
Quartz in mule
Quartz in muleQuartz in mule
Quartz in mule
 
Quartz connector
Quartz connectorQuartz connector
Quartz connector
 
Quartz.NET - Enterprise Job Scheduler for .NET Platform
Quartz.NET - Enterprise Job Scheduler for .NET PlatformQuartz.NET - Enterprise Job Scheduler for .NET Platform
Quartz.NET - Enterprise Job Scheduler for .NET Platform
 
Quartzでcronを範囲検索したい
Quartzでcronを範囲検索したいQuartzでcronを範囲検索したい
Quartzでcronを範囲検索したい
 
Using spring scheduler mule
Using spring scheduler muleUsing spring scheduler mule
Using spring scheduler mule
 
White Belt DMAIC Project Line G MTTR
White Belt DMAIC Project Line G  MTTRWhite Belt DMAIC Project Line G  MTTR
White Belt DMAIC Project Line G MTTR
 

Similar to Spring Services

Microservices for performance - GOTO Chicago 2016
Microservices for performance - GOTO Chicago 2016Microservices for performance - GOTO Chicago 2016
Microservices for performance - GOTO Chicago 2016Peter Lawrey
 
OSMC 2018 | Stream connector: Easily sending events and/or metrics from the C...
OSMC 2018 | Stream connector: Easily sending events and/or metrics from the C...OSMC 2018 | Stream connector: Easily sending events and/or metrics from the C...
OSMC 2018 | Stream connector: Easily sending events and/or metrics from the C...NETWAYS
 
Develop modern apps using Spring ecosystem at time of BigData
Develop modern apps using Spring ecosystem at time of BigData Develop modern apps using Spring ecosystem at time of BigData
Develop modern apps using Spring ecosystem at time of BigData Oleg Tsal-Tsalko
 
Networking in java, Advanced programming
Networking in java, Advanced programmingNetworking in java, Advanced programming
Networking in java, Advanced programmingGera Paulos
 
Advanced web application architecture - Talk
Advanced web application architecture - TalkAdvanced web application architecture - Talk
Advanced web application architecture - TalkMatthias Noback
 
Lagom : Reactive microservice framework
Lagom : Reactive microservice frameworkLagom : Reactive microservice framework
Lagom : Reactive microservice frameworkFabrice Sznajderman
 
Data Microservices with Spring Cloud
Data Microservices with Spring CloudData Microservices with Spring Cloud
Data Microservices with Spring CloudOrkhan Gasimov
 
Displaying google maps in mobileapplication.pptx
Displaying google maps in mobileapplication.pptxDisplaying google maps in mobileapplication.pptx
Displaying google maps in mobileapplication.pptxsanaiftikhar23
 
Developing Microservices using Spring - Beginner's Guide
Developing Microservices using Spring - Beginner's GuideDeveloping Microservices using Spring - Beginner's Guide
Developing Microservices using Spring - Beginner's GuideMohanraj Thirumoorthy
 
Serverless Compose vs hurtownia danych
Serverless Compose vs hurtownia danychServerless Compose vs hurtownia danych
Serverless Compose vs hurtownia danychThe Software House
 
Top 7 Angular Best Practices to Organize Your Angular App
Top 7 Angular Best Practices to Organize Your Angular AppTop 7 Angular Best Practices to Organize Your Angular App
Top 7 Angular Best Practices to Organize Your Angular AppKaty Slemon
 
Software architecture for data applications
Software architecture for data applicationsSoftware architecture for data applications
Software architecture for data applicationsDing Li
 
Serverless Computing
Serverless ComputingServerless Computing
Serverless ComputingAnand Gupta
 
The Fn Project: A Quick Introduction (December 2017)
The Fn Project: A Quick Introduction (December 2017)The Fn Project: A Quick Introduction (December 2017)
The Fn Project: A Quick Introduction (December 2017)Oracle Developers
 
Current & Future Use-Cases of OpenDaylight
Current & Future Use-Cases of OpenDaylightCurrent & Future Use-Cases of OpenDaylight
Current & Future Use-Cases of OpenDaylightabhijit2511
 

Similar to Spring Services (20)

Microservices for performance - GOTO Chicago 2016
Microservices for performance - GOTO Chicago 2016Microservices for performance - GOTO Chicago 2016
Microservices for performance - GOTO Chicago 2016
 
Meet with Meteor
Meet with MeteorMeet with Meteor
Meet with Meteor
 
OSMC 2018 | Stream connector: Easily sending events and/or metrics from the C...
OSMC 2018 | Stream connector: Easily sending events and/or metrics from the C...OSMC 2018 | Stream connector: Easily sending events and/or metrics from the C...
OSMC 2018 | Stream connector: Easily sending events and/or metrics from the C...
 
Develop modern apps using Spring ecosystem at time of BigData
Develop modern apps using Spring ecosystem at time of BigData Develop modern apps using Spring ecosystem at time of BigData
Develop modern apps using Spring ecosystem at time of BigData
 
Networking in java, Advanced programming
Networking in java, Advanced programmingNetworking in java, Advanced programming
Networking in java, Advanced programming
 
Advanced web application architecture - Talk
Advanced web application architecture - TalkAdvanced web application architecture - Talk
Advanced web application architecture - Talk
 
Lagom : Reactive microservice framework
Lagom : Reactive microservice frameworkLagom : Reactive microservice framework
Lagom : Reactive microservice framework
 
Data Microservices with Spring Cloud
Data Microservices with Spring CloudData Microservices with Spring Cloud
Data Microservices with Spring Cloud
 
Displaying google maps in mobileapplication.pptx
Displaying google maps in mobileapplication.pptxDisplaying google maps in mobileapplication.pptx
Displaying google maps in mobileapplication.pptx
 
Developing Microservices using Spring - Beginner's Guide
Developing Microservices using Spring - Beginner's GuideDeveloping Microservices using Spring - Beginner's Guide
Developing Microservices using Spring - Beginner's Guide
 
Java Server Pages
Java Server PagesJava Server Pages
Java Server Pages
 
Serverless Compose vs hurtownia danych
Serverless Compose vs hurtownia danychServerless Compose vs hurtownia danych
Serverless Compose vs hurtownia danych
 
L06 Using Design Patterns
L06 Using Design PatternsL06 Using Design Patterns
L06 Using Design Patterns
 
Top 7 Angular Best Practices to Organize Your Angular App
Top 7 Angular Best Practices to Organize Your Angular AppTop 7 Angular Best Practices to Organize Your Angular App
Top 7 Angular Best Practices to Organize Your Angular App
 
Software architecture for data applications
Software architecture for data applicationsSoftware architecture for data applications
Software architecture for data applications
 
Springboot Microservices
Springboot MicroservicesSpringboot Microservices
Springboot Microservices
 
JSP.pdf
JSP.pdfJSP.pdf
JSP.pdf
 
Serverless Computing
Serverless ComputingServerless Computing
Serverless Computing
 
The Fn Project: A Quick Introduction (December 2017)
The Fn Project: A Quick Introduction (December 2017)The Fn Project: A Quick Introduction (December 2017)
The Fn Project: A Quick Introduction (December 2017)
 
Current & Future Use-Cases of OpenDaylight
Current & Future Use-Cases of OpenDaylightCurrent & Future Use-Cases of OpenDaylight
Current & Future Use-Cases of OpenDaylight
 

Recently uploaded

BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 

Recently uploaded (20)

BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 

Spring Services

  • 2. hSenid Lanka: Spring Services  What is Spring?  What Does Spring Offer?  Spring Services  Task Execution and Scheduling  Demo-Scheduling  Email 2
  • 3. hSenid Lanka: Spring Services 3  Demo-Email  Data Access With JDBC  Demo-Data Access  Transaction Management  Demo-Database Transaction
  • 4. hSenid Lanka: Spring Services 4 • Spring is an open source layered Java/J2EE application framework. • Philosophy: J2EE should be easier to use, “Lightweight Container” concept • Spring performs two major roles for a Java application.
  • 5. hSenid Lanka: Spring Services 5 • A Container o Creates objects and makes them available to your application.  First Spring is a container that manages all or some of the objects used by the application. Behind the scenes Spring configures your objects with what they need to in order to perform their roles in the application.
  • 6. hSenid Lanka: Spring Services 6 • A Framework o Provides an infrastructure of classes that make it easier to accomplish tasks.  Spring is also a framework because it provides libraries of classes that make it easier to accomplish common tasks such as transaction management, database integration, email, and web applications.
  • 7. hSenid Lanka: Spring Services 7 • Lightweight container and framework. • Manages dependencies between your objects. o Encourages use of interfaces o Lessens “coupling” between objects • Providing services to simplify tasks. o Task scheduling o Email sending o Data access o Database Transaction
  • 8. hSenid Lanka: Spring Services 8 • Where to use scheduling? o Generate periodic reports o Invoke batch process o Execute periodic application maintenance tasks • Spring provides support for scheduling • Quartz: Open source solution by OpenSymphony • Trigger: SimpleTrigger, CronTrigger, etc.
  • 9. hSenid Lanka: Spring Services 9 1.Using the MethodInvokingJobDetailFactoryObject 2.Using Annotations 3.Using Quartz Scheduler 4.Using Trigger (SimpleTrigger, CronTrigger)
  • 10. hSenid Lanka: Spring Services 10 • The Spring Framework provides a helpful utility library for sending email. • The org.springframework.mail package is the root level package for the Spring Framework’s email support.Timers: Java's built in scheduler • The central interface for sending emails is the MailSender interface; a simple value object encapsulating the properties of a simple mail such as from and to (plus many others) is the SimpleMailMessage class.
  • 11. hSenid Lanka: Spring Services 11 1.Textual Email 2.Email with attachment
  • 12. hSenid Lanka: Spring Services 12 Action Spring You Define connection parameters. X Open the connection. X Specify the SQL statement. X Declare parameters and provide parameter values X Prepare and execute the statement. X Set up the loop to iterate through the results (if any). X Do the work for each iteration. X Process any exception. X Handle transactions. X Close the connection, statement and resultset. X
  • 13. hSenid Lanka: Spring Services 13 • The JdbcTemplate class is the central class in the JDBC core package. • It simplifies the use of JDBC since it handles the creation and release of resources. • This helps to avoid common errors such as forgetting to always close the connection. • It executes the core JDBC workflow like statement creation and execution, leaving application code to provide SQL and extract results.
  • 14. hSenid Lanka: Spring Services 14
  • 15. hSenid Lanka: Spring Services 15 • Data Integrity. • Consistency. • Data and Resources may be corrupted and left in an inconsistent state. • Important for recovering from unexpected errors in a concurrent and distributed environment.
  • 16. hSenid Lanka: Spring Services 16 • The concept of transactions can be described with following four key properties.  Atomicity  Consistency  Isolation  Durability
  • 17. hSenid Lanka: Spring Services 17 • Atomicity o A transaction should be treated as a single unit of operation which means either the entire sequence of operations is successful or unsuccessful. • Consistency o Once all actions of a transaction have completed, the transaction is committed. Then your data and resources will be in a consistent state that confirms to business rules.
  • 18. hSenid Lanka: Spring Services 18 • Isolation o Because there may be many transactions processing with the same data set at the same time, each transaction should be isolated from others to prevent data corruption.
  • 19. hSenid Lanka: Spring Services 19 • Durability o Once a transaction has completed, the results of this transaction have to be made permanent and cannot be erased from the database due to system failure.(imagine if the power to your machine was cut right in the middle of a transaction’s commit). Usually, the result of a transaction is written to persistent storage.
  • 20. hSenid Lanka: Spring Services 20
  • 21. hSenid Lanka: Spring Services 21 • Brief Introduction to Spring • Spring Services • Scheduling (Annotations, Quartz, Trigger, MethodInvokingJobDetailFactoryObject) • Email (With and without an attachment) • Data Accessing • Database Transaction
  • 22. hSenid Lanka: Spring Services Demo projects can be found in GitHub • Spring Scheduling - MethodInvokingTimerTaskFactoryBean • Spring Scheduling – Annotation based • Spring Scheduling – Simple, Quartz and Cron triggers • Spring JDBC Template with Transaction Management