Skip to content
Browse files

[SNOWDROP-11]; upgrade Snowdrop to VFS3.

(update Kernel, CL, Deployers transitively)
  • Loading branch information...
1 parent e42fede commit a2d7837a99e3d1a3dcc96e2e9428633c69327aad @alesj alesj committed
View
4 deployers/pom.xml
@@ -69,7 +69,7 @@
<artifactId>jboss-logging-log4j</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.microcontainer</groupId>
+ <groupId>org.jboss.kernel</groupId>
<artifactId>jboss-dependency</artifactId>
</dependency>
<dependency>
@@ -89,7 +89,7 @@
<artifactId>jboss-deployers-core-spi</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.microcontainer</groupId>
+ <groupId>org.jboss.kernel</groupId>
<artifactId>jboss-kernel</artifactId>
</dependency>
<dependency>
View
2 deployers/src/main/java/org/jboss/spring/deployers/SpringParserDeployer.java
@@ -23,7 +23,7 @@
import org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer;
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-import org.jboss.virtual.VirtualFile;
+import org.jboss.vfs.VirtualFile;
/**
* Spring deployer.
View
4 facade/pom.xml
@@ -15,11 +15,11 @@
<dependencies>
<!-- Compile (global dependencies) -->
<dependency>
- <groupId>org.jboss.microcontainer</groupId>
+ <groupId>org.jboss.kernel</groupId>
<artifactId>jboss-dependency</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.microcontainer</groupId>
+ <groupId>org.jboss.kernel</groupId>
<artifactId>jboss-kernel</artifactId>
</dependency>
<dependency>
View
8 facade/src/main/java/org/jboss/spring/facade/ControllerBeanFactory.java
@@ -224,11 +224,15 @@ public Class getType(String name) throws NoSuchBeanDefinitionException
/**
* Get prototype class.
*
- * @param kcc the kernel controller context
+ * @param cc the controller context
* @return prototype's class
*/
- protected Class<?> getPrototypeClass(KernelControllerContext kcc)
+ protected Class<?> getPrototypeClass(ControllerContext cc)
{
+ if (cc instanceof KernelControllerContext == false)
+ return null;
+
+ KernelControllerContext kcc = (KernelControllerContext) cc;
BeanMetaData bmd = kcc.getBeanMetaData();
Set<PropertyMetaData> properties = bmd.getProperties();
for (PropertyMetaData pmd : properties)
View
16 facade/src/main/java/org/jboss/spring/facade/KernelControllerListableBeanFactory.java
@@ -96,20 +96,20 @@ public int getBeanDefinitionCount()
public String[] getBeanNamesForType(Class clazz, boolean includePrototypes, boolean allowEagerInit)
{
List<String> result = new ArrayList<String>();
- Set<KernelControllerContext> contexts = kernelController.getInstantiatedContexts(clazz);
+ Set<ControllerContext> contexts = kernelController.getInstantiatedContexts(clazz);
if (contexts != null && contexts.isEmpty() == false)
{
- for (KernelControllerContext context : contexts)
+ for (ControllerContext context : contexts)
{
result.add(context.getName().toString());
}
}
if (includePrototypes)
{
- Set<KernelControllerContext> factories = kernelController.getInstantiatedContexts(AbstractBeanFactory.class);
+ Set<ControllerContext> factories = kernelController.getInstantiatedContexts(AbstractBeanFactory.class);
if (factories != null && factories.isEmpty() == false)
{
- for (KernelControllerContext kcc : factories)
+ for (ControllerContext kcc : factories)
{
Class<?> prototypeClass = getPrototypeClass(kcc);
if (prototypeClass != null)
@@ -137,18 +137,18 @@ public Map getBeansOfType(Class clazz) throws BeansException
public Map getBeansOfType(Class clazz, boolean includePrototypes, boolean allowEagerInit) throws BeansException
{
Map<String, Object> result = new HashMap<String, Object>();
- Set<KernelControllerContext> contexts = kernelController.getContexts(clazz, ControllerState.INSTALLED);
- for (KernelControllerContext context : contexts)
+ Set<ControllerContext> contexts = kernelController.getContexts(clazz, ControllerState.INSTALLED);
+ for (ControllerContext context : contexts)
{
Object target = context.getTarget();
result.put(context.getName().toString(), target);
}
if (includePrototypes)
{
- Set<KernelControllerContext> factories = kernelController.getInstantiatedContexts(AbstractBeanFactory.class);
+ Set<ControllerContext> factories = kernelController.getInstantiatedContexts(AbstractBeanFactory.class);
if (factories != null && factories.isEmpty() == false)
{
- for (KernelControllerContext kcc : factories)
+ for (ControllerContext kcc : factories)
{
Class<?> prototypeClass = getPrototypeClass(kcc);
if (prototypeClass != null)
View
42 pom.xml
@@ -30,16 +30,16 @@
</modules>
<properties>
- <version.jboss.vfs>2.1.3.SP1</version.jboss.vfs>
+ <version.jboss.vfs>3.0.0.CR1</version.jboss.vfs>
<version.jboss.man>2.1.0.GA</version.jboss.man>
- <version.jboss.mdr>2.0.2.GA</version.jboss.mdr>
- <version.jboss.microcontainer>2.0.9.GA</version.jboss.microcontainer>
- <version.jboss.classloader>2.0.7.CR2</version.jboss.classloader>
- <version.jboss.deployers>2.0.8.SP1</version.jboss.deployers>
- <version.jboss.common.core>2.2.16.GA</version.jboss.common.core>
- <version.jboss.common.logging.spi>2.0.5.GA</version.jboss.common.logging.spi>
- <version.jboss.common.logging.log4j>2.0.5.GA</version.jboss.common.logging.log4j>
- <version.jbossxb>2.0.1.GA</version.jbossxb>
+ <version.jboss.mdr>2.2.0.Alpha1</version.jboss.mdr>
+ <version.jboss.kernel>2.2.0.Alpha6</version.jboss.kernel>
+ <version.jboss.classloader>2.2.0.Alpha3</version.jboss.classloader>
+ <version.jboss.deployers>2.2.0.Alpha2</version.jboss.deployers>
+ <version.jboss.common.core>2.2.17.GA</version.jboss.common.core>
+ <version.jboss.common.logging.spi>2.1.0.GA</version.jboss.common.logging.spi>
+ <version.jboss.common.logging.log4j>2.1.0.GA</version.jboss.common.logging.log4j>
+ <version.jbossxb>2.0.2.Beta4</version.jbossxb>
<version.jboss.aop>2.0.1.GA</version.jboss.aop>
<version.jboss.pojocache>3.0.0.GA</version.jboss.pojocache>
<version.org.jboss.test>1.0.5.GA</version.org.jboss.test>
@@ -188,33 +188,33 @@
<dependency>
- <groupId>org.jboss.microcontainer</groupId>
+ <groupId>org.jboss.kernel</groupId>
<artifactId>jboss-dependency</artifactId>
- <version>${version.jboss.microcontainer}</version>
+ <version>${version.jboss.kernel}</version>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.jboss.microcontainer</groupId>
+ <groupId>org.jboss.kernel</groupId>
<artifactId>jboss-kernel</artifactId>
- <version>${version.jboss.microcontainer}</version>
+ <version>${version.jboss.kernel}</version>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.jboss.microcontainer</groupId>
+ <groupId>org.jboss.kernel</groupId>
<artifactId>jboss-aop-mc-int</artifactId>
- <version>${version.jboss.microcontainer}</version>
+ <version>${version.jboss.kernel}</version>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>snowdrop</artifactId>
- <version>${version.jboss.microcontainer}</version>
+ <groupId>org.jboss.kernel</groupId>
+ <artifactId>jboss-spring-int</artifactId>
+ <version>${version.jboss.kernel}</version>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.jboss.microcontainer</groupId>
+ <groupId>org.jboss.kernel</groupId>
<artifactId>jboss-guice-int</artifactId>
- <version>${version.jboss.microcontainer}</version>
+ <version>${version.jboss.kernel}</version>
<scope>provided</scope>
</dependency>
<dependency>
@@ -474,4 +474,4 @@
</repository>
</distributionManagement>
-</project>
+</project>
View
84 vfs/src/main/java/org/jboss/spring/vfs/VFSResource.java
@@ -28,9 +28,9 @@
import java.io.File;
import java.io.InputStream;
-import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.VFSUtils;
-import org.jboss.virtual.VFS;
+import org.jboss.vfs.VirtualFile;
+import org.jboss.vfs.VFSUtils;
+import org.jboss.vfs.VFS;
import org.springframework.core.io.Resource;
import org.springframework.core.io.AbstractResource;
@@ -56,9 +56,9 @@ public VFSResource(URL url)
throw new IllegalArgumentException("Null url");
try
{
- this.file = VFS.getRoot(url);
+ this.file = VFS.getChild(url);
}
- catch (IOException e)
+ catch (Exception e)
{
throw new IllegalArgumentException("Cannot retrieve file from URL: ", e);
}
@@ -66,14 +66,7 @@ public VFSResource(URL url)
public boolean exists()
{
- try
- {
- return file.exists();
- }
- catch (IOException e)
- {
- throw new RuntimeException(e);
- }
+ return file.exists();
}
public boolean isOpen()
@@ -83,40 +76,17 @@ public boolean isOpen()
public boolean isReadable()
{
- try
- {
- return file.getSize() > 0;
- }
- catch (IOException e)
- {
- throw new RuntimeException(e);
- }
+ return file.getSize() > 0;
}
public long lastModified()
{
- try
- {
- return file.getLastModified();
- }
- catch (IOException e)
- {
- throw new RuntimeException(e);
- }
+ return file.getLastModified();
}
public URL getURL() throws IOException
{
- try
- {
- return file.toURL();
- }
- catch (URISyntaxException e)
- {
- IOException ioe = new IOException(e.getMessage());
- ioe.initCause(e);
- throw ioe;
- }
+ return file.toURL();
}
public URI getURI() throws IOException
@@ -135,23 +105,7 @@ public URI getURI() throws IOException
public File getFile() throws IOException
{
- if (VFSUtils.isNestedFile(file))
- throw new IOException("This resource is a nested resource: " + file);
-
- try
- {
- return new File(VFSUtils.getCompatibleURI(file));
- }
- catch (IOException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- IOException ioe = new IOException(e.getMessage());
- ioe.initCause(e);
- throw ioe;
- }
+ return file.getPhysicalFile();
}
@SuppressWarnings("deprecation")
@@ -159,9 +113,9 @@ public Resource createRelative(String relativePath) throws IOException
{
//VirtualFile.findChild will not scan the parent or current directory
if (relativePath.startsWith("."))
- return new VFSResource(VFS.getRoot(new URL(getURL(), relativePath)));
+ return new VFSResource(getChild(new URL(getURL(), relativePath)));
else
- return new VFSResource(file.findChild(relativePath));
+ return new VFSResource(file.getChild(relativePath));
}
public String getFilename()
@@ -202,4 +156,18 @@ public int hashCode()
{
return file.hashCode();
}
+
+ static VirtualFile getChild(URL url) throws IOException
+ {
+ try
+ {
+ return VFS.getChild(url);
+ }
+ catch (URISyntaxException e)
+ {
+ IOException ioe = new IOException(e.getMessage());
+ ioe.initCause(e);
+ throw ioe;
+ }
+ }
}
View
10 vfs/src/main/java/org/jboss/spring/vfs/VFSResourcePatternResolvingHelper.java
@@ -26,10 +26,10 @@
import java.util.*;
import org.jboss.logging.Logger;
-import org.jboss.virtual.VFS;
-import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.VirtualFileVisitor;
-import org.jboss.virtual.VisitorAttributes;
+import org.jboss.vfs.VFS;
+import org.jboss.vfs.VirtualFile;
+import org.jboss.vfs.VirtualFileVisitor;
+import org.jboss.vfs.VisitorAttributes;
import org.springframework.core.io.Resource;
import org.springframework.util.PathMatcher;
@@ -80,7 +80,7 @@
public static Set<Resource> getVFSResources(URL rootURL, String subPattern, PathMatcher pathMatcher) throws IOException
{
log.debug("Scanning url: " + rootURL + ", sub-pattern: " + subPattern);
- VirtualFile root = VFS.getRoot(rootURL);
+ VirtualFile root = VFSResource.getChild(rootURL);
PatternVirtualFileVisitor visitor = new PatternVirtualFileVisitor(root.getPathName(), subPattern, pathMatcher);
root.visit(visitor);
if (log.isTraceEnabled())
View
8 vfs/src/main/java/org/jboss/spring/vfs/VFSServletContextResourcePatternResolver.java
@@ -24,8 +24,8 @@
import java.io.IOException;
import java.net.URL;
-import org.jboss.virtual.VFS;
-import org.jboss.virtual.VirtualFile;
+import org.jboss.vfs.VFS;
+import org.jboss.vfs.VirtualFile;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
import org.springframework.web.context.support.ServletContextResourcePatternResolver;
@@ -66,10 +66,10 @@ protected Resource convertClassLoaderURL(URL url)
{
try
{
- VirtualFile file = VFS.getRoot(url);
+ VirtualFile file = VFS.getChild(url);
return new VFSResource(file);
}
- catch (IOException e)
+ catch (Exception e)
{
throw new RuntimeException(e);
}

0 comments on commit a2d7837

Please sign in to comment.
Something went wrong with that request. Please try again.