struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject svn commit: r1364073 - in /struts/struts2/trunk/plugins/osgi/src/main/java/org/apache/struts2/osgi: BundlePackageLoader.java OsgiConfigurationProvider.java PackageLoader.java
Date Sat, 21 Jul 2012 12:36:57 GMT
Author: lukaszlenart
Date: Sat Jul 21 12:36:57 2012
New Revision: 1364073

URL: http://svn.apache.org/viewvc?rev=1364073&view=rev
Log:
WW-3851 adds FileManager dependency

Modified:
    struts/struts2/trunk/plugins/osgi/src/main/java/org/apache/struts2/osgi/BundlePackageLoader.java
    struts/struts2/trunk/plugins/osgi/src/main/java/org/apache/struts2/osgi/OsgiConfigurationProvider.java
    struts/struts2/trunk/plugins/osgi/src/main/java/org/apache/struts2/osgi/PackageLoader.java

Modified: struts/struts2/trunk/plugins/osgi/src/main/java/org/apache/struts2/osgi/BundlePackageLoader.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/osgi/src/main/java/org/apache/struts2/osgi/BundlePackageLoader.java?rev=1364073&r1=1364072&r2=1364073&view=diff
==============================================================================
--- struts/struts2/trunk/plugins/osgi/src/main/java/org/apache/struts2/osgi/BundlePackageLoader.java
(original)
+++ struts/struts2/trunk/plugins/osgi/src/main/java/org/apache/struts2/osgi/BundlePackageLoader.java
Sat Jul 21 12:36:57 2012
@@ -21,33 +21,35 @@
 
 package org.apache.struts2.osgi;
 
-import java.io.IOException;
-import java.net.URL;
-import java.util.*;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-
+import com.opensymphony.xwork2.FileManager;
 import com.opensymphony.xwork2.ObjectFactory;
-import com.opensymphony.xwork2.ActionContext;
-import com.opensymphony.xwork2.inject.Inject;
 import com.opensymphony.xwork2.config.Configuration;
 import com.opensymphony.xwork2.config.ConfigurationException;
-import com.opensymphony.xwork2.config.PackageProvider;
 import com.opensymphony.xwork2.config.entities.PackageConfig;
 import com.opensymphony.xwork2.config.impl.DefaultConfiguration;
 import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
-import com.opensymphony.xwork2.util.location.Location;
 import com.opensymphony.xwork2.util.logging.Logger;
 import com.opensymphony.xwork2.util.logging.LoggerFactory;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
 
 /**
  * Package loader implementation that loads resources from a bundle
  */
 public class BundlePackageLoader implements PackageLoader {
+
     private static final Logger LOG = LoggerFactory.getLogger(BundlePackageLoader.class);
 
-    public List<PackageConfig> loadPackages(Bundle bundle, BundleContext bundleContext,
ObjectFactory objectFactory, Map<String, PackageConfig> pkgConfigs) throws ConfigurationException
{
+    public List<PackageConfig> loadPackages(Bundle bundle, BundleContext bundleContext,
ObjectFactory objectFactory,
+                                            FileManager fileManager, Map<String, PackageConfig>
pkgConfigs) throws ConfigurationException {
         Configuration config = new DefaultConfiguration("struts.xml");
         BundleConfigurationProvider prov = new BundleConfigurationProvider("struts.xml",
bundle, bundleContext);
         for (PackageConfig pkg : pkgConfigs.values()) {

Modified: struts/struts2/trunk/plugins/osgi/src/main/java/org/apache/struts2/osgi/OsgiConfigurationProvider.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/osgi/src/main/java/org/apache/struts2/osgi/OsgiConfigurationProvider.java?rev=1364073&r1=1364072&r2=1364073&view=diff
==============================================================================
--- struts/struts2/trunk/plugins/osgi/src/main/java/org/apache/struts2/osgi/OsgiConfigurationProvider.java
(original)
+++ struts/struts2/trunk/plugins/osgi/src/main/java/org/apache/struts2/osgi/OsgiConfigurationProvider.java
Sat Jul 21 12:36:57 2012
@@ -22,6 +22,8 @@
 package org.apache.struts2.osgi;
 
 import com.opensymphony.xwork2.ActionContext;
+import com.opensymphony.xwork2.FileManager;
+import com.opensymphony.xwork2.FileManagerFactory;
 import com.opensymphony.xwork2.ObjectFactory;
 import com.opensymphony.xwork2.config.Configuration;
 import com.opensymphony.xwork2.config.ConfigurationException;
@@ -54,6 +56,7 @@ public class OsgiConfigurationProvider i
 
     private Configuration configuration;
     private ObjectFactory objectFactory;
+    private FileManager fileManager;
 
     private OsgiHost osgiHost;
     private BundleContext bundleContext;
@@ -130,7 +133,7 @@ public class OsgiConfigurationProvider i
 
             //XML config
             PackageLoader loader = new BundlePackageLoader();
-            for (PackageConfig pkg : loader.loadPackages(bundle, bundleContext, objectFactory,
configuration.getPackageConfigs())) {
+            for (PackageConfig pkg : loader.loadPackages(bundle, bundleContext, objectFactory,
fileManager, configuration.getPackageConfigs())) {
                 configuration.addPackageConfig(pkg.getName(), pkg);
                 bundleAccessor.addPackageFromBundle(bundle, pkg.getName());
             }
@@ -202,6 +205,10 @@ public class OsgiConfigurationProvider i
         this.servletContext = servletContext;
     }
 
+    public void setFileManagerFactory(FileManagerFactory fmFactory) {
+        this.fileManager = fmFactory.getFileManager();
+    }
+
     public void destroy() {
         try {
             osgiHost.destroy();

Modified: struts/struts2/trunk/plugins/osgi/src/main/java/org/apache/struts2/osgi/PackageLoader.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/osgi/src/main/java/org/apache/struts2/osgi/PackageLoader.java?rev=1364073&r1=1364072&r2=1364073&view=diff
==============================================================================
--- struts/struts2/trunk/plugins/osgi/src/main/java/org/apache/struts2/osgi/PackageLoader.java
(original)
+++ struts/struts2/trunk/plugins/osgi/src/main/java/org/apache/struts2/osgi/PackageLoader.java
Sat Jul 21 12:36:57 2012
@@ -21,20 +21,22 @@
 
 package org.apache.struts2.osgi;
 
-import java.util.List;
-import java.util.Map;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-
+import com.opensymphony.xwork2.FileManager;
 import com.opensymphony.xwork2.ObjectFactory;
 import com.opensymphony.xwork2.config.ConfigurationException;
-import com.opensymphony.xwork2.config.PackageProvider;
 import com.opensymphony.xwork2.config.entities.PackageConfig;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+
+import java.util.List;
+import java.util.Map;
 
 /**
  * Implementations of this interface can load packages from a Bundle
  */
 public interface PackageLoader {
-    List<PackageConfig> loadPackages(Bundle bundle, BundleContext bundleContext, ObjectFactory
objectFactory, Map<String, PackageConfig> map) throws ConfigurationException;
+
+    List<PackageConfig> loadPackages(Bundle bundle, BundleContext bundleContext, ObjectFactory
objectFactory, FileManager fileManager,
+                                     Map<String, PackageConfig> map) throws ConfigurationException;
+
 }



Mime
View raw message