You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2012/03/08 16:53:32 UTC

svn commit: r1298443 - in /myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/adapters: ImplementationSPI.java MyFacesSPI.java

Author: werpu
Date: Thu Mar  8 15:53:32 2012
New Revision: 1298443

URL: http://svn.apache.org/viewvc?rev=1298443&view=rev
Log:
EXTSCRIPT-154: Code Rewrite/Refactoring, loading classes now works

Added:
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/adapters/ImplementationSPI.java
Modified:
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/adapters/MyFacesSPI.java

Added: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/adapters/ImplementationSPI.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/adapters/ImplementationSPI.java?rev=1298443&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/adapters/ImplementationSPI.java (added)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/adapters/ImplementationSPI.java Thu Mar  8 15:53:32 2012
@@ -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 rewrite.org.apache.myfaces.extensions.scripting.jsf.adapters;
+
+import javax.servlet.ServletContext;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ * SPI Interface which ever implementation
+ * connector has to implement
+ * This spi is mirrored into the WeavingContext
+ */
+public interface ImplementationSPI
+{
+    public void registerClassloadingExtension(ServletContext context);
+    public Class forName(String clazz);
+
+}

Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/adapters/MyFacesSPI.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/adapters/MyFacesSPI.java?rev=1298443&r1=1298442&r2=1298443&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/adapters/MyFacesSPI.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/rewrite/org/apache/myfaces/extensions/scripting/jsf/adapters/MyFacesSPI.java Thu Mar  8 15:53:32 2012
@@ -30,17 +30,23 @@ import javax.servlet.ServletContext;
  *
  * SPI for various myfaces related tasks
  */
-public class MyFacesSPI
+public class MyFacesSPI implements ImplementationSPI
 {
-
+    CustomChainLoader _loader = null;
+    
     public void registerClassloadingExtension(ServletContext context) {
-        Object loader = new CustomChainLoader(context); //ReflectUtil.instantiate("extras.org.apache.myfaces.extensions
+        CustomChainLoader loader = new CustomChainLoader(context); //ReflectUtil.instantiate("extras.org.apache.myfaces.extensions
         // .scripting.servlet" +
                 //".CustomChainLoader",
                 //new Cast(ServletContext.class, context));
         ClassUtils.addClassLoadingExtension(loader, true);
+        _loader = loader;
     }
 
+    public Class forName(String clazz) {
+        return _loader.forName(clazz);
+    }
+    
 
     private static MyFacesSPI ourInstance = new MyFacesSPI();