[jboss-svn-commits] JBoss Common SVN: r3965 - in shrinkwrap/trunk/extension-glassfish/src: main/java/com/jboss/shrinkwrap and 14 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sat Jan 30 02:07:30 EST 2010


Author: ALRubinger
Date: 2010-01-30 02:07:29 -0500 (Sat, 30 Jan 2010)
New Revision: 3965

Added:
   shrinkwrap/trunk/extension-glassfish/src/main/java/org/
   shrinkwrap/trunk/extension-glassfish/src/main/java/org/jboss/
   shrinkwrap/trunk/extension-glassfish/src/main/java/org/jboss/shrinkwrap/
   shrinkwrap/trunk/extension-glassfish/src/main/java/org/jboss/shrinkwrap/glassfish/
   shrinkwrap/trunk/extension-glassfish/src/main/java/org/jboss/shrinkwrap/glassfish/api/
   shrinkwrap/trunk/extension-glassfish/src/main/java/org/jboss/shrinkwrap/glassfish/api/ShrinkwrapReadableArchive.java
   shrinkwrap/trunk/extension-glassfish/src/main/java/org/jboss/shrinkwrap/glassfish/impl/
   shrinkwrap/trunk/extension-glassfish/src/main/java/org/jboss/shrinkwrap/glassfish/impl/ShrinkwrapReadableArchiveImpl.java
   shrinkwrap/trunk/extension-glassfish/src/main/resources/META-INF/services/org.jboss.shrinkwrap.glassfish.api.ShrinkwrapReadableArchive
   shrinkwrap/trunk/extension-glassfish/src/test/java/org/
   shrinkwrap/trunk/extension-glassfish/src/test/java/org/jboss/
   shrinkwrap/trunk/extension-glassfish/src/test/java/org/jboss/shrinkwrap/
   shrinkwrap/trunk/extension-glassfish/src/test/java/org/jboss/shrinkwrap/glassfish/
   shrinkwrap/trunk/extension-glassfish/src/test/java/org/jboss/shrinkwrap/glassfish/ejb/
   shrinkwrap/trunk/extension-glassfish/src/test/java/org/jboss/shrinkwrap/glassfish/ejb/EchoBean.java
   shrinkwrap/trunk/extension-glassfish/src/test/java/org/jboss/shrinkwrap/glassfish/ejb/EchoLocalBusiness.java
Removed:
   shrinkwrap/trunk/extension-glassfish/src/main/java/com/jboss/shrinkwrap/glassfish/
   shrinkwrap/trunk/extension-glassfish/src/main/java/org/jboss/shrinkwrap/glassfish/ShrinkwrapReadableArchive.java
   shrinkwrap/trunk/extension-glassfish/src/main/java/org/jboss/shrinkwrap/glassfish/ShrinkwrapReadableArchiveImpl.java
   shrinkwrap/trunk/extension-glassfish/src/main/resources/META-INF/services/com.jboss.shrinkwrap.glassfish.ShrinkwrapReadableArchive
   shrinkwrap/trunk/extension-glassfish/src/test/java/com/jboss/shrinkwrap/glassfish/
   shrinkwrap/trunk/extension-glassfish/src/test/java/org/jboss/shrinkwrap/glassfish/EchoBean.java
   shrinkwrap/trunk/extension-glassfish/src/test/java/org/jboss/shrinkwrap/glassfish/EchoLocalBusiness.java
Modified:
   shrinkwrap/trunk/extension-glassfish/src/test/java/org/jboss/shrinkwrap/glassfish/GlassFishDeploymentUnitTestCase.java
   shrinkwrap/trunk/extension-glassfish/src/test/java/org/jboss/shrinkwrap/glassfish/ShrinkwrapReadableArchiveUnitTestCase.java
Log:
[SHRINKWRAP-124] Change package namespace to "org.jboss.shrinkwrap.glassfish" for extension-glassfish

Copied: shrinkwrap/trunk/extension-glassfish/src/main/java/org/jboss/shrinkwrap/glassfish (from rev 3964, shrinkwrap/trunk/extension-glassfish/src/main/java/com/jboss/shrinkwrap/glassfish)

Deleted: shrinkwrap/trunk/extension-glassfish/src/main/java/org/jboss/shrinkwrap/glassfish/ShrinkwrapReadableArchive.java
===================================================================
--- shrinkwrap/trunk/extension-glassfish/src/main/java/com/jboss/shrinkwrap/glassfish/ShrinkwrapReadableArchive.java	2010-01-30 06:49:10 UTC (rev 3964)
+++ shrinkwrap/trunk/extension-glassfish/src/main/java/org/jboss/shrinkwrap/glassfish/ShrinkwrapReadableArchive.java	2010-01-30 07:07:29 UTC (rev 3965)
@@ -1,31 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed 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 com.jboss.shrinkwrap.glassfish;
-
-import org.glassfish.api.deployment.archive.ReadableArchive;
-import org.jboss.shrinkwrap.api.Assignable;
-
-/**
- * ShrinkWrap extension to support GlassFishs ReadableArchive.
- *
- * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
- * @version $Revision: $
- */
-public interface ShrinkwrapReadableArchive extends ReadableArchive, Assignable
-{
-
-}

Deleted: shrinkwrap/trunk/extension-glassfish/src/main/java/org/jboss/shrinkwrap/glassfish/ShrinkwrapReadableArchiveImpl.java
===================================================================
--- shrinkwrap/trunk/extension-glassfish/src/main/java/com/jboss/shrinkwrap/glassfish/ShrinkwrapReadableArchiveImpl.java	2010-01-30 06:49:10 UTC (rev 3964)
+++ shrinkwrap/trunk/extension-glassfish/src/main/java/org/jboss/shrinkwrap/glassfish/ShrinkwrapReadableArchiveImpl.java	2010-01-30 07:07:29 UTC (rev 3965)
@@ -1,310 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed 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 com.jboss.shrinkwrap.glassfish;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.jar.Manifest;
-
-import org.glassfish.api.deployment.archive.ReadableArchive;
-import org.jboss.shrinkwrap.api.Archive;
-import org.jboss.shrinkwrap.api.ArchivePath;
-import org.jboss.shrinkwrap.api.ArchivePaths;
-import org.jboss.shrinkwrap.api.Asset;
-import org.jboss.shrinkwrap.impl.base.AssignableBase;
-import org.jboss.shrinkwrap.impl.base.Validate;
-import org.jboss.shrinkwrap.impl.base.asset.ArchiveAsset;
-import org.jboss.shrinkwrap.impl.base.asset.DirectoryAsset;
-import org.jboss.shrinkwrap.impl.base.io.IOUtil;
-
-/**
- * ShrinkWrap extension to support GlassFishs {@link ReadableArchive}
- * backed by an {@link Archive}
- *
- * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
- * @version $Revision: $
- */
-public class ShrinkwrapReadableArchiveImpl extends AssignableBase implements ShrinkwrapReadableArchive
-{
-   private final Archive<?> archive;
-
-   /**
-    * @param archive
-    */
-   public ShrinkwrapReadableArchiveImpl(final Archive<?> archive)
-   {
-      Validate.notNull(archive, "Archive must be specified");
-      this.archive = archive;
-   }
-
-   /**
-    * {@inheritDoc}
-    * @see org.jboss.shrinkwrap.impl.base.AssignableBase#getArchive()
-    */
-   @Override
-   protected Archive<?> getArchive()
-   {
-      return archive;
-   }
-
-   /**
-    * A ShrinkWrap archive can not be deleted. 
-    * 
-    * @return This always returns false.
-    */
-   @Override
-   public boolean delete()
-   {
-      return false;
-   }
-
-   /**
-    * A ShrinkWrap archive can never not-exist. 
-    * 
-    * @return This always returns true.
-    */
-   @Override
-   public boolean exists()
-   {
-      return true;
-   }
-
-   /**
-    * {@inheritDoc}
-    * @see org.glassfish.api.deployment.archive.ReadableArchive#exists(java.lang.String)
-    */
-   @Override
-   public boolean exists(String path) throws IOException
-   {
-      return archive.contains(ArchivePaths.create(path));
-   }
-
-   /**
-    * {@inheritDoc}
-    * @see org.glassfish.api.deployment.archive.ReadableArchive#getEntry(java.lang.String)
-    */
-   @Override
-   public InputStream getEntry(String path) throws IOException
-   {
-      return archive.get(ArchivePaths.create(path)).openStream();
-   }
-
-   /**
-    * {@inheritDoc}
-    * @see org.glassfish.api.deployment.archive.ReadableArchive#getEntrySize(java.lang.String)
-    */
-   // TODO: ShrinkWrap have not know the size of a Asset. Hacking figure it out runtime. 
-   // Needed by GlassFish for buff sizes.
-   @Override
-   public long getEntrySize(String path)
-   {
-      Asset asset = archive.get(ArchivePaths.create(path));
-      ByteArrayOutputStream output = new ByteArrayOutputStream();
-      try
-      {
-         IOUtil.copyWithClose(asset.openStream(), output);
-         return output.toByteArray().length;
-      }
-      catch (IOException e)
-      {
-         throw new RuntimeException(e);
-      }
-   }
-
-   /**
-    * ShrinkWrap does not have a bi-directional relationship between parent-child. 
-    * 
-    * @return This always return null.
-    */
-   @Override
-   public ReadableArchive getParentArchive()
-   {
-      return null;
-   }
-
-   /**
-    * ShrinkWrap does not have a bi-directional relationship between parent-child.
-    * 
-    *  This does nothing.
-    */
-   @Override
-   public void setParentArchive(ReadableArchive arg0)
-   {
-   }
-
-   /**
-    * {@inheritDoc}
-    * @see org.glassfish.api.deployment.archive.ReadableArchive#getSubArchive(java.lang.String)
-    */
-   // TODO: We should support non ShrinkWrap nested Archives as well. ie: external jar files.
-   @Override
-   public ReadableArchive getSubArchive(String path) throws IOException
-   {
-      Asset archiveAsset = archive.get(ArchivePaths.create(path));
-      if (archiveAsset instanceof ArchiveAsset)
-      {
-         return ((ArchiveAsset) archiveAsset).getArchive().as(ShrinkwrapReadableArchive.class);
-      }
-      throw new IOException(path + " not a Archive");
-   }
-
-   /* (non-Javadoc)
-    * @see org.glassfish.api.deployment.archive.ReadableArchive#open(java.net.URI)
-    */
-   @Override
-   public void open(URI arg0) throws IOException
-   {
-   }
-
-   /**
-    * A ShrinkWrap archive can not be renamed. 
-    * 
-    * @return This always return false.
-    */
-   @Override
-   public boolean renameTo(String arg0)
-   {
-      return false;
-   }
-
-   /* (non-Javadoc)
-    * @see org.glassfish.api.deployment.archive.Archive#close()
-    */
-   @Override
-   public void close() throws IOException
-   {
-   }
-
-   /* (non-Javadoc)
-    * @see org.glassfish.api.deployment.archive.Archive#entries()
-    */
-   @Override
-   public Enumeration<String> entries()
-   {
-      List<String> entries = new ArrayList<String>();
-
-      for (Entry<ArchivePath, Asset> entry : archive.getContent().entrySet())
-      {
-         entries.add(entry.getKey().get());
-      }
-      return Collections.enumeration(entries);
-   }
-
-   /* (non-Javadoc)
-    * @see org.glassfish.api.deployment.archive.Archive#entries(java.lang.String)
-    */
-   @Override
-   public Enumeration<String> entries(String path)
-   {
-      List<String> entries = new ArrayList<String>();
-
-      for (Entry<ArchivePath, Asset> entry : archive.getContent().entrySet())
-      {
-         if (entry.getKey().get().startsWith(path))
-         {
-            entries.add(entry.getKey().get());
-         }
-      }
-      return Collections.enumeration(entries);
-   }
-
-   /**
-    * ShrinkWrap does not track Asset sizes.
-    * 
-    * @return This always return -1
-    */
-   @Override
-   public long getArchiveSize() throws SecurityException
-   {
-      return -1;
-   }
-
-   /* (non-Javadoc)
-    * @see org.glassfish.api.deployment.archive.Archive#getDirectories()
-    */
-   @Override
-   public Collection<String> getDirectories() throws IOException
-   {
-      List<String> entries = new ArrayList<String>();
-
-      for (Entry<ArchivePath, Asset> entry : archive.getContent().entrySet())
-      {
-         if (entry.getValue() == DirectoryAsset.INSTANCE)
-         {
-            entries.add(entry.getKey().get());
-         }
-      }
-      return entries;
-   }
-
-   /* (non-Javadoc)
-    * @see org.glassfish.api.deployment.archive.Archive#getManifest()
-    */
-   @Override
-   public Manifest getManifest() throws IOException
-   {
-      ArchivePath manifestPath = ArchivePaths.create("META-INF/MANIFEST.MF");
-      if (archive.contains(manifestPath))
-      {
-         return new Manifest(archive.get(manifestPath).openStream());
-      }
-      return null;
-   }
-
-   /* (non-Javadoc)
-    * @see org.glassfish.api.deployment.archive.Archive#getName()
-    */
-   @Override
-   public String getName()
-   {
-      return archive.getName();
-   }
-
-   /* (non-Javadoc)
-    * @see org.glassfish.api.deployment.archive.Archive#getURI()
-    */
-   @Override
-   public URI getURI()
-   {
-      try
-      {
-         return new URI("archive://" + archive.getName());
-      }
-      catch (URISyntaxException e)
-      {
-         throw new RuntimeException(e);
-      }
-   }
-
-   /* (non-Javadoc)
-    * @see org.glassfish.api.deployment.archive.Archive#isDirectory(java.lang.String)
-    */
-   @Override
-   public boolean isDirectory(String path)
-   {
-      return archive.get(ArchivePaths.create(path)) == DirectoryAsset.INSTANCE;
-   }
-}
\ No newline at end of file

Added: shrinkwrap/trunk/extension-glassfish/src/main/java/org/jboss/shrinkwrap/glassfish/api/ShrinkwrapReadableArchive.java
===================================================================
--- shrinkwrap/trunk/extension-glassfish/src/main/java/org/jboss/shrinkwrap/glassfish/api/ShrinkwrapReadableArchive.java	                        (rev 0)
+++ shrinkwrap/trunk/extension-glassfish/src/main/java/org/jboss/shrinkwrap/glassfish/api/ShrinkwrapReadableArchive.java	2010-01-30 07:07:29 UTC (rev 3965)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.shrinkwrap.glassfish.api;
+
+import org.glassfish.api.deployment.archive.ReadableArchive;
+import org.jboss.shrinkwrap.api.Assignable;
+
+/**
+ * ShrinkWrap extension to support GlassFishs ReadableArchive.
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public interface ShrinkwrapReadableArchive extends ReadableArchive, Assignable
+{
+
+}

Added: shrinkwrap/trunk/extension-glassfish/src/main/java/org/jboss/shrinkwrap/glassfish/impl/ShrinkwrapReadableArchiveImpl.java
===================================================================
--- shrinkwrap/trunk/extension-glassfish/src/main/java/org/jboss/shrinkwrap/glassfish/impl/ShrinkwrapReadableArchiveImpl.java	                        (rev 0)
+++ shrinkwrap/trunk/extension-glassfish/src/main/java/org/jboss/shrinkwrap/glassfish/impl/ShrinkwrapReadableArchiveImpl.java	2010-01-30 07:07:29 UTC (rev 3965)
@@ -0,0 +1,311 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.shrinkwrap.glassfish.impl;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Map.Entry;
+import java.util.jar.Manifest;
+
+import org.glassfish.api.deployment.archive.ReadableArchive;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.ArchivePath;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.glassfish.api.ShrinkwrapReadableArchive;
+import org.jboss.shrinkwrap.impl.base.AssignableBase;
+import org.jboss.shrinkwrap.impl.base.Validate;
+import org.jboss.shrinkwrap.impl.base.asset.ArchiveAsset;
+import org.jboss.shrinkwrap.impl.base.asset.DirectoryAsset;
+import org.jboss.shrinkwrap.impl.base.io.IOUtil;
+
+/**
+ * ShrinkWrap extension to support GlassFishs {@link ReadableArchive}
+ * backed by an {@link Archive}
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class ShrinkwrapReadableArchiveImpl extends AssignableBase implements ShrinkwrapReadableArchive
+{
+   private final Archive<?> archive;
+
+   /**
+    * @param archive
+    */
+   public ShrinkwrapReadableArchiveImpl(final Archive<?> archive)
+   {
+      Validate.notNull(archive, "Archive must be specified");
+      this.archive = archive;
+   }
+
+   /**
+    * {@inheritDoc}
+    * @see org.jboss.shrinkwrap.impl.base.AssignableBase#getArchive()
+    */
+   @Override
+   protected Archive<?> getArchive()
+   {
+      return archive;
+   }
+
+   /**
+    * A ShrinkWrap archive can not be deleted. 
+    * 
+    * @return This always returns false.
+    */
+   @Override
+   public boolean delete()
+   {
+      return false;
+   }
+
+   /**
+    * A ShrinkWrap archive can never not-exist. 
+    * 
+    * @return This always returns true.
+    */
+   @Override
+   public boolean exists()
+   {
+      return true;
+   }
+
+   /**
+    * {@inheritDoc}
+    * @see org.glassfish.api.deployment.archive.ReadableArchive#exists(java.lang.String)
+    */
+   @Override
+   public boolean exists(String path) throws IOException
+   {
+      return archive.contains(ArchivePaths.create(path));
+   }
+
+   /**
+    * {@inheritDoc}
+    * @see org.glassfish.api.deployment.archive.ReadableArchive#getEntry(java.lang.String)
+    */
+   @Override
+   public InputStream getEntry(String path) throws IOException
+   {
+      return archive.get(ArchivePaths.create(path)).openStream();
+   }
+
+   /**
+    * {@inheritDoc}
+    * @see org.glassfish.api.deployment.archive.ReadableArchive#getEntrySize(java.lang.String)
+    */
+   // TODO: ShrinkWrap have not know the size of a Asset. Hacking figure it out runtime. 
+   // Needed by GlassFish for buff sizes.
+   @Override
+   public long getEntrySize(String path)
+   {
+      Asset asset = archive.get(ArchivePaths.create(path));
+      ByteArrayOutputStream output = new ByteArrayOutputStream();
+      try
+      {
+         IOUtil.copyWithClose(asset.openStream(), output);
+         return output.toByteArray().length;
+      }
+      catch (IOException e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+
+   /**
+    * ShrinkWrap does not have a bi-directional relationship between parent-child. 
+    * 
+    * @return This always return null.
+    */
+   @Override
+   public ReadableArchive getParentArchive()
+   {
+      return null;
+   }
+
+   /**
+    * ShrinkWrap does not have a bi-directional relationship between parent-child.
+    * 
+    *  This does nothing.
+    */
+   @Override
+   public void setParentArchive(ReadableArchive arg0)
+   {
+   }
+
+   /**
+    * {@inheritDoc}
+    * @see org.glassfish.api.deployment.archive.ReadableArchive#getSubArchive(java.lang.String)
+    */
+   // TODO: We should support non ShrinkWrap nested Archives as well. ie: external jar files.
+   @Override
+   public ReadableArchive getSubArchive(String path) throws IOException
+   {
+      Asset archiveAsset = archive.get(ArchivePaths.create(path));
+      if (archiveAsset instanceof ArchiveAsset)
+      {
+         return ((ArchiveAsset) archiveAsset).getArchive().as(ShrinkwrapReadableArchive.class);
+      }
+      throw new IOException(path + " not a Archive");
+   }
+
+   /* (non-Javadoc)
+    * @see org.glassfish.api.deployment.archive.ReadableArchive#open(java.net.URI)
+    */
+   @Override
+   public void open(URI arg0) throws IOException
+   {
+   }
+
+   /**
+    * A ShrinkWrap archive can not be renamed. 
+    * 
+    * @return This always return false.
+    */
+   @Override
+   public boolean renameTo(String arg0)
+   {
+      return false;
+   }
+
+   /* (non-Javadoc)
+    * @see org.glassfish.api.deployment.archive.Archive#close()
+    */
+   @Override
+   public void close() throws IOException
+   {
+   }
+
+   /* (non-Javadoc)
+    * @see org.glassfish.api.deployment.archive.Archive#entries()
+    */
+   @Override
+   public Enumeration<String> entries()
+   {
+      List<String> entries = new ArrayList<String>();
+
+      for (Entry<ArchivePath, Asset> entry : archive.getContent().entrySet())
+      {
+         entries.add(entry.getKey().get());
+      }
+      return Collections.enumeration(entries);
+   }
+
+   /* (non-Javadoc)
+    * @see org.glassfish.api.deployment.archive.Archive#entries(java.lang.String)
+    */
+   @Override
+   public Enumeration<String> entries(String path)
+   {
+      List<String> entries = new ArrayList<String>();
+
+      for (Entry<ArchivePath, Asset> entry : archive.getContent().entrySet())
+      {
+         if (entry.getKey().get().startsWith(path))
+         {
+            entries.add(entry.getKey().get());
+         }
+      }
+      return Collections.enumeration(entries);
+   }
+
+   /**
+    * ShrinkWrap does not track Asset sizes.
+    * 
+    * @return This always return -1
+    */
+   @Override
+   public long getArchiveSize() throws SecurityException
+   {
+      return -1;
+   }
+
+   /* (non-Javadoc)
+    * @see org.glassfish.api.deployment.archive.Archive#getDirectories()
+    */
+   @Override
+   public Collection<String> getDirectories() throws IOException
+   {
+      List<String> entries = new ArrayList<String>();
+
+      for (Entry<ArchivePath, Asset> entry : archive.getContent().entrySet())
+      {
+         if (entry.getValue() == DirectoryAsset.INSTANCE)
+         {
+            entries.add(entry.getKey().get());
+         }
+      }
+      return entries;
+   }
+
+   /* (non-Javadoc)
+    * @see org.glassfish.api.deployment.archive.Archive#getManifest()
+    */
+   @Override
+   public Manifest getManifest() throws IOException
+   {
+      ArchivePath manifestPath = ArchivePaths.create("META-INF/MANIFEST.MF");
+      if (archive.contains(manifestPath))
+      {
+         return new Manifest(archive.get(manifestPath).openStream());
+      }
+      return null;
+   }
+
+   /* (non-Javadoc)
+    * @see org.glassfish.api.deployment.archive.Archive#getName()
+    */
+   @Override
+   public String getName()
+   {
+      return archive.getName();
+   }
+
+   /* (non-Javadoc)
+    * @see org.glassfish.api.deployment.archive.Archive#getURI()
+    */
+   @Override
+   public URI getURI()
+   {
+      try
+      {
+         return new URI("archive://" + archive.getName());
+      }
+      catch (URISyntaxException e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+
+   /* (non-Javadoc)
+    * @see org.glassfish.api.deployment.archive.Archive#isDirectory(java.lang.String)
+    */
+   @Override
+   public boolean isDirectory(String path)
+   {
+      return archive.get(ArchivePaths.create(path)) == DirectoryAsset.INSTANCE;
+   }
+}
\ No newline at end of file

Deleted: shrinkwrap/trunk/extension-glassfish/src/main/resources/META-INF/services/com.jboss.shrinkwrap.glassfish.ShrinkwrapReadableArchive
===================================================================
--- shrinkwrap/trunk/extension-glassfish/src/main/resources/META-INF/services/com.jboss.shrinkwrap.glassfish.ShrinkwrapReadableArchive	2010-01-30 06:49:10 UTC (rev 3964)
+++ shrinkwrap/trunk/extension-glassfish/src/main/resources/META-INF/services/com.jboss.shrinkwrap.glassfish.ShrinkwrapReadableArchive	2010-01-30 07:07:29 UTC (rev 3965)
@@ -1 +0,0 @@
-com.jboss.shrinkwrap.glassfish.ShrinkwrapReadableArchiveImpl
\ No newline at end of file

Copied: shrinkwrap/trunk/extension-glassfish/src/main/resources/META-INF/services/org.jboss.shrinkwrap.glassfish.api.ShrinkwrapReadableArchive (from rev 3964, shrinkwrap/trunk/extension-glassfish/src/main/resources/META-INF/services/com.jboss.shrinkwrap.glassfish.ShrinkwrapReadableArchive)
===================================================================
--- shrinkwrap/trunk/extension-glassfish/src/main/resources/META-INF/services/org.jboss.shrinkwrap.glassfish.api.ShrinkwrapReadableArchive	                        (rev 0)
+++ shrinkwrap/trunk/extension-glassfish/src/main/resources/META-INF/services/org.jboss.shrinkwrap.glassfish.api.ShrinkwrapReadableArchive	2010-01-30 07:07:29 UTC (rev 3965)
@@ -0,0 +1 @@
+org.jboss.shrinkwrap.glassfish.impl.ShrinkwrapReadableArchiveImpl
\ No newline at end of file

Copied: shrinkwrap/trunk/extension-glassfish/src/test/java/org/jboss/shrinkwrap/glassfish (from rev 3964, shrinkwrap/trunk/extension-glassfish/src/test/java/com/jboss/shrinkwrap/glassfish)

Deleted: shrinkwrap/trunk/extension-glassfish/src/test/java/org/jboss/shrinkwrap/glassfish/EchoBean.java
===================================================================
--- shrinkwrap/trunk/extension-glassfish/src/test/java/com/jboss/shrinkwrap/glassfish/EchoBean.java	2010-01-30 06:49:10 UTC (rev 3964)
+++ shrinkwrap/trunk/extension-glassfish/src/test/java/org/jboss/shrinkwrap/glassfish/EchoBean.java	2010-01-30 07:07:29 UTC (rev 3965)
@@ -1,66 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed 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 com.jboss.shrinkwrap.glassfish;
-
-import javax.ejb.Local;
-import javax.ejb.Stateless;
-
-/**
- * 
- * 
- * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
- * @version $Revision: $
- */
- at Stateless
- at Local(EchoLocalBusiness.class)
-public class EchoBean implements EchoLocalBusiness
-{
-
-   //-------------------------------------------------------------------------------------||
-   // Class Members ----------------------------------------------------------------------||
-   //-------------------------------------------------------------------------------------||
-
-   //-------------------------------------------------------------------------------------||
-   // Instance Members -------------------------------------------------------------------||
-   //-------------------------------------------------------------------------------------||
-
-   //-------------------------------------------------------------------------------------||
-   // Constructor ------------------------------------------------------------------------||
-   //-------------------------------------------------------------------------------------||
-
-   //-------------------------------------------------------------------------------------||
-   // Required Implementations -----------------------------------------------------------||
-   //-------------------------------------------------------------------------------------||
-
-   /**
-    * {@inheritDoc}
-    * @see com.jboss.shrinkwrap.glassfish.EchoLocalBusiness#echo(java.lang.String)
-    */
-   @Override
-   public String echo(final String value)
-   {
-      return value;
-   }
-
-   //-------------------------------------------------------------------------------------||
-   // Functional Methods -----------------------------------------------------------------||
-   //-------------------------------------------------------------------------------------||
-
-   //-------------------------------------------------------------------------------------||
-   // Internal Helper Methods ------------------------------------------------------------||
-   //-------------------------------------------------------------------------------------||
-}

Deleted: shrinkwrap/trunk/extension-glassfish/src/test/java/org/jboss/shrinkwrap/glassfish/EchoLocalBusiness.java
===================================================================
--- shrinkwrap/trunk/extension-glassfish/src/test/java/com/jboss/shrinkwrap/glassfish/EchoLocalBusiness.java	2010-01-30 06:49:10 UTC (rev 3964)
+++ shrinkwrap/trunk/extension-glassfish/src/test/java/org/jboss/shrinkwrap/glassfish/EchoLocalBusiness.java	2010-01-30 07:07:29 UTC (rev 3965)
@@ -1,28 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed 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 com.jboss.shrinkwrap.glassfish;
-
-/**
- * 
- * 
- * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
- * @version $Revision: $
- */
-public interface EchoLocalBusiness
-{
-   String echo(String value);
-}

Modified: shrinkwrap/trunk/extension-glassfish/src/test/java/org/jboss/shrinkwrap/glassfish/GlassFishDeploymentUnitTestCase.java
===================================================================
--- shrinkwrap/trunk/extension-glassfish/src/test/java/com/jboss/shrinkwrap/glassfish/GlassFishDeploymentUnitTestCase.java	2010-01-30 06:49:10 UTC (rev 3964)
+++ shrinkwrap/trunk/extension-glassfish/src/test/java/org/jboss/shrinkwrap/glassfish/GlassFishDeploymentUnitTestCase.java	2010-01-30 07:07:29 UTC (rev 3965)
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.jboss.shrinkwrap.glassfish;
+package org.jboss.shrinkwrap.glassfish;
 
 import java.util.logging.Logger;
 
@@ -34,6 +34,9 @@
 import org.jboss.shrinkwrap.api.Archive;
 import org.jboss.shrinkwrap.api.Archives;
 import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.glassfish.api.ShrinkwrapReadableArchive;
+import org.jboss.shrinkwrap.glassfish.ejb.EchoBean;
+import org.jboss.shrinkwrap.glassfish.ejb.EchoLocalBusiness;
 import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.Before;

Modified: shrinkwrap/trunk/extension-glassfish/src/test/java/org/jboss/shrinkwrap/glassfish/ShrinkwrapReadableArchiveUnitTestCase.java
===================================================================
--- shrinkwrap/trunk/extension-glassfish/src/test/java/com/jboss/shrinkwrap/glassfish/ShrinkwrapReadableArchiveUnitTestCase.java	2010-01-30 06:49:10 UTC (rev 3964)
+++ shrinkwrap/trunk/extension-glassfish/src/test/java/org/jboss/shrinkwrap/glassfish/ShrinkwrapReadableArchiveUnitTestCase.java	2010-01-30 07:07:29 UTC (rev 3965)
@@ -14,11 +14,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.jboss.shrinkwrap.glassfish;
+package org.jboss.shrinkwrap.glassfish;
 
 import junit.framework.Assert;
 
 import org.jboss.shrinkwrap.api.Archives;
+import org.jboss.shrinkwrap.glassfish.api.ShrinkwrapReadableArchive;
 import org.junit.Test;
 
 

Added: shrinkwrap/trunk/extension-glassfish/src/test/java/org/jboss/shrinkwrap/glassfish/ejb/EchoBean.java
===================================================================
--- shrinkwrap/trunk/extension-glassfish/src/test/java/org/jboss/shrinkwrap/glassfish/ejb/EchoBean.java	                        (rev 0)
+++ shrinkwrap/trunk/extension-glassfish/src/test/java/org/jboss/shrinkwrap/glassfish/ejb/EchoBean.java	2010-01-30 07:07:29 UTC (rev 3965)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.shrinkwrap.glassfish.ejb;
+
+import javax.ejb.Local;
+import javax.ejb.Stateless;
+
+/**
+ * Simple test SLSB which returns its request back to the caller
+ * 
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+ at Stateless
+ at Local(EchoLocalBusiness.class)
+public class EchoBean implements EchoLocalBusiness
+{
+   //-------------------------------------------------------------------------------------||
+   // Required Implementations -----------------------------------------------------------||
+   //-------------------------------------------------------------------------------------||
+
+   /**
+    * {@inheritDoc}
+    * @see org.jboss.shrinkwrap.glassfish.ejb.EchoLocalBusiness#echo(java.lang.String)
+    */
+   @Override
+   public String echo(final String value)
+   {
+      return value;
+   }
+}

Added: shrinkwrap/trunk/extension-glassfish/src/test/java/org/jboss/shrinkwrap/glassfish/ejb/EchoLocalBusiness.java
===================================================================
--- shrinkwrap/trunk/extension-glassfish/src/test/java/org/jboss/shrinkwrap/glassfish/ejb/EchoLocalBusiness.java	                        (rev 0)
+++ shrinkwrap/trunk/extension-glassfish/src/test/java/org/jboss/shrinkwrap/glassfish/ejb/EchoLocalBusiness.java	2010-01-30 07:07:29 UTC (rev 3965)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.shrinkwrap.glassfish.ejb;
+
+/**
+ * Local business interface of a simple test EJB
+ * 
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public interface EchoLocalBusiness
+{
+   /**
+    * Returns the reference value
+    * @param value
+    * @return
+    */
+   String echo(String value);
+}



More information about the jboss-svn-commits mailing list