Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsReusing SCA Service Implementations
https://www.eclipse.org/forums/index.php/mv/msg/194765/620092/#msg_620092
Originally posted by: michael.gebhart.googlemail.com
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]]>2008-10-01T11:59:49-00:00Re: Reusing SCA Service Implementations
https://www.eclipse.org/forums/index.php/mv/msg/194765/620095/#msg_620095
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]]>2008-10-01T12:02:47-00:00Re: Reusing SCA Service Implementations
https://www.eclipse.org/forums/index.php/mv/msg/194765/620096/#msg_620096
Michael Gebhart a écrit :
> 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.
Yes, it is easy to design composites and write implementations for
components with SCA editor.
> 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.
I think that the implementation you wrote does not depend on SCA
runtime, it only depends on SCA annotations (@Reference, @Property...),
but those annotation don't change your class logic, thus you can use
your classes out of SCA context (but you'll have to provide the jar
containing SCA references to resolve annotations).
But the question that comes to me ie "why don't you use a SCA runtime?".
I understand that there may be conflicts because with some
applications server, but it is worse trying...
> Or do we have to manually adapt the implementation that it works within
> a typical WS-compliant java application server?
I can't help you on this topic.
> 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.)
SCA is an alternative for generic (Java-friendly) service programming. I
often use it to expose WebServices simply by creating a java component
that exposes its service through a binding.ws, and it works quite well
without brainstorming:
Then, you have a web service published on localhost:8081/endpoint, and
your SCA runtime made everything necessary to get it working, you simply
wrote the composite, the interface, and the implementation (only
business code)
> Greetings
>
> Michael
Regards,
Mickael]]>Mickael Istria2008-10-01T12:48:17-00:00Re: Reusing SCA Service Implementations
https://www.eclipse.org/forums/index.php/mv/msg/194765/620097/#msg_620097
I clicked "Reply" without checking the forum.
Sorry for the spam...
Mickael
Mickael Istria a écrit :
> Hi Michael, all
>
> Michael Gebhart a écrit :
>> 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.
>
> Yes, it is easy to design composites and write implementations for
> components with SCA editor.
>
>
>> 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.
>
> I think that the implementation you wrote does not depend on SCA
> runtime, it only depends on SCA annotations (@Reference, @Property...),
> but those annotation don't change your class logic, thus you can use
> your classes out of SCA context (but you'll have to provide the jar
> containing SCA references to resolve annotations).
>
> But the question that comes to me ie "why don't you use a SCA runtime?".
> I understand that there may be conflicts because with some applications
> server, but it is worse trying...
>
>
>> Or do we have to manually adapt the implementation that it works
>> within a typical WS-compliant java application server?
>
> I can't help you on this topic.
>
>
>> 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.)
>
> SCA is an alternative for generic (Java-friendly) service programming. I
> often use it to expose WebServices simply by creating a java component
> that exposes its service through a binding.ws, and it works quite well
> without brainstorming:
>
> <composite ...>
> <component name="myComponent">
> <implementation.java class="package.ServiceImpl" />
> <service name="myService">
> <interface.java interface="package.IService" />
> <binding.ws uri="http://localhost:8081/endpoint" />
> </service>
> </component>
> </composite>
>
>
> Then, you have a web service published on localhost:8081/endpoint, and
> your SCA runtime made everything necessary to get it working, you simply
> wrote the composite, the interface, and the implementation (only
> business code)
>
>
>> Greetings
>>
>> Michael
>
> Regards,
> Mickael]]>Mickael Istria2008-10-01T12:49:53-00:00Re: Reusing SCA Service Implementations
https://www.eclipse.org/forums/index.php/mv/msg/194765/620098/#msg_620098
>
> 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;
}
}
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]]>Stephane Drapeau2008-10-01T13:27:32-00:00Re: Reusing SCA Service Implementations
https://www.eclipse.org/forums/index.php/mv/msg/194765/620100/#msg_620100
I agree with you Mickael.
Stéphane Drapeau
Obeo
Mickael Istria a écrit :
> Oops,
>
> I clicked "Reply" without checking the forum.
> Sorry for the spam...
>
> Mickael
>
> Mickael Istria a écrit :
>> Hi Michael, all
>>
>> Michael Gebhart a écrit :
>>> 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.
>>
>> Yes, it is easy to design composites and write implementations for
>> components with SCA editor.
>>
>>
>>> 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.
>>
>> I think that the implementation you wrote does not depend on SCA
>> runtime, it only depends on SCA annotations (@Reference,
>> @Property...), but those annotation don't change your class logic,
>> thus you can use your classes out of SCA context (but you'll have to
>> provide the jar containing SCA references to resolve annotations).
>>
>> But the question that comes to me ie "why don't you use a SCA
>> runtime?". I understand that there may be conflicts because with some
>> applications server, but it is worse trying...
>>
>>
>>> Or do we have to manually adapt the implementation that it works
>>> within a typical WS-compliant java application server?
>>
>> I can't help you on this topic.
>>
>>
>>> 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.)
>>
>> SCA is an alternative for generic (Java-friendly) service programming.
>> I often use it to expose WebServices simply by creating a java
>> component that exposes its service through a binding.ws, and it works
>> quite well without brainstorming:
>>
>> <composite ...>
>> <component name="myComponent">
>> <implementation.java class="package.ServiceImpl" />
>> <service name="myService">
>> <interface.java interface="package.IService" />
>> <binding.ws uri="http://localhost:8081/endpoint" />
>> </service>
>> </component>
>> </composite>
>>
>>
>> Then, you have a web service published on localhost:8081/endpoint, and
>> your SCA runtime made everything necessary to get it working, you
>> simply wrote the composite, the interface, and the implementation
>> (only business code)
>>
>>
>>> Greetings
>>>
>>> Michael
>>
>> Regards,
>> Mickael]]>Stephane Drapeau2008-10-01T13:35:12-00:00