SlideShare a Scribd company logo
 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

More Related Content

What's hot

Mule Message Chunk Aggregator
Mule Message Chunk AggregatorMule Message Chunk Aggregator
Mule Message Chunk Aggregator
Ankush Sharma
 
Splitters in mule
Splitters in muleSplitters in mule
Splitters in mule
vasanthii9
 
Mule java part-1
Mule java part-1Mule java part-1
Mule java part-1
Karnam Karthik
 
Mule servlet connector
Mule servlet connectorMule servlet connector
Mule servlet connector
Ankush Sharma
 
Mule jms
Mule   jmsMule   jms
Mule concepts transformers
Mule concepts transformersMule concepts transformers
Mule concepts transformers
kunal vishe
 
Mule overview
Mule overviewMule overview
Mule overview
Rajkattamuri
 
Mule rabbit mq
Mule rabbit mqMule rabbit mq
Mule rabbit mq
D.Rajesh Kumar
 
Mule Expression Transformer
Mule Expression TransformerMule Expression Transformer
Mule Expression Transformer
Ankush Sharma
 
Mule UDP Transport
Mule UDP TransportMule UDP Transport
Mule UDP Transport
Ankush Sharma
 
Java Servlets
Java ServletsJava Servlets
Message structure
Message structureMessage structure
Message structure
Son Nguyen
 
Mule messages and transformers
Mule messages and transformersMule messages and transformers
Mule messages and transformers
Naresh Naidu
 
Controlling Message Flow - Mule ESB
Controlling Message Flow - Mule ESBControlling Message Flow - Mule ESB
Controlling Message Flow - Mule ESB
Mani Rathnam Gudi
 
Mule expression component
Mule expression componentMule expression component
Mule expression component
Karnam Karthik
 
Mule LDAP Connector
Mule LDAP ConnectorMule LDAP Connector
Mule LDAP Connector
Ankush Sharma
 
Rabbit Mq in Mule
Rabbit Mq in MuleRabbit Mq in Mule
Rabbit Mq in Mule
Mohammed246
 
Mule JMS Transport
Mule JMS TransportMule JMS Transport
Mule JMS Transport
Rupesh Sinha
 
Mule generic connector
Mule generic connectorMule generic connector
Mule generic connector
Ankush Sharma
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
Nitin Pai
 

What's hot (20)

Mule Message Chunk Aggregator
Mule Message Chunk AggregatorMule Message Chunk Aggregator
Mule Message Chunk Aggregator
 
Splitters in mule
Splitters in muleSplitters in mule
Splitters in mule
 
Mule java part-1
Mule java part-1Mule java part-1
Mule java part-1
 
Mule servlet connector
Mule servlet connectorMule servlet connector
Mule servlet connector
 
Mule jms
Mule   jmsMule   jms
Mule jms
 
Mule concepts transformers
Mule concepts transformersMule concepts transformers
Mule concepts transformers
 
Mule overview
Mule overviewMule overview
Mule overview
 
Mule rabbit mq
Mule rabbit mqMule rabbit mq
Mule rabbit mq
 
Mule Expression Transformer
Mule Expression TransformerMule Expression Transformer
Mule Expression Transformer
 
Mule UDP Transport
Mule UDP TransportMule UDP Transport
Mule UDP Transport
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
Message structure
Message structureMessage structure
Message structure
 
Mule messages and transformers
Mule messages and transformersMule messages and transformers
Mule messages and transformers
 
Controlling Message Flow - Mule ESB
Controlling Message Flow - Mule ESBControlling Message Flow - Mule ESB
Controlling Message Flow - Mule ESB
 
Mule expression component
Mule expression componentMule expression component
Mule expression component
 
Mule LDAP Connector
Mule LDAP ConnectorMule LDAP Connector
Mule LDAP Connector
 
Rabbit Mq in Mule
Rabbit Mq in MuleRabbit Mq in Mule
Rabbit Mq in Mule
 
Mule JMS Transport
Mule JMS TransportMule JMS Transport
Mule JMS Transport
 
Mule generic connector
Mule generic connectorMule generic connector
Mule generic connector
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 

Viewers also liked

Mule soft csv_toxml
Mule soft csv_toxmlMule soft csv_toxml
Mule soft csv_toxml
VenkataNaveen Kumar
 
MuleSoft Anypoint Studio - Essentials - Data Filtering
MuleSoft Anypoint Studio - Essentials - Data FilteringMuleSoft Anypoint Studio - Essentials - Data Filtering
MuleSoft Anypoint Studio - Essentials - Data Filtering
VenkataNaveen Kumar
 
Thread Management In Mule
Thread Management In MuleThread Management In Mule
Thread Management In Mule
VenkataNaveen Kumar
 
Java Week6(B) Notepad
Java Week6(B)   NotepadJava 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 componentInput 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 TutorialJava Swing Custom GUI MVC Component Tutorial
Java Swing Custom GUI MVC Component Tutorial
Sagun Dhakhwa
 
Chapter 1 swings
Chapter 1 swingsChapter 1 swings
Chapter 1 swings
Jafar Nesargi
 
java swing programming
java swing programming java swing programming
java swing programming
Ankit Desai
 
Swing and AWT in java
Swing and AWT in javaSwing and AWT in java
Swing and AWT in java
Adil Mehmoood
 
java swing
java swingjava swing
java swing
vannarith
 
JAVA AWT
JAVA AWTJAVA AWT
JAVA AWT
shanmuga rajan
 
Munit_in_mule_naveen
Munit_in_mule_naveenMunit_in_mule_naveen
Munit_in_mule_naveen
VenkataNaveen Kumar
 

Viewers also liked (12)

Mule soft csv_toxml
Mule soft csv_toxmlMule soft csv_toxml
Mule soft csv_toxml
 
MuleSoft Anypoint Studio - Essentials - Data Filtering
MuleSoft Anypoint Studio - Essentials - Data FilteringMuleSoft Anypoint Studio - Essentials - Data Filtering
MuleSoft Anypoint Studio - Essentials - Data Filtering
 
Thread Management In Mule
Thread Management In MuleThread Management In Mule
Thread Management In Mule
 
Java Week6(B) Notepad
Java Week6(B)   NotepadJava Week6(B)   Notepad
Java Week6(B) Notepad
 
Input and output flow using http and java component
Input and output flow using http and java componentInput and output flow using http and java component
Input and output flow using http and java component
 
Java Swing Custom GUI MVC Component Tutorial
Java Swing Custom GUI MVC Component TutorialJava Swing Custom GUI MVC Component Tutorial
Java Swing Custom GUI MVC Component Tutorial
 
Chapter 1 swings
Chapter 1 swingsChapter 1 swings
Chapter 1 swings
 
java swing programming
java swing programming java swing programming
java swing programming
 
Swing and AWT in java
Swing and AWT in javaSwing and AWT in java
Swing and AWT in java
 
java swing
java swingjava swing
java swing
 
JAVA AWT
JAVA AWTJAVA AWT
JAVA AWT
 
Munit_in_mule_naveen
Munit_in_mule_naveenMunit_in_mule_naveen
Munit_in_mule_naveen
 

Similar to Java Components and their applicability in Mule Anypoint Studio

Java components in mule
Java components in muleJava components in mule
Java components in mule
Harish43
 
Java components in Mule
Java components in MuleJava components in Mule
Java components in Mule
Madhuri Chitrala
 
Introduction to testing mule
Introduction to testing muleIntroduction to testing mule
Introduction to testing mule
Ramakrishna kapa
 
Mule ESB
Mule ESBMule ESB
Mule ESB
Yura Nosenko
 
An Introduction To Unit Testing and TDD
An Introduction To Unit Testing and TDDAn Introduction To Unit Testing and TDD
An Introduction To Unit Testing and TDD
Ahmed Ehab AbdulAziz
 
Introduction testingmule
Introduction testingmuleIntroduction testingmule
Introduction testingmule
Srikrishna k
 
Message Driven Beans (6)
Message Driven Beans (6)Message Driven Beans (6)
Message Driven Beans (6)
Abdalla Mahmoud
 
Custom transformer and annotation
Custom transformer and annotationCustom transformer and annotation
Custom transformer and annotation
Sunil Kumar
 
Java in mule part 1
Java in mule part 1Java in mule part 1
Java in mule part 1
vasanthii9
 
Maf3 - Part 1
Maf3 - Part 1Maf3 - Part 1
Maf3 - Part 1
Paolo Quadrani
 
Servlets
ServletsServlets
Servlets
Abdalla Mahmoud
 
Mule ctf
Mule  ctfMule  ctf
Mule ctf
D.Rajesh Kumar
 
Java concurrency
Java concurrencyJava concurrency
Java concurrency
Abhijit Gaikwad
 
Angular2 + rxjs
Angular2 + rxjsAngular2 + rxjs
Angular2 + rxjs
Christoffer Noring
 
Android development training programme , Day 3
Android development training programme , Day 3Android development training programme , Day 3
Android development training programme , Day 3
DHIRAJ PRAVIN
 
Celery
CeleryCelery
Angular performance slides
Angular performance slidesAngular performance slides
Angular performance slides
David Barreto
 
Workshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testingWorkshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testing
Visual Engineering
 
Testing mule
Testing   muleTesting   mule
Testing mule
Sindhu VL
 
Mule testing
Mule   testingMule   testing
Mule testing
Sindhu VL
 

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

Java components in mule
Java components in muleJava components in mule
Java components in mule
 
Java components in Mule
Java components in MuleJava components in Mule
Java components in Mule
 
Introduction to testing mule
Introduction to testing muleIntroduction to testing mule
Introduction to testing mule
 
Mule ESB
Mule ESBMule ESB
Mule ESB
 
An Introduction To Unit Testing and TDD
An Introduction To Unit Testing and TDDAn Introduction To Unit Testing and TDD
An Introduction To Unit Testing and TDD
 
Introduction testingmule
Introduction testingmuleIntroduction testingmule
Introduction testingmule
 
Message Driven Beans (6)
Message Driven Beans (6)Message Driven Beans (6)
Message Driven Beans (6)
 
Custom transformer and annotation
Custom transformer and annotationCustom transformer and annotation
Custom transformer and annotation
 
Java in mule part 1
Java in mule part 1Java in mule part 1
Java in mule part 1
 
Maf3 - Part 1
Maf3 - Part 1Maf3 - Part 1
Maf3 - Part 1
 
Servlets
ServletsServlets
Servlets
 
Mule ctf
Mule  ctfMule  ctf
Mule ctf
 
Java concurrency
Java concurrencyJava concurrency
Java concurrency
 
Angular2 + rxjs
Angular2 + rxjsAngular2 + rxjs
Angular2 + rxjs
 
Android development training programme , Day 3
Android development training programme , Day 3Android development training programme , Day 3
Android development training programme , Day 3
 
Celery
CeleryCelery
Celery
 
Angular performance slides
Angular performance slidesAngular performance slides
Angular performance slides
 
Workshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testingWorkshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testing
 
Testing mule
Testing   muleTesting   mule
Testing mule
 
Mule testing
Mule   testingMule   testing
Mule testing
 

Recently uploaded

JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
Shinana2
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
Data Hops
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Precisely
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Tatiana Kojar
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
SAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloudSAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloud
maazsz111
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 

Recently uploaded (20)

JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
SAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloudSAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloud
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 

Java Components and their applicability in Mule Anypoint Studio

  • 1.
  • 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