Re: Cross-Origin Resource Sharing support on the HTTP binding

2011-08-09 Thread ant elder
On Thu, Jul 28, 2011 at 9:05 AM, Florian Moga moga@gmail.com wrote:
 On Thu, Jul 28, 2011 at 10:59 AM, ant elder antel...@apache.org wrote:

 I'll go add it as an attribute on binding.rest for now and we can see
 what thats like. I would quite like to keep it simple without needing
 extra optional config which is why it would be good to have it enabled
 by default and to not be something like an optional wireFormat or
 operationSelector.

   ...ant

 Sounds good to me.

 Florian

I've just committed some minimal code to show how Cross-Origin
Resource Sharing works by setting some Access-Control headers in the
REST binding. To try it out run the
samples/getting-started/helloworld-jaxrs sample with mvn tuscany:run
and then in a browser open the standalone web page
samples/getting-started/helloworld-jaxrs/cors.html and click the link.

This code just shows whats needed to get a CORS client running, to do
it more completely we'd need to add support for it to the scdl to
enable/disable the function and perhaps some control of the header
values. I could do that in binding.rest or perhaps in a binding.jaxrs
to keep it more separate from all the old rest support.

   ...ant


   ...ant


Fwd: Adding and removing wires dynamically during runtime

2011-08-09 Thread ant elder
Bringing up this quite old email again on adding and removing wires dynamically.

Now that the domain registry is more functional I think we can get
this working now so fyi i'm going start having a go, so say if you've
views on the best approach. For now I'll try as suggested below with
some new data in the domain registry for the wire re-targets so that
dynamic wires can be deployed around the distributed domain and so
that endpoints can be reset when wires are removed.

   ...ant


-- Forwarded message --
From: ant elder ant.el...@gmail.com
Date: Fri, Feb 12, 2010 at 7:12 PM
Subject: Adding and removing wires dynamically during runtime
To: dev@tuscany.apache.org


Another part of the distributed domain support we've still to do is
deploying composites with wire elements which retarget existing
references. This is described in section 5.4 in the Assembly spec. The
wires could be deployed anywhere in the domain so the reference is not
necessarily in the same JVM as the wire, so this is new information we
need to propergate around the distributed registry, and we need to be
able to put things back when a wire is undeployed so it needs a way to
remember the old target.

  ...ant


Re: [Composite Diagram Generator] Need a suggestion

2011-08-09 Thread ant elder
On Tue, Aug 9, 2011 at 1:20 AM, Jean-Sebastien Delfino
jsdelf...@apache.org wrote:
 On Sat, Aug 6, 2011 at 12:27 AM, ant elder antel...@apache.org wrote:
 On Fri, Aug 5, 2011 at 6:47 PM, Jean-Sebastien Delfino
 jsdelf...@apache.org wrote:
 On Wed, Jul 6, 2011 at 12:34 AM, ant elder ant.el...@gmail.com wrote:
 On Tue, Jul 5, 2011 at 5:15 PM, Jean-Sebastien Delfino
 jsdelf...@apache.org wrote:
 A few thoughts:

 I was under the impression that the SVG diagram generator would give
 you a view of the composites as they are authored or configured, and
 not necessarily a view of the reduced and 'compiled' composition model
 resulting from their assembly processing

 (I'm using the term 'compile' in the general sense here, not to
 generate machine code but to collect and compose artifacts into a form
 optimized form for a particular usage scenario, i.e. in Tuscany, an
 assembly model optimized for running an SCA composite application).

 To take an example, if a composite A included another composite B or
 used B as an implementation, and was itself included in another
 composite C, I imagined an SVG representation for A with a link to B's
 SVG representation, instead of an SVG representation of the reduced
 and 'compiled' combination of A, B and C.


 Are you sure that isn't possible to do from the Tuscany 'compiled'
 model? I think it should be, the information isn't thrown away and the
 model objects have references to all the necessary artifacts. If it
 turns out there is something getting lost then we could just fix that
 so that the info is maintained.

 With infinite time and resources everything is possible :)

 To draw an analogy with Java, it's a little bit like if you wanted to
 write a Java editor. You could compile the Java source, then try to
 have the editor work off the generated byte code, then go and tweak
 the Java compiler to have the whole source embedded in the byte code,
 then tweak it more to have it do that even with incomplete Java code
 that wouldn't normally compile... Then you could even argue that it'd
 be possible to do... with infinite time and resources :)

 I personally would never do that. I would just read and parse the Java
 source, work off a model representing the Java source document and
 syntax, keep it simple and go on with writing my editor without many
 detours.

 That's the kind of simple approach that I was trying to describe...
 But Nirmal should pick the approach that he prefers and he thinks
 makes the most sense, I'll be happy with whatever works best for him
 and the project.


 I think the comment in your earlier email hints at where this tension
 is coming from -

 I was under the impression that the SVG diagram generator would give
 you a view of the composites as they are authored or configured, and
 not necessarily a view of the reduced and 'compiled' composition model
 resulting from their assembly processing

 I don't know where that impression came from but its not the
 impression i get reading the project proposal -
 https://cwiki.apache.org/confluence/display/TUSCANYWIKI/Develop+a+simple+tool+that+can+be+used+to+generate+composite+diagrams

 It should Develop a _simple_ tool ..., my emphasis on simple, ... that can
 1) Help to document Tuscany's tutorials and samples.
 2) Integrate with the SCA domain manager to visualize the SCA domain
 (contributions, composites, nodes etc).

 ...

 So we're just getting different impressions. That happens :)

 IMO 'help document tutorials and samples' is in line with 'give you a
 view of the composites as they are authored...' and 'integrate with
 the SCA domain manager' is also well in line with 'give you a view of
 the composites as they are ... configured'.

 I think it's better to have the visualization that documents a
 composite closer to the composite document as it was
 authored/configured composite than the result of its compilation (and
 again you could apply the same principle to Java or any other
 programming or composition language). I also think it's simpler to do
 it this way, as I've tried to explain in the last few emails.

 You don't think the same way, and that's OK with me, plus I'm not sure
 I'll be able to convince you otherwise anyway.

 I'd be interested in Nirmal's opinion too. He has already spent quite
 a bit of time on the subject and made really good progress, so like I
 already said, I think he should pick the approach that he thinks works
 best for his project.


The thing is with open source and Apache projects in particular in
order to get code that lasts you need to collaborate, find consensus
and foster others helping with your code. Of course this project could
just focus solely on the approach you've suggested,  maybe it would
take off and be successful though we don't really have many
environments yet where it will get used much like that and as you
comment in an earlier email its an approach that is ...probably not
going to be very popular with other people in the Tuscany 

[ANNOUNCE] Apache Tuscany SCA Java 2.0-Beta3 released

2011-08-09 Thread ant elder
The Apache Tuscany team is pleased to announce the 2.0-Beta3 release
of the Java SCA 2.0 project.

Apache Tuscany/SCA provides a runtime environment based on Service
Component Architecture (SCA), which is a set of OASIS specifications
aimed at simplifying SOA application development.

This is the third beta release on our way to a full 2.0 release. It
contains many improvements and bug fixes to the Web Service binding,
distributed domain support, samples and many other areas plus two new
bindings for comet and web socket support. See the RELEASE_NOTES and
CHANGES file for more details about the release, and to download the
distributions please go to:

http://tuscany.apache.org/sca-java-2x-releases.html

To find out more about OASIS Open CSA go to:

http://www.oasis-opencsa.org

Apache Tuscany welcomes your help. Any contribution, including code,
testing, contributions to the documentation, or bug reporting is
always appreciated. For more information on how to get involved in
Apache Tuscany visit the website at:

http://tuscany.apache.org

Thank you for your interest in Apache Tuscany!


[jira] [Created] (TUSCANY-3913) JCA otests fail when run with domain node

2011-08-09 Thread Simon Laws (JIRA)
JCA otests fail when run with domain node
-

 Key: TUSCANY-3913
 URL: https://issues.apache.org/jira/browse/TUSCANY-3913
 Project: Tuscany
  Issue Type: Bug
  Components: SCA Java Runtime
Affects Versions: Java-SCA-2.0
 Environment: all
Reporter: Simon Laws
Assignee: Simon Laws
 Fix For: Java-SCA-2.0


I have a example RuntimeBridge which uses the domain node rather than the 
original node and with the new configuration the tests fail reporting that the 
SOAP intent cannot be resolved as the excluded intent of antiSOAP. 



--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (TUSCANY-3913) JCA otests fail when run with domain node

2011-08-09 Thread Simon Laws (JIRA)

[ 
https://issues.apache.org/jira/browse/TUSCANY-3913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13081547#comment-13081547
 ] 

Simon Laws commented on TUSCANY-3913:
-

The problem is that the domain node is not passing down the full set of 
contributions when resolving the composite and hence some of the configuration 
is incorrect. The following change fixes the problem for me however the just 
treats the symptom. I need to find out why the dependedOnContributions 
collection contains multiple copies of the same contribution. 

--- 
C:/Users/slaws/AppData/Local/Temp/DeployedComposite.java-revBASE.svn000.tmp.java
Tue Aug  9 10:43:30 2011
+++ 
C:/simon/svn/sca-java-2.x/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/DeployedComposite.java
  Mon Aug  8 17:28:56 2011
@@ -92,6 +92,12 @@
 contributions.add(contribution);
 contributions.get(0).getDeployables().clear();
 contributions.get(0).getDeployables().add(composite);
+
+for (Contribution contribution : dependedOnContributions){
+if (!contributions.contains(contribution)){
+contributions.add(contribution);
+}
+}
 
 MapQName, ListString bs = new HashMapQName, ListString();
 if (endpointsIncludeDomainName) {

 JCA otests fail when run with domain node
 -

 Key: TUSCANY-3913
 URL: https://issues.apache.org/jira/browse/TUSCANY-3913
 Project: Tuscany
  Issue Type: Bug
  Components: SCA Java Runtime
Affects Versions: Java-SCA-2.0
 Environment: all
Reporter: Simon Laws
Assignee: Simon Laws
 Fix For: Java-SCA-2.0


 I have a example RuntimeBridge which uses the domain node rather than the 
 original node and with the new configuration the tests fail reporting that 
 the SOAP intent cannot be resolved as the excluded intent of antiSOAP. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira




Re: parsing parameters to the init method

2011-08-09 Thread Luciano Resende
On Sat, Aug 6, 2011 at 8:30 PM, Eranda Sooriyabandara 0704...@gmail.com wrote:
 Hi Jean-Sebastian,
 I was bit confused on how am I going to maintain the relationship between
 Session, Database and Group. With all these methods I am kind of lost in the
 middle in choosing one. If you can call one for me I can work on it.
 First I was thought of keep some status for the component but later I
 realized that constructor injection will be more applicable since I have
 constructors with Complex datatypes. What do you think?
 In the middle of implementing I got the following problems,
 Can we parse a complex datatype as a constructor parameter.
 When we going to initialize the class (call the constructor).
 Can we access the Objects of Session, Database and Group in the client and
 access its method.

 thanks
 Eranda


I had a similar use case, and I modeled it like two compoments :
DataSource and DataAccess, DataSource had multiple properties which
were mostly database specific configuration required to instantiate a
connection and Data Access had a reference to a dataSource which got
injected by SCA. If I understand your concept of session, you might be
able to handle that by using scopes  where a singleton
DataSource/DataAccess would be injected  into a service that
requires persistence access. You might need to play a little bit with
generics to allow your DataSource to create different types of
connections based on what persistence implementation you are
utilizing.

-- 
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/


Re: svn commit: r1151203 - in /tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core: assembly/impl/RuntimeEndpointImpl.java assembly/impl/WSDLHelper.java runtime/impl/Endp

2011-08-09 Thread Simon Laws
On Tue, Jul 26, 2011 at 7:38 PM,  antel...@apache.org wrote:
 Author: antelder
 Date: Tue Jul 26 18:38:46 2011
 New Revision: 1151203

 URL: http://svn.apache.org/viewvc?rev=1151203view=rev
 Log:
 Add some code to try to convert the wsdl string from the remote endpoint back 
 into a WSDLInterfaceContract. This doesn't work properly and throws an 
 InvalidWSDLException with some JDKs. Committing as-is to see if anyone has 
 any ideas why

 Added:
    
 tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/WSDLHelper.java
 Modified:
    
 tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointImpl.java
    
 tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java

 Modified: 
 tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointImpl.java
 URL: 
 http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointImpl.java?rev=1151203r1=1151202r2=1151203view=diff
 ==
 --- 
 tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointImpl.java
  (original)
 +++ 
 tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointImpl.java
  Tue Jul 26 18:38:46 2011
 @@ -31,9 +31,6 @@ import java.util.List;
  import java.util.Map;
  import java.util.concurrent.ConcurrentHashMap;

 -import javax.wsdl.Definition;
 -import javax.wsdl.WSDLException;
 -import javax.wsdl.xml.WSDLReader;
  import javax.wsdl.xml.WSDLWriter;
  import javax.xml.namespace.QName;
  import javax.xml.stream.XMLStreamException;
 @@ -82,7 +79,6 @@ import org.apache.tuscany.sca.interfaced
  import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
  import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
  import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
 -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory;
  import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
  import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterfaceContract;
  import org.apache.tuscany.sca.invocation.Interceptor;
 @@ -115,7 +111,6 @@ import org.apache.tuscany.sca.runtime.Ru
  import org.apache.tuscany.sca.runtime.RuntimeWireProcessorExtensionPoint;
  import org.apache.tuscany.sca.work.WorkScheduler;
  import org.oasisopen.sca.ServiceRuntimeException;
 -import org.xml.sax.InputSource;

  /**
  * Runtime model for Endpoint that supports java serialization
 @@ -1067,24 +1062,12 @@ public class RuntimeEndpointImpl extends
         if (wsdl == null || wsdl.length()  1) {
             return;
         }
 -        try {
 -            InterfaceContract ic = getComponentServiceInterfaceContract();
 -            WSDLFactory wsdlFactory = 
 registry.getExtensionPoint(FactoryExtensionPoint.class).getFactory(WSDLFactory.class);
 -            WSDLInterfaceContract wsdlIC = 
 wsdlFactory.createWSDLInterfaceContract();
 -            WSDLInterface wsdlIface = wsdlFactory.createWSDLInterface();
 -            WSDLDefinition wsdlDef = wsdlFactory.createWSDLDefinition();
 -            WSDLReader reader = 
 javax.wsdl.factory.WSDLFactory.newInstance().newWSDLReader();
 -            InputSource inputSource = new InputSource(new 
 StringReader(wsdl));
 -            Definition def = reader.readWSDL(, inputSource);
 -            wsdlDef.setDefinition(def);
 -            wsdlIface.setWsdlDefinition(wsdlDef);
 -            wsdlIC.setInterface(wsdlIface);
 -            ic.setNormalizedWSDLContract(wsdlIC);
 -        } catch (WSDLException e) {
 -            throw new RuntimeException(e);
 +        InterfaceContract ic = getComponentServiceInterfaceContract();
 +        if (ic != null) {
 +            
 ic.setNormalizedWSDLContract(WSDLHelper.createWSDLInterfaceContract(registry, 
 wsdl));
         }
     }
 -
 +
     public InterfaceContract getGeneratedWSDLContract(InterfaceContract 
 interfaceContract) {

         if ( interfaceContract.getNormalizedWSDLContract() == null){

 Added: 
 tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/WSDLHelper.java
 URL: 
 http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/WSDLHelper.java?rev=1151203view=auto
 ==
 --- 
 tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/WSDLHelper.java
  (added)
 +++ 
 tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/WSDLHelper.java
  Tue Jul 26 18:38:46 2011
 @@ -0,0 +1,117 @@
 +/*
 + * Licensed to the Apache Software 

Re: svn commit: r1151203 - in /tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core: assembly/impl/RuntimeEndpointImpl.java assembly/impl/WSDLHelper.java runtime/impl/Endp

2011-08-09 Thread Simon Laws
On Tue, Aug 9, 2011 at 3:02 PM, ant elder ant.el...@gmail.com wrote:
 On Tue, Aug 9, 2011 at 2:50 PM, Simon Laws simonsl...@googlemail.com wrote:
 On Tue, Jul 26, 2011 at 7:38 PM,  antel...@apache.org wrote:
 Author: antelder
 Date: Tue Jul 26 18:38:46 2011
 New Revision: 1151203

 URL: http://svn.apache.org/viewvc?rev=1151203view=rev
 Log:
 Add some code to try to convert the wsdl string from the remote endpoint 
 back into a WSDLInterfaceContract. This doesn't work properly and throws an 
 InvalidWSDLException with some JDKs. Committing as-is to see if anyone has 
 any ideas why

 Added:
    
 tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/WSDLHelper.java
 Modified:
    
 tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointImpl.java
    
 tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java

 Modified: 
 tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointImpl.java
 URL: 
 http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointImpl.java?rev=1151203r1=1151202r2=1151203view=diff
 ==
 --- 
 tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointImpl.java
  (original)
 +++ 
 tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointImpl.java
  Tue Jul 26 18:38:46 2011
 @@ -31,9 +31,6 @@ import java.util.List;
  import java.util.Map;
  import java.util.concurrent.ConcurrentHashMap;

 -import javax.wsdl.Definition;
 -import javax.wsdl.WSDLException;
 -import javax.wsdl.xml.WSDLReader;
  import javax.wsdl.xml.WSDLWriter;
  import javax.xml.namespace.QName;
  import javax.xml.stream.XMLStreamException;
 @@ -82,7 +79,6 @@ import org.apache.tuscany.sca.interfaced
  import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
  import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
  import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
 -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory;
  import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
  import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterfaceContract;
  import org.apache.tuscany.sca.invocation.Interceptor;
 @@ -115,7 +111,6 @@ import org.apache.tuscany.sca.runtime.Ru
  import org.apache.tuscany.sca.runtime.RuntimeWireProcessorExtensionPoint;
  import org.apache.tuscany.sca.work.WorkScheduler;
  import org.oasisopen.sca.ServiceRuntimeException;
 -import org.xml.sax.InputSource;

  /**
  * Runtime model for Endpoint that supports java serialization
 @@ -1067,24 +1062,12 @@ public class RuntimeEndpointImpl extends
         if (wsdl == null || wsdl.length()  1) {
             return;
         }
 -        try {
 -            InterfaceContract ic = getComponentServiceInterfaceContract();
 -            WSDLFactory wsdlFactory = 
 registry.getExtensionPoint(FactoryExtensionPoint.class).getFactory(WSDLFactory.class);
 -            WSDLInterfaceContract wsdlIC = 
 wsdlFactory.createWSDLInterfaceContract();
 -            WSDLInterface wsdlIface = wsdlFactory.createWSDLInterface();
 -            WSDLDefinition wsdlDef = wsdlFactory.createWSDLDefinition();
 -            WSDLReader reader = 
 javax.wsdl.factory.WSDLFactory.newInstance().newWSDLReader();
 -            InputSource inputSource = new InputSource(new 
 StringReader(wsdl));
 -            Definition def = reader.readWSDL(, inputSource);
 -            wsdlDef.setDefinition(def);
 -            wsdlIface.setWsdlDefinition(wsdlDef);
 -            wsdlIC.setInterface(wsdlIface);
 -            ic.setNormalizedWSDLContract(wsdlIC);
 -        } catch (WSDLException e) {
 -            throw new RuntimeException(e);
 +        InterfaceContract ic = getComponentServiceInterfaceContract();
 +        if (ic != null) {
 +            
 ic.setNormalizedWSDLContract(WSDLHelper.createWSDLInterfaceContract(registry,
  wsdl));
         }
     }
 -
 +
     public InterfaceContract getGeneratedWSDLContract(InterfaceContract 
 interfaceContract) {

         if ( interfaceContract.getNormalizedWSDLContract() == null){

 Added: 
 tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/WSDLHelper.java
 URL: 
 http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/WSDLHelper.java?rev=1151203view=auto
 ==
 --- 
 tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/WSDLHelper.java
  (added)
 +++ 
 

Re: svn commit: r1151203 - in /tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core: assembly/impl/RuntimeEndpointImpl.java assembly/impl/WSDLHelper.java runtime/impl/Endp

2011-08-09 Thread Simon Laws
snip...

 Yes its that code which isn't working correctly. For example if you
 run something like the helloworld-scaclient testcase you should see an
 exception InvalidWSDLException: Element cannot be resolved:
 {http://sample/}sayHello. (The test does pass successfully even with
 that exception as the remote interface validataion code isn't enabled
 yet).

   ...ant


I'm on:

java version 1.6.0_26
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)

and see:

---
 T E S T S
---
Running sample.HelloworldTestCase
09-Aug-2011 15:58:22 org.apache.tuscany.sca.registry.hazelcast.HazelcastDomainRe
gistry initHazelcastInstance
INFO: started node in domain 'default' + at: /127.0.0.1:7654
09-Aug-2011 15:58:22 org.apache.tuscany.sca.impl.NodeImpl init
INFO: domain: default
09-Aug-2011 15:58:23 org.apache.tuscany.sca.impl.NodeImpl installContribution
INFO: installContribution: helloworld
09-Aug-2011 15:58:23 org.apache.tuscany.sca.registry.hazelcast.HazelcastDomainRe
gistry addEndpoint
INFO: Add endpoint - (@106030716)Endpoint:  URI = HelloworldComponent#service-bi
nding(Helloworld/Helloworld)
09-Aug-2011 15:58:23 org.apache.tuscany.sca.impl.NodeImpl startComposite
INFO: startComposite: helloworld/helloworld.composite
HelloworldSCAClient, using domainURI uri:default?wka=127.0.0.1:7654
Calling HelloworldComponent.sayHello(world):
wsdl: C:\Users\slaws\AppData\Local\Temp\endpoint154063411841302205.wsdl
wsdl: C:\Users\slaws\AppData\Local\Temp\endpoint4201080581756982322.wsdl
Hello world
09-Aug-2011 15:58:24 org.apache.tuscany.sca.registry.hazelcast.HazelcastDomainRe
gistry removeEndpoint
INFO: Removed endpoint - (@106030716)Endpoint:  URI = HelloworldComponent#servic
e-binding(Helloworld/Helloworld)
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.041 sec

So presumably this is a success case

Simon

-- 
Apache Tuscany committer: tuscany.apache.org
Co-author of a book about Tuscany and SCA: tuscanyinaction.com


Re: [Composite Diagram Generator] Need a suggestion

2011-08-09 Thread Nirmal Fernando
Hi Ant,

On Mon, Aug 8, 2011 at 1:58 PM, ant elder ant.el...@gmail.com wrote:

 Nirmal, I've just committed a module with a couple of classes that
 show how your SVG code could be used by the Tuscany Shell to draw SVG
 pictures of composites:


 https://svn.apache.org/repos/asf/tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramShellPlugin/

 The code is pretty simple, just one Batik class copied from their
 examples to display an SVG with Swing, and one small class for the
 Tuscany Shell command. If you check that out and from its directory do
 mvn tuscany:run it will start the Tuscany Shell and you'll see in
 the help there is a new draw command, and entering

 draw CompositeDiagramShellPlugin helloworld.composite

 it will try to display the SVG. That doesn't quite work as the
 EntityBuilder has a problem parsing the XML. Ideally it wouldn't have
 to parse the XML but would be able to work with the Tuscany Composite
 object directly.


Thanks for the contribution ! :)



 What do you think about adding another EntityBuilder impl that works
 with the Composite object?


I added the support to the Tuscany composite object by adding
TuscanyCompositeEntityBuilder class:
https://svn.apache.org/repos/asf/tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/layout/TuscanyCompositeEntityBuilder.java

And tried to run the shell command, but I think there's some problem with
the temp file which you are creating in DrawShellCommand class.






   ...ant

 On Sat, Jun 25, 2011 at 1:54 PM, Nirmal Fernando
 nirmal070...@apache.org wrote:
  Hi All,
 
  I need your help to decide how should Composite Diagram Generator loads
  composite XML.
  I can see two main options:
 
  1) Load from the Jar file
  2) Directly load the composite XML (i.e. user gives it as the input)
 
  Thanks.
 




-- 
Best Regards,
Nirmal

C.S.Nirmal J. Fernando
Department of Computer Science  Engineering,
Faculty of Engineering,
University of Moratuwa,
Sri Lanka.

Blog: http://nirmalfdo.blogspot.com/


Re: Target service scope with implementation.composite

2011-08-09 Thread Greg Dritschler
New question:  What is the scope for resolving a COMPOSITE reference target?
 It seems like it is resolved in the context of the using composite.

I recall seeing something about this somewhere but all I can find is this:
http://www.osoa.org/jira/browse/ASSEMBLY-5

Greg


Re: Fun with LevelDB, LLVM and OpenCL

2011-08-09 Thread dsh
Hi Jean-Sebastien Delfino,

some things I noticed during the configure process (I am using MacPorts):

* I think it would help to point out in the INSTALL file that mozjs
can be downloaded at - ftp://ftp.mozilla.org/pub/mozilla.org/js/
* On OSX Lion xulrunner won't install from MacPorts and thus one would
end up without a proper mozjs installation
* If compiling mozjs from the prio mentioned URL, it ends up to be
installed as /opt/local/lib/libmozjs185.1.0.0.dylib which causes the
configure process to fail
* I thus symlinked /opt/local/lib/libmozjs185.1.0.0.dylib to
/opt/local/lib/libmozjs.dylib
* The configure process is looking for -lapr-2 instead of -lapr-1 (I
have APR 1.4.5_1 installed)
* I thus had to symlink /opt/local/lib/libapr-1.0.dylib to
/opt/local/lib/libapr-2.dylib

If you like I could try to update the INSTALL document accordingly and
attach the patch to a JIRA. I am doing the dependency setup in
parallel on FreeBSD 8.2 to see whether I would run into similar issues
(for instance the one of having a -lapr-1 installed instead of the
expected -lapr-2). We could then decide whether we want to improve the
auto* tools infrastructure or not (or even migrate to CMake).

PS: I am planning to create a FreeBSD port for Apache Tuscany (native)
cause I feel having to setup all of these dependencies is kind of
daunting.

Cheers
Daniel

On Mon, Aug 8, 2011 at 7:05 PM, Jean-Sebastien Delfino
jsdelf...@apache.org wrote:
 On Sun, Aug 7, 2011 at 6:35 PM, dsh daniel.hais...@googlemail.com wrote:
 Just a little update:

 OSX Lion with Xcode 4.1:

 * i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc.
 build 5658) (LLVM build 2335.15.00)
 * Apple clang version 2.1

 OSX Lion with Xcode 4.2:

 * i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1
 * Apple clang version 3.0

 OSX Snow Leopard with Xcode 4.0.2:

 * i686-apple-darwin10-llvm-gcc-4.2 (GCC) 4.2.1
 * Apple clang version 2.0 based on LLVM 2.9svn

 PS: There exists an Apple Xcode version 4.2 for OSX Snow Leopard which
 we could use as a fallback if 4.0.2 turns out to be unusable
 PPS: I really love these virtualized OSX envs I setup recently because
 they allow to have all those different setups and configurations :)

 Cheers
 Daniel


 OK, here's what I'm using on OS X Lion:

 Xcode Version 4.1 Build 4B110

 macbook-air:~$ g++ --version
 i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc.
 build 5658) (LLVM build 2335.15.00)

 macbook-air:~$ clang++ --version
 Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn)
 Target: x86_64-apple-darwin11.0.0
 Thread model: posix

 --
 Jean-Sebastien



Re: Fun with LevelDB, LLVM and OpenCL

2011-08-09 Thread dsh
Looks like OS X does not support thread local storage. I.e. __thread
causes an compile error and thus one would not need to use
--enable-threads or would need to disable them explicitely using
--disable-threads. Is this a known issue on OS X?

Cheers
Daniel

On Wed, Aug 10, 2011 at 12:53 AM, dsh daniel.hais...@googlemail.com wrote:
 Hi Jean-Sebastien Delfino,

 some things I noticed during the configure process (I am using MacPorts):

 * I think it would help to point out in the INSTALL file that mozjs
 can be downloaded at - ftp://ftp.mozilla.org/pub/mozilla.org/js/
 * On OSX Lion xulrunner won't install from MacPorts and thus one would
 end up without a proper mozjs installation
 * If compiling mozjs from the prio mentioned URL, it ends up to be
 installed as /opt/local/lib/libmozjs185.1.0.0.dylib which causes the
 configure process to fail
 * I thus symlinked /opt/local/lib/libmozjs185.1.0.0.dylib to
 /opt/local/lib/libmozjs.dylib
 * The configure process is looking for -lapr-2 instead of -lapr-1 (I
 have APR 1.4.5_1 installed)
 * I thus had to symlink /opt/local/lib/libapr-1.0.dylib to
 /opt/local/lib/libapr-2.dylib

 If you like I could try to update the INSTALL document accordingly and
 attach the patch to a JIRA. I am doing the dependency setup in
 parallel on FreeBSD 8.2 to see whether I would run into similar issues
 (for instance the one of having a -lapr-1 installed instead of the
 expected -lapr-2). We could then decide whether we want to improve the
 auto* tools infrastructure or not (or even migrate to CMake).

 PS: I am planning to create a FreeBSD port for Apache Tuscany (native)
 cause I feel having to setup all of these dependencies is kind of
 daunting.

 Cheers
 Daniel

 On Mon, Aug 8, 2011 at 7:05 PM, Jean-Sebastien Delfino
 jsdelf...@apache.org wrote:
 On Sun, Aug 7, 2011 at 6:35 PM, dsh daniel.hais...@googlemail.com wrote:
 Just a little update:

 OSX Lion with Xcode 4.1:

 * i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc.
 build 5658) (LLVM build 2335.15.00)
 * Apple clang version 2.1

 OSX Lion with Xcode 4.2:

 * i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1
 * Apple clang version 3.0

 OSX Snow Leopard with Xcode 4.0.2:

 * i686-apple-darwin10-llvm-gcc-4.2 (GCC) 4.2.1
 * Apple clang version 2.0 based on LLVM 2.9svn

 PS: There exists an Apple Xcode version 4.2 for OSX Snow Leopard which
 we could use as a fallback if 4.0.2 turns out to be unusable
 PPS: I really love these virtualized OSX envs I setup recently because
 they allow to have all those different setups and configurations :)

 Cheers
 Daniel


 OK, here's what I'm using on OS X Lion:

 Xcode Version 4.1 Build 4B110

 macbook-air:~$ g++ --version
 i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc.
 build 5658) (LLVM build 2335.15.00)

 macbook-air:~$ clang++ --version
 Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn)
 Target: x86_64-apple-darwin11.0.0
 Thread model: posix

 --
 Jean-Sebastien




Re: Fun with LevelDB, LLVM and OpenCL

2011-08-09 Thread Jean-Sebastien Delfino
On Tue, Aug 9, 2011 at 3:53 PM, dsh daniel.hais...@googlemail.com wrote:
 Hi Jean-Sebastien Delfino,

 some things I noticed during the configure process (I am using MacPorts):

 * I think it would help to point out in the INSTALL file that mozjs
 can be downloaded at - ftp://ftp.mozilla.org/pub/mozilla.org/js/
 * On OSX Lion xulrunner won't install from MacPorts and thus one would
 end up without a proper mozjs installation
 * If compiling mozjs from the prio mentioned URL, it ends up to be
 installed as /opt/local/lib/libmozjs185.1.0.0.dylib which causes the
 configure process to fail
 * I thus symlinked /opt/local/lib/libmozjs185.1.0.0.dylib to
 /opt/local/lib/libmozjs.dylib

I usually run configure
--with-js-include=$build/tracemonkey-bin/include/js
--with-js-lib=$build/tracemonkey-bin/lib
with $build pointing to a non-system directory;

... after having built trace monkey like this:
curl -OL http://hg.mozilla.org/tracemonkey/archive/e4364736e170.tar.gz
mv e4364736e170.tar.gz tracemonkey-e4364736e170.tar.gz
tar xzf tracemonkey-e4364736e170.tar.gz
cd tracemonkey-e4364736e170/js/src
$build/autoconf-2.13-bin/bin/autoconf
./configure --prefix=$build/tracemonkey-bin
make
make install

... and on Mac OS X this additional step:
install_name_tool -id $build/tracemonkey-bin/lib/libmozjs.dylib
$build/tracemonkey-bin/lib/libmozjs.dylib

I've never had much luck installing libmozjs in the system directories
for all kinds of reasons. On Ubuntu and Redhat I had conflicts with
already installed incompatible versions, dependencies dragged by
xulrunner, and IIRC similar issues on Mac OS X with macports too.

Thanks for the link to js 185, I'll try it on Ubuntu, Redhat and Mac
OS X too, happy to switch to it if it works on these systems, but I'd
like to avoid installing it in the default system directories (hoping
there's a way to specify the install dir with --prefix).

More generally I try to stay away from using pre-built packaged system
dependencies for the following reasons:

- most of the times they system dependencies conflict with the
versions of the dependencies I want, for example Ubuntu 10.10 ships
with Apache httpd 2.2.16 which is really old compared to the 2.3.10
version used by Tuscany;

- using the system dependencies shipped with the operating system
means versions on different systems, different behavior and
significant effort to port and test with all these different versions;

- if I need to debug or patch them I'll have to recompile them anyway,
and if I do that then I'll have to install them in a non-system
directory to not mess up my system; After all, that's the beauty of
open-source, you can get the source, compile it yourself and install
it wherever is most convenient for you...

- if I need to install Tuscany and its dependencies on a new machine
(an EC2 VM for example), it's much easier to build and install all the
dependencies in the same directory as Tuscany, zip that directory up,
and transfer that zip to the target VMs without altering its system
directories.

 * The configure process is looking for -lapr-2 instead of -lapr-1 (I
 have APR 1.4.5_1 installed)
 * I thus had to symlink /opt/local/lib/libapr-1.0.dylib to
 /opt/local/lib/libapr-2.dylib

Yes I've been using apr-2 as it's required by httpd's mod-session for
crypto. See the related email discussion on the httpd dev list there:
http://markmail.org/thread/dbavlf55ywf2a33h

I don't think that APR 1.4.5 includes the crypto API required by httpd
2.3.x mod_session_crypto yet, so we're stuck with APR trunk for now,
until APR releases that API and httpd ports to that release.


 If you like I could try to update the INSTALL document accordingly and
 attach the patch to a JIRA.

That would help, but what would help even more , I think, would be to
have a script that downloads / checks out the dependencies and builds
them end to end on a particular system. The single INSTALL doc may get
really big if we start to add to it all the different instructions to
build off system dependencies on Ubuntu, Redhat, Mac OS X, FreeBSD
etc...

There's already a script to build everything on Ubuntu 10.x there:
https://svn.apache.org/repos/asf/tuscany/sca-cpp/trunk/ubuntu/ubuntu-install

There's another one for Mac OS X Leopard and Lion there:
https://svn.apache.org/repos/asf/tuscany/sca-cpp/trunk/macos/macos-install

... which by the way should help you build on MacOS without fighting
with any system dependencies. With that script, you should be able to
build on a pristine Mac OS system + GCC 4.4+ from Macport or other,
without polluting your system directories with any other dependencies
at all... as all required dependencies are built from source by the
script.

 I am doing the dependency setup in
 parallel on FreeBSD 8.2 to see whether I would run into similar issues
 (for instance the one of having a -lapr-1 installed instead of the
 expected -lapr-2). We could then decide whether we want to improve the
 auto* tools infrastructure or not (or even 

Re: parsing parameters to the init method

2011-08-09 Thread Jean-Sebastien Delfino
On Sat, Aug 6, 2011 at 8:30 PM, Eranda Sooriyabandara 0704...@gmail.com wrote:
 Hi Jean-Sebastian,
 I was bit confused on how am I going to maintain the relationship between
 Session, Database and Group. With all these methods I am kind of lost in the
 middle in choosing one. If you can call one for me I can work on it.
 First I was thought of keep some status for the component but later I
 realized that constructor injection will be more applicable since I have
 constructors with Complex datatypes. What do you think?
 In the middle of implementing I got the following problems,
 Can we parse a complex datatype as a constructor parameter.
 When we going to initialize the class (call the constructor).
 Can we access the Objects of Session, Database and Group in the client and
 access its method.


If the usage pattern you're thinking about is:
s = new SessionFactory().getSession();
d = s.getDatabase(db);
g = d.getGroup(group);
e = g.getEntry(key);

Then you're going to have to maintain some state (group + database +
session), which won't work well in a distributed environment, as (1)
you can't assume that the client program will behave and release that
state, and (2) one million clients could create one million sessions
which would overload and take your system down :).

Instead I'd suggest the following approaches:

a) One component representing the collection of entries.

Use the following service interface (c is your datastore component)
e = c.getEntry(db, group, key)

and obtain the database, group and session, and release them, in the
getEntry method.

or

b) Three components representing the collection of entries, group and
database (or perhaps one more with a component providing sessions).

Use the following service interface (c is your datastore component)
e = c.getEntry(key)

then wire c to a component g, providing a getGroup() operation
returning group group, group being configured as a property of g;
and wire g to a component d providing a getDatabase() operation
returning database db, db being configured as a property of d.

Does that help?
-- 
Jean-Sebastien


Re: [jira] [Issue Comment Edited] (TUSCANY-3496) Develop a simple tool that can be used to generate composite diagrams from the xml files

2011-08-09 Thread Jean-Sebastien Delfino
Hi Nirmal,

I've reviewed your latest update and it looks pretty good. I have a
few suggestions to make it even better:

- Generate a simple HTML document around the SVG. That'll help set a
title for the document, a link to the original composite (assuming
it's online) and any other decoration you'd like to add around the
diagram.

- Use groups (svg:g) to nest the various shapes you're generating.
This should help simplify your code as you won't have to worry about
positioning related shapes (as they'll be naturally nested).

- To help navigate nested composites and included composites, generate
links to their diagrams (perhaps you've already done that but I
couldn't see it with the example diagrams you've committed).

- Position the titles below or above the services and references.
Right now they're kind of mixed with the services / references.

These are only suggestions. Think about about them and decide yourself
if you think they're good ideas or not. At this point I think you know
better than me what's feasible and what makes more sense...
--
Jean-Sebastien

On Sat, Aug 6, 2011 at 12:04 PM, C.S. Nirmal J. Fernando (JIRA)
dev@tuscany.apache.org wrote:

    [ 
 https://issues.apache.org/jira/browse/TUSCANY-3496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13080446#comment-13080446
  ]

 C.S. Nirmal J. Fernando edited comment on TUSCANY-3496 at 8/6/11 7:03 PM:
 --

 Hi All,

 I have almost finished implementing the necessary requirements of Composite 
 Diagram Generator as per now, and starting to testing the tool.

 You can find the code up to date from 
 https://svn.apache.org/repos/asf/tuscany/collaboration/GSoC-2011-Nirmal/

 Herewith I have attached 4 SVG images, created using the tool, and the 4 
 attached composites files were created/modified just for the feature 
 validation process, thus may not be meaningful.

 Please download and open the SVG images using your web browser, then only 
 you'll get to see the 'inclusion' links working. Also you should place all 4 
 SVG images in one place to get the links to work.

 PS: You may notice that the images are not scrollable, I couldn't find a way 
 to make SVG scrollable yet (I spent very little time on it ), for now you may 
 want to zoom in and out.

 Waiting for your comments!

 Thanks.

      was (Author: nirmal):
    Hi All,

 I have almost finished implementing the necessary requirements of Composite 
 Diagram Generator as per now, and starting to testing the tool.

 You can find the code up to date from 
 https://svn.apache.org/repos/asf/tuscany/collaboration/GSoC-2011-Nirmal/

 Herewith I have attached 4 SVG images, created using the tool, and the 4 
 attached composites files were created/modified just for the feature 
 validation process, thus may not be meaningful.

 Please download and open the SVG images using your web browser, then only 
 you'll get to see the 'inclusion' links working. Also you should place all 4 
 SVG images in one place to get the links to work.

 Waiting for your comments!

 Thanks.

 Develop a simple tool that can be used to generate composite diagrams from 
 the xml files
 

                 Key: TUSCANY-3496
                 URL: https://issues.apache.org/jira/browse/TUSCANY-3496
             Project: Tuscany
          Issue Type: Wish
          Components: Java SCA Community Ideas
    Affects Versions: Java-SCA-1.x
            Reporter: Raymond Feng
            Assignee: C.S. Nirmal J. Fernando
              Labels: gsoc, gsoc2010, gsoc2011, mentor
         Attachments: Calculator.xml, Calculator_diagram.svg, 
 CompositeDiagramGeneratorUsingBatik-Maven.zip, 
 CompositeDiagramGeneratorUsingBatik.zip, MyValueComposite2.xml, 
 MyValueComposite2_diagram.svg, proposed_design_1.jpg, store.xml, 
 store_diagram.svg, supplychain.xml, supplychain_diagram.svg

   Original Estimate: 1m
  Remaining Estimate: 1m

 I'm looking a simple tool (web based or command) that can generate the 
 composite diagrams from a list of composite files. One technology we can try 
 is the Apache Batik project.
 http://xmlgraphics.apache.org/batik/
 This tool can serve multiple purposes:
 1) Help document our tutorials and samples
 2) Be integrated with the SCA domain manager to visualize the SCA domain 
 (contributions, composites, nodes etc)

 --
 This message is automatically generated by JIRA.
 For more information on JIRA, see: http://www.atlassian.com/software/jira