You're right, it's probably not the right place for this :)

I moved it to http://svn.apache.org/repos/asf/incubator/tuscany/sandbox/sebastien/java/sca/node-api/smaller.


ant elder wrote:
Is the release branch really the place for something like this? How about a
sandbox?

   ...ant

On 9/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Author: jsdelfino
Date: Sun Sep 16 15:21:15 2007
New Revision: 576198

URL: http://svn.apache.org/viewvc?rev=576198&view=rev
Log:
Strawman of a simpler/smaller API for initializing an SCA node.

Added:
    incubator/tuscany/branches/sca-java-1.0
/modules/node-api/src/main/java/org/apache/tuscany/sca/node/smaller/
    
incubator/tuscany/branches/sca-java-1.0/modules/node-api/src/main/java/org/apache/tuscany/sca/node/smaller/SCADomain.java
(with props)
    
incubator/tuscany/branches/sca-java-1.0/modules/node-api/src/main/java/org/apache/tuscany/sca/node/smaller/SCANode.java
(with props)

Added: incubator/tuscany/branches/sca-java-1.0
/modules/node-api/src/main/java/org/apache/tuscany/sca/node/smaller/SCADomain.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-1.0/modules/node-api/src/main/java/org/apache/tuscany/sca/node/smaller/SCADomain.java?rev=576198&view=auto

==============================================================================
--- 
incubator/tuscany/branches/sca-java-1.0/modules/node-api/src/main/java/org/apache/tuscany/sca/node/smaller/SCADomain.java
(added)
+++ 
incubator/tuscany/branches/sca-java-1.0/modules/node-api/src/main/java/org/apache/tuscany/sca/node/smaller/SCADomain.java
Sun Sep 16 15:21:15 2007
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node.smaller;
+
+import org.osoa.sca.CallableReference;
+import org.osoa.sca.ServiceReference;
+
+
+/**
+ * A handle to an SCA domain.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface SCADomain {
+
+    /**
+     * Returns the name of the domain that this node
+     * is part of.
+     *
+     * @return the domain Uri
+     */
+    public String getURI();
+
+    /**
+     * Cast a type-safe reference to a CallableReference. Converts a
type-safe
+     * reference to an equivalent CallableReference; if the target refers
to a
+     * service then a ServiceReference will be returned, if the target
refers to
+     * a callback then a CallableReference will be returned.
+     *
+     * @param target a reference proxy provided by the SCA runtime
+     * @param <B> the Java type of the business interface for the
reference
+     * @param <R> the type of reference to be returned
+     * @return a CallableReference equivalent for the proxy
+     * @throws IllegalArgumentException if the supplied instance is not a
+     *             reference supplied by the SCA runtime
+     */
+    public <B, R extends CallableReference<B>> R cast(B target) throws
IllegalArgumentException;
+
+    /**
+     * Returns a proxy for a service provided by a component in the SCA
domain.
+     *
+     * @param businessInterface the interface that will be used to invoke
the
+     *            service
+     * @param serviceName the name of the service
+     * @param <B> the Java type of the business interface for the service
+     * @return an object that implements the business interface
+     */
+    public <B> B getService(Class<B> businessInterface, String
serviceName);
+
+    /**
+     * Returns a ServiceReference for a service provided by a component
in the
+     * SCA domain.
+     *
+     * @param businessInterface the interface that will be used to invoke
the
+     *            service
+     * @param serviceName the name of the service
+     * @param <B> the Java type of the business interface for the service
+     * @return a ServiceReference for the designated service
+     */
+    public <B> ServiceReference<B> getServiceReference(Class<B>
businessInterface, String referenceName);
+
+}

Propchange: incubator/tuscany/branches/sca-java-1.0
/modules/node-api/src/main/java/org/apache/tuscany/sca/node/smaller/SCADomain.java

------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/branches/sca-java-1.0
/modules/node-api/src/main/java/org/apache/tuscany/sca/node/smaller/SCADomain.java

------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/branches/sca-java-1.0
/modules/node-api/src/main/java/org/apache/tuscany/sca/node/smaller/SCANode.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-1.0/modules/node-api/src/main/java/org/apache/tuscany/sca/node/smaller/SCANode.java?rev=576198&view=auto

==============================================================================
--- 
incubator/tuscany/branches/sca-java-1.0/modules/node-api/src/main/java/org/apache/tuscany/sca/node/smaller/SCANode.java
(added)
+++ 
incubator/tuscany/branches/sca-java-1.0/modules/node-api/src/main/java/org/apache/tuscany/sca/node/smaller/SCANode.java
Sun Sep 16 15:21:15 2007
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node.smaller;
+
+import java.io.IOException;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
+import org.apache.tuscany.sca.contribution.service.ContributionException;
+import org.apache.tuscany.sca.core.assembly.ActivationException;
+
+
+/**
+ * An SCA Node. Where a domain runs components
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class SCANode {
+
+    /**
+     * Returns a new instance of an SCA node.
+     * @param domainURI
+     * @param nodeURI
+     *
+     * @return
+     */
+    public static SCANode newInstance(String domainURI, String nodeURI) {
+        // Create a new NodeImpl
+        return null;
+    }
+
+    /**
+     * Returns the URL of the contribution containing the specified
composite file.
+     * @param compositePath
+     * @return
+     */
+    //TODO Not sure we really need this
+    public abstract URL findContributionFromComposite(String
compositeFile);
+
+    /**
+     * Returns the URI of this node
+     *
+     * @return the node name
+     */
+    public abstract String getURI();
+
+    /**
+     * Returns the SCA domain that the node belongs to.
+     * @return the SCA domain that the node belongs to.
+     */
+    public abstract SCADomain getSCADomain();
+
+    /**
+     * Accepts a new contribution and passes it onto the domain
implementation
+     *
+     * @param contributionLocation the URL location of the contribution
+     * @throws ActivationException
+     */
+    public abstract void addContribution(URL contrubutionLocation)
+     throws ActivationException, ContributionException, IOException,
CompositeBuilderException;
+
+    /**
+     * Removes the specified contribution from the domain
+     *
+     * @param contributionname
+     * throws ActivationException
+     */
+    public abstract void removeContribution(URL contributionName)
+      throws ActivationException, ContributionException;
+
+    /**
+     * Starts a named composite
+     *
+     * @param domainUri the string uri for the distributed domain
+     * @param nodeUri the string uri for the node
+     * @param componentName the name of the component to be started
+     */
+    public abstract void startComposite(QName compositeName);
+
+    /**
+     * Stops a named composite
+     *
+     * @param domainUri the string uri for the distributed domain
+     * @param nodeUri the string uri for the node
+     * @param componentName the name of the component to be started
+     */
+    public abstract void stopComposite(QName compositeName);
+
+    /**
+     * Starts a named composite
+     *
+     * @param domainUri the string uri for the distributed domain
+     * @param nodeUri the string uri for the node
+     * @param componentName the name of the component to be started
+     */
+    public abstract void addComposite(QName compositeName);
+
+    /**
+     * Stops a named composite
+     *
+     * @param domainUri the string uri for the distributed domain
+     * @param nodeUri the string uri for the node
+     * @param componentName the name of the component to be started
+     */
+    public abstract void removeComposite(QName compositeName);
+
+}

Propchange: incubator/tuscany/branches/sca-java-1.0
/modules/node-api/src/main/java/org/apache/tuscany/sca/node/smaller/SCANode.java

------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/branches/sca-java-1.0
/modules/node-api/src/main/java/org/apache/tuscany/sca/node/smaller/SCANode.java

------------------------------------------------------------------------------
    svn:keywords = Rev Date



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Jean-Sebastien


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to