SlideShare a Scribd company logo
Java Components and their applicability in Mule Anypoint Studio
 The Java component enables the developer to package custom Java code
that executes when the component receives a message
 Mule provides two JavaComponent implementations:
 DefaultJavaComponent, which configured with the `component `element
<component class="org.my.CustomComponent"/>
 PooledJavaComponent, which adds pooling functionality when configured
with the pooled-component element.
<pooled-component class="org.my.CustomComponent"/>
 To configure the Java component, selecting a class is the only required
entry.
 The class name can be specified either through the “Class Name”
attribute or the “Object” attribute.
 Using the “Class Name” attribute is equivalent to using the prototype
object factory
J a v a C o m p o n e n t s i n M u l e .
 Object factories manage both object creation in case of Mule instantiated
instance or object look up from another container such as Spring.
 The following object factories are included with Mule and can be configured
using Mule’s core schema.
Type 1:<prototype-object class=…"/> :Creates a new instance of the object on
each call.
Example: <component class="org.my.CustomComponent"/>
or
<component ><prototype-object class="org.my.CustomComponent">
</component>
Type2:<singleton-object class=…"/> :Creates an instance of the object once and
then always returns the same instance .
Example:<component>
<singleton-object class="org.my.CustomComponent"/>
</component>
Type 3: <spring-object bean=…"/> :This is an implementation of the ObjectFactory
interface which simply delegates to the Spring ApplicationContext. Since the
delegation happens each time a call to getOrCreate() is made, this will correctly
handle Spring beans which are non-singletons (factory beans, etc.)
Example:
<component>
<spring-object bean="myCustomComponentBean"/>
</component>
Interceptors:
 Interceptors let us provide additional services to the component
Example: the ability to log transactions and the ability to log the time for each
transaction.
 An interceptor contains the business logic that is applied to the message payload
before being sent to the next building block.
 The following types of interceptors can be added to the Java component:
a)Custom Interceptor
b)Logging Interceptor
c)Timer Interceptor
Entry Point Resolvers:
 The entry point is the method in our component that is invoked by Mule
when a message is received.
 Entry point resolver determine how our component is invoked when a
message is received by the flow
 helps us to determine which method of a Java component will be called.
 Each entry point resolver is tried in turn until one succeeds in delivering the
message to the component.
Reflection Entry point resolver:
 Determines the message to be invoked based on number and type of
arguments.
<component class=”org.my.PrototypeObjectWithMyLifecycle”>
<reflection-entry-point-resolver/>
</component>
Entry Point Resolvers:
Property Entry point resolver:
 Uses a mule message property to select the component method to be called.
<component class=”org.my.PrototypeObjectWithMyLifecycle”>
<property-entry-point-resolver property="propertyName"/>
</component>
The property-entry-point-resolver lets you choose a method to invoke at run-
time by adding this property name to the MuleMessage.
Method entry point resolver:
 Delivers the message to a named method.
<component class=”org.my.PrototypeObjectWithMyLifecycle”>
<method-entry-point-resolver>
<include-entry-point method="methodString" />
</method-entry-point-resolver>
</component>
Entry Point Resolvers:
Custom Entry point resolver:
 Allows user-supplied code to determine how a message is passed to a
component in Java. .
<component class=”org.my.PrototypeObjectWithMyLifecycle”>
<custom-entry-point-resolver
class="org.mule.test.integration.resolvers.CustomEntryPointResolver"
/>
</component>
Callable Entry point resolver:
 An entry point resolver for the components that implement the Callable
interface.
 This passes a MuleEventContext to the component.
 This entry point resolver is implicitly configured only if the component
implements the Callable interface.
<component class="org.my.PrototypeObjectWithMyLifecycle">
<callable-entry-point-resolver/>
</component>
Entry Point Resolvers:
Array Entry point resolver:
 Delivers the message to a method that takes a single array as
argument.
<component class=”org.my.PrototypeObjectWithMyLifecycle”>
<array-entry-point-resolver/>
</component>
No Arguments Entry point resolver:
 Calls a method without any arguments.
<component class=”org.my.PrototypeObjectWithMyLifecycle”>
<no-arguments-entry-point-resolver/>
</component>
Include Entry point:
 Includes a particular method to be invoked.
Can be used in combination with any other entry point resolver when
there is ambiguity
Component Life-Cycle Interfaces
A custom LifecycleAdaptor can be configured to customize
the way in which the component implementation is initialized
and disposed
Ad

Recommended

Types of MessageRouting in Mule
Types of MessageRouting in Mule
VenkataNaveen Kumar
 
Mule: Java Component
Mule: Java Component
Sulthony Hartanto
 
Mule: Java Transformer
Mule: Java Transformer
Sulthony Hartanto
 
Mule Custom Aggregator
Mule Custom Aggregator
Ankush Sharma
 
Mule java part-1
Mule java part-1
Ravinder Singh
 
Mule esb usecase
Mule esb usecase
charan teja R
 
Message processor in mule
Message processor in mule
Son Nguyen
 
Expression language
Expression language
Son Nguyen
 
Mule Message Chunk Aggregator
Mule Message Chunk Aggregator
Ankush Sharma
 
Splitters in mule
Splitters in mule
vasanthii9
 
Mule java part-1
Mule java part-1
Karnam Karthik
 
Mule servlet connector
Mule servlet connector
Ankush Sharma
 
Mule jms
Mule jms
Rajarajan Sadhasivam
 
Mule concepts transformers
Mule concepts transformers
kunal vishe
 
Mule overview
Mule overview
Rajkattamuri
 
Mule rabbit mq
Mule rabbit mq
D.Rajesh Kumar
 
Mule Expression Transformer
Mule Expression Transformer
Ankush Sharma
 
Mule UDP Transport
Mule UDP Transport
Ankush Sharma
 
Java Servlets
Java Servlets
university of education,Lahore
 
Message structure
Message structure
Son Nguyen
 
Mule messages and transformers
Mule messages and transformers
Naresh Naidu
 
Controlling Message Flow - Mule ESB
Controlling Message Flow - Mule ESB
Mani Rathnam Gudi
 
Mule expression component
Mule expression component
Karnam Karthik
 
Mule LDAP Connector
Mule LDAP Connector
Ankush Sharma
 
Rabbit Mq in Mule
Rabbit Mq in Mule
Mohammed246
 
Mule JMS Transport
Mule JMS Transport
Rupesh Sinha
 
Mule generic connector
Mule generic connector
Ankush Sharma
 
Java Servlets
Java Servlets
Nitin Pai
 
Mule soft csv_toxml
Mule soft csv_toxml
VenkataNaveen Kumar
 
MuleSoft Anypoint Studio - Essentials - Data Filtering
MuleSoft Anypoint Studio - Essentials - Data Filtering
VenkataNaveen Kumar
 

More Related Content

What's hot (20)

Mule Message Chunk Aggregator
Mule Message Chunk Aggregator
Ankush Sharma
 
Splitters in mule
Splitters in mule
vasanthii9
 
Mule java part-1
Mule java part-1
Karnam Karthik
 
Mule servlet connector
Mule servlet connector
Ankush Sharma
 
Mule jms
Mule jms
Rajarajan Sadhasivam
 
Mule concepts transformers
Mule concepts transformers
kunal vishe
 
Mule overview
Mule overview
Rajkattamuri
 
Mule rabbit mq
Mule rabbit mq
D.Rajesh Kumar
 
Mule Expression Transformer
Mule Expression Transformer
Ankush Sharma
 
Mule UDP Transport
Mule UDP Transport
Ankush Sharma
 
Java Servlets
Java Servlets
university of education,Lahore
 
Message structure
Message structure
Son Nguyen
 
Mule messages and transformers
Mule messages and transformers
Naresh Naidu
 
Controlling Message Flow - Mule ESB
Controlling Message Flow - Mule ESB
Mani Rathnam Gudi
 
Mule expression component
Mule expression component
Karnam Karthik
 
Mule LDAP Connector
Mule LDAP Connector
Ankush Sharma
 
Rabbit Mq in Mule
Rabbit Mq in Mule
Mohammed246
 
Mule JMS Transport
Mule JMS Transport
Rupesh Sinha
 
Mule generic connector
Mule generic connector
Ankush Sharma
 
Java Servlets
Java Servlets
Nitin Pai
 

Viewers also liked (12)

Mule soft csv_toxml
Mule soft csv_toxml
VenkataNaveen Kumar
 
MuleSoft Anypoint Studio - Essentials - Data Filtering
MuleSoft Anypoint Studio - Essentials - Data Filtering
VenkataNaveen Kumar
 
Thread Management In Mule
Thread Management In Mule
VenkataNaveen Kumar
 
Java Week6(B) Notepad
Java Week6(B) Notepad
Chaitanya Rajkumar Limmala
 
Input and output flow using http and java component
Input and output flow using http and java component
Son Nguyen
 
Java Swing Custom GUI MVC Component Tutorial
Java Swing Custom GUI MVC Component Tutorial
Sagun Dhakhwa
 
Chapter 1 swings
Chapter 1 swings
Jafar Nesargi
 
java swing programming
java swing programming
Ankit Desai
 
Swing and AWT in java
Swing and AWT in java
Adil Mehmoood
 
java swing
java swing
vannarith
 
JAVA AWT
JAVA AWT
shanmuga rajan
 
Munit_in_mule_naveen
Munit_in_mule_naveen
VenkataNaveen Kumar
 
MuleSoft Anypoint Studio - Essentials - Data Filtering
MuleSoft Anypoint Studio - Essentials - Data Filtering
VenkataNaveen Kumar
 
Input and output flow using http and java component
Input and output flow using http and java component
Son Nguyen
 
Java Swing Custom GUI MVC Component Tutorial
Java Swing Custom GUI MVC Component Tutorial
Sagun Dhakhwa
 
java swing programming
java swing programming
Ankit Desai
 
Swing and AWT in java
Swing and AWT in java
Adil Mehmoood
 
Ad

Similar to Java Components and their applicability in Mule Anypoint Studio (20)

Java components in mule
Java components in mule
Harish43
 
Java components in Mule
Java components in Mule
Madhuri Chitrala
 
Mule ESB
Mule ESB
Yura Nosenko
 
Mule web services
Mule web services
Thang Loi
 
Mule and web services
Mule and web services
Manav Prasad
 
Esb process
Esb process
saikiran6423
 
Mule esb kranthi
Mule esb kranthi
Earnest Stephen
 
Mule esb
Mule esb
saikiran6423
 
Mule esb kranthi
Mule esb kranthi
kranthikumar1210
 
Mule java part-3
Mule java part-3
Karnam Karthik
 
Sai mule esb batch
Sai mule esb batch
saikiran6423
 
Mule slides
Mule slides
naveenkodumuri12
 
Mule
Mule
saikiran6423
 
Mule esb
Mule esb
vishnukanthro45
 
Mule esb
Mule esb
charan teja R
 
Mule esb
Mule esb
Phaniu
 
Mule esb Basics
Mule esb Basics
Sunil Komarapu
 
Mule esb
Mule esb
Khasim Saheb
 
Mule esb
Mule esb
princeirfancivil
 
Mule esb
Mule esb
Phaniu
 
Ad

Recently uploaded (20)

Enhance GitHub Copilot using MCP - Enterprise version.pdf
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
 
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
9-1-1 Addressing: End-to-End Automation Using FME
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
Curietech AI in action - Accelerate MuleSoft development
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
 
The Future of Product Management in AI ERA.pdf
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Priyanka Aash
 
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 
AI VIDEO MAGAZINE - June 2025 - r/aivideo
AI VIDEO MAGAZINE - June 2025 - r/aivideo
1pcity Studios, Inc
 
"Scaling in space and time with Temporal", Andriy Lupa.pdf
"Scaling in space and time with Temporal", Andriy Lupa.pdf
Fwdays
 
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
Daily Lesson Log MATATAG ICT TEchnology 8
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
digitaljignect
 
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
 
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
9-1-1 Addressing: End-to-End Automation Using FME
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
Curietech AI in action - Accelerate MuleSoft development
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
 
The Future of Product Management in AI ERA.pdf
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Priyanka Aash
 
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 
AI VIDEO MAGAZINE - June 2025 - r/aivideo
AI VIDEO MAGAZINE - June 2025 - r/aivideo
1pcity Studios, Inc
 
"Scaling in space and time with Temporal", Andriy Lupa.pdf
"Scaling in space and time with Temporal", Andriy Lupa.pdf
Fwdays
 
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
Daily Lesson Log MATATAG ICT TEchnology 8
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
digitaljignect
 

Java Components and their applicability in Mule Anypoint Studio

  • 2.  The Java component enables the developer to package custom Java code that executes when the component receives a message  Mule provides two JavaComponent implementations:  DefaultJavaComponent, which configured with the `component `element <component class="org.my.CustomComponent"/>  PooledJavaComponent, which adds pooling functionality when configured with the pooled-component element. <pooled-component class="org.my.CustomComponent"/>  To configure the Java component, selecting a class is the only required entry.  The class name can be specified either through the “Class Name” attribute or the “Object” attribute.  Using the “Class Name” attribute is equivalent to using the prototype object factory J a v a C o m p o n e n t s i n M u l e .
  • 3.  Object factories manage both object creation in case of Mule instantiated instance or object look up from another container such as Spring.  The following object factories are included with Mule and can be configured using Mule’s core schema. Type 1:<prototype-object class=…"/> :Creates a new instance of the object on each call. Example: <component class="org.my.CustomComponent"/> or <component ><prototype-object class="org.my.CustomComponent"> </component> Type2:<singleton-object class=…"/> :Creates an instance of the object once and then always returns the same instance . Example:<component> <singleton-object class="org.my.CustomComponent"/> </component>
  • 4. Type 3: <spring-object bean=…"/> :This is an implementation of the ObjectFactory interface which simply delegates to the Spring ApplicationContext. Since the delegation happens each time a call to getOrCreate() is made, this will correctly handle Spring beans which are non-singletons (factory beans, etc.) Example: <component> <spring-object bean="myCustomComponentBean"/> </component> Interceptors:  Interceptors let us provide additional services to the component Example: the ability to log transactions and the ability to log the time for each transaction.  An interceptor contains the business logic that is applied to the message payload before being sent to the next building block.  The following types of interceptors can be added to the Java component: a)Custom Interceptor b)Logging Interceptor c)Timer Interceptor
  • 5. Entry Point Resolvers:  The entry point is the method in our component that is invoked by Mule when a message is received.  Entry point resolver determine how our component is invoked when a message is received by the flow  helps us to determine which method of a Java component will be called.  Each entry point resolver is tried in turn until one succeeds in delivering the message to the component. Reflection Entry point resolver:  Determines the message to be invoked based on number and type of arguments. <component class=”org.my.PrototypeObjectWithMyLifecycle”> <reflection-entry-point-resolver/> </component>
  • 6. Entry Point Resolvers: Property Entry point resolver:  Uses a mule message property to select the component method to be called. <component class=”org.my.PrototypeObjectWithMyLifecycle”> <property-entry-point-resolver property="propertyName"/> </component> The property-entry-point-resolver lets you choose a method to invoke at run- time by adding this property name to the MuleMessage. Method entry point resolver:  Delivers the message to a named method. <component class=”org.my.PrototypeObjectWithMyLifecycle”> <method-entry-point-resolver> <include-entry-point method="methodString" /> </method-entry-point-resolver> </component>
  • 7. Entry Point Resolvers: Custom Entry point resolver:  Allows user-supplied code to determine how a message is passed to a component in Java. . <component class=”org.my.PrototypeObjectWithMyLifecycle”> <custom-entry-point-resolver class="org.mule.test.integration.resolvers.CustomEntryPointResolver" /> </component> Callable Entry point resolver:  An entry point resolver for the components that implement the Callable interface.  This passes a MuleEventContext to the component.  This entry point resolver is implicitly configured only if the component implements the Callable interface. <component class="org.my.PrototypeObjectWithMyLifecycle"> <callable-entry-point-resolver/> </component>
  • 8. Entry Point Resolvers: Array Entry point resolver:  Delivers the message to a method that takes a single array as argument. <component class=”org.my.PrototypeObjectWithMyLifecycle”> <array-entry-point-resolver/> </component> No Arguments Entry point resolver:  Calls a method without any arguments. <component class=”org.my.PrototypeObjectWithMyLifecycle”> <no-arguments-entry-point-resolver/> </component> Include Entry point:  Includes a particular method to be invoked. Can be used in combination with any other entry point resolver when there is ambiguity
  • 9. Component Life-Cycle Interfaces A custom LifecycleAdaptor can be configured to customize the way in which the component implementation is initialized and disposed