You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by binhnt22 <Bi...@viettel.com.vn> on 2012/08/20 04:59:38 UTC
Call Tuscany 2.0 service from JBPM 5 WorkItemHandler
Hi all,
With Tuscany 1.6.2, I can make call to Tuscany service from WorkItemHandler
through DomainManager class.
As far as I know, DomainManager class is not present in Tuscany 2.0.
How can I achieve that with Tuscany 2.0 (calling Tuscany Service from a
random java class).
Best regards,
RE: Call Tuscany 2.0 service from JBPM 5 WorkItemHandler
Posted by binhnt22 <Bi...@viettel.com.vn>.
Thank you very much, I'll give a try
It's quite hard to find a good document of Tuscany SCA version 2.0
Best regards
From: Raymond Feng [mailto:enjoyjava@gmail.com]
Sent: Tuesday, August 21, 2012 11:42 AM
To: user@tuscany.apache.org
Subject: Re: Call Tuscany 2.0 service from JBPM 5 WorkItemHandler
The domain URI depicts which Tuscany SCA service registry to use to resolve
remote endpoints by the service URI (componentName/serviceName/bindingName).
By default, the domain URI is "default". To make remote endpoint
descriptions available to a node, there are a few different ways:
* Use a distributed registry such as Hazelcast to broadcast
* Use a static definition in node.xml, for example:
<?xml version="1.0" encoding="UTF-8"?>
<node xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
xmlns="http://tuscany.apache.org/xmlns/sca/1.1"
xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
uri="appserver/node" domainRegistry="vm:default"
domain="default">
<!-- Configure the base URIs for a given binding -->
<!-- Each base URI is for a protocol supported by the binding -->
<binding name="sca:binding.ws" baseURIs="http://localhost" />
<binding name="tuscany:binding.http" baseURIs="http://localhost" />
<binding name="tuscany:binding.rest" baseURIs="http://localhost" />
<binding name="tuscany:binding.jsonrpc" baseURIs="http://localhost" />
<!-- Configure a list of contributions -->
<contribution uri="contribution1" location="WEB-INF/classes" />
<remoteEndpoints>
<sca:composite
targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1" name="Endpoint">
<sca:component name="XComponent">
<sca:service name="XResource">
<tuscany:binding.rest name="rest"
uri="http://sample.com/services/x" />
</sca:service>
</sca:component>
<sca:component name="YComponent">
<sca:service name="YService">
<tuscany:binding.jsonrpc name="jsonrpc"
uri="http://sample.com/services/yservice-jsonrpc" />
</sca:service>
</sca:component>
</<sca:composite>
</remoteEndpoints>
</node>
Then in WEB-INF/web.xml, define the following:
<context-param>
<param-name>node.configuration</param-name>
<param-value>/node.xml</param-value> <!-- relative to the root of
the web app -->
</context-param>
<filter>
<filter-name>tuscany</filter-name>
<filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>tuscany</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Thanks,
Raymond
On Aug 20, 2012, at 6:04 PM, binhnt22 wrote:
Hi Raymond,
This is a web application, I don't know what to put into domainURI
Best regards
From: Raymond Feng [mailto:enjoyjava@gmail.com]
Sent: Monday, August 20, 2012 11:17 PM
To: user@tuscany.apache.org
Subject: Re: Call Tuscany 2.0 service from JBPM 5 WorkItemHandler
You can use the SCAClient API, such as:
SCAClientFactory clientFactory =
SCAClientFactory.newInstance(URI.create(domainURI); //
MyService service = clientFactory.getService(MyService.class, serviceURI);
On Aug 19, 2012, at 7:59 PM, binhnt22 wrote:
Hi all,
With Tuscany 1.6.2, I can make call to Tuscany service from WorkItemHandler
through DomainManager class.
As far as I know, DomainManager class is not present in Tuscany 2.0.
How can I achieve that with Tuscany 2.0 (calling Tuscany Service from a
random java class).
Best regards,
RE: Call Tuscany 2.0 service from JBPM 5 WorkItemHandler
Posted by Makiet <Bi...@viettel.com.vn>.
Can you be more specified in "Use a distributed registry such as Hazelcast
to broadcast"
I know Hazelcast, but don't know how to push SCA service on to Hazelcast,
nor get SCA services in Hazelcast from a client, neither.
Best regards
From: Raymond Feng [mailto:enjoyjava@gmail.com]
Sent: Tuesday, August 21, 2012 11:42 AM
To: user@tuscany.apache.org
Subject: Re: Call Tuscany 2.0 service from JBPM 5 WorkItemHandler
The domain URI depicts which Tuscany SCA service registry to use to resolve
remote endpoints by the service URI (componentName/serviceName/bindingName).
By default, the domain URI is "default". To make remote endpoint
descriptions available to a node, there are a few different ways:
* Use a distributed registry such as Hazelcast to broadcast
* Use a static definition in node.xml, for example:
<?xml version="1.0" encoding="UTF-8"?>
<node xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
xmlns="http://tuscany.apache.org/xmlns/sca/1.1"
xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
uri="appserver/node" domainRegistry="vm:default"
domain="default">
<!-- Configure the base URIs for a given binding -->
<!-- Each base URI is for a protocol supported by the binding -->
<binding name="sca:binding.ws" baseURIs="http://localhost" />
<binding name="tuscany:binding.http" baseURIs="http://localhost" />
<binding name="tuscany:binding.rest" baseURIs="http://localhost" />
<binding name="tuscany:binding.jsonrpc" baseURIs="http://localhost" />
<!-- Configure a list of contributions -->
<contribution uri="contribution1" location="WEB-INF/classes" />
<remoteEndpoints>
<sca:composite
targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1" name="Endpoint">
<sca:component name="XComponent">
<sca:service name="XResource">
<tuscany:binding.rest name="rest"
uri="http://sample.com/services/x" />
</sca:service>
</sca:component>
<sca:component name="YComponent">
<sca:service name="YService">
<tuscany:binding.jsonrpc name="jsonrpc"
uri="http://sample.com/services/yservice-jsonrpc" />
</sca:service>
</sca:component>
</<sca:composite>
</remoteEndpoints>
</node>
Then in WEB-INF/web.xml, define the following:
<context-param>
<param-name>node.configuration</param-name>
<param-value>/node.xml</param-value> <!-- relative to the root of
the web app -->
</context-param>
<filter>
<filter-name>tuscany</filter-name>
<filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>tuscany</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Thanks,
Raymond
On Aug 20, 2012, at 6:04 PM, binhnt22 wrote:
Hi Raymond,
This is a web application, I don't know what to put into domainURI
Best regards
From: Raymond Feng [mailto:enjoyjava@gmail.com]
Sent: Monday, August 20, 2012 11:17 PM
To: user@tuscany.apache.org
Subject: Re: Call Tuscany 2.0 service from JBPM 5 WorkItemHandler
You can use the SCAClient API, such as:
SCAClientFactory clientFactory =
SCAClientFactory.newInstance(URI.create(domainURI); //
MyService service = clientFactory.getService(MyService.class, serviceURI);
On Aug 19, 2012, at 7:59 PM, binhnt22 wrote:
Hi all,
With Tuscany 1.6.2, I can make call to Tuscany service from WorkItemHandler
through DomainManager class.
As far as I know, DomainManager class is not present in Tuscany 2.0.
How can I achieve that with Tuscany 2.0 (calling Tuscany Service from a
random java class).
Best regards,
Re: Call Tuscany 2.0 service from JBPM 5 WorkItemHandler
Posted by Raymond Feng <en...@gmail.com>.
The domain URI depicts which Tuscany SCA service registry to use to resolve remote endpoints by the service URI (componentName/serviceName/bindingName). By default, the domain URI is "default". To make remote endpoint descriptions available to a node, there are a few different ways:
* Use a distributed registry such as Hazelcast to broadcast
* Use a static definition in node.xml, for example:
<?xml version="1.0" encoding="UTF-8"?>
<node xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912" xmlns="http://tuscany.apache.org/xmlns/sca/1.1"
xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" uri="appserver/node" domainRegistry="vm:default"
domain="default">
<!-- Configure the base URIs for a given binding -->
<!-- Each base URI is for a protocol supported by the binding -->
<binding name="sca:binding.ws" baseURIs="http://localhost" />
<binding name="tuscany:binding.http" baseURIs="http://localhost" />
<binding name="tuscany:binding.rest" baseURIs="http://localhost" />
<binding name="tuscany:binding.jsonrpc" baseURIs="http://localhost" />
<!-- Configure a list of contributions -->
<contribution uri="contribution1" location="WEB-INF/classes" />
<remoteEndpoints>
<sca:composite targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1" name="Endpoint">
<sca:component name="XComponent">
<sca:service name="XResource">
<tuscany:binding.rest name="rest" uri="http://sample.com/services/x" />
</sca:service>
</sca:component>
<sca:component name="YComponent">
<sca:service name="YService">
<tuscany:binding.jsonrpc name="jsonrpc"
uri="http://sample.com/services/yservice-jsonrpc" />
</sca:service>
</sca:component>
</<sca:composite>
</remoteEndpoints>
</node>
Then in WEB-INF/web.xml, define the following:
<context-param>
<param-name>node.configuration</param-name>
<param-value>/node.xml</param-value> <!-- relative to the root of the web app -->
</context-param>
<filter>
<filter-name>tuscany</filter-name>
<filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter </filter-class>
</filter>
<filter-mapping>
<filter-name>tuscany</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Thanks,
Raymond
On Aug 20, 2012, at 6:04 PM, binhnt22 wrote:
> Hi Raymond,
>
> This is a web application, I don’t know what to put into domainURI
>
> Best regards
>
> From: Raymond Feng [mailto:enjoyjava@gmail.com]
> Sent: Monday, August 20, 2012 11:17 PM
> To: user@tuscany.apache.org
> Subject: Re: Call Tuscany 2.0 service from JBPM 5 WorkItemHandler
>
> You can use the SCAClient API, such as:
>
> SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create(domainURI); //
> MyService service = clientFactory.getService(MyService.class, serviceURI);
>
> On Aug 19, 2012, at 7:59 PM, binhnt22 wrote:
>
>
> Hi all,
> With Tuscany 1.6.2, I can make call to Tuscany service from WorkItemHandler through DomainManager class.
> As far as I know, DomainManager class is not present in Tuscany 2.0.
> How can I achieve that with Tuscany 2.0 (calling Tuscany Service from a random java class).
> Best regards,
RE: Call Tuscany 2.0 service from JBPM 5 WorkItemHandler
Posted by binhnt22 <Bi...@viettel.com.vn>.
Hi Raymond,
This is a web application, I don't know what to put into domainURI
Best regards
From: Raymond Feng [mailto:enjoyjava@gmail.com]
Sent: Monday, August 20, 2012 11:17 PM
To: user@tuscany.apache.org
Subject: Re: Call Tuscany 2.0 service from JBPM 5 WorkItemHandler
You can use the SCAClient API, such as:
SCAClientFactory clientFactory =
SCAClientFactory.newInstance(URI.create(domainURI); //
MyService service = clientFactory.getService(MyService.class, serviceURI);
On Aug 19, 2012, at 7:59 PM, binhnt22 wrote:
Hi all,
With Tuscany 1.6.2, I can make call to Tuscany service from WorkItemHandler
through DomainManager class.
As far as I know, DomainManager class is not present in Tuscany 2.0.
How can I achieve that with Tuscany 2.0 (calling Tuscany Service from a
random java class).
Best regards,
Re: Call Tuscany 2.0 service from JBPM 5 WorkItemHandler
Posted by Raymond Feng <en...@gmail.com>.
You can use the SCAClient API, such as:
SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create(domainURI); //
MyService service = clientFactory.getService(MyService.class, serviceURI);
On Aug 19, 2012, at 7:59 PM, binhnt22 wrote:
> Hi all,
> With Tuscany 1.6.2, I can make call to Tuscany service from WorkItemHandler through DomainManager class.
> As far as I know, DomainManager class is not present in Tuscany 2.0.
> How can I achieve that with Tuscany 2.0 (calling Tuscany Service from a random java class).
> Best regards,