[jboss-cvs] JBossAS SVN: r95965 - in projects/demos/microcontainer/trunk/classloader/src/main: java/org/jboss/demos/classloader/deployers and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Nov 3 11:35:50 EST 2009


Author: alesj
Date: 2009-11-03 11:35:49 -0500 (Tue, 03 Nov 2009)
New Revision: 95965

Added:
   projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/CryptVisitor.java
   projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/Decrypter.java
   projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/DecrypterTranslator.java
   projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/Encrypter.java
   projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/deployers/DecrypterClassLoaderDescribeDeployer.java
   projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/deployers/DecrypterClassLoaderPolicyModule.java
Removed:
   projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/CryptVisitor.java
   projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/CrypterTranslator.java
   projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/deployers/CrypterClassLoaderDescribeDeployer.java
   projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/deployers/CrypterClassLoaderPolicyModule.java
Modified:
   projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/CipherCrypter.java
   projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/Crypter.java
   projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/Tools.java
   projects/demos/microcontainer/trunk/classloader/src/main/resources/META-INF/classloader-beans.xml
Log:
Split into encrypter and decrypter.

Modified: projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/CipherCrypter.java
===================================================================
--- projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/CipherCrypter.java	2009-11-03 16:35:13 UTC (rev 95964)
+++ projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/CipherCrypter.java	2009-11-03 16:35:49 UTC (rev 95965)
@@ -30,11 +30,11 @@
 /**
  * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
  */
-public class CipherCrypter implements Crypter
+public class CipherCrypter implements Encrypter, Decrypter
 {
    public static final String MODE = "ECB";
    public static final String PADDING = "PKCS5Padding";
-   public static final String XFORM = ALGORITHM + "/" + MODE + "/" + PADDING;
+   public static final String XFORM = Crypter.ALGORITHM + "/" + MODE + "/" + PADDING;
 
    private Cipher cipher;
 
@@ -69,33 +69,38 @@
       cipher.init(mode, key);
    }
 
-   public static Crypter getEncrypter(Key key) throws Exception
+   public static Encrypter getEncrypter(Key key) throws Exception
    {
       return new CipherCrypter(null, Cipher.ENCRYPT_MODE, key);
    }
 
-   public static Crypter getEncrypter(String xform, Key key) throws Exception
+   public static Encrypter getEncrypter(String xform, Key key) throws Exception
    {
       return new CipherCrypter(xform, Cipher.ENCRYPT_MODE, key);
    }
 
-   public static Crypter getDecrypter(Key key) throws Exception
+   public static Decrypter getDecrypter(Key key) throws Exception
    {
       return new CipherCrypter(null, Cipher.DECRYPT_MODE, key);
    }
 
-   public static Crypter getDecrypter(String xform, Key key) throws Exception
+   public static Decrypter getDecrypter(String xform, Key key) throws Exception
    {
       return new CipherCrypter(xform, Cipher.DECRYPT_MODE, key);
    }
 
-   public byte[] encrypt(byte[] bytes) throws Exception
+   public byte[] crypt(byte[] bytes) throws Exception
    {
       return cipher.doFinal(bytes);
    }
 
+   public byte[] encrypt(byte[] bytes) throws Exception
+   {
+      return crypt(bytes);
+   }
+
    public byte[] decrypt(byte[] bytes) throws Exception
    {
-      return cipher.doFinal(bytes);
+      return crypt(bytes);
    }
 }
\ No newline at end of file

Deleted: projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/CryptVisitor.java
===================================================================
--- projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/CryptVisitor.java	2009-11-03 16:35:13 UTC (rev 95964)
+++ projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/CryptVisitor.java	2009-11-03 16:35:49 UTC (rev 95965)
@@ -1,104 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This 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.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.demos.classloader.crypt;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.jar.JarEntry;
-import java.util.jar.JarOutputStream;
-
-import org.jboss.virtual.VFSUtils;
-import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.VirtualFileVisitor;
-import org.jboss.virtual.VisitorAttributes;
-import org.jboss.virtual.plugins.vfs.helpers.AbstractVirtualFileFilterWithAttributes;
-
-/**
- * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
-public class CryptVisitor extends AbstractVirtualFileFilterWithAttributes implements VirtualFileVisitor
-{
-   private VirtualFile root;
-   private Crypter crypter;
-   private File file;
-   private JarOutputStream jos;
-
-   public CryptVisitor(VirtualFile root, Crypter crypter) throws Exception
-   {
-      super(VisitorAttributes.RECURSE_LEAVES_ONLY);
-      this.root = root;
-      this.crypter = crypter;
-   }
-
-   public File getFile() throws Exception
-   {
-      file = File.createTempFile("crypt-", ".jar");
-      FileOutputStream fos = new FileOutputStream(file);
-      jos = new JarOutputStream(fos);
-
-      root.visit(this);
-
-      try
-      {
-         jos.flush();
-      }
-      finally
-      {
-         jos.close();
-      }
-      return file;
-   }
-
-   public boolean accepts(VirtualFile file)
-   {
-      return file.getName().endsWith(".class");
-   }
-
-   public void visit(VirtualFile vf)
-   {
-      try
-      {
-         String path = vf.getPathName();
-         JarEntry entry = new JarEntry(path);
-         jos.putNextEntry(entry);
-         byte[] bytes = bytes(vf);
-
-         if (accepts(vf))
-            bytes = crypter.encrypt(bytes);
-
-         jos.write(bytes);
-      }
-      catch (Exception e)
-      {
-         throw new IllegalArgumentException(e);
-      }
-   }
-
-   protected byte[] bytes(VirtualFile vf) throws IOException
-   {
-      ByteArrayOutputStream baos = new ByteArrayOutputStream();
-      VFSUtils.copyStreamAndClose(vf.openStream(), baos);
-      return baos.toByteArray();
-   }
-}

Added: projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/CryptVisitor.java
===================================================================
--- projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/CryptVisitor.java	                        (rev 0)
+++ projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/CryptVisitor.java	2009-11-03 16:35:49 UTC (rev 95965)
@@ -0,0 +1,104 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.demos.classloader.crypt;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.jar.JarEntry;
+import java.util.jar.JarOutputStream;
+
+import org.jboss.virtual.VFSUtils;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.VirtualFileVisitor;
+import org.jboss.virtual.VisitorAttributes;
+import org.jboss.virtual.plugins.vfs.helpers.AbstractVirtualFileFilterWithAttributes;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class CryptVisitor extends AbstractVirtualFileFilterWithAttributes implements VirtualFileVisitor
+{
+   private VirtualFile root;
+   private Crypter crypter;
+   private File file;
+   private JarOutputStream jos;
+
+   public CryptVisitor(VirtualFile root, Encrypter crypter) throws Exception
+   {
+      super(VisitorAttributes.RECURSE_LEAVES_ONLY);
+      this.root = root;
+      this.crypter = crypter;
+   }
+
+   public File getFile() throws Exception
+   {
+      file = File.createTempFile("crypt-", ".jar");
+      FileOutputStream fos = new FileOutputStream(file);
+      jos = new JarOutputStream(fos);
+
+      root.visit(this);
+
+      try
+      {
+         jos.flush();
+      }
+      finally
+      {
+         jos.close();
+      }
+      return file;
+   }
+
+   public boolean accepts(VirtualFile file)
+   {
+      return file.getName().endsWith(".class");
+   }
+
+   public void visit(VirtualFile vf)
+   {
+      try
+      {
+         String path = vf.getPathName();
+         JarEntry entry = new JarEntry(path);
+         jos.putNextEntry(entry);
+         byte[] bytes = bytes(vf);
+
+         if (accepts(vf))
+            bytes = crypter.crypt(bytes);
+
+         jos.write(bytes);
+      }
+      catch (Exception e)
+      {
+         throw new IllegalArgumentException(e);
+      }
+   }
+
+   protected byte[] bytes(VirtualFile vf) throws IOException
+   {
+      ByteArrayOutputStream baos = new ByteArrayOutputStream();
+      VFSUtils.copyStreamAndClose(vf.openStream(), baos);
+      return baos.toByteArray();
+   }
+}

Modified: projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/Crypter.java
===================================================================
--- projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/Crypter.java	2009-11-03 16:35:13 UTC (rev 95964)
+++ projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/Crypter.java	2009-11-03 16:35:49 UTC (rev 95965)
@@ -28,7 +28,5 @@
 {
    public static final String ALGORITHM = "AES";
 
-   byte[] encrypt(byte[] bytes) throws Exception;
-
-   byte[] decrypt(byte[] bytes) throws Exception;
+   byte[] crypt(byte[] bytes) throws Exception;
 }

Deleted: projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/CrypterTranslator.java
===================================================================
--- projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/CrypterTranslator.java	2009-11-03 16:35:13 UTC (rev 95964)
+++ projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/CrypterTranslator.java	2009-11-03 16:35:49 UTC (rev 95965)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This 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.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.demos.classloader.crypt;
-
-import java.security.ProtectionDomain;
-
-import org.jboss.util.loading.Translator;
-
-/**
- * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
-public class CrypterTranslator implements Translator
-{
-   private Crypter crypter;
-
-   public CrypterTranslator(Crypter crypter)
-   {
-      this.crypter = crypter;
-   }
-
-   public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws Exception
-   {
-      return crypter.decrypt(classfileBuffer);
-   }
-
-   public void unregisterClassLoader(ClassLoader loader)
-   {
-   }
-}
\ No newline at end of file

Added: projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/Decrypter.java
===================================================================
--- projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/Decrypter.java	                        (rev 0)
+++ projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/Decrypter.java	2009-11-03 16:35:49 UTC (rev 95965)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.demos.classloader.crypt;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public interface Decrypter extends Crypter
+{
+   byte[] decrypt(byte[] bytes) throws Exception;
+}
\ No newline at end of file

Copied: projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/DecrypterTranslator.java (from rev 95934, projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/CrypterTranslator.java)
===================================================================
--- projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/DecrypterTranslator.java	                        (rev 0)
+++ projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/DecrypterTranslator.java	2009-11-03 16:35:49 UTC (rev 95965)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.demos.classloader.crypt;
+
+import java.security.ProtectionDomain;
+
+import org.jboss.util.loading.Translator;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class DecrypterTranslator implements Translator
+{
+   private Decrypter decrypter;
+
+   public DecrypterTranslator(Decrypter decrypter)
+   {
+      this.decrypter = decrypter;
+   }
+
+   public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws Exception
+   {
+      return decrypter.decrypt(classfileBuffer);
+   }
+
+   public void unregisterClassLoader(ClassLoader loader)
+   {
+   }
+}
\ No newline at end of file

Copied: projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/Encrypter.java (from rev 95952, projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/Crypter.java)
===================================================================
--- projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/Encrypter.java	                        (rev 0)
+++ projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/Encrypter.java	2009-11-03 16:35:49 UTC (rev 95965)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.demos.classloader.crypt;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public interface Encrypter extends Crypter
+{
+   byte[] encrypt(byte[] bytes) throws Exception;
+}
\ No newline at end of file

Modified: projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/Tools.java
===================================================================
--- projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/Tools.java	2009-11-03 16:35:13 UTC (rev 95964)
+++ projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/Tools.java	2009-11-03 16:35:49 UTC (rev 95965)
@@ -51,10 +51,10 @@
             keyProvider.writeKeys();
 
          Key key = keyProvider.getEncryptionKey();
-         Crypter crypter = CipherCrypter.getEncrypter(key);
+         Encrypter encrypter = CipherCrypter.getEncrypter(key);
 
          VirtualFile root = VFS.getRoot(archive.toURI());
-         CryptVisitor visitor = new CryptVisitor(root, crypter);
+         CryptVisitor visitor = new CryptVisitor(root, encrypter);
          File file = visitor.getFile();
          File copy = new File(archive.getParentFile(), file.getName());
          if (file.renameTo(copy) == false)

Deleted: projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/deployers/CrypterClassLoaderDescribeDeployer.java
===================================================================
--- projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/deployers/CrypterClassLoaderDescribeDeployer.java	2009-11-03 16:35:13 UTC (rev 95964)
+++ projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/deployers/CrypterClassLoaderDescribeDeployer.java	2009-11-03 16:35:49 UTC (rev 95965)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This 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.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.demos.classloader.deployers;
-
-import org.jboss.classloading.spi.dependency.policy.ClassLoaderPolicyModule;
-import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
-import org.jboss.demos.classloader.crypt.Crypter;
-import org.jboss.deployers.plugins.classloading.AbstractClassLoaderDescribeDeployer;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-
-/**
- * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
-public class CrypterClassLoaderDescribeDeployer extends AbstractClassLoaderDescribeDeployer
-{
-   private Crypter crypter;
-
-   public CrypterClassLoaderDescribeDeployer(Crypter crypter)
-   {
-      this.crypter = crypter;
-   }
-
-   protected ClassLoaderPolicyModule createModule(DeploymentUnit unit, ClassLoadingMetaData metaData) throws DeploymentException
-   {
-      return new CrypterClassLoaderPolicyModule(unit, crypter);
-   }
-}

Deleted: projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/deployers/CrypterClassLoaderPolicyModule.java
===================================================================
--- projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/deployers/CrypterClassLoaderPolicyModule.java	2009-11-03 16:35:13 UTC (rev 95964)
+++ projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/deployers/CrypterClassLoaderPolicyModule.java	2009-11-03 16:35:49 UTC (rev 95965)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This 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.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.demos.classloader.deployers;
-
-import org.jboss.classloading.spi.vfs.policy.VFSClassLoaderPolicy;
-import org.jboss.demos.classloader.crypt.Crypter;
-import org.jboss.demos.classloader.crypt.CrypterTranslator;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.deployers.vfs.plugins.classloader.VFSDeploymentClassLoaderPolicyModule;
-
-/**
- * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
-public class CrypterClassLoaderPolicyModule extends VFSDeploymentClassLoaderPolicyModule
-{
-   private Crypter crypter;
-
-   public CrypterClassLoaderPolicyModule(DeploymentUnit unit, Crypter crypter)
-   {
-      super(unit);
-      this.crypter = crypter;
-   }
-
-   @Override
-   protected VFSClassLoaderPolicy determinePolicy()
-   {
-      VFSClassLoaderPolicy policy = super.determinePolicy();
-      policy.addTranslator(new CrypterTranslator(crypter));
-      return policy;
-   }
-}
\ No newline at end of file

Copied: projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/deployers/DecrypterClassLoaderDescribeDeployer.java (from rev 95957, projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/deployers/CrypterClassLoaderDescribeDeployer.java)
===================================================================
--- projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/deployers/DecrypterClassLoaderDescribeDeployer.java	                        (rev 0)
+++ projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/deployers/DecrypterClassLoaderDescribeDeployer.java	2009-11-03 16:35:49 UTC (rev 95965)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.demos.classloader.deployers;
+
+import org.jboss.classloading.spi.dependency.policy.ClassLoaderPolicyModule;
+import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
+import org.jboss.demos.classloader.crypt.Decrypter;
+import org.jboss.deployers.plugins.classloading.AbstractClassLoaderDescribeDeployer;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class DecrypterClassLoaderDescribeDeployer extends AbstractClassLoaderDescribeDeployer
+{
+   private Decrypter decrypter;
+
+   public DecrypterClassLoaderDescribeDeployer(Decrypter decrypter)
+   {
+      this.decrypter = decrypter;
+   }
+
+   protected ClassLoaderPolicyModule createModule(DeploymentUnit unit, ClassLoadingMetaData metaData) throws DeploymentException
+   {
+      return new DecrypterClassLoaderPolicyModule(unit, decrypter);
+   }
+}

Copied: projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/deployers/DecrypterClassLoaderPolicyModule.java (from rev 95957, projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/deployers/CrypterClassLoaderPolicyModule.java)
===================================================================
--- projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/deployers/DecrypterClassLoaderPolicyModule.java	                        (rev 0)
+++ projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/deployers/DecrypterClassLoaderPolicyModule.java	2009-11-03 16:35:49 UTC (rev 95965)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This 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.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.demos.classloader.deployers;
+
+import org.jboss.classloading.spi.vfs.policy.VFSClassLoaderPolicy;
+import org.jboss.demos.classloader.crypt.Decrypter;
+import org.jboss.demos.classloader.crypt.DecrypterTranslator;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.plugins.classloader.VFSDeploymentClassLoaderPolicyModule;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class DecrypterClassLoaderPolicyModule extends VFSDeploymentClassLoaderPolicyModule
+{
+   private Decrypter decrypter;
+
+   public DecrypterClassLoaderPolicyModule(DeploymentUnit unit, Decrypter decrypter)
+   {
+      super(unit);
+      this.decrypter = decrypter;
+   }
+
+   @Override
+   protected VFSClassLoaderPolicy determinePolicy()
+   {
+      VFSClassLoaderPolicy policy = super.determinePolicy();
+      policy.addTranslator(new DecrypterTranslator(decrypter));
+      return policy;
+   }
+}
\ No newline at end of file

Modified: projects/demos/microcontainer/trunk/classloader/src/main/resources/META-INF/classloader-beans.xml
===================================================================
--- projects/demos/microcontainer/trunk/classloader/src/main/resources/META-INF/classloader-beans.xml	2009-11-03 16:35:13 UTC (rev 95964)
+++ projects/demos/microcontainer/trunk/classloader/src/main/resources/META-INF/classloader-beans.xml	2009-11-03 16:35:49 UTC (rev 95965)
@@ -12,7 +12,7 @@
     </constructor>    
   </bean>
 
-  <bean name="Crypter" class="org.jboss.demos.classloader.crypt.Crypter">
+  <bean name="Decrypter" class="org.jboss.demos.classloader.crypt.Decrypter">
     <constructor factoryClass="org.jboss.demos.classloader.crypt.CipherCrypter" factoryMethod="getDecrypter">
       <parameter>
         <inject bean="KeyProvider" property="decryptionKey"/>
@@ -20,10 +20,10 @@
     </constructor>
   </bean>
 
-  <bean name="ClassLoaderDescribeDeployer" class="org.jboss.demos.classloader.deployers.CrypterClassLoaderDescribeDeployer">
+  <bean name="ClassLoaderDescribeDeployer" class="org.jboss.demos.classloader.deployers.DecrypterClassLoaderDescribeDeployer">
     <constructor>
       <parameter>
-        <inject bean="Crypter"/>
+        <inject bean="Decrypter"/>
       </parameter>
     </constructor>
     <property name="classLoading"><inject bean="ClassLoading"/></property>




More information about the jboss-cvs-commits mailing list