OW2 Consortium
Search OW2 Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | fractal-commits List | December 2006 Index

<--  Date Index  --> <--  Thread Index  -->

CVS update of julia/src/org/objectweb/fractal/juliak/platform (3 files)


    Date: Saturday, December 16, 2006 @ 21:25:57
  Author: seintur
    Path: /cvsroot/fractal/julia/src/org/objectweb/fractal/juliak/platform

Modified: Platform.java PlatformJSE.java
 Removed: PlatformJMECLDC.java

Removing dead code.


----------------------+
 Platform.java        |   29 +-------------
 PlatformJMECLDC.java |   97 -------------------------------------------------
 PlatformJSE.java     |   25 +++++-------
 3 files changed, 12 insertions(+), 139 deletions(-)


Index: julia/src/org/objectweb/fractal/juliak/platform/Platform.java
diff -u julia/src/org/objectweb/fractal/juliak/platform/Platform.java:1.3 
julia/src/org/objectweb/fractal/juliak/platform/Platform.java:1.4
--- julia/src/org/objectweb/fractal/juliak/platform/Platform.java:1.3   Fri 
Nov 10 21:06:38 2006
+++ julia/src/org/objectweb/fractal/juliak/platform/Platform.java       Sat 
Dec 16 21:25:57 2006
@@ -25,45 +25,20 @@
 
 
 /**
- * This class defines references the version of the {@link PlatformItf}
- * implementation suitable for the current platform (e.g Java SE or Java ME.)
+ * This class references the version of the {@link PlatformItf}
+ * implementation suitable for the current platform.
  * 
  * @author Lionel Seinturier <Lionel.Seinturier@xxxxxxx>
  * @since 2.5
  */
 public class Platform {
     
-    /**
-     * The name of the property defining the target platform. Legal values 
are:
-     * JavaSE (default), JavaME-CDC, JavaME-CLDC.
-     */
-    final public static String PLATFORM_PROP_NAME =
-        "org.objectweb.fractal.aokell.platform";
-    
     /** The singleton instance of the {@link PlatformItf} implementation. */
     private static PlatformItf singleton;
     
     public static PlatformItf get() {
         if( singleton == null ) {
-            String value = System.getProperty(PLATFORM_PROP_NAME);
-            if( value == null ) {
-                value = "JavaSE";
-            }
-            if( !( value.equals("JavaSE") ||
-                   value.equals("JavaME-CDC")) ||
-                   value.equals("JavaME-CLDC")
-               ) {
-                final String msg =
-                    "Unsupported value ("+value+")for the 
"+PLATFORM_PROP_NAME+
-                    " system property. Legal values are: JavaSE (default), 
JavaME-CDC, JavaME-CLDC";
-                throw new IllegalArgumentException(msg);
-            }
-            if( value.equals("JavaSE") || value.equals("JavaME-CDC") ) {
                 singleton = new PlatformJSE();
-            }
-            if( value.equals("JavaME-CLDC") ) {
-                singleton = new PlatformJMECLDC();
-            }
         }
         return singleton;
     }
Index: julia/src/org/objectweb/fractal/juliak/platform/PlatformJMECLDC.java
diff -u 
julia/src/org/objectweb/fractal/juliak/platform/PlatformJMECLDC.java:1.2 
julia/src/org/objectweb/fractal/juliak/platform/PlatformJMECLDC.java:removed
--- julia/src/org/objectweb/fractal/juliak/platform/PlatformJMECLDC.java:1.2  
  Fri Nov 10 21:06:38 2006
+++ julia/src/org/objectweb/fractal/juliak/platform/PlatformJMECLDC.java      
  Sat Dec 16 21:25:57 2006
@@ -1,97 +0,0 @@
-/***
- * Julia
- * Copyright (C) 2005-2006 INRIA, France Telecom, USTL
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * Contact: Lionel.Seinturier@xxxxxxx
- *
- * Author: Lionel Seinturier
- */
-
-package org.objectweb.fractal.juliak.platform;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-
-/**
- * This class contains the implementation of the {@link PlatformItf} 
interface
- * for the Java ME CLDC platform.
- * 
- * @author Lionel Seinturier <Lionel.Seinturier@xxxxxxx>
- */
-public class PlatformJMECLDC implements PlatformItf {
-
-    /**
-     * Set the loader to be used by AOKell for loading classes.
-     * 
-     * @param cl  the loader.
-     *      This parameter must implement ClassLoader. It is declared as an
-     *      Object in order to be compliant with the J2ME version of AOKell.
-     */
-    public void setLoader( Object cl ) {
-        /*
-         * To simplify the writing of the AOKell code which is common to all
-         * features, I have kept a setLoader method even though it can not be
-         * implemented for J2ME.
-         * 
-         * UnsupportedOperationException is not in the CLDC API.
-         */
-        throw new RuntimeException("Unsupported operation with Java ME 
CLDC");
-    }
-
-    /**
-     * Return the loader used by AOKell for loading classes.
-     */
-    public Class loadClass(String name) throws ClassNotFoundException {
-        return Class.forName(name);
-    }
-
-    /**
-     * Load a ressource.
-     */
-    public InputStream getResourceAsStream(String name) {
-        throw new RuntimeException("Unsupported operation with Java ME 
CLDC");
-    }
-
-    /**
-     * Define a new class.
-     */
-    public Class defineClass(String name, byte[] b) {
-        throw new RuntimeException("Unsupported operation with Java ME 
CLDC");
-    }
-
-    
-    // ------------------------------------------------------------------
-    // Filesystem related functions (no filesystem available with the
-    // platform.j2me-cldc feature.)
-    // ------------------------------------------------------------------
-    
-    /**
-     * Utility method to write the bytecode from a class to a file. This 
method
-     * creates the directory structure corresponding to package names.
-     * 
-     * @param dirname    the root directory name
-     * @param classname  the name of the class
-     * @param b          the bytecode
-     */
-    public void dumpClassToFile(
-            String dirname, String classname, byte[] b ) throws IOException {
-        // No filesystem, we can not dump the bytecode into a file.
-        // Simply ignore the command.
-    }
-    
-}
Index: julia/src/org/objectweb/fractal/juliak/platform/PlatformJSE.java
diff -u julia/src/org/objectweb/fractal/juliak/platform/PlatformJSE.java:1.3 
julia/src/org/objectweb/fractal/juliak/platform/PlatformJSE.java:1.4
--- julia/src/org/objectweb/fractal/juliak/platform/PlatformJSE.java:1.3      
  Fri Nov 10 21:06:38 2006
+++ julia/src/org/objectweb/fractal/juliak/platform/PlatformJSE.java    Sat 
Dec 16 21:25:57 2006
@@ -30,7 +30,7 @@
 
 /**
  * This class contains the implementation of the {@link PlatformItf} 
interface
- * for the Java SE and Java ME CDC platforms.
+ * for the Java SE platform.
  * 
  * @author Lionel Seinturier <Lionel.Seinturier@xxxxxxx>
  * @since 2.5
@@ -64,36 +64,31 @@
      * Load a class.
      */
     public Class loadClass(String name) throws ClassNotFoundException {
-        return AOKellClassLoader.get().loadClass(name);
+        return JuliakClassLoader.get().loadClass(name);
     }
     
     /**
      * Load a ressource.
      */
     public InputStream getResourceAsStream( String name ) {
-        return AOKellClassLoader.get().getResourceAsStream(name);
+        return JuliakClassLoader.get().getResourceAsStream(name);
     }
 
     
-    // ------------------------------------------------------------------
-    // AOKell class loader for registering classes generated on the fly.
-    // See for instance {@link 
org.objectweb.fractal.aokell.asm.ASMGeneratorForImplementedInterface}.
-    // ------------------------------------------------------------------
-    
     /**
      * Define a new class.
      */
     public Class defineClass( String name, byte[] b ) {
-        return AOKellClassLoader.get().defineClass(name,b);
+        return JuliakClassLoader.get().defineClass(name,b);
     }
         
     
     /**
-     * AOKell class loader.
+     * Juliak class loader.
      * 
      * @author Lionel Seinturier <Lionel.Seinturier@xxxxxxx>
      */
-    private static class AOKellClassLoader extends ClassLoader {
+    private static class JuliakClassLoader extends ClassLoader {
         
         /*
          * Thread.currentThread().getContextClassLoader() is needed as a 
parent
@@ -104,12 +99,12 @@
          * communication stubs) with the java.rmi.server.codebase property.
          */
 
-        private AOKellClassLoader() {
+        private JuliakClassLoader() {
             super(Thread.currentThread().getContextClassLoader());
         }
         
         /** Return the singleton instance of this class. */
-        public static AOKellClassLoader get() {
+        public static JuliakClassLoader get() {
             if( singleton == null ||
                 singleton.getParent() !=
                     Thread.currentThread().getContextClassLoader() ) {
@@ -119,12 +114,12 @@
                  * fractalrmi uses the java.rmi.server.codebase property.
                  */
                 
-                singleton = new AOKellClassLoader();
+                singleton = new JuliakClassLoader();
             }
             return singleton;
         }
         
-        private static AOKellClassLoader singleton;;
+        private static JuliakClassLoader singleton;;
 
         public Class defineClass(String name, byte[] b) {
             return defineClass(name,b,0,b.length);



<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 2006-2007, OW2 Consortium | contact | webmaster.