Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Service Component Architecture (SCA) Tools » Re: Reusing SCA Service Implementations
Re: Reusing SCA Service Implementations [message #2931] Wed, 01 October 2008 12:02 Go to next message
Eclipse User
Originally posted by: atoulme.intalio.com

Michael,

anything SCA related should be posted to the SCa newsgroup, that I added
to the to: list of this message.

If your message is both relevant to STP and SCA, you can send a message
to both newsgroups.

I hope it helps.

Antoine

Michael Gebhart wrote:
> Hi,
>
> when using the SCA editor to create my service architecture, I can
> easily implement services. I can write a java class and set it as the
> implementation of a component.
>
> My question is: Can I only use this implementation within a SCA runtime?
> We have a typical application server running and don't wanna provide a
> SCA runtime. But we'd like to use SCA for modeling the architecture.
>
> Or do we have to manually adapt the implementation that it works within
> a typical WS-compliant java application server?
>
> Is the SCA way an alternative for the usual web service programming? Is
> it still necessary to write the web services as we have done it before?
> (Using JAX-WS etc.)
>
> Greetings
>
> Michael
Re: Reusing SCA Service Implementations [message #2965 is a reply to message #2931] Wed, 01 October 2008 13:27 Go to previous messageGo to next message
Stephane Drapeau is currently offline Stephane Drapeau
Messages: 198
Registered: July 2009
Senior Member
Hi Michael,

>
> Michael Gebhart wrote:
>> Hi,
>>
>> when using the SCA editor to create my service architecture, I can
>> easily implement services. I can write a java class and set it as the
>> implementation of a component.
>>
>> My question is: Can I only use this implementation within a SCA runtime?

No. Your implementation doesn't depend on an particular SCA runtime.
There is only a dependance with the SCA annotations (for instance
@Remotable is necessary if you want to use a WS binding)

>> We have a typical application server running and don't wanna provide a
>> SCA runtime. But we'd like to use SCA for modeling the architecture.

Yep, I think that the SCA Designer is a great tool for modeling the
architecture. ;)
But, what a pity that you don't use an SCA runtime... ;)

>>
>> Or do we have to manually adapt the implementation that it works within
>> a typical WS-compliant java application server?

I don't believe it. The service that you wrote for your SCA assembly
contains only business logic.

>>
>> Is the SCA way an alternative for the usual web service programming? Is
>> it still necessary to write the web services as we have done it before?
>> (Using JAX-WS etc.)

No. You only need to define a web service binding in your SCA assembly
file. The SCA runtime will generate the wsdl file for the service.

Below a sample:

The interface:
package helloworld;
import org.osoa.sca.annotations.Remotable;
@Remotable
public interface HelloWorld {
String sayHello(String name);
}

The implementation:
package helloworld;
public class HelloWorldImpl implements HelloWorld {
public String sayHello(String name) {
return "Hello " + name;
}
}

Teh SCA assembly file:
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
xmlns:c="http://helloworld"
xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0" name="helloworld"
targetNamespace="http://helloworld">
<component name="HelloWorldComponent">
<implementation.java class="helloworld.HelloWorldImpl"/>
<service name="HelloWorld">
<binding.ws uri="http://localhost:8080/HelloWorld"/>
</service>
</component>
</composite>

A class to run the SCA assembly with Tuscany:
package helloworld;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import org.apache.tuscany.sca.host.embedded.SCADomain;
public class Client {
public static void main(String[] args) throws Exception {
SCADomain scaDomain = SCADomain.newInstance("helloworld.composite");
HelloWorld hw = scaDomain.getService(HelloWorld.class, "helloworld");

BufferedReader bufferedReader = new BufferedReader(
new InputStreamReader(System.in));
bufferedReader.readLine();
scaDomain.close();
}
}

Launch this class. You should have your web service live, and
http://localhost:8080/HelloWorld?wsdl should give you back a generated
wsdl for the service.

Stéphane Drapeau
Obeo


PS : Thanks Antoine
Re: Reusing SCA Service Implementations [message #2998 is a reply to message #2965] Wed, 01 October 2008 15:36 Go to previous messageGo to next message
Eclipse User
Originally posted by: michael.gebhart.googlemail.com

Hi,

thanks for your answer. Hm it is still not easy for me to compare it
with other Java WS approaches.

If I use a typical ws framework like axis or metro I get a lot of
functionality. I can use stuff like ws-security etc. Is this possible
with SCA too?

What if I have several webservices shared across several application
servers. I can't assume that everybody has a SCA runtime installed. So
one application server provides a SCA runtime, another doesn't.

Now I wanna share my webservice across both application servers. Is SCA
the right way to use here?

In my opinion SCA is more an approach to build whole applications with
components. But it is not comparable to a Java WS framework because a WS
is more flexible.

Greetings

Michael


> Hi Michael,
>
>>
>> Michael Gebhart wrote:
>>> Hi,
>>>
>>> when using the SCA editor to create my service architecture, I can
>>> easily implement services. I can write a java class and set it as the
>>> implementation of a component.
>>>
>>> My question is: Can I only use this implementation within a SCA runtime?
>
> No. Your implementation doesn't depend on an particular SCA runtime.
> There is only a dependance with the SCA annotations (for instance
> @Remotable is necessary if you want to use a WS binding)
>
>>> We have a typical application server running and don't wanna provide a
>>> SCA runtime. But we'd like to use SCA for modeling the architecture.
>
> Yep, I think that the SCA Designer is a great tool for modeling the
> architecture. ;)
> But, what a pity that you don't use an SCA runtime... ;)
>
>>>
>>> Or do we have to manually adapt the implementation that it works within
>>> a typical WS-compliant java application server?
>
> I don't believe it. The service that you wrote for your SCA assembly
> contains only business logic.
>
>>>
>>> Is the SCA way an alternative for the usual web service programming? Is
>>> it still necessary to write the web services as we have done it before?
>>> (Using JAX-WS etc.)
>
> No. You only need to define a web service binding in your SCA assembly
> file. The SCA runtime will generate the wsdl file for the service.
>
> Below a sample:
>
> The interface:
> package helloworld;
> import org.osoa.sca.annotations.Remotable;
> @Remotable
> public interface HelloWorld {
> String sayHello(String name);
> }
>
> The implementation:
> package helloworld;
> public class HelloWorldImpl implements HelloWorld {
> public String sayHello(String name) {
> return "Hello " + name;
> }
> }
>
> Teh SCA assembly file:
> <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
> xmlns:c="http://helloworld"
> xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0" name="helloworld"
> targetNamespace="http://helloworld">
> <component name="HelloWorldComponent">
> <implementation.java class="helloworld.HelloWorldImpl"/>
> <service name="HelloWorld">
> <binding.ws uri="http://localhost:8080/HelloWorld"/>
> </service>
> </component>
> </composite>
>
> A class to run the SCA assembly with Tuscany:
> package helloworld;
> import java.io.BufferedReader;
> import java.io.InputStreamReader;
> import org.apache.tuscany.sca.host.embedded.SCADomain;
> public class Client {
> public static void main(String[] args) throws Exception {
> SCADomain scaDomain =
> SCADomain.newInstance("helloworld.composite");
> HelloWorld hw = scaDomain.getService(HelloWorld.class,
> "helloworld");
>
> BufferedReader bufferedReader = new BufferedReader(
> new InputStreamReader(System.in));
> bufferedReader.readLine();
> scaDomain.close();
> }
> }
>
> Launch this class. You should have your web service live, and
> http://localhost:8080/HelloWorld?wsdl should give you back a generated
> wsdl for the service.
>
> Stéphane Drapeau
> Obeo
>
>
> PS : Thanks Antoine
Re: Reusing SCA Service Implementations [message #3017 is a reply to message #2998] Wed, 01 October 2008 16:10 Go to previous messageGo to next message
Stephane Drapeau is currently offline Stephane Drapeau
Messages: 198
Registered: July 2009
Senior Member
Michael Gebhart a écrit :
> Hi,
>
> thanks for your answer. Hm it is still not easy for me to compare it
> with other Java WS approaches.
>
> If I use a typical ws framework like axis or metro I get a lot of
> functionality. I can use stuff like ws-security etc. Is this possible
> with SCA too?

Yes.
http://www.osoa.org/download/attachments/35/SCA_Policy_Frame work_V100.pdf?version=1
>
> What if I have several webservices shared across several application
> servers. I can't assume that everybody has a SCA runtime installed.

Sure.

So
> one application server provides a SCA runtime, another doesn't.
>
> Now I wanna share my webservice across both application servers. Is SCA
> the right way to use here?

Yes. The SCA runtime allows
1) to publish easily your SCA application as a Web Service or
2) to link easily your SCA application with a Web Service on an
application server without SCA runtime.

>
> In my opinion SCA is more an approach to build whole applications with
> components. But it is not comparable to a Java WS framework because a WS
> is more flexible.
>
> Greetings
>
> Michael
>
>
>> Hi Michael,
>>
>>>
>>> Michael Gebhart wrote:
>>>> Hi,
>>>>
>>>> when using the SCA editor to create my service architecture, I can
>>>> easily implement services. I can write a java class and set it as the
>>>> implementation of a component.
>>>>
>>>> My question is: Can I only use this implementation within a SCA
>>>> runtime?
>>
>> No. Your implementation doesn't depend on an particular SCA runtime.
>> There is only a dependance with the SCA annotations (for instance
>> @Remotable is necessary if you want to use a WS binding)
>>
>>>> We have a typical application server running and don't wanna provide a
>>>> SCA runtime. But we'd like to use SCA for modeling the architecture.
>>
>> Yep, I think that the SCA Designer is a great tool for modeling the
>> architecture. ;)
>> But, what a pity that you don't use an SCA runtime... ;)
>>
>>>>
>>>> Or do we have to manually adapt the implementation that it works within
>>>> a typical WS-compliant java application server?
>>
>> I don't believe it. The service that you wrote for your SCA assembly
>> contains only business logic.
>>
>>>>
>>>> Is the SCA way an alternative for the usual web service programming? Is
>>>> it still necessary to write the web services as we have done it before?
>>>> (Using JAX-WS etc.)
>>
>> No. You only need to define a web service binding in your SCA assembly
>> file. The SCA runtime will generate the wsdl file for the service.
>>
>> Below a sample:
>>
>> The interface:
>> package helloworld;
>> import org.osoa.sca.annotations.Remotable;
>> @Remotable
>> public interface HelloWorld {
>> String sayHello(String name);
>> }
>>
>> The implementation:
>> package helloworld;
>> public class HelloWorldImpl implements HelloWorld {
>> public String sayHello(String name) {
>> return "Hello " + name;
>> }
>> }
>>
>> Teh SCA assembly file:
>> <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
>> xmlns:c="http://helloworld"
>> xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0" name="helloworld"
>> targetNamespace="http://helloworld">
>> <component name="HelloWorldComponent">
>> <implementation.java class="helloworld.HelloWorldImpl"/>
>> <service name="HelloWorld">
>> <binding.ws uri="http://localhost:8080/HelloWorld"/>
>> </service>
>> </component>
>> </composite>
>>
>> A class to run the SCA assembly with Tuscany:
>> package helloworld;
>> import java.io.BufferedReader;
>> import java.io.InputStreamReader;
>> import org.apache.tuscany.sca.host.embedded.SCADomain;
>> public class Client {
>> public static void main(String[] args) throws Exception {
>> SCADomain scaDomain =
>> SCADomain.newInstance("helloworld.composite");
>> HelloWorld hw = scaDomain.getService(HelloWorld.class,
>> "helloworld");
>>
>> BufferedReader bufferedReader = new BufferedReader(
>> new InputStreamReader(System.in));
>> bufferedReader.readLine();
>> scaDomain.close();
>> }
>> }
>>
>> Launch this class. You should have your web service live, and
>> http://localhost:8080/HelloWorld?wsdl should give you back a generated
>> wsdl for the service.
>>
>> Stéphane Drapeau
>> Obeo
>>
>>
>> PS : Thanks Antoine
Re: Reusing SCA Service Implementations [message #3033 is a reply to message #3017] Wed, 01 October 2008 17:29 Go to previous messageGo to next message
Eclipse User
Originally posted by: michael.gebhart.googlemail.com

Hi Stephane,

good points, very interesting. But do I really now at the design time
where (the concrete application server) a service will be hosted?

I already know the endpoint. But at design time I don't wanna care
about, if a service runs within a SCA container or if it doesn't?

You say that I can distinguish between services within a SCA container
or a service outside a SCA runtime. This means that everytime I change
the host (not the endpoint) the SCA model has to be changed.

But at design time it doesn't care if a service runs within a SCA
container or not.

Thus, SCA seams more to provide a way to build applications that are
based on services. The application is the composite. But SCA is not
appropriate to design the entire WS landscape.

Greetings

Michael
Re: Reusing SCA Service Implementations [message #3045 is a reply to message #3033] Thu, 02 October 2008 08:27 Go to previous messageGo to next message
Stephane Drapeau is currently offline Stephane Drapeau
Messages: 198
Registered: July 2009
Senior Member
Hi Michael,

I think that SCA is a good technology for that you want.
SCA identifies 3 roles (architect, developer, and deployer) and two ways
to construct an SCA application (top-down or bottom-up manner).

Top-down:
1) the architect starts with gathering requirements for the top-level
composite
2) He defines the services/ references and properties for the composite
3) He breaks down the composite into individual components and he wires
between them
4) He recursively breaks down each component
So, the architect doesn't care about the implementations or the way to
bind the application.
5) Then, he hands off the individual component contracts (services,
references, properties, intents) to developers for implementation.
6) Then, the deployer chooses and configures communication mechanisms
for services/references without having to modify the component
implementation.

The SCA Composite Designer is a good tool for this scenario.

Bottom-up:
1) The architect selects a set of existing component implementations for
building the new composite
2) He configures the component properties
3) He draws the internal wires
4) He wraps the components in a composite and he configures composite
services/references
5) He hands off the composite to the deployer
6) The deployer chooses and configures the communication mechanisms.

For this scenario, the SCA Composite Designer needs a feature allowing
the introspection of the implementations [1].

So, at design time, the architect doesn't care where a service will be
hosted and if a service runs within a SCA container or not.
Concerning web services, have a look at [2].

Regards,

Stéphane Drapeau

[1]: https://bugs.eclipse.org/bugs/show_bug.cgi?id=233484
[2]:
http://www.osoa.org/download/attachments/35/SCA_WebServiceBi nding_V100.pdf?version=2


Michael Gebhart a écrit :
> Hi Stephane,
>
> good points, very interesting. But do I really now at the design time
> where (the concrete application server) a service will be hosted?
>
> I already know the endpoint. But at design time I don't wanna care
> about, if a service runs within a SCA container or if it doesn't?
>
> You say that I can distinguish between services within a SCA container
> or a service outside a SCA runtime. This means that everytime I change
> the host (not the endpoint) the SCA model has to be changed.
>
> But at design time it doesn't care if a service runs within a SCA
> container or not.
>
> Thus, SCA seams more to provide a way to build applications that are
> based on services. The application is the composite. But SCA is not
> appropriate to design the entire WS landscape.
>
> Greetings
>
> Michael
Re: Reusing SCA Service Implementations [message #3057 is a reply to message #3045] Thu, 02 October 2008 16:20 Go to previous messageGo to next message
Eclipse User
Originally posted by: michael.gebhart.googlemail.com

Hi Stephane,

I thought all components within one composite have to run within a SCA
runtime, right?

Thus, if I wanna use a component outside a SCA runtime I have to place
the component outside the composite.

This means that I can't design my entire SOA with the SCA designer
without knowing if a service runs within a SCA runtime or if it doesn't.

Or is it possible to deploy a component within a SCA composite into a
non-SCA-compliant application server?

Greetings

Mike
Re: Reusing SCA Service Implementations [message #4072 is a reply to message #3057] Thu, 02 October 2008 16:45 Go to previous messageGo to next message
Eclipse User
Originally posted by: mickael.istria.openwide.fr

Hi Michael, Stephane, all,

Michael Gebhart a écrit :
> Hi Stephane,
>
> I thought all components within one composite have to run within a SCA
> runtime, right?

Any SCA component or composite is intended to be run in an SCA runtime.
Indeed, SCA is a runtime technology, and composites and component are
intended to be run on a SCA runtime platform.


> Thus, if I wanna use a component outside a SCA runtime I have to place
> the component outside the composite.

I don't really understand why you would like to use SCA components out
of SCA runtime.
Do you only use SCA models to describe graphically a network of
webservices (without wishing to run those SCA component)?


> This means that I can't design my entire SOA with the SCA designer
> without knowing if a service runs within a SCA runtime or if it doesn't.

I don't think that SCA is intended to be used to "design entire SOA", it
is a runtime technology (like Spring, but with a better comprehension of
services).


> Or is it possible to deploy a component within a SCA composite into a
> non-SCA-compliant application server?

No, a SCA components/composites are intended to run in a SCA runtime.
But SCA components/composites can reference web services that are not
promoted by a SCA runtime. You can use your favorite yahoo! meteo web
services in your SCA composites if you want, whatever is the runtime
that exposes them.

However, your application server can become "SCA compliant" by adding in
its classpath the set of jars that are necessary for a SCA runtime.



Regards,
Mickael

> Greetings
>
> Mike
Re: Reusing SCA Service Implementations [message #4134 is a reply to message #4072] Mon, 06 October 2008 12:26 Go to previous message
Eclipse User
Originally posted by: michael.gebhart.googlemail.com

Hi Mickael,

thanks for your answers. This was indeed my idea, to model the entire
SOA with SCA. Thus, this isn't the intention of SCA. It is more to
develop simple applications. Of course, then I need a SCA runtime to run
the application. But if I wanted to model the entire SOA it wouldn't be
easy, because then I need to know, if the web service runs within a SCA
container or not. Because otherwise I can't create a correct SCA
assembly diagram.

Greetings

Michael

> Hi Michael, Stephane, all,
>
> Michael Gebhart a écrit :
>> Hi Stephane,
>>
>> I thought all components within one composite have to run within a SCA
>> runtime, right?
>
> Any SCA component or composite is intended to be run in an SCA runtime.
> Indeed, SCA is a runtime technology, and composites and component are
> intended to be run on a SCA runtime platform.
>
>
>> Thus, if I wanna use a component outside a SCA runtime I have to place
>> the component outside the composite.
>
> I don't really understand why you would like to use SCA components out
> of SCA runtime.
> Do you only use SCA models to describe graphically a network of
> webservices (without wishing to run those SCA component)?
>
>
>> This means that I can't design my entire SOA with the SCA designer
>> without knowing if a service runs within a SCA runtime or if it doesn't.
>
> I don't think that SCA is intended to be used to "design entire SOA", it
> is a runtime technology (like Spring, but with a better comprehension of
> services).
>
>
>> Or is it possible to deploy a component within a SCA composite into a
>> non-SCA-compliant application server?
>
> No, a SCA components/composites are intended to run in a SCA runtime.
> But SCA components/composites can reference web services that are not
> promoted by a SCA runtime. You can use your favorite yahoo! meteo web
> services in your SCA composites if you want, whatever is the runtime
> that exposes them.
>
> However, your application server can become "SCA compliant" by adding in
> its classpath the set of jars that are necessary for a SCA runtime.
>
>
>
> Regards,
> Mickael
>
>> Greetings
>>
>> Mike
Re: Reusing SCA Service Implementations [message #573332 is a reply to message #2931] Wed, 01 October 2008 13:27 Go to previous message
Stephane Drapeau is currently offline Stephane Drapeau
Messages: 198
Registered: July 2009
Senior Member
Hi Michael,

>
> Michael Gebhart wrote:
>> Hi,
>>
>> when using the SCA editor to create my service architecture, I can
>> easily implement services. I can write a java class and set it as the
>> implementation of a component.
>>
>> My question is: Can I only use this implementation within a SCA runtime?

No. Your implementation doesn't depend on an particular SCA runtime.
There is only a dependance with the SCA annotations (for instance
@Remotable is necessary if you want to use a WS binding)

>> We have a typical application server running and don't wanna provide a
>> SCA runtime. But we'd like to use SCA for modeling the architecture.

Yep, I think that the SCA Designer is a great tool for modeling the
architecture. ;)
But, what a pity that you don't use an SCA runtime... ;)

>>
>> Or do we have to manually adapt the implementation that it works within
>> a typical WS-compliant java application server?

I don't believe it. The service that you wrote for your SCA assembly
contains only business logic.

>>
>> Is the SCA way an alternative for the usual web service programming? Is
>> it still necessary to write the web services as we have done it before?
>> (Using JAX-WS etc.)

No. You only need to define a web service binding in your SCA assembly
file. The SCA runtime will generate the wsdl file for the service.

Below a sample:

The interface:
package helloworld;
import org.osoa.sca.annotations.Remotable;
@Remotable
public interface HelloWorld {
String sayHello(String name);
}

The implementation:
package helloworld;
public class HelloWorldImpl implements HelloWorld {
public String sayHello(String name) {
return "Hello " + name;
}
}

Teh SCA assembly file:
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
xmlns:c="http://helloworld"
xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0" name="helloworld"
targetNamespace="http://helloworld">
<component name="HelloWorldComponent">
<implementation.java class="helloworld.HelloWorldImpl"/>
<service name="HelloWorld">
<binding.ws uri="http://localhost:8080/HelloWorld"/>
</service>
</component>
</composite>

A class to run the SCA assembly with Tuscany:
package helloworld;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import org.apache.tuscany.sca.host.embedded.SCADomain;
public class Client {
public static void main(String[] args) throws Exception {
SCADomain scaDomain = SCADomain.newInstance("helloworld.composite");
HelloWorld hw = scaDomain.getService(HelloWorld.class, "helloworld");

BufferedReader bufferedReader = new BufferedReader(
new InputStreamReader(System.in));
bufferedReader.readLine();
scaDomain.close();
}
}

Launch this class. You should have your web service live, and
http://localhost:8080/HelloWorld?wsdl should give you back a generated
wsdl for the service.

Stéphane Drapeau
Obeo


PS : Thanks Antoine
Re: Reusing SCA Service Implementations [message #573394 is a reply to message #2965] Wed, 01 October 2008 15:36 Go to previous message
Eclipse User
Originally posted by: michael.gebhart.googlemail.com

Hi,

thanks for your answer. Hm it is still not easy for me to compare it
with other Java WS approaches.

If I use a typical ws framework like axis or metro I get a lot of
functionality. I can use stuff like ws-security etc. Is this possible
with SCA too?

What if I have several webservices shared across several application
servers. I can't assume that everybody has a SCA runtime installed. So
one application server provides a SCA runtime, another doesn't.

Now I wanna share my webservice across both application servers. Is SCA
the right way to use here?

In my opinion SCA is more an approach to build whole applications with
components. But it is not comparable to a Java WS framework because a WS
is more flexible.

Greetings

Michael


> Hi Michael,
>
>>
>> Michael Gebhart wrote:
>>> Hi,
>>>
>>> when using the SCA editor to create my service architecture, I can
>>> easily implement services. I can write a java class and set it as the
>>> implementation of a component.
>>>
>>> My question is: Can I only use this implementation within a SCA runtime?
>
> No. Your implementation doesn't depend on an particular SCA runtime.
> There is only a dependance with the SCA annotations (for instance
> @Remotable is necessary if you want to use a WS binding)
>
>>> We have a typical application server running and don't wanna provide a
>>> SCA runtime. But we'd like to use SCA for modeling the architecture.
>
> Yep, I think that the SCA Designer is a great tool for modeling the
> architecture. ;)
> But, what a pity that you don't use an SCA runtime... ;)
>
>>>
>>> Or do we have to manually adapt the implementation that it works within
>>> a typical WS-compliant java application server?
>
> I don't believe it. The service that you wrote for your SCA assembly
> contains only business logic.
>
>>>
>>> Is the SCA way an alternative for the usual web service programming? Is
>>> it still necessary to write the web services as we have done it before?
>>> (Using JAX-WS etc.)
>
> No. You only need to define a web service binding in your SCA assembly
> file. The SCA runtime will generate the wsdl file for the service.
>
> Below a sample:
>
> The interface:
> package helloworld;
> import org.osoa.sca.annotations.Remotable;
> @Remotable
> public interface HelloWorld {
> String sayHello(String name);
> }
>
> The implementation:
> package helloworld;
> public class HelloWorldImpl implements HelloWorld {
> public String sayHello(String name) {
> return "Hello " + name;
> }
> }
>
> Teh SCA assembly file:
> <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
> xmlns:c="http://helloworld"
> xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0" name="helloworld"
> targetNamespace="http://helloworld">
> <component name="HelloWorldComponent">
> <implementation.java class="helloworld.HelloWorldImpl"/>
> <service name="HelloWorld">
> <binding.ws uri="http://localhost:8080/HelloWorld"/>
> </service>
> </component>
> </composite>
>
> A class to run the SCA assembly with Tuscany:
> package helloworld;
> import java.io.BufferedReader;
> import java.io.InputStreamReader;
> import org.apache.tuscany.sca.host.embedded.SCADomain;
> public class Client {
> public static void main(String[] args) throws Exception {
> SCADomain scaDomain =
> SCADomain.newInstance("helloworld.composite");
> HelloWorld hw = scaDomain.getService(HelloWorld.class,
> "helloworld");
>
> BufferedReader bufferedReader = new BufferedReader(
> new InputStreamReader(System.in));
> bufferedReader.readLine();
> scaDomain.close();
> }
> }
>
> Launch this class. You should have your web service live, and
> http://localhost:8080/HelloWorld?wsdl should give you back a generated
> wsdl for the service.
>
> Stéphane Drapeau
> Obeo
>
>
> PS : Thanks Antoine
Re: Reusing SCA Service Implementations [message #573424 is a reply to message #2998] Wed, 01 October 2008 16:10 Go to previous message
Stephane Drapeau is currently offline Stephane Drapeau
Messages: 198
Registered: July 2009
Senior Member
Michael Gebhart a écrit :
> Hi,
>
> thanks for your answer. Hm it is still not easy for me to compare it
> with other Java WS approaches.
>
> If I use a typical ws framework like axis or metro I get a lot of
> functionality. I can use stuff like ws-security etc. Is this possible
> with SCA too?

Yes.
http://www.osoa.org/download/attachments/35/SCA_Policy_Frame work_V100.pdf?version=1
>
> What if I have several webservices shared across several application
> servers. I can't assume that everybody has a SCA runtime installed.

Sure.

So
> one application server provides a SCA runtime, another doesn't.
>
> Now I wanna share my webservice across both application servers. Is SCA
> the right way to use here?

Yes. The SCA runtime allows
1) to publish easily your SCA application as a Web Service or
2) to link easily your SCA application with a Web Service on an
application server without SCA runtime.

>
> In my opinion SCA is more an approach to build whole applications with
> components. But it is not comparable to a Java WS framework because a WS
> is more flexible.
>
> Greetings
>
> Michael
>
>
>> Hi Michael,
>>
>>>
>>> Michael Gebhart wrote:
>>>> Hi,
>>>>
>>>> when using the SCA editor to create my service architecture, I can
>>>> easily implement services. I can write a java class and set it as the
>>>> implementation of a component.
>>>>
>>>> My question is: Can I only use this implementation within a SCA
>>>> runtime?
>>
>> No. Your implementation doesn't depend on an particular SCA runtime.
>> There is only a dependance with the SCA annotations (for instance
>> @Remotable is necessary if you want to use a WS binding)
>>
>>>> We have a typical application server running and don't wanna provide a
>>>> SCA runtime. But we'd like to use SCA for modeling the architecture.
>>
>> Yep, I think that the SCA Designer is a great tool for modeling the
>> architecture. ;)
>> But, what a pity that you don't use an SCA runtime... ;)
>>
>>>>
>>>> Or do we have to manually adapt the implementation that it works within
>>>> a typical WS-compliant java application server?
>>
>> I don't believe it. The service that you wrote for your SCA assembly
>> contains only business logic.
>>
>>>>
>>>> Is the SCA way an alternative for the usual web service programming? Is
>>>> it still necessary to write the web services as we have done it before?
>>>> (Using JAX-WS etc.)
>>
>> No. You only need to define a web service binding in your SCA assembly
>> file. The SCA runtime will generate the wsdl file for the service.
>>
>> Below a sample:
>>
>> The interface:
>> package helloworld;
>> import org.osoa.sca.annotations.Remotable;
>> @Remotable
>> public interface HelloWorld {
>> String sayHello(String name);
>> }
>>
>> The implementation:
>> package helloworld;
>> public class HelloWorldImpl implements HelloWorld {
>> public String sayHello(String name) {
>> return "Hello " + name;
>> }
>> }
>>
>> Teh SCA assembly file:
>> <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
>> xmlns:c="http://helloworld"
>> xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0" name="helloworld"
>> targetNamespace="http://helloworld">
>> <component name="HelloWorldComponent">
>> <implementation.java class="helloworld.HelloWorldImpl"/>
>> <service name="HelloWorld">
>> <binding.ws uri="http://localhost:8080/HelloWorld"/>
>> </service>
>> </component>
>> </composite>
>>
>> A class to run the SCA assembly with Tuscany:
>> package helloworld;
>> import java.io.BufferedReader;
>> import java.io.InputStreamReader;
>> import org.apache.tuscany.sca.host.embedded.SCADomain;
>> public class Client {
>> public static void main(String[] args) throws Exception {
>> SCADomain scaDomain =
>> SCADomain.newInstance("helloworld.composite");
>> HelloWorld hw = scaDomain.getService(HelloWorld.class,
>> "helloworld");
>>
>> BufferedReader bufferedReader = new BufferedReader(
>> new InputStreamReader(System.in));
>> bufferedReader.readLine();
>> scaDomain.close();
>> }
>> }
>>
>> Launch this class. You should have your web service live, and
>> http://localhost:8080/HelloWorld?wsdl should give you back a generated
>> wsdl for the service.
>>
>> Stéphane Drapeau
>> Obeo
>>
>>
>> PS : Thanks Antoine
Re: Reusing SCA Service Implementations [message #573460 is a reply to message #3017] Wed, 01 October 2008 17:29 Go to previous message
Eclipse User
Originally posted by: michael.gebhart.googlemail.com

Hi Stephane,

good points, very interesting. But do I really now at the design time
where (the concrete application server) a service will be hosted?

I already know the endpoint. But at design time I don't wanna care
about, if a service runs within a SCA container or if it doesn't?

You say that I can distinguish between services within a SCA container
or a service outside a SCA runtime. This means that everytime I change
the host (not the endpoint) the SCA model has to be changed.

But at design time it doesn't care if a service runs within a SCA
container or not.

Thus, SCA seams more to provide a way to build applications that are
based on services. The application is the composite. But SCA is not
appropriate to design the entire WS landscape.

Greetings

Michael
Re: Reusing SCA Service Implementations [message #573489 is a reply to message #3033] Thu, 02 October 2008 08:27 Go to previous message
Stephane Drapeau is currently offline Stephane Drapeau
Messages: 198
Registered: July 2009
Senior Member
Hi Michael,

I think that SCA is a good technology for that you want.
SCA identifies 3 roles (architect, developer, and deployer) and two ways
to construct an SCA application (top-down or bottom-up manner).

Top-down:
1) the architect starts with gathering requirements for the top-level
composite
2) He defines the services/ references and properties for the composite
3) He breaks down the composite into individual components and he wires
between them
4) He recursively breaks down each component
So, the architect doesn't care about the implementations or the way to
bind the application.
5) Then, he hands off the individual component contracts (services,
references, properties, intents) to developers for implementation.
6) Then, the deployer chooses and configures communication mechanisms
for services/references without having to modify the component
implementation.

The SCA Composite Designer is a good tool for this scenario.

Bottom-up:
1) The architect selects a set of existing component implementations for
building the new composite
2) He configures the component properties
3) He draws the internal wires
4) He wraps the components in a composite and he configures composite
services/references
5) He hands off the composite to the deployer
6) The deployer chooses and configures the communication mechanisms.

For this scenario, the SCA Composite Designer needs a feature allowing
the introspection of the implementations [1].

So, at design time, the architect doesn't care where a service will be
hosted and if a service runs within a SCA container or not.
Concerning web services, have a look at [2].

Regards,

Stéphane Drapeau

[1]: https://bugs.eclipse.org/bugs/show_bug.cgi?id=233484
[2]:
http://www.osoa.org/download/attachments/35/SCA_WebServiceBi nding_V100.pdf?version=2


Michael Gebhart a écrit :
> Hi Stephane,
>
> good points, very interesting. But do I really now at the design time
> where (the concrete application server) a service will be hosted?
>
> I already know the endpoint. But at design time I don't wanna care
> about, if a service runs within a SCA container or if it doesn't?
>
> You say that I can distinguish between services within a SCA container
> or a service outside a SCA runtime. This means that everytime I change
> the host (not the endpoint) the SCA model has to be changed.
>
> But at design time it doesn't care if a service runs within a SCA
> container or not.
>
> Thus, SCA seams more to provide a way to build applications that are
> based on services. The application is the composite. But SCA is not
> appropriate to design the entire WS landscape.
>
> Greetings
>
> Michael
Re: Reusing SCA Service Implementations [message #573523 is a reply to message #3045] Thu, 02 October 2008 16:20 Go to previous message
Eclipse User
Originally posted by: michael.gebhart.googlemail.com

Hi Stephane,

I thought all components within one composite have to run within a SCA
runtime, right?

Thus, if I wanna use a component outside a SCA runtime I have to place
the component outside the composite.

This means that I can't design my entire SOA with the SCA designer
without knowing if a service runs within a SCA runtime or if it doesn't.

Or is it possible to deploy a component within a SCA composite into a
non-SCA-compliant application server?

Greetings

Mike
Re: Reusing SCA Service Implementations [message #573545 is a reply to message #3057] Thu, 02 October 2008 16:45 Go to previous message
Mickael Istria is currently offline Mickael Istria
Messages: 765
Registered: July 2009
Location: Grenoble, France
Senior Member
Hi Michael, Stephane, all,

Michael Gebhart a écrit :
> Hi Stephane,
>
> I thought all components within one composite have to run within a SCA
> runtime, right?

Any SCA component or composite is intended to be run in an SCA runtime.
Indeed, SCA is a runtime technology, and composites and component are
intended to be run on a SCA runtime platform.


> Thus, if I wanna use a component outside a SCA runtime I have to place
> the component outside the composite.

I don't really understand why you would like to use SCA components out
of SCA runtime.
Do you only use SCA models to describe graphically a network of
webservices (without wishing to run those SCA component)?


> This means that I can't design my entire SOA with the SCA designer
> without knowing if a service runs within a SCA runtime or if it doesn't.

I don't think that SCA is intended to be used to "design entire SOA", it
is a runtime technology (like Spring, but with a better comprehension of
services).


> Or is it possible to deploy a component within a SCA composite into a
> non-SCA-compliant application server?

No, a SCA components/composites are intended to run in a SCA runtime.
But SCA components/composites can reference web services that are not
promoted by a SCA runtime. You can use your favorite yahoo! meteo web
services in your SCA composites if you want, whatever is the runtime
that exposes them.

However, your application server can become "SCA compliant" by adding in
its classpath the set of jars that are necessary for a SCA runtime.



Regards,
Mickael

> Greetings
>
> Mike
Re: Reusing SCA Service Implementations [message #573601 is a reply to message #4072] Mon, 06 October 2008 12:26 Go to previous message
Eclipse User
Originally posted by: michael.gebhart.googlemail.com

Hi Mickael,

thanks for your answers. This was indeed my idea, to model the entire
SOA with SCA. Thus, this isn't the intention of SCA. It is more to
develop simple applications. Of course, then I need a SCA runtime to run
the application. But if I wanted to model the entire SOA it wouldn't be
easy, because then I need to know, if the web service runs within a SCA
container or not. Because otherwise I can't create a correct SCA
assembly diagram.

Greetings

Michael

> Hi Michael, Stephane, all,
>
> Michael Gebhart a écrit :
>> Hi Stephane,
>>
>> I thought all components within one composite have to run within a SCA
>> runtime, right?
>
> Any SCA component or composite is intended to be run in an SCA runtime.
> Indeed, SCA is a runtime technology, and composites and component are
> intended to be run on a SCA runtime platform.
>
>
>> Thus, if I wanna use a component outside a SCA runtime I have to place
>> the component outside the composite.
>
> I don't really understand why you would like to use SCA components out
> of SCA runtime.
> Do you only use SCA models to describe graphically a network of
> webservices (without wishing to run those SCA component)?
>
>
>> This means that I can't design my entire SOA with the SCA designer
>> without knowing if a service runs within a SCA runtime or if it doesn't.
>
> I don't think that SCA is intended to be used to "design entire SOA", it
> is a runtime technology (like Spring, but with a better comprehension of
> services).
>
>
>> Or is it possible to deploy a component within a SCA composite into a
>> non-SCA-compliant application server?
>
> No, a SCA components/composites are intended to run in a SCA runtime.
> But SCA components/composites can reference web services that are not
> promoted by a SCA runtime. You can use your favorite yahoo! meteo web
> services in your SCA composites if you want, whatever is the runtime
> that exposes them.
>
> However, your application server can become "SCA compliant" by adding in
> its classpath the set of jars that are necessary for a SCA runtime.
>
>
>
> Regards,
> Mickael
>
>> Greetings
>>
>> Mike
Previous Topic:Re: Reusing SCA Service Implementations
Next Topic:Re: AnnValidator missing from Ganymede Update
Goto Forum:
  


Current Time: Fri Oct 24 12:46:42 GMT 2014

Powered by FUDForum. Page generated in 0.02565 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software