You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by jb...@apache.org on 2007/02/09 20:04:55 UTC

svn commit: r505426 - in /incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/classloading: ./ ClassLoaderRegistry.java DuplicateClassLoaderException.java

Author: jboynes
Date: Fri Feb  9 11:04:54 2007
New Revision: 505426

URL: http://svn.apache.org/viewvc?view=rev&rev=505426
Log:
add interface for a classloader registry

Added:
    incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/classloading/
    incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/classloading/ClassLoaderRegistry.java   (with props)
    incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/classloading/DuplicateClassLoaderException.java   (with props)

Added: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/classloading/ClassLoaderRegistry.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/classloading/ClassLoaderRegistry.java?view=auto&rev=505426
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/classloading/ClassLoaderRegistry.java (added)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/classloading/ClassLoaderRegistry.java Fri Feb  9 11:04:54 2007
@@ -0,0 +1,53 @@
+/*
+ * 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.services.classloading;
+
+import java.net.URI;
+
+/**
+ * Registry for classloaders available to the local runtime.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface ClassLoaderRegistry {
+    /**
+     * Register a ClassLoader with the runtime.
+     *
+     * @param id a unique id for the classloader
+     * @param classLoader the classloader to register
+     * @throws DuplicateClassLoaderException if there is already a classloader registered with the same id
+     */
+    void register(URI id, ClassLoader classLoader) throws DuplicateClassLoaderException;
+
+    /**
+     * Returns the classloader registered with the supplied id, or null if none is registered.
+     *
+     * @param id the id for the classloader
+     * @return the ClassLoader registered with that id, or null
+     */
+    ClassLoader getClassLoader(URI id);
+
+    /**
+     * Unregister the specified classloader from the system.
+     *
+     * @param id the id for the classloader
+     * @return the classloader that was registed with the id, or null if none
+     */
+    ClassLoader unregister(URI id);
+}

Propchange: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/classloading/ClassLoaderRegistry.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/classloading/ClassLoaderRegistry.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/classloading/DuplicateClassLoaderException.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/classloading/DuplicateClassLoaderException.java?view=auto&rev=505426
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/classloading/DuplicateClassLoaderException.java (added)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/classloading/DuplicateClassLoaderException.java Fri Feb  9 11:04:54 2007
@@ -0,0 +1,36 @@
+/*
+ * 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.services.classloading;
+
+import org.apache.tuscany.spi.CoreRuntimeException;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class DuplicateClassLoaderException extends CoreRuntimeException {
+    /**
+     * Constructor specifying message and the ID of the duplicate classloader.
+     *
+     * @param message exception message
+     * @param identifier the id of the classloader that is already present
+     */
+    public DuplicateClassLoaderException(String message, String identifier) {
+        super(message, identifier);
+    }
+}

Propchange: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/classloading/DuplicateClassLoaderException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/classloading/DuplicateClassLoaderException.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