You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2007/03/13 07:51:05 UTC

svn commit: r517565 - in /incubator/tuscany/branches/sca-java-integration/sca/scdl: ./ src/main/java/org/apache/tuscany/api/ src/main/java/org/apache/tuscany/spi/

Author: jsdelfino
Date: Mon Mar 12 23:51:04 2007
New Revision: 517565

URL: http://svn.apache.org/viewvc?view=rev&rev=517565
Log:
Bringing some of the other SPI dependencies in this module for now. Will probably need some refactoring later to remove these dependencies.

Added:
    incubator/tuscany/branches/sca-java-integration/sca/scdl/src/main/java/org/apache/tuscany/api/
    incubator/tuscany/branches/sca-java-integration/sca/scdl/src/main/java/org/apache/tuscany/api/TuscanyException.java   (with props)
    incubator/tuscany/branches/sca-java-integration/sca/scdl/src/main/java/org/apache/tuscany/api/TuscanyRuntimeException.java   (with props)
    incubator/tuscany/branches/sca-java-integration/sca/scdl/src/main/java/org/apache/tuscany/spi/ObjectCreationException.java   (with props)
    incubator/tuscany/branches/sca-java-integration/sca/scdl/src/main/java/org/apache/tuscany/spi/ObjectFactory.java   (with props)
Modified:
    incubator/tuscany/branches/sca-java-integration/sca/scdl/pom.xml

Modified: incubator/tuscany/branches/sca-java-integration/sca/scdl/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/scdl/pom.xml?view=diff&rev=517565&r1=517564&r2=517565
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/scdl/pom.xml (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/scdl/pom.xml Mon Mar 12 23:51:04 2007
@@ -32,6 +32,18 @@
     <dependencies>
 
         <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-assembly</artifactId>
+            <version>0.1-integration-incubating-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>stax</groupId>
+            <artifactId>stax-api</artifactId>
+            <version>1.0.1</version>
+        </dependency>
+
+        <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <version>4.2</version>

Added: incubator/tuscany/branches/sca-java-integration/sca/scdl/src/main/java/org/apache/tuscany/api/TuscanyException.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/scdl/src/main/java/org/apache/tuscany/api/TuscanyException.java?view=auto&rev=517565
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/scdl/src/main/java/org/apache/tuscany/api/TuscanyException.java (added)
+++ incubator/tuscany/branches/sca-java-integration/sca/scdl/src/main/java/org/apache/tuscany/api/TuscanyException.java Mon Mar 12 23:51:04 2007
@@ -0,0 +1,124 @@
+/*
+ * 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.api;
+
+import java.io.PrintWriter;
+
+/**
+ * The root checked exception for the Tuscany runtime.
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class TuscanyException extends Exception {
+    private static final long serialVersionUID = -7847121698339635268L;
+    private final String identifier;
+
+    /**
+     * Override constructor from Exception.
+     *
+     * @see Exception
+     */
+    public TuscanyException() {
+        super();
+        this.identifier = null;
+    }
+
+    /**
+     * Override constructor from Exception.
+     *
+     * @param message passed to Exception
+     * @see Exception
+     */
+    public TuscanyException(String message) {
+        super(message);
+        this.identifier = null;
+    }
+
+    /**
+     * Override constructor from Exception.
+     *
+     * @param message    passed to Exception
+     * @param identifier additional error information referred to in the error message
+     * @see Exception
+     */
+    public TuscanyException(String message, String identifier) {
+        super(message);
+        this.identifier = identifier;
+    }
+
+    /**
+     * Override constructor from Exception.
+     *
+     * @param message passed to Exception
+     * @param cause   passed to Exception
+     * @see Exception
+     */
+    public TuscanyException(String message, Throwable cause) {
+        super(message, cause);
+        this.identifier = null;
+    }
+
+    /**
+     * Override constructor from Exception.
+     *
+     * @param message    passed to Exception
+     * @param identifier additional error information referred to in the error message
+     * @param cause      passed to Exception
+     * @see Exception
+     */
+    public TuscanyException(String message, String identifier, Throwable cause) {
+        super(message, cause);
+        this.identifier = identifier;
+    }
+
+    /**
+     * Override constructor from Exception.
+     *
+     * @param cause passed to Exception
+     * @see Exception
+     */
+    public TuscanyException(Throwable cause) {
+        super(cause);
+        this.identifier = null;
+    }
+
+    /**
+     * Returns a string representing additional error information referred to in the error message.
+     *
+     * @return additional error information
+     */
+    public String getIdentifier() {
+        return identifier;
+    }
+
+    public PrintWriter appendBaseMessage(PrintWriter writer) {
+        if (identifier == null) {
+            if (super.getMessage() == null) {
+                return writer;
+            }
+            return writer.append(super.getMessage());
+        }
+        if (super.getMessage() != null) {
+            writer.append(super.getMessage());
+        }
+        writer.append(" [").append(identifier).append(']');
+        return writer;
+    }
+
+}

Propchange: incubator/tuscany/branches/sca-java-integration/sca/scdl/src/main/java/org/apache/tuscany/api/TuscanyException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/branches/sca-java-integration/sca/scdl/src/main/java/org/apache/tuscany/api/TuscanyException.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/branches/sca-java-integration/sca/scdl/src/main/java/org/apache/tuscany/api/TuscanyRuntimeException.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/scdl/src/main/java/org/apache/tuscany/api/TuscanyRuntimeException.java?view=auto&rev=517565
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/scdl/src/main/java/org/apache/tuscany/api/TuscanyRuntimeException.java (added)
+++ incubator/tuscany/branches/sca-java-integration/sca/scdl/src/main/java/org/apache/tuscany/api/TuscanyRuntimeException.java Mon Mar 12 23:51:04 2007
@@ -0,0 +1,127 @@
+/*
+ * 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.api;
+
+import java.io.PrintWriter;
+
+/**
+ * The root unchecked exception for the Tuscany runtime.
+ *
+ * @version $Rev$ $Date$
+ */
+
+public abstract class TuscanyRuntimeException extends RuntimeException {
+    private static final long serialVersionUID = -759677431966121786L;
+    private final String identifier;
+
+    /**
+     * Override constructor from RuntimeException.
+     *
+     * @see RuntimeException
+     */
+    public TuscanyRuntimeException() {
+        super();
+        this.identifier = null;
+    }
+
+    /**
+     * Override constructor from RuntimeException.
+     *
+     * @param message passed to RuntimeException
+     * @see RuntimeException
+     */
+    public TuscanyRuntimeException(String message) {
+        super(message);
+        this.identifier = null;
+    }
+
+
+    /**
+     * Override constructor from Exception.
+     *
+     * @param message    passed to Exception
+     * @param identifier additional error information referred to in the error message
+     * @see Exception
+     */
+    protected TuscanyRuntimeException(String message, String identifier) {
+        super(message);
+        this.identifier = identifier;
+    }
+
+    /**
+     * Override constructor from RuntimeException.
+     *
+     * @param message passed to RuntimeException
+     * @param cause   passed to RuntimeException
+     * @see RuntimeException
+     */
+    public TuscanyRuntimeException(String message, Throwable cause) {
+        super(message, cause);
+        this.identifier = null;
+    }
+
+
+    /**
+     * Override constructor from Exception.
+     *
+     * @param message    passed to Exception
+     * @param identifier additional error information referred to in the error message
+     * @param cause      passed to RuntimeException
+     * @see Exception
+     */
+    protected TuscanyRuntimeException(String message, String identifier, Throwable cause) {
+        super(message, cause);
+        this.identifier = identifier;
+    }
+
+    /**
+     * Override constructor from RuntimeException.
+     *
+     * @param cause passed to RuntimeException
+     * @see RuntimeException
+     */
+    public TuscanyRuntimeException(Throwable cause) {
+        super(cause);
+        this.identifier = null;
+    }
+
+    /**
+     * Returns a string representing additional error information referred to in the error message.
+     *
+     * @return additional error information
+     */
+    public String getIdentifier() {
+        return identifier;
+    }
+
+    public PrintWriter appendBaseMessage(PrintWriter writer) {
+        if (identifier == null) {
+            if (super.getMessage() == null) {
+                return writer;
+            }
+            return writer.append(super.getMessage());
+        }
+        if (super.getMessage() != null) {
+            writer.append(super.getMessage());
+        }
+        writer.append(" [").append(identifier).append(']');
+        return writer;
+    }
+
+}

Propchange: incubator/tuscany/branches/sca-java-integration/sca/scdl/src/main/java/org/apache/tuscany/api/TuscanyRuntimeException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/branches/sca-java-integration/sca/scdl/src/main/java/org/apache/tuscany/api/TuscanyRuntimeException.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/branches/sca-java-integration/sca/scdl/src/main/java/org/apache/tuscany/spi/ObjectCreationException.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/scdl/src/main/java/org/apache/tuscany/spi/ObjectCreationException.java?view=auto&rev=517565
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/scdl/src/main/java/org/apache/tuscany/spi/ObjectCreationException.java (added)
+++ incubator/tuscany/branches/sca-java-integration/sca/scdl/src/main/java/org/apache/tuscany/spi/ObjectCreationException.java Mon Mar 12 23:51:04 2007
@@ -0,0 +1,56 @@
+/*
+ * 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.spi;
+
+import org.apache.tuscany.api.TuscanyRuntimeException;
+
+/**
+ * Denotes an error creating a new object instance
+ *
+ * @version $Rev$ $Date$
+ */
+public class ObjectCreationException extends TuscanyRuntimeException {
+    private static final long serialVersionUID = -6423113430265944499L;
+
+    public ObjectCreationException() {
+        super();
+    }
+
+    public ObjectCreationException(String message) {
+        super(message);
+    }
+
+    public ObjectCreationException(String message, String identifier) {
+        super(message, identifier);
+    }
+
+    public ObjectCreationException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public ObjectCreationException(String message, String identifier, Throwable cause) {
+        super(message, identifier, cause);
+    }
+
+    public ObjectCreationException(Throwable cause) {
+        super(cause);
+    }
+
+}
+

Propchange: incubator/tuscany/branches/sca-java-integration/sca/scdl/src/main/java/org/apache/tuscany/spi/ObjectCreationException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/branches/sca-java-integration/sca/scdl/src/main/java/org/apache/tuscany/spi/ObjectCreationException.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/branches/sca-java-integration/sca/scdl/src/main/java/org/apache/tuscany/spi/ObjectFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/scdl/src/main/java/org/apache/tuscany/spi/ObjectFactory.java?view=auto&rev=517565
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/scdl/src/main/java/org/apache/tuscany/spi/ObjectFactory.java (added)
+++ incubator/tuscany/branches/sca-java-integration/sca/scdl/src/main/java/org/apache/tuscany/spi/ObjectFactory.java Mon Mar 12 23:51:04 2007
@@ -0,0 +1,35 @@
+/*
+ * 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.spi;
+
+/**
+ * Implementations create new instances of a particular type
+ *
+ * @version $Rev$ $Date$
+ */
+public interface ObjectFactory<T> {
+
+    /**
+     * Return a instance of the type that this factory creates.
+     *
+     * @return a instance from this factory
+     */
+    T getInstance() throws ObjectCreationException;
+
+}

Propchange: incubator/tuscany/branches/sca-java-integration/sca/scdl/src/main/java/org/apache/tuscany/spi/ObjectFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/branches/sca-java-integration/sca/scdl/src/main/java/org/apache/tuscany/spi/ObjectFactory.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



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