SlideShare a Scribd company logo
1 of 17
JAVA-MULE
GSN-K
Java Custom Component
• Java components are used write our custom code and custom
transformation. java transformers will be used when we cannot
transform a message using available Mule transformers. In this
example, following components are explained.
• Java Component
• Java component with singleton
• Invoke Component
• Java Transformer
• Reflection Entry Point Resolver
• Annotated Entry Point Resolver
• Invoking a service using java component
Below is the main flow which exposes a HTTP service and
refers to multiple sub flows one after another to cover all above
concepts.
Java Component:
Java component is used to refer a class which has complex code.
Example:
Below is sub flow named 'simple-java-component' which has Set
Payload and java component.
'Set Payload' component sets payload as "Custom Payload".
• Java component is reffered to custom made class
(UsingCallable) which implements Callable interface. This class is used
to print current payload, size of inbound properties and size of
invocation properties.
Above class implements Callable interface. it has
onCall(MuleEventContext eventContext) overriden method. This method
provides MuleEventContext . We can get all the data using MuleContext
instace as shown in above code snippet.Data-Mapper.
Java Component with Singleton:
The singleton object factory does not create a new instance for each
request; instead, the instance is shared.
Example:
Drag java component and double click on the java component to
bring up properties.
Click "+" symbol next to the 'Object' field
Select “core:singleton-object” and click "next".
Click on "..." button and select class
"com.techm.javacustomcomponents.UsingSingletonObject"
• Click on "Advanced" tab and create following three properties using "+"
as shown below and click on Finish.
• name
• dept
• location
Same properties with same names need to be created along with
setters and getters in "UsingSingletonObject" class. So that, specified
properties values in java component are assigned into java class
properties. Below is the code to create map object with these three
properties.
• A bean needs to be created in global elements to use Invoke
component. Create a bean which refers to a custom made java class
in global elements. In "Global Elements" tab click on "Create" button.
• Click on "..." symbol next to "Class" field to select a java custom made
class. Provide some meaningful names in "ID" and "Name" fields. Click
on OK button.
• Drag a invoke component and double click on the component to bring
up the properties. Fill the required fields as shown below.
• Name Any meaningful name
• Object Ref "ID" value of bean which is created earlier
• Method Method name which needs to be invoked
• Method Arguments Values of method arguments
• In the same way two more invoke components are created for
two methods (substract and multiply)
•Thank You All

More Related Content

What's hot

Idempotent filter in mule
Idempotent filter in muleIdempotent filter in mule
Idempotent filter in muleMohammed246
 
Integration with Dropbox using Mule ESB
Integration with Dropbox using Mule ESBIntegration with Dropbox using Mule ESB
Integration with Dropbox using Mule ESBRupesh Sinha
 
Junit in mule demo
Junit in mule demoJunit in mule demo
Junit in mule demoSudha Ch
 
Message properties component in Mule
Message properties component in MuleMessage properties component in Mule
Message properties component in MuleKhan625
 
Deploying and Running in Mule
Deploying and Running in MuleDeploying and Running in Mule
Deploying and Running in MuleKhasim Saheb
 
Using maven with mule
Using maven with muleUsing maven with mule
Using maven with muleSindhu VL
 
Mule testing
Mule   testingMule   testing
Mule testingSindhu VL
 
Velocity in Mule
Velocity in MuleVelocity in Mule
Velocity in MuleMohammed246
 
Idempotent filter in Mule
Idempotent filter in MuleIdempotent filter in Mule
Idempotent filter in MuleF K
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esbPraneethchampion
 
Anypoint mq acknowledgement mode
Anypoint mq acknowledgement modeAnypoint mq acknowledgement mode
Anypoint mq acknowledgement modeSon Nguyen
 
Mule - HTTP Listener
Mule - HTTP ListenerMule - HTTP Listener
Mule - HTTP ListenerAnkush Sharma
 

What's hot (19)

Idempotent filter in mule
Idempotent filter in muleIdempotent filter in mule
Idempotent filter in mule
 
Integration with Dropbox using Mule ESB
Integration with Dropbox using Mule ESBIntegration with Dropbox using Mule ESB
Integration with Dropbox using Mule ESB
 
Junit in mule demo
Junit in mule demoJunit in mule demo
Junit in mule demo
 
Message properties component in Mule
Message properties component in MuleMessage properties component in Mule
Message properties component in Mule
 
Deploying and Running in Mule
Deploying and Running in MuleDeploying and Running in Mule
Deploying and Running in Mule
 
Using maven with mule
Using maven with muleUsing maven with mule
Using maven with mule
 
Mule - logger
Mule -  loggerMule -  logger
Mule - logger
 
Mule velocity
Mule velocityMule velocity
Mule velocity
 
Mule testing
Mule   testingMule   testing
Mule testing
 
Dynamic file attribute
Dynamic file attributeDynamic file attribute
Dynamic file attribute
 
Velocity in Mule
Velocity in MuleVelocity in Mule
Velocity in Mule
 
Mule quartz
Mule quartz Mule quartz
Mule quartz
 
Idempotent filter in Mule
Idempotent filter in MuleIdempotent filter in Mule
Idempotent filter in Mule
 
Mule java part-1
Mule java part-1Mule java part-1
Mule java part-1
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esb
 
Mule properties
Mule propertiesMule properties
Mule properties
 
Anypoint mq acknowledgement mode
Anypoint mq acknowledgement modeAnypoint mq acknowledgement mode
Anypoint mq acknowledgement mode
 
Mule - HTTP Listener
Mule - HTTP ListenerMule - HTTP Listener
Mule - HTTP Listener
 
Propertiesinmule
PropertiesinmulePropertiesinmule
Propertiesinmule
 

Similar to Java mule

Java in mule part 2
Java in mule part 2Java in mule part 2
Java in mule part 2vasanthii9
 
Mastering the Lightning Framework - Part 1
Mastering the Lightning Framework - Part 1Mastering the Lightning Framework - Part 1
Mastering the Lightning Framework - Part 1Salesforce Developers
 
[2015/2016] Require JS and Handlebars JS
[2015/2016] Require JS and Handlebars JS[2015/2016] Require JS and Handlebars JS
[2015/2016] Require JS and Handlebars JSIvano Malavolta
 
object oriented programming language.pptx
object oriented programming language.pptxobject oriented programming language.pptx
object oriented programming language.pptxsyedabbas594247
 
Java component
Java componentJava component
Java componentkrishashi
 
Selenium Training in Chennai Demo Part-2
Selenium Training in Chennai Demo Part-2 Selenium Training in Chennai Demo Part-2
Selenium Training in Chennai Demo Part-2 Thecreating Experts
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
Fundamental Concepts of React JS for Beginners.pdf
Fundamental Concepts of React JS for Beginners.pdfFundamental Concepts of React JS for Beginners.pdf
Fundamental Concepts of React JS for Beginners.pdfStephieJohn
 
Intro To C++ - Class 05 - Introduction To Classes, Objects, & Strings
Intro To C++ - Class 05 - Introduction To  Classes, Objects, & StringsIntro To C++ - Class 05 - Introduction To  Classes, Objects, & Strings
Intro To C++ - Class 05 - Introduction To Classes, Objects, & StringsBlue Elephant Consulting
 
Understanding Object Oriented Javascript - Coffee@DBG June
Understanding Object Oriented Javascript - Coffee@DBG JuneUnderstanding Object Oriented Javascript - Coffee@DBG June
Understanding Object Oriented Javascript - Coffee@DBG JuneDeepu S Nath
 
JavaScript Interview Questions Part - 1.pdf
JavaScript Interview Questions Part - 1.pdfJavaScript Interview Questions Part - 1.pdf
JavaScript Interview Questions Part - 1.pdfkatarichallenge
 
Oop Constructor Destructors Constructor Overloading lecture 2
Oop Constructor  Destructors Constructor Overloading lecture 2Oop Constructor  Destructors Constructor Overloading lecture 2
Oop Constructor Destructors Constructor Overloading lecture 2Abbas Ajmal
 

Similar to Java mule (20)

Java
JavaJava
Java
 
Mule java part-1
Mule java part-1Mule java part-1
Mule java part-1
 
Mule java part-2
Mule java part-2Mule java part-2
Mule java part-2
 
Mule java part-2
Mule java part-2Mule java part-2
Mule java part-2
 
Mule java part-1
Mule java part-1Mule java part-1
Mule java part-1
 
Java in mule part 2
Java in mule part 2Java in mule part 2
Java in mule part 2
 
Mastering the Lightning Framework - Part 1
Mastering the Lightning Framework - Part 1Mastering the Lightning Framework - Part 1
Mastering the Lightning Framework - Part 1
 
[2015/2016] Require JS and Handlebars JS
[2015/2016] Require JS and Handlebars JS[2015/2016] Require JS and Handlebars JS
[2015/2016] Require JS and Handlebars JS
 
object oriented programming language.pptx
object oriented programming language.pptxobject oriented programming language.pptx
object oriented programming language.pptx
 
Java component
Java componentJava component
Java component
 
Java component
Java componentJava component
Java component
 
Advanced oops concept using asp
Advanced oops concept using aspAdvanced oops concept using asp
Advanced oops concept using asp
 
Selenium Training in Chennai Demo Part-2
Selenium Training in Chennai Demo Part-2 Selenium Training in Chennai Demo Part-2
Selenium Training in Chennai Demo Part-2
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
Fundamental Concepts of React JS for Beginners.pdf
Fundamental Concepts of React JS for Beginners.pdfFundamental Concepts of React JS for Beginners.pdf
Fundamental Concepts of React JS for Beginners.pdf
 
Intro To C++ - Class 05 - Introduction To Classes, Objects, & Strings
Intro To C++ - Class 05 - Introduction To  Classes, Objects, & StringsIntro To C++ - Class 05 - Introduction To  Classes, Objects, & Strings
Intro To C++ - Class 05 - Introduction To Classes, Objects, & Strings
 
Understanding Object Oriented Javascript - Coffee@DBG June
Understanding Object Oriented Javascript - Coffee@DBG JuneUnderstanding Object Oriented Javascript - Coffee@DBG June
Understanding Object Oriented Javascript - Coffee@DBG June
 
JavaScript Interview Questions Part - 1.pdf
JavaScript Interview Questions Part - 1.pdfJavaScript Interview Questions Part - 1.pdf
JavaScript Interview Questions Part - 1.pdf
 
WEB TECHNOLOGIES JavaScript
WEB TECHNOLOGIES JavaScriptWEB TECHNOLOGIES JavaScript
WEB TECHNOLOGIES JavaScript
 
Oop Constructor Destructors Constructor Overloading lecture 2
Oop Constructor  Destructors Constructor Overloading lecture 2Oop Constructor  Destructors Constructor Overloading lecture 2
Oop Constructor Destructors Constructor Overloading lecture 2
 

More from Gandham38

Mule routing and filters
Mule routing and filtersMule routing and filters
Mule routing and filtersGandham38
 
Mule splitters
Mule splittersMule splitters
Mule splittersGandham38
 
Mule system properties
Mule system propertiesMule system properties
Mule system propertiesGandham38
 
Mule properties
Mule propertiesMule properties
Mule propertiesGandham38
 
Mule jms queues
Mule jms queuesMule jms queues
Mule jms queuesGandham38
 
Mule jms-topics
Mule jms-topicsMule jms-topics
Mule jms-topicsGandham38
 
Mule enricher component
Mule enricher component Mule enricher component
Mule enricher component Gandham38
 

More from Gandham38 (8)

Mule routing and filters
Mule routing and filtersMule routing and filters
Mule routing and filters
 
Mule splitters
Mule splittersMule splitters
Mule splitters
 
Mule system properties
Mule system propertiesMule system properties
Mule system properties
 
Mule properties
Mule propertiesMule properties
Mule properties
 
Mule batch
Mule batchMule batch
Mule batch
 
Mule jms queues
Mule jms queuesMule jms queues
Mule jms queues
 
Mule jms-topics
Mule jms-topicsMule jms-topics
Mule jms-topics
 
Mule enricher component
Mule enricher component Mule enricher component
Mule enricher component
 

Recently uploaded

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 

Recently uploaded (20)

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 

Java mule

  • 2. Java Custom Component • Java components are used write our custom code and custom transformation. java transformers will be used when we cannot transform a message using available Mule transformers. In this example, following components are explained. • Java Component • Java component with singleton • Invoke Component • Java Transformer
  • 3. • Reflection Entry Point Resolver • Annotated Entry Point Resolver • Invoking a service using java component Below is the main flow which exposes a HTTP service and refers to multiple sub flows one after another to cover all above concepts.
  • 4. Java Component: Java component is used to refer a class which has complex code. Example: Below is sub flow named 'simple-java-component' which has Set Payload and java component. 'Set Payload' component sets payload as "Custom Payload".
  • 5. • Java component is reffered to custom made class (UsingCallable) which implements Callable interface. This class is used to print current payload, size of inbound properties and size of invocation properties.
  • 6. Above class implements Callable interface. it has onCall(MuleEventContext eventContext) overriden method. This method provides MuleEventContext . We can get all the data using MuleContext instace as shown in above code snippet.Data-Mapper.
  • 7. Java Component with Singleton: The singleton object factory does not create a new instance for each request; instead, the instance is shared. Example: Drag java component and double click on the java component to bring up properties. Click "+" symbol next to the 'Object' field Select “core:singleton-object” and click "next".
  • 8. Click on "..." button and select class "com.techm.javacustomcomponents.UsingSingletonObject"
  • 9. • Click on "Advanced" tab and create following three properties using "+" as shown below and click on Finish. • name • dept • location Same properties with same names need to be created along with setters and getters in "UsingSingletonObject" class. So that, specified properties values in java component are assigned into java class properties. Below is the code to create map object with these three properties.
  • 10.
  • 11.
  • 12.
  • 13. • A bean needs to be created in global elements to use Invoke component. Create a bean which refers to a custom made java class in global elements. In "Global Elements" tab click on "Create" button. • Click on "..." symbol next to "Class" field to select a java custom made class. Provide some meaningful names in "ID" and "Name" fields. Click on OK button.
  • 14. • Drag a invoke component and double click on the component to bring up the properties. Fill the required fields as shown below.
  • 15.
  • 16. • Name Any meaningful name • Object Ref "ID" value of bean which is created earlier • Method Method name which needs to be invoked • Method Arguments Values of method arguments • In the same way two more invoke components are created for two methods (substract and multiply)