You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by shaoguang geng <ge...@yahoo.com> on 2007/09/29 04:11:07 UTC

Question concerns implementation-das

Hi, every one:

I have a question about implementation-das, could some one tell me WHICH  InterfaceContract IS ASSIGNED to a <tuscany:implementation.das/>?

Thanks

       
---------------------------------
Luggage? GPS? Comic books? 
Check out fitting  gifts for grads at Yahoo! Search.

Re: Question concerns implementation-das

Posted by Luciano Resende <lu...@gmail.com>.
To retrieve the right service, you could either do :

dasService = scaDomain.getService(DAS.class, "DASServiceComponent/DAS");

or

dasCompanyService = scaDomain.getService(CompanyService.class,
"CompanyServiceComponent/CompanyService");

Where DAS is the fixed name, and CompanyService is the one defined in
the componentType side file.

Maybe you could provide more details of what are you trying to do, is
it just trying to test cases ? or you have some modified ones ?

On 9/28/07, shaoguang geng <ge...@yahoo.com> wrote:
> Thank you again, you explain is enough clear to me.
>
> I was using the latest trunk revision 580546, and I think there might be some bug here:
>
> I debugged in ComponentServiceImpl.setService(*), CompanyService should be set with DAS, but actually it was set CompanyService.
>
> Thanks.
>
> Luciano Resende <lu...@gmail.com> wrote: At the moment, the DAS service is the "static das contract" that gets
> assigned to every  component and allows you to
> perform simple CRUD operations. The other service interfaces are added
> at the moment by the componentType side file, that must match the das
> config file name.... so, if you have something like :
>
>    ...
>
>
>
>
>     driverClass="org.apache.derby.jdbc.EmbeddedDriver"
>     databaseURL="jdbc:derby:target/test-classes/dastest; create = true"
>     loginTimeout="600000"/>
>
>
>
>     ...
>
> Then you should define the services in a company.componentType side file
>
>
>
> interface="org.apache.tuscany.sca.implementation.das.company.CompanyService"/>
>
>
> You should also be using recent trunk code,  as I have recently fixed
> couple issues on this area. The test cases from implementation.das and
> customer-map demo should also be a reference for you.
>
> Let me know if it works for you, and if you have other questions...
>
> On 9/28/07, shaoguang geng  wrote:
> > Hi Luciano, thank you very much,
> >
> > Let me be further, (during debugging) I saw a service with name=DAS got instantiated (twice), but when the RuntimeSCAServiceBindingProvider started, the CompanyService which seems not instantiated throws an NPE due to no interfacecontract.
> >
> > (I noticed that an JavaInterfaceContractImpl will be assigned to an implementation das)
> >
> > Do you have any suggestion to me?
> >
> > Thanks.
> >
> > Luciano Resende  wrote: In the  test cases, there is a component type file
> > that assign the proper interface to the service as below :
> >
> >
> >
> > interface="org.apache.tuscany.sca.implementation.das.company.CompanyService"/>
> >
> >
> > The interface looks like this :
> >
> > public interface CompanyService {
> >     public DataObject getCompanies();
> > }
> >
> >
> > Please let me know if you have further questions.
> >
> > On 9/28/07, shaoguang geng  wrote:
> > > Hi, every one:
> > >
> > > I have a question about implementation-das, could some one tell me WHICH  InterfaceContract IS ASSIGNED to a ?
> > >
> > > Thanks
> > >
> > >
> > > ---------------------------------
> > > Luggage? GPS? Comic books?
> > > Check out fitting  gifts for grads at Yahoo! Search.
> >
> >
> > --
> > Luciano Resende
> > Apache Tuscany Committer
> > http://people.apache.org/~lresende
> > http://lresende.blogspot.com/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> >
> >
> >
> >
> > ---------------------------------
> > Building a website is a piece of cake.
> > Yahoo! Small Business gives you all the tools to get online.
>
>
> --
> Luciano Resende
> Apache Tuscany Committer
> http://people.apache.org/~lresende
> http://lresende.blogspot.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>
>
>
> ---------------------------------
> Don't let your dream ride pass you by.    Make it a reality with Yahoo! Autos.


-- 
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

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


Re: Question concerns implementation-das

Posted by shaoguang geng <ge...@yahoo.com>.
Thank you again, you explain is enough clear to me.

I was using the latest trunk revision 580546, and I think there might be some bug here:

I debugged in ComponentServiceImpl.setService(*), CompanyService should be set with DAS, but actually it was set CompanyService.

Thanks.

Luciano Resende <lu...@gmail.com> wrote: At the moment, the DAS service is the "static das contract" that gets
assigned to every  component and allows you to
perform simple CRUD operations. The other service interfaces are added
at the moment by the componentType side file, that must match the das
config file name.... so, if you have something like :

   ...
    
        
        
   
    driverClass="org.apache.derby.jdbc.EmbeddedDriver"
    databaseURL="jdbc:derby:target/test-classes/dastest; create = true"
    loginTimeout="600000"/>
   
  
    
    ...

Then you should define the services in a company.componentType side file

    
        
interface="org.apache.tuscany.sca.implementation.das.company.CompanyService"/>
    

You should also be using recent trunk code,  as I have recently fixed
couple issues on this area. The test cases from implementation.das and
customer-map demo should also be a reference for you.

Let me know if it works for you, and if you have other questions...

On 9/28/07, shaoguang geng  wrote:
> Hi Luciano, thank you very much,
>
> Let me be further, (during debugging) I saw a service with name=DAS got instantiated (twice), but when the RuntimeSCAServiceBindingProvider started, the CompanyService which seems not instantiated throws an NPE due to no interfacecontract.
>
> (I noticed that an JavaInterfaceContractImpl will be assigned to an implementation das)
>
> Do you have any suggestion to me?
>
> Thanks.
>
> Luciano Resende  wrote: In the  test cases, there is a component type file
> that assign the proper interface to the service as below :
>
>
>
> interface="org.apache.tuscany.sca.implementation.das.company.CompanyService"/>
>
>
> The interface looks like this :
>
> public interface CompanyService {
>     public DataObject getCompanies();
> }
>
>
> Please let me know if you have further questions.
>
> On 9/28/07, shaoguang geng  wrote:
> > Hi, every one:
> >
> > I have a question about implementation-das, could some one tell me WHICH  InterfaceContract IS ASSIGNED to a ?
> >
> > Thanks
> >
> >
> > ---------------------------------
> > Luggage? GPS? Comic books?
> > Check out fitting  gifts for grads at Yahoo! Search.
>
>
> --
> Luciano Resende
> Apache Tuscany Committer
> http://people.apache.org/~lresende
> http://lresende.blogspot.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>
>
>
> ---------------------------------
> Building a website is a piece of cake.
> Yahoo! Small Business gives you all the tools to get online.


-- 
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

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



       
---------------------------------
Don't let your dream ride pass you by.    Make it a reality with Yahoo! Autos. 

Re: Question concerns implementation-das

Posted by Luciano Resende <lu...@gmail.com>.
At the moment, the DAS service is the "static das contract" that gets
assigned to every <implementation.das> component and allows you to
perform simple CRUD operations. The other service interfaces are added
at the moment by the componentType side file, that must match the das
config file name.... so, if you have something like :

   ...
    <component name="DASServiceComponent">
        <tuscany:implementation.das config="company.xml" dataAccessType="rdb">
        <tuscany:connectionInfo>
			<tuscany:connectionProperties
				driverClass="org.apache.derby.jdbc.EmbeddedDriver"
				databaseURL="jdbc:derby:target/test-classes/dastest; create = true"
				loginTimeout="600000"/>
			</tuscany:connectionInfo>
		</tuscany:implementation.das>
    </component>
    ...

Then you should define the services in a company.componentType side file

    <service name="CompanyService">
        <interface.java
interface="org.apache.tuscany.sca.implementation.das.company.CompanyService"/>
    </service>

You should also be using recent trunk code,  as I have recently fixed
couple issues on this area. The test cases from implementation.das and
customer-map demo should also be a reference for you.

Let me know if it works for you, and if you have other questions...

On 9/28/07, shaoguang geng <ge...@yahoo.com> wrote:
> Hi Luciano, thank you very much,
>
> Let me be further, (during debugging) I saw a service with name=DAS got instantiated (twice), but when the RuntimeSCAServiceBindingProvider started, the CompanyService which seems not instantiated throws an NPE due to no interfacecontract.
>
> (I noticed that an JavaInterfaceContractImpl will be assigned to an implementation das)
>
> Do you have any suggestion to me?
>
> Thanks.
>
> Luciano Resende <lu...@gmail.com> wrote: In the  test cases, there is a component type file
> that assign the proper interface to the service as below :
>
>
>
> interface="org.apache.tuscany.sca.implementation.das.company.CompanyService"/>
>
>
> The interface looks like this :
>
> public interface CompanyService {
>     public DataObject getCompanies();
> }
>
>
> Please let me know if you have further questions.
>
> On 9/28/07, shaoguang geng  wrote:
> > Hi, every one:
> >
> > I have a question about implementation-das, could some one tell me WHICH  InterfaceContract IS ASSIGNED to a ?
> >
> > Thanks
> >
> >
> > ---------------------------------
> > Luggage? GPS? Comic books?
> > Check out fitting  gifts for grads at Yahoo! Search.
>
>
> --
> Luciano Resende
> Apache Tuscany Committer
> http://people.apache.org/~lresende
> http://lresende.blogspot.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>
>
>
> ---------------------------------
> Building a website is a piece of cake.
> Yahoo! Small Business gives you all the tools to get online.


-- 
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

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


Re: Question concerns implementation-das

Posted by shaoguang geng <ge...@yahoo.com>.
Hi Luciano, thank you very much,

Let me be further, (during debugging) I saw a service with name=DAS got instantiated (twice), but when the RuntimeSCAServiceBindingProvider started, the CompanyService which seems not instantiated throws an NPE due to no interfacecontract.

(I noticed that an JavaInterfaceContractImpl will be assigned to an implementation das)

Do you have any suggestion to me?

Thanks.

Luciano Resende <lu...@gmail.com> wrote: In the  test cases, there is a component type file
that assign the proper interface to the service as below :

    
        
interface="org.apache.tuscany.sca.implementation.das.company.CompanyService"/>
    

The interface looks like this :

public interface CompanyService {
    public DataObject getCompanies();
}


Please let me know if you have further questions.

On 9/28/07, shaoguang geng  wrote:
> Hi, every one:
>
> I have a question about implementation-das, could some one tell me WHICH  InterfaceContract IS ASSIGNED to a ?
>
> Thanks
>
>
> ---------------------------------
> Luggage? GPS? Comic books?
> Check out fitting  gifts for grads at Yahoo! Search.


-- 
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

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



       
---------------------------------
Building a website is a piece of cake. 
Yahoo! Small Business gives you all the tools to get online.

Re: Question concerns implementation-das

Posted by Luciano Resende <lu...@gmail.com>.
In the <implementation.das> test cases, there is a component type file
that assign the proper interface to the service as below :

    <service name="CompanyService">
        <interface.java
interface="org.apache.tuscany.sca.implementation.das.company.CompanyService"/>
    </service>

The interface looks like this :

public interface CompanyService {
    public DataObject getCompanies();
}


Please let me know if you have further questions.

On 9/28/07, shaoguang geng <ge...@yahoo.com> wrote:
> Hi, every one:
>
> I have a question about implementation-das, could some one tell me WHICH  InterfaceContract IS ASSIGNED to a <tuscany:implementation.das/>?
>
> Thanks
>
>
> ---------------------------------
> Luggage? GPS? Comic books?
> Check out fitting  gifts for grads at Yahoo! Search.


-- 
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

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