You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Scott Kurz <sc...@gmail.com> on 2006/09/20 16:36:25 UTC

Has anyone put a binding on a nested composite?

Maybe my last phrasing of this question was too confusing, so I'm trying
again.   If no one answers this time, I'll give it a try myself by the end
of the week.

=======================================================================================

How is a binding on a service in a nested composite handled?

That is, suppose I deploy top-level composite Z1 which contains component
C1, and that C1 is implemented by composite Z2.
Could I put a WS binding on a composite-level service S of Z2?   Would I
need to surface S to the Z1 composite and put a WS binding on the service
surfaced to the Z1-level?
I'd assume I would be able to override the URL the service can be invoked at
(or some right-hand portion of the URL ) at the Z1 level.
=======================================================================================

Thanks,
Scott

Re: Has anyone put a binding on a nested composite?

Posted by Jojo <jo...@gmail.com>.
I tried with a composite-level service in the inner composite (Z2) with RMI
binding. The service definition was :

<service name="HelloWorldRmiService" target="HelloWorldServiceComponent">
        <interface.java interface="helloworld.HelloWorldRmiService"/>
        <rmi:binding.rmi host="localhost" port="1099"
serviceName="HelloWorldRemoteService"   />
        <reference>HelloWorldRmiServiceComponent</reference>
    </service>

The reference to this service from the parent composite (Z1) failed with the
following exception:

java.lang.NullPointerException
    at org.apache.tuscany.core.builder.ConnectorImpl.connect(
ConnectorImpl.java:141)
    at org.apache.tuscany.core.builder.ConnectorImpl.connect(
ConnectorImpl.java:119)
    at
org.apache.tuscany.core.implementation.composite.AbstractCompositeComponent.prepare
(AbstractCompositeComponent.java:241)
    at org.apache.tuscany.core.deployer.DeployerImpl.deploy(
DeployerImpl.java:86)
    at org.apache.tuscany.core.launcher.LauncherImpl.bootApplication(
LauncherImpl.java:193)
    ....

However if don't use the RMI binding, I am able to resolve the reference
using the default bindings. I am not sure how to resolve this. Any thoughts
? Is it a limitation that if you have a nested component, then we need to
use the default binding ?

Also in the process I found that the JDKWireService throws an NPE if the
target cannot be resolved. It is so hard to figure out the cause without
debugging. It would be nice to throw a more intutive exception
(TargetNotFoundException ?).


On 9/20/06, Scott Kurz <sc...@gmail.com> wrote:
>
> Maybe my last phrasing of this question was too confusing, so I'm trying
> again.   If no one answers this time, I'll give it a try myself by the end
> of the week.
>
>
> =======================================================================================
>
> How is a binding on a service in a nested composite handled?
>
> That is, suppose I deploy top-level composite Z1 which contains component
> C1, and that C1 is implemented by composite Z2.
> Could I put a WS binding on a composite-level service S of Z2?   Would I
> need to surface S to the Z1 composite and put a WS binding on the service
> surfaced to the Z1-level?
> I'd assume I would be able to override the URL the service can be invoked
> at
> (or some right-hand portion of the URL ) at the Z1 level.
>
> =======================================================================================
>
> Thanks,
> Scott
>
>


-- 
Warm regards,
jojo.

Re: Has anyone put a binding on a nested composite?

Posted by Jeremy Boynes <jb...@apache.org>.
On Sep 20, 2006, at 7:36 AM, Scott Kurz wrote:

> Maybe my last phrasing of this question was too confusing, so I'm  
> trying
> again.   If no one answers this time, I'll give it a try myself by  
> the end
> of the week.
>
> ====================================================================== 
> =================
>
> How is a binding on a service in a nested composite handled?
>
> That is, suppose I deploy top-level composite Z1 which contains  
> component
> C1, and that C1 is implemented by composite Z2.
> Could I put a WS binding on a composite-level service S of Z2?    
> Would I
> need to surface S to the Z1 composite and put a WS binding on the  
> service
> surfaced to the Z1-level?
> I'd assume I would be able to override the URL the service can be  
> invoked at
> (or some right-hand portion of the URL ) at the Z1 level.
> ====================================================================== 
> =================

I don't think the spec is clear on this - for example, I don't think  
there is a way to turn off the binding declared in Z2; you can  
override/replace in Z1 but I don't think you can't unbind it.

ATM I believe we will always bind it.
--
Jeremy


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: Has anyone put a binding on a nested composite?

Posted by Jojo <jo...@gmail.com>.
Hi Scott,

After reading your mail again, I guess I missed your point. I am not really
using a binding on a nested component, but I am willing to try it.

Sorry for the confusion.

On 9/20/06, Jojo <jo...@gmail.com> wrote:
>
> Hi Scott,
>
> I have tried a few variations on this. For example I have nested the
> javascript helloworld sample inside the RMI helloworld sample. My intention
> was to get through the SCA concepts. And believe me, it turned out to be
> easier than I thought. The end result was a javascript function exposed to
> the external world using RMI.
>
> My HelloWorldRmiComposite looked like this:
>
> <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
>            xmlns:rmi="
> http://tuscany.apache.org/xmlns/binding/rmi/1.0-SNAPSHOT"
>            name="HelloWorldRmiComposite">
>
>     <service name="HelloWorldRmiService"
> target="HelloWorldServiceComponent">
>         <interface.java interface="helloworld.HelloWorldService"/>
>         <rmi:binding.rmi host="localhost" port="1099"
> serviceName="HelloWorldRemoteService"   />
>         <reference>HelloWorldServiceComponent</reference>
>     </service>
>
>     <component name="HelloWorldServiceComponent">
>         <implementation.composite name="xyz" scdlLocation="
> helloworldJS.scdl"/>
>     </component>
>
>    <component name="HelloWorldRmiServiceComponent">
>         <implementation.java class="helloworld.HelloWorldRmiImpl"/>
>         <reference name="extService">HelloWorldRmiReference</reference>
>     </component>
>
>       <reference name="HelloWorldRmiReference" target="Nothing">
>         <interface.java interface="helloworld.HelloWorldService"/>
>         <rmi:binding.rmi host="localhost" port="1099"
> serviceName="HelloWorldRemoteService" />
>     </reference>
>
> </composite>
>
> And the HelloWorldJavaScriptComposite looked like :
>
> <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
>            xmlns:js="http://tuscany.apache.org/xmlns/js/1.0"
>            name="HelloWorldJavaScriptComposite">
>
>     <service name="HelloWorldJavaScriptService">
>         <interface.java interface="helloworld.HelloWorldService"/>
>         <reference>HelloWorldJavaScriptComponent</reference>
>     </service>
>
>     <component name="HelloWorldJavaScriptComponent">
>         <js:implementation.js script="HelloWorld.js"/>
>     </component>
>
> </composite>
>
> If you are interested, I can send you the entire code zipped. I should add
> a disclaimer that I don't know if I did everything right.
>
>
> On 9/20/06, Scott Kurz <sc...@gmail.com> wrote:
> >
> > Maybe my last phrasing of this question was too confusing, so I'm trying
> > again.   If no one answers this time, I'll give it a try myself by the
> > end
> > of the week.
> >
> > =======================================================================================
> >
> >
> > How is a binding on a service in a nested composite handled?
> >
> > That is, suppose I deploy top-level composite Z1 which contains
> > component
> > C1, and that C1 is implemented by composite Z2.
> > Could I put a WS binding on a composite-level service S of Z2?   Would I
> >
> > need to surface S to the Z1 composite and put a WS binding on the
> > service
> > surfaced to the Z1-level?
> > I'd assume I would be able to override the URL the service can be
> > invoked at
> > (or some right-hand portion of the URL ) at the Z1 level.
> >
> > =======================================================================================
> >
> > Thanks,
> > Scott
> >
> >
>
>
> --
> Warm regards,
> jojo.
>



-- 
Warm regards,
jojo.

Re: Has anyone put a binding on a nested composite?

Posted by Jojo <jo...@gmail.com>.
Hi Scott,

I have tried a few variations on this. For example I have nested the
javascript helloworld sample inside the RMI helloworld sample. My intention
was to get through the SCA concepts. And believe me, it turned out to be
easier than I thought. The end result was a javascript function exposed to
the external world using RMI.

My HelloWorldRmiComposite looked like this:

<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
           xmlns:rmi="
http://tuscany.apache.org/xmlns/binding/rmi/1.0-SNAPSHOT"
           name="HelloWorldRmiComposite">

    <service name="HelloWorldRmiService"
target="HelloWorldServiceComponent">
        <interface.java interface="helloworld.HelloWorldService"/>
        <rmi:binding.rmi host="localhost" port="1099"
serviceName="HelloWorldRemoteService"   />
        <reference>HelloWorldServiceComponent</reference>
    </service>

    <component name="HelloWorldServiceComponent">
        <implementation.composite name="xyz" scdlLocation="helloworldJS.scdl
"/>
    </component>

   <component name="HelloWorldRmiServiceComponent">
        <implementation.java class="helloworld.HelloWorldRmiImpl"/>
        <reference name="extService">HelloWorldRmiReference</reference>
    </component>

      <reference name="HelloWorldRmiReference" target="Nothing">
        <interface.java interface="helloworld.HelloWorldService"/>
        <rmi:binding.rmi host="localhost" port="1099"
serviceName="HelloWorldRemoteService" />
    </reference>

</composite>

And the HelloWorldJavaScriptComposite looked like :

<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
           xmlns:js="http://tuscany.apache.org/xmlns/js/1.0"
           name="HelloWorldJavaScriptComposite">

    <service name="HelloWorldJavaScriptService">
        <interface.java interface="helloworld.HelloWorldService"/>
        <reference>HelloWorldJavaScriptComponent</reference>
    </service>

    <component name="HelloWorldJavaScriptComponent">
        <js:implementation.js script="HelloWorld.js"/>
    </component>

</composite>

If you are interested, I can send you the entire code zipped. I should add a
disclaimer that I don't know if I did everything right.

On 9/20/06, Scott Kurz <sc...@gmail.com> wrote:
>
> Maybe my last phrasing of this question was too confusing, so I'm trying
> again.   If no one answers this time, I'll give it a try myself by the end
> of the week.
>
>
> =======================================================================================
>
> How is a binding on a service in a nested composite handled?
>
> That is, suppose I deploy top-level composite Z1 which contains component
> C1, and that C1 is implemented by composite Z2.
> Could I put a WS binding on a composite-level service S of Z2?   Would I
> need to surface S to the Z1 composite and put a WS binding on the service
> surfaced to the Z1-level?
> I'd assume I would be able to override the URL the service can be invoked
> at
> (or some right-hand portion of the URL ) at the Z1 level.
>
> =======================================================================================
>
> Thanks,
> Scott
>
>


-- 
Warm regards,
jojo.