<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to use &amp;quot;injected&amp;quot; services ? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-use-quot-injected-quot-services/m-p/2252885#M148596</link>
    <description>&lt;P&gt;Hi, I am no Java expert but I want some help to make a custom component. It's a processor component. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got some questions here : &lt;/P&gt;&lt;P&gt;How to use injected services ? I try to find how but can't find a real answer. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, I want to use the RecordBuilderFactory. I can't create an instance of it since it's a interface and also there is this recommandation :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;" If you create the instances yourself, you cannot benefit from these features, nor from the memory optimization done by the runtime. Prefer reusing the framework instances over custom ones. "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So there may be already existing instances of them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I declare a variable and use a method, I got the NULL pointer exception.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I really want to know is how to create a Record( using string or any other type for example). In the documentation, there is an example : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;public Record createRecord() {&lt;/P&gt;&lt;P&gt; return factory.newRecordBuilder()&lt;/P&gt;&lt;P&gt; .withString("name", "Gary")&lt;/P&gt;&lt;P&gt; .withDateTime("date", ZonedDateTime.of(LocalDateTime.of(2011, 2,&lt;/P&gt;&lt;P&gt;6, 8, 0), ZoneId.of("UTC")))&lt;/P&gt;&lt;P&gt; .build();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no explanation on how to have the factory instance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And there is this recommandation : &lt;/P&gt;&lt;P&gt;" Record is a Java interface but never implement it yourself to ensure&lt;/P&gt;&lt;P&gt;compatibility with the different Talend products. Follow the guidelines&lt;/P&gt;&lt;P&gt;below. " means I should not implement myself the interfaces.&lt;/P&gt;</description>
    <pubDate>Fri, 02 Jan 2026 14:45:42 GMT</pubDate>
    <dc:creator>FTB</dc:creator>
    <dc:date>2026-01-02T14:45:42Z</dc:date>
    <item>
      <title>How to use "injected" services ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-use-quot-injected-quot-services/m-p/2252885#M148596</link>
      <description>&lt;P&gt;Hi, I am no Java expert but I want some help to make a custom component. It's a processor component. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got some questions here : &lt;/P&gt;&lt;P&gt;How to use injected services ? I try to find how but can't find a real answer. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, I want to use the RecordBuilderFactory. I can't create an instance of it since it's a interface and also there is this recommandation :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;" If you create the instances yourself, you cannot benefit from these features, nor from the memory optimization done by the runtime. Prefer reusing the framework instances over custom ones. "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So there may be already existing instances of them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I declare a variable and use a method, I got the NULL pointer exception.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I really want to know is how to create a Record( using string or any other type for example). In the documentation, there is an example : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;public Record createRecord() {&lt;/P&gt;&lt;P&gt; return factory.newRecordBuilder()&lt;/P&gt;&lt;P&gt; .withString("name", "Gary")&lt;/P&gt;&lt;P&gt; .withDateTime("date", ZonedDateTime.of(LocalDateTime.of(2011, 2,&lt;/P&gt;&lt;P&gt;6, 8, 0), ZoneId.of("UTC")))&lt;/P&gt;&lt;P&gt; .build();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no explanation on how to have the factory instance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And there is this recommandation : &lt;/P&gt;&lt;P&gt;" Record is a Java interface but never implement it yourself to ensure&lt;/P&gt;&lt;P&gt;compatibility with the different Talend products. Follow the guidelines&lt;/P&gt;&lt;P&gt;below. " means I should not implement myself the interfaces.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jan 2026 14:45:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-use-quot-injected-quot-services/m-p/2252885#M148596</guid>
      <dc:creator>FTB</dc:creator>
      <dc:date>2026-01-02T14:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to use "injected" services ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-use-quot-injected-quot-services/m-p/2252886#M148597</link>
      <description>&lt;P&gt;Hi @Fabrice Balan​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;You don't have to create services by hand, just use the annotation `@Service` ( https://github.com/Talend/component-runtime/blob/master/component-api/src/main/java/org/talend/sdk/component/api/service/Service.java ) .&lt;/P&gt;&lt;P&gt;Here's a sample usage : https://github.com/Talend/connectors-se/blob/master/couchbase/src/main/java/org/talend/components/couchbase/service/CouchbaseService.java#L79-L83&lt;/P&gt;&lt;P&gt;Hope that it will help...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 09:37:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-use-quot-injected-quot-services/m-p/2252886#M148597</guid>
      <dc:creator>undx</dc:creator>
      <dc:date>2021-09-17T09:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to use "injected" services ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-use-quot-injected-quot-services/m-p/2252887#M148598</link>
      <description>&lt;P&gt;Thanks for your answer. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should I declare them in Service class ? &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 10:00:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-use-quot-injected-quot-services/m-p/2252887#M148598</guid>
      <dc:creator>FTB</dc:creator>
      <dc:date>2021-09-17T10:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to use "injected" services ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-use-quot-injected-quot-services/m-p/2252888#M148599</link>
      <description>&lt;P&gt;Hi @Fabrice Balan​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Not necessary but usually in your business logic modules.&lt;/P&gt;&lt;P&gt;best regards.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Sep 2021 07:00:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-use-quot-injected-quot-services/m-p/2252888#M148599</guid>
      <dc:creator>undx</dc:creator>
      <dc:date>2021-09-23T07:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to use "injected" services ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-use-quot-injected-quot-services/m-p/2252889#M148600</link>
      <description>&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 12:19:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-use-quot-injected-quot-services/m-p/2252889#M148600</guid>
      <dc:creator>FTB</dc:creator>
      <dc:date>2021-09-28T12:19:08Z</dc:date>
    </item>
  </channel>
</rss>

