SlideShare a Scribd company logo
Mule ESB
By Srilatha Kante
Java Component
• The Java component enables the developer to
package custom Java code that executes when
the component receives a message. The Java
component can be used to enhance the
functionality and capability of your web-based
applications written in Java.
Java Component
• To configure the Java component, selecting
a class is the only required entry.
• The class is simply a collection of properties,
attributes and methods the component applies to
all messages
• In addition, this component allows you to
optionally configure Singleton (object factory
that creates an object instance)
and Spring (object factory used to obtain Spring
bean instances) object factories, which are
invoked when a message is received
Example
Start..
• In the package explorer right click on your
project and select New > Class
• Name your class, and make the
package org.mule.transformers
• You can use the basic class as a skeleton to
construct a simple Java Component:
Java Class Sample
• package com.mypackage;
• public class JavaComponentDemo {
• public String greetMe(String name){
• return name;
• }
• }
Exception
• Check for the Exception related to Callable
interface
• Callable is an interface which is provided by
mule for using the Java Component in flows
• Callable needs an overridden method called
onCall()
Usage of Callable Interface
• package com.mypackage;
• import org.mule.api.MuleEventContext;
• import org.mule.api.lifecycle.Callable;
• public class JavaComponentDemo implements Callable{
• @Override
• public Object onCall(MuleEventContext eventContext) throws Exception
{
• return "Hello ";
• }
• }

More Related Content

What's hot

Ms build – inline task
Ms build – inline taskMs build – inline task
Ms build – inline task
LearningTech
 
Idempotent filter in mule
Idempotent filter in muleIdempotent filter in mule
Idempotent filter in mule
Mohammed246
 
Getting anypoint studios all versions
Getting anypoint studios all versionsGetting anypoint studios all versions
Getting anypoint studios all versions
Anirban Sen Chowdhary
 
Mule velocity
Mule velocityMule velocity
Mule velocity
Praneethchampion
 
Idempotent filter in Mule
Idempotent filter in MuleIdempotent filter in Mule
Idempotent filter in Mule
F K
 
Using maven with mule
Using maven with muleUsing maven with mule
Using maven with mule
Sindhu VL
 
Initialize database in Mule part2
Initialize database in Mule part2Initialize database in Mule part2
Initialize database in Mule part2
Anirban Sen Chowdhary
 
Servlet
ServletServlet
Servlet
Rami Nayan
 
My journey and learnings using mule esb part 1
My journey and learnings using mule esb part 1My journey and learnings using mule esb part 1
My journey and learnings using mule esb part 1
Alex Fernandez
 
Mule management console installation with Tomcat
Mule management console installation with TomcatMule management console installation with Tomcat
Mule management console installation with Tomcat
Sudha Ch
 
AngularJS Version 1.3
AngularJS  Version 1.3AngularJS  Version 1.3
AngularJS Version 1.3
Nir Noy
 
Deploying and Running in Mule
Deploying and Running in MuleDeploying and Running in Mule
Deploying and Running in Mule
Khasim Saheb
 
Mule with drools
Mule with droolsMule with drools
Mule with drools
F K
 
Anypoint mq acknowledgement mode
Anypoint mq acknowledgement modeAnypoint mq acknowledgement mode
Anypoint mq acknowledgement mode
Son Nguyen
 

What's hot (14)

Ms build – inline task
Ms build – inline taskMs build – inline task
Ms build – inline task
 
Idempotent filter in mule
Idempotent filter in muleIdempotent filter in mule
Idempotent filter in mule
 
Getting anypoint studios all versions
Getting anypoint studios all versionsGetting anypoint studios all versions
Getting anypoint studios all versions
 
Mule velocity
Mule velocityMule velocity
Mule velocity
 
Idempotent filter in Mule
Idempotent filter in MuleIdempotent filter in Mule
Idempotent filter in Mule
 
Using maven with mule
Using maven with muleUsing maven with mule
Using maven with mule
 
Initialize database in Mule part2
Initialize database in Mule part2Initialize database in Mule part2
Initialize database in Mule part2
 
Servlet
ServletServlet
Servlet
 
My journey and learnings using mule esb part 1
My journey and learnings using mule esb part 1My journey and learnings using mule esb part 1
My journey and learnings using mule esb part 1
 
Mule management console installation with Tomcat
Mule management console installation with TomcatMule management console installation with Tomcat
Mule management console installation with Tomcat
 
AngularJS Version 1.3
AngularJS  Version 1.3AngularJS  Version 1.3
AngularJS Version 1.3
 
Deploying and Running in Mule
Deploying and Running in MuleDeploying and Running in Mule
Deploying and Running in Mule
 
Mule with drools
Mule with droolsMule with drools
Mule with drools
 
Anypoint mq acknowledgement mode
Anypoint mq acknowledgement modeAnypoint mq acknowledgement mode
Anypoint mq acknowledgement mode
 

Viewers also liked

Mule esb domain
Mule esb domainMule esb domain
Mule esb domain
D.Rajesh Kumar
 
Mule message
Mule messageMule message
Mule message
Marta Bryla
 
Mule_Portal
Mule_PortalMule_Portal
Mule_Portal
Srilatha Kante
 
Java-JSON-Jackson
Java-JSON-JacksonJava-JSON-Jackson
Java-JSON-Jackson
Srilatha Kante
 
Mule advanced
Mule advancedMule advanced
Mule advanced
D.Rajesh Kumar
 
Mule Cloud Connectors-Save and Load OAuth
Mule Cloud Connectors-Save and Load OAuthMule Cloud Connectors-Save and Load OAuth
Mule Cloud Connectors-Save and Load OAuth
Sara Peralta
 
Web services
Web servicesWeb services
Web services
Srilatha Kante
 
Mule message structure and varibles scopes
Mule message structure and varibles scopesMule message structure and varibles scopes
Mule message structure and varibles scopes
Ramakrishna kapa
 
MMC
MMCMMC
Connection management
Connection managementConnection management
Connection management
Srilatha Kante
 
Logger
LoggerLogger
Anypoint platform security components
Anypoint platform security componentsAnypoint platform security components
Anypoint platform security components
D.Rajesh Kumar
 
Mule message structure
Mule message structureMule message structure
Mule message structure
Srilatha Kante
 
Mule exception handlingstrategies
Mule exception handlingstrategiesMule exception handlingstrategies
Mule exception handlingstrategies
D.Rajesh Kumar
 
Mule message structure
Mule message structureMule message structure
Mule message structure
Shanky Gupta
 
Connection management
Connection managementConnection management
Connection management
Srilatha Kante
 

Viewers also liked (16)

Mule esb domain
Mule esb domainMule esb domain
Mule esb domain
 
Mule message
Mule messageMule message
Mule message
 
Mule_Portal
Mule_PortalMule_Portal
Mule_Portal
 
Java-JSON-Jackson
Java-JSON-JacksonJava-JSON-Jackson
Java-JSON-Jackson
 
Mule advanced
Mule advancedMule advanced
Mule advanced
 
Mule Cloud Connectors-Save and Load OAuth
Mule Cloud Connectors-Save and Load OAuthMule Cloud Connectors-Save and Load OAuth
Mule Cloud Connectors-Save and Load OAuth
 
Web services
Web servicesWeb services
Web services
 
Mule message structure and varibles scopes
Mule message structure and varibles scopesMule message structure and varibles scopes
Mule message structure and varibles scopes
 
MMC
MMCMMC
MMC
 
Connection management
Connection managementConnection management
Connection management
 
Logger
LoggerLogger
Logger
 
Anypoint platform security components
Anypoint platform security componentsAnypoint platform security components
Anypoint platform security components
 
Mule message structure
Mule message structureMule message structure
Mule message structure
 
Mule exception handlingstrategies
Mule exception handlingstrategiesMule exception handlingstrategies
Mule exception handlingstrategies
 
Mule message structure
Mule message structureMule message structure
Mule message structure
 
Connection management
Connection managementConnection management
Connection management
 

Similar to Java component

Java component
Java componentJava component
Java component
krishashi
 
JAVA PROGRAMMING
JAVA PROGRAMMINGJAVA PROGRAMMING
Invoke component demo in mule
Invoke component demo in muleInvoke component demo in mule
Invoke component demo in mule
Ramakrishna kapa
 
Module 1.pptx
Module 1.pptxModule 1.pptx
Module 1.pptx
YakaviBalakrishnan
 
CS8392 OOP
CS8392 OOPCS8392 OOP
oop unit1.pptx
oop unit1.pptxoop unit1.pptx
oop unit1.pptx
sureshkumara29
 
JAVA_BEAN.pptx
JAVA_BEAN.pptxJAVA_BEAN.pptx
JAVA_BEAN.pptx
koodalcsc
 
Osgi
OsgiOsgi
Java mule
Java muleJava mule
Java mule
Gandham38
 
Java components in mule
Java components in muleJava components in mule
Java components in mule
Harish43
 
CONSTRUCTORS.pptx
CONSTRUCTORS.pptxCONSTRUCTORS.pptx
CONSTRUCTORS.pptx
SaraswathiVelmurugan1
 
oop 3.pptx
oop 3.pptxoop 3.pptx
oop 3.pptx
OsamaMuhammad18
 
Testing mule
Testing   muleTesting   mule
Testing mule
Sindhu VL
 
Java
JavaJava
Java
manavp
 
Preparing for java 9 modules upload
Preparing for java 9 modules uploadPreparing for java 9 modules upload
Preparing for java 9 modules upload
Ryan Cuprak
 
Constructors in java
Constructors in javaConstructors in java
Constructors in java
sunilchute1
 
A begineers guide of JAVA - Getting Started
 A begineers guide of JAVA - Getting Started A begineers guide of JAVA - Getting Started
A begineers guide of JAVA - Getting Started
Rakesh Madugula
 
Java Platform Module System
Java Platform Module SystemJava Platform Module System
Java Platform Module System
Vignesh Ramesh
 
API workshop: Deep dive into Java
API workshop: Deep dive into JavaAPI workshop: Deep dive into Java
API workshop: Deep dive into Java
Tom Johnson
 
Concurrency Programming in Java - 02 - Essentials of Java Part 1
Concurrency Programming in Java - 02 - Essentials of Java Part 1Concurrency Programming in Java - 02 - Essentials of Java Part 1
Concurrency Programming in Java - 02 - Essentials of Java Part 1
Sachintha Gunasena
 

Similar to Java component (20)

Java component
Java componentJava component
Java component
 
JAVA PROGRAMMING
JAVA PROGRAMMINGJAVA PROGRAMMING
JAVA PROGRAMMING
 
Invoke component demo in mule
Invoke component demo in muleInvoke component demo in mule
Invoke component demo in mule
 
Module 1.pptx
Module 1.pptxModule 1.pptx
Module 1.pptx
 
CS8392 OOP
CS8392 OOPCS8392 OOP
CS8392 OOP
 
oop unit1.pptx
oop unit1.pptxoop unit1.pptx
oop unit1.pptx
 
JAVA_BEAN.pptx
JAVA_BEAN.pptxJAVA_BEAN.pptx
JAVA_BEAN.pptx
 
Osgi
OsgiOsgi
Osgi
 
Java mule
Java muleJava mule
Java mule
 
Java components in mule
Java components in muleJava components in mule
Java components in mule
 
CONSTRUCTORS.pptx
CONSTRUCTORS.pptxCONSTRUCTORS.pptx
CONSTRUCTORS.pptx
 
oop 3.pptx
oop 3.pptxoop 3.pptx
oop 3.pptx
 
Testing mule
Testing   muleTesting   mule
Testing mule
 
Java
JavaJava
Java
 
Preparing for java 9 modules upload
Preparing for java 9 modules uploadPreparing for java 9 modules upload
Preparing for java 9 modules upload
 
Constructors in java
Constructors in javaConstructors in java
Constructors in java
 
A begineers guide of JAVA - Getting Started
 A begineers guide of JAVA - Getting Started A begineers guide of JAVA - Getting Started
A begineers guide of JAVA - Getting Started
 
Java Platform Module System
Java Platform Module SystemJava Platform Module System
Java Platform Module System
 
API workshop: Deep dive into Java
API workshop: Deep dive into JavaAPI workshop: Deep dive into Java
API workshop: Deep dive into Java
 
Concurrency Programming in Java - 02 - Essentials of Java Part 1
Concurrency Programming in Java - 02 - Essentials of Java Part 1Concurrency Programming in Java - 02 - Essentials of Java Part 1
Concurrency Programming in Java - 02 - Essentials of Java Part 1
 

Recently uploaded

A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Undress Baby
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
What is Master Data Management by PiLog Group
What is Master Data Management by PiLog GroupWhat is Master Data Management by PiLog Group
What is Master Data Management by PiLog Group
aymanquadri279
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
Yara Milbes
 

Recently uploaded (20)

A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
What is Master Data Management by PiLog Group
What is Master Data Management by PiLog GroupWhat is Master Data Management by PiLog Group
What is Master Data Management by PiLog Group
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
 

Java component

  • 2. Java Component • The Java component enables the developer to package custom Java code that executes when the component receives a message. The Java component can be used to enhance the functionality and capability of your web-based applications written in Java.
  • 3. Java Component • To configure the Java component, selecting a class is the only required entry. • The class is simply a collection of properties, attributes and methods the component applies to all messages • In addition, this component allows you to optionally configure Singleton (object factory that creates an object instance) and Spring (object factory used to obtain Spring bean instances) object factories, which are invoked when a message is received
  • 5. Start.. • In the package explorer right click on your project and select New > Class • Name your class, and make the package org.mule.transformers • You can use the basic class as a skeleton to construct a simple Java Component:
  • 6. Java Class Sample • package com.mypackage; • public class JavaComponentDemo { • public String greetMe(String name){ • return name; • } • }
  • 7. Exception • Check for the Exception related to Callable interface • Callable is an interface which is provided by mule for using the Java Component in flows • Callable needs an overridden method called onCall()
  • 8. Usage of Callable Interface • package com.mypackage; • import org.mule.api.MuleEventContext; • import org.mule.api.lifecycle.Callable; • public class JavaComponentDemo implements Callable{ • @Override • public Object onCall(MuleEventContext eventContext) throws Exception { • return "Hello "; • } • }