<?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 Re: [resolved] How to use osgi service from job in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-use-osgi-service-from-job/m-p/2247492#M32667</link>
    <description>Hi&amp;nbsp;
&lt;BR /&gt;You can use tRestClient component to call the rest webservcice you have deployed in Runtime.
&lt;BR /&gt;Best regards
&lt;BR /&gt;Shong</description>
    <pubDate>Thu, 04 Dec 2014 02:23:44 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-12-04T02:23:44Z</dc:date>
    <item>
      <title>[resolved] How to use osgi service from job</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-use-osgi-service-from-job/m-p/2247491#M32666</link>
      <description>Hello,&lt;BR /&gt;how can I use an osgi service deployed in TESB from a Talend job?&lt;BR /&gt;Thanks, Viktor</description>
      <pubDate>Sat, 16 Nov 2024 11:24:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-use-osgi-service-from-job/m-p/2247491#M32666</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T11:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] How to use osgi service from job</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-use-osgi-service-from-job/m-p/2247492#M32667</link>
      <description>Hi&amp;nbsp;
&lt;BR /&gt;You can use tRestClient component to call the rest webservcice you have deployed in Runtime.
&lt;BR /&gt;Best regards
&lt;BR /&gt;Shong</description>
      <pubDate>Thu, 04 Dec 2014 02:23:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-use-osgi-service-from-job/m-p/2247492#M32667</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-04T02:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] How to use osgi service from job</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-use-osgi-service-from-job/m-p/2247493#M32668</link>
      <description>Hello Shong,
&lt;BR /&gt;thank you for your answer. My osgi service is not a webservice. It is java interface and implementation, service published using blueprint.
&lt;BR /&gt;I want to access this service from talend job, that means I need to somehow access this service (something like BundleContext.getServiceReference), use its api without including the jar in the exported job (require/include in manifest).
&lt;BR /&gt;Thank you,
&lt;BR /&gt;Viktor</description>
      <pubDate>Thu, 04 Dec 2014 07:11:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-use-osgi-service-from-job/m-p/2247493#M32668</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-04T07:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] How to use osgi service from job</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-use-osgi-service-from-job/m-p/2247494#M32669</link>
      <description>Hi 
&lt;BR /&gt;Maybe you can hard code on tJava or create a routine to access the service, load external jar using tLibraryLoad if needed.
&lt;BR /&gt;Best regards
&lt;BR /&gt;Shong</description>
      <pubDate>Thu, 04 Dec 2014 10:16:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-use-osgi-service-from-job/m-p/2247494#M32669</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-04T10:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] How to use osgi service from job</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-use-osgi-service-from-job/m-p/2247495#M32670</link>
      <description>Use sample routine: 
&lt;BR /&gt; 
&lt;PRE&gt;package routines;&lt;BR /&gt;import org.osgi.framework.Bundle;&lt;BR /&gt;import org.osgi.framework.BundleContext;&lt;BR /&gt;import org.osgi.framework.FrameworkUtil;&lt;BR /&gt;import org.osgi.framework.InvalidSyntaxException;&lt;BR /&gt;import org.osgi.framework.ServiceReference;&lt;BR /&gt;public class OsgiHelper {&lt;BR /&gt;    private OsgiHelper() {&lt;BR /&gt;    }&lt;BR /&gt;    public static &amp;lt;T&amp;gt; T getService(Class&amp;lt;T&amp;gt; clazz, String fullJobName) throws InvalidSyntaxException {&lt;BR /&gt;        Bundle bundle = FrameworkUtil.getBundle(clazz);&lt;BR /&gt;        if (bundle != null) {&lt;BR /&gt;            BundleContext context = bundle.getBundleContext();&lt;BR /&gt;            ServiceReference[] serviceReferences =&lt;BR /&gt;                    context.getServiceReferences(clazz.getName(), "(&amp;amp;(name=" + fullJobName.substring(fullJobName.lastIndexOf('.') + 1) + ")(type=job))");&lt;BR /&gt;            if (null != serviceReferences) {&lt;BR /&gt;                return clazz.cast(context.getService(serviceReferences));&lt;BR /&gt;            }&lt;BR /&gt;        }&lt;BR /&gt;        return null;&lt;BR /&gt;    }&lt;BR /&gt;}&lt;BR /&gt;&lt;/PRE&gt; 
&lt;BR /&gt;And following call in job 
&lt;BR /&gt;System.out.println(routines.OsgiHelper.getService(TalendJob.class, this.getClass().getName())); 
&lt;BR /&gt;In Studio output is null, at runtime like esb.demoserviceconsumer_0_1.DemoServiceConsumer@79ee5eaf</description>
      <pubDate>Thu, 04 Dec 2014 13:38:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-use-osgi-service-from-job/m-p/2247495#M32670</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-04T13:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] How to use osgi service from job</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-use-osgi-service-from-job/m-p/2247496#M32671</link>
      <description>Hello Alex,
&lt;BR /&gt;thank you, looks very promising. 
&lt;BR /&gt;Not sure how it will work when I need to load api library for class T (interface of service) instead of requiring it in manifest. Will post update.
&lt;BR /&gt;Viktor</description>
      <pubDate>Thu, 04 Dec 2014 14:42:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-How-to-use-osgi-service-from-job/m-p/2247496#M32671</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-04T14:42:04Z</dc:date>
    </item>
  </channel>
</rss>

