[jboss-cvs] JBossAS SVN: r60444 - in trunk/embedded: src/main/java/org/jboss/embedded and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Feb 8 18:21:55 EST 2007


Author: bill.burke at jboss.com
Date: 2007-02-08 18:21:54 -0500 (Thu, 08 Feb 2007)
New Revision: 60444

Modified:
   trunk/embedded/install-tomcat55.xml
   trunk/embedded/src/main/java/org/jboss/embedded/DeploymentGroup.java
   trunk/embedded/src/main/java/org/jboss/embedded/DeploymentScanner.java
   trunk/embedded/src/main/java/org/jboss/embedded/jndi/KernelInitializingContextFactory.java
Log:
add some new deployment options, specifically filesByResource

Modified: trunk/embedded/install-tomcat55.xml
===================================================================
--- trunk/embedded/install-tomcat55.xml	2007-02-08 23:16:40 UTC (rev 60443)
+++ trunk/embedded/install-tomcat55.xml	2007-02-08 23:21:54 UTC (rev 60444)
@@ -4,18 +4,17 @@
    <property name="jboss.dir" value="."/>
 
    <target name="main">
-
-      <copy todir="${tomcat.dir}/server/classes">
-         <fileset dir="${jboss.dir}/bootstrap">
-            <include name="**/*"/>
-            <exclude name="jndi.properties"/>
-         </fileset>
-      </copy>
       <copy todir="${tomcat.dir}/server/lib">
          <fileset dir="${jboss.dir}/lib">
             <include name="jboss-embedded-tomcat-bootstrap.jar"/>
          </fileset>
       </copy>
+      <copy todir="${tomcat.dir}/common/classes">
+         <fileset dir="${jboss.dir}/bootstrap">
+            <include name="**/*"/>
+            <exclude name="jndi.properties"/>
+         </fileset>
+      </copy>
       <copy todir="${tomcat.dir}/common/lib">
          <fileset dir="${jboss.dir}/lib">
             <include name="*.jar"/>

Modified: trunk/embedded/src/main/java/org/jboss/embedded/DeploymentGroup.java
===================================================================
--- trunk/embedded/src/main/java/org/jboss/embedded/DeploymentGroup.java	2007-02-08 23:16:40 UTC (rev 60443)
+++ trunk/embedded/src/main/java/org/jboss/embedded/DeploymentGroup.java	2007-02-08 23:21:54 UTC (rev 60444)
@@ -368,6 +368,35 @@
       addVirtualFiles(files);
    }
 
+   /**
+    * Searches for a file based on the location of an existing classloader resource
+    * as described in the  getDirFromResource() method of this class.
+    *
+    * schedules this particular file for deployment
+    *
+    *
+    * @param resource
+    * @throws DeploymentException
+    * @throws IOException
+    */
+   public void addFileByResource(String resource) throws DeploymentException, IOException
+   {
+      ClassLoader loader = Thread.currentThread().getContextClassLoader();
+      if (classLoader != null) loader = classLoader;
+      URL url = getDirFromResource(loader, resource);
+      if (url == null)
+      {
+         throw new DeploymentException("Unable to find file from resource: " + resource);
+      }
+      String urlStr = url.toString();
+      if (urlStr.endsWith("/"))
+      {
+         urlStr = urlStr.substring(0, urlStr.length() -1);
+      }
+      url = new URL(urlStr);
+      add(url);
+   }
+
    public void addDirectory(URL directory, boolean recurse) throws DeploymentException, IOException
    {
       addVirtualFiles(getDeployerDirUrls(filter, directory, recurse));

Modified: trunk/embedded/src/main/java/org/jboss/embedded/DeploymentScanner.java
===================================================================
--- trunk/embedded/src/main/java/org/jboss/embedded/DeploymentScanner.java	2007-02-08 23:16:40 UTC (rev 60443)
+++ trunk/embedded/src/main/java/org/jboss/embedded/DeploymentScanner.java	2007-02-08 23:21:54 UTC (rev 60444)
@@ -42,6 +42,7 @@
    private List<String> resources;
    private List<String> multiple;
    private List<String> dirs;
+   private List<String> filesByResource;
 
    public void setUrls(List<URL> urls) throws DeploymentException
    {
@@ -66,6 +67,12 @@
       dirs = resources;
    }
 
+
+   public void setFilesByResource(List<String> filesByResource)
+   {
+      this.filesByResource = filesByResource;
+   }
+
    public void start() throws Exception
    {
       try
@@ -92,6 +99,13 @@
                addDirectoryByResource(resource, true);
             }
          }
+         if (filesByResource != null)
+         {
+            for (String resource : filesByResource)
+            {
+               addFileByResource(resource);
+            }
+         }
          mainDeployer.process();
       }
       catch (Exception ex)

Modified: trunk/embedded/src/main/java/org/jboss/embedded/jndi/KernelInitializingContextFactory.java
===================================================================
--- trunk/embedded/src/main/java/org/jboss/embedded/jndi/KernelInitializingContextFactory.java	2007-02-08 23:16:40 UTC (rev 60443)
+++ trunk/embedded/src/main/java/org/jboss/embedded/jndi/KernelInitializingContextFactory.java	2007-02-08 23:21:54 UTC (rev 60444)
@@ -22,6 +22,7 @@
 package org.jboss.embedded.jndi;
 
 import org.jboss.embedded.Bootstrap;
+import org.jboss.naming.JBossRemotingContextFactory;
 
 import javax.naming.Context;
 import javax.naming.NamingException;
@@ -30,13 +31,25 @@
 /**
  * InitialContextFactory that will bootstrap embedded jboss.
  *
- * This factory also delegates to a org.jnp.interfaces.NamingContextFactory.  You can change the delegate
- * by setting the jboss.embeddded.initial.context.factory.delegate jndi property.
+ * If Context.SECURITY_PRINCIPAL and Context.SECURITY_CREDENTIALS are set,
+ * this InitialContextFactory implementation combines the
+ * authentication phase with the InitialContext creation. During the
+ * getInitialContext callback from the JNDI naming, layer security context
+ * identity is populated with the username obtained from the
+ * Context.SECURITY_PRINCIPAL env property and the credentials from the
+ * Context.SECURITY_CREDENTIALS env property. There is no actual authentication
+ * of this information. It is merely made available to the jboss transport
+ * layer for incorporation into subsequent invocations. Authentication and
+ * authorization will occur on the server.
  *
+ * If Context.SECURITY_PROTOCOL is provided as well as the principal and credentials,
+ * then a JAAS login will be performed instead using the security domain provided with the
+ * SECURITY_PROTOCOL variable.
+ *
  * @author <a href="bill at jboss.com">Bill Burke</a>
  * @version $Revision: 1.1 $
  */
-public class KernelInitializingContextFactory extends DelegatingContextFactory
+public class KernelInitializingContextFactory extends JBossRemotingContextFactory
 {
    public static boolean initialized = false;
    public static final String BOOTSTRAP_RESOURCE_PATH = "jboss.embedded.resource.path";




More information about the jboss-cvs-commits mailing list