[jboss-cvs] JBossAS SVN: r95934 - projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Nov 2 18:00:26 EST 2009


Author: alesj
Date: 2009-11-02 18:00:26 -0500 (Mon, 02 Nov 2009)
New Revision: 95934

Added:
   projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/CrypterTranslator.java
Log:
Add translator.

Copied: projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/CrypterTranslator.java (from rev 95932, 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/CrypterTranslator.java	                        (rev 0)
+++ projects/demos/microcontainer/trunk/classloader/src/main/java/org/jboss/demos/classloader/crypt/CrypterTranslator.java	2009-11-02 23:00:26 UTC (rev 95934)
@@ -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 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




More information about the jboss-cvs-commits mailing list