hi,
some comments inline. we have now get that to work. the main problem was
our inital idea we could integrate our stuff in tuscany, now we are
probably on the right way ;)....
Jean-Sebastien Delfino <[EMAIL PROTECTED]> wrote on 08/17/2007 01:35:23
PM:
> A few comments and questions inline.
>
> ant elder wrote:
> > On 8/12/07, Florian Rosenberg <[EMAIL PROTECTED]> wrote:
> >
> >> hi SCA folks,
> >>
> >> I'm pretty new to SCA and I want to develop a new component type
> >> implementation, similar to BPEL (sorry for any terminology mismatch).
The
> >> stuff I'm currently having here is basically a composition engine for
> >> RESTful services which I currently running on Tomcat (as a servlet
with
> >> some backend stuff). Now I want to bring the whole stuff into SCA to
> >> allow
> >> component types to be implemented as RESTful compositions.
> >>
>
> Sounds really interesting!
>
> I'm curious, what will the business interface of these SCA components
> look like? get/post/put/delete? or something else?
the current business interface of the SCA component is just a method to
trigger the flow execution (a flow in our terminology is a RESTful
composition of some REST services). we plan to build a REST binding for it
to do that later on. we could then trigger of a process by sending a GET or
POST to the engine. we do not support PUT and DELETE because they to not
make sense in our case.
> >> The problem I'm having now is the following: we envision that the user
> >> creates a Tuscany based web-app
>
> OK let me stop here and ask a few questions to make sure I understand
> the context and what you're looking for :)
>
> What do you mean by Tuscany based web-app?
an tuscany app deployed in a servlet host.
> Are you talking about an SCA component that provides a Web UI? if this
> is the case what technology are you using to provide the UI? Servlet?
> JSP? Faces? Struts?
no I'm not really talking about a UI
> Or do you mean a JEE WAR as a way for you to package a set of SCA
> components and deploy them such that they can talk REST/HTTP?
yep, that's what we want
> >> deployed on a servlet container and we
> >> dynamically register our composition engine servlet during startup of
the
> >> container. Nevertheless, I could not figure out how to do that. I
have it
> >> running in the embedded mode, where I start a tomcat server by myself
in
> >> the provider implementation but that is not what is desired (for
example,
> >> if the user deploys this Tuscany app in a Tomcat then, it crashed
since
> >> the
> >> port is already used). What I would need is a way to get access to the
> >> servlet host (which runs the Tuscany app) and register my servlet
there,
> >> but all I tried started a new servlet host internally (which can't
work if
> >> the Tomcat hosting the SCA app is already using port 8080 and using
> >> another
> >> one is not really desired).
> >>
>
> You don't need to start your own server :) The Tuscany runtime can take
> care of that for you:
>
> - Just place tuscany-http-tomcat-1.0-incubating-SNAPSHOT.jar or
> tuscany-http-jetty-1.0-incubating-SNAPSHOT.jar on the classpath of the
> J2SE program that starts Tuscany. I'm assuming that you're doing
> something like this to start Tuscany:
>
> public static void main(String[] args) {
>
> SCADomain scaDomain =
> SCADomain.newInstance("helloworldws.composite");
>
> try {
> System.out.println("HelloWorld server started (press enter
> to shutdown)");
> System.in.read();
> } catch (IOException e) {
> e.printStackTrace();
> }
>
> scaDomain.close();
> System.out.println("HelloWorld server stopped");
> }
>
> When Tuscany starts, it'll boot up an embedded Tomcat or Jetty server
> for you.
I figured that out already, but I was thinking about the fact that when I
deploy an app into tuscany it automatically uses the servlet container
where the app is deployed to as it's host, not starting of a new one
inside.
> - Then, I'm assuming that you're extending Tuscany with a new Component
> implementation extension, so if you've already done that you must have
> written an ImplementationProviderFactory. In your
> ImplementationProviderFactory constructor do this:
>
> public class RESTFulStuffImplementationProviderFactory implements
> ImplementationProviderFactory<RESTFulStuffImplementation> {
>
> public
> RESTFulStuffImplementationProviderFactory(ExtensionPointRegistry
registry) {
> ServletHostExtensionPoint servletHostExtensionPoint =
> extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class);
>
> // Here you can select whatever Servlet Host you have added to
> your environment
> // Typically people will only have one, Jetty or Tomcat, but if
> you added both
> // both JARs to your classpath you'll see two entries, and if
> you really want
> // to, then you can go over this list and pick the one that your
> are interested
> servletHost = servletHostExtensionPoint.getServletHosts().get(0);
> }
>
>
> - Then later in your code you can register whatever servlet you want to
> register with that ServletHost, like this:
>
> servletHost.addServletMapping("/my/restful/resource",
> myRestFulThingServlet)
>
>
> That being said, I don't know yet what your new component implementation
> does and how it works, but I'm curious about why the component
> implementation extension would need to deal with servlets directly. If
> this is about talking REST / XML/HTTP then this is typically done in SCA
> with a binding, independent of the component implementation itself.
we fixed that already, it was mainly due to our lack of indepth tuscany
knowledge, we now keep that all separate, the implementation and the REST
binding which we will need for that.
cu florian
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]