geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r809078 [10/12] - in /geronimo/sandbox/djencks/osgi/framework: ./ assemblies/ assemblies/geronimo-framework/ buildsupport/ buildsupport/buildsupport-maven-plugin/ buildsupport/car-maven-plugin/ buildsupport/car-maven-plugin/src/main/java/or...
Date Sat, 29 Aug 2009 00:51:37 GMT
Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/test/resources/copyfiletest/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/test/resources/copyfiletest/repository/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/test/resources/copyfiletest/repository/test/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/test/resources/copyfiletest/repository/test/jar/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/test/resources/copyfiletest/repository/test/jar/1.0/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/test/resources/copyfiletest/repository/test/module/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/test/resources/copyfiletest/repository/test/module/1.0/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/test/resources/copyfiletest/repository/test/module/1.0/module-1.0.car/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/test/resources/copyfiletest/repository/test/module/1.0/module-1.0.car/META-INF/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/test/resources/copyfiletest/repository/test/module/1.0/module-1.0.car/dir1/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/test/resources/copyfiletest/repository/test/module/1.0/module-1.0.car/dir1/emptydir1/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/test/resources/copyfiletest/repository/test/module/1.0/module-1.0.car/emptydir1/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/test/resources/geronimo-plugins.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/test/resources/geronimo-plugins.xml?rev=809078&r1=809077&r2=809078&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/test/resources/geronimo-plugins.xml (original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-plugin/src/test/resources/geronimo-plugins.xml Sat Aug 29 00:51:12 2009
@@ -29,7 +29,7 @@
                 <type>car</type>
             </module-id>
             <geronimo-versions>
-                <version>2.2-SNAPSHOT</version>
+                <version>3.0-SNAPSHOT</version>
             </geronimo-versions>
             <prerequisite>
                 <id>
@@ -45,7 +45,7 @@
                     from another Tomcat Geronimo installation.
                 </description>
             </prerequisite>
-            <dependency>geronimo/j2ee-server/2.2-SNAPSHOT/car</dependency>
+            <dependency>geronimo/j2ee-server/3.0-SNAPSHOT/car</dependency>
             <dependency>geronimo/geronimo-daytrader-derby-db/2.0-SNAPSHOT/jar</dependency>
         </plugin-artifact>
     </plugin>
@@ -62,7 +62,7 @@
                 <type>car</type>
             </module-id>
             <geronimo-versions>
-                <version>2.2-SNAPSHOT</version>
+                <version>3.0-SNAPSHOT</version>
             </geronimo-versions>
             <prerequisite>
                 <id>
@@ -81,7 +81,7 @@
             <dependency>
                 <groupId>geronimo</groupId>
                 <artifactId>client</artifactId>
-                <version>2.2-SNAPSHOT</version>
+                <version>3.0-SNAPSHOT</version>
                 <type>car</type>
             </dependency>
         </plugin-artifact>

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -1,10 +1,9 @@
+.*
 *.iws
 *.ipr
 *.iml
-.classpath
-.project
-.settings
 *.log
 junit*.properties
+maven-eclipse.xml
 target
 bin

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/pom.xml?rev=809078&r1=809077&r2=809078&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/pom.xml (original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/pom.xml Sat Aug 29 00:51:12 2009
@@ -25,41 +25,15 @@
     <parent>
         <groupId>org.apache.geronimo.framework</groupId>
         <artifactId>modules</artifactId>
-        <version>2.2-SNAPSHOT</version>
+        <version>3.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>geronimo-security</artifactId>
+    <packaging>bundle</packaging>
     <name>Geronimo Framework, Modules :: Security</name>
     
     <dependencies>
 
-        <!-- for GERONIMO_SERVICE constant string -->
-        <!--<dependency>-->
-            <!--<groupId>org.apache.geronimo.framework</groupId>-->
-            <!--<artifactId>geronimo-j2ee</artifactId>-->
-            <!--<version>${version}</version>-->
-            <!--<scope>provided</scope>-->
-        <!--</dependency>-->
-        <!--<dependency>-->
-            <!--<groupId>org.apache.geronimo.framework</groupId>-->
-            <!--<artifactId>geronimo-kernel</artifactId>-->
-            <!--<version>${version}</version>-->
-        <!--</dependency>-->
-        <!--<dependency>-->
-            <!--<groupId>org.apache.geronimo.framework</groupId>-->
-            <!--<artifactId>geronimo-system</artifactId>-->
-            <!--<version>${version}</version>-->
-        <!--</dependency>-->
-        <!--<dependency>-->
-            <!--<groupId>org.apache.geronimo.framework</groupId>-->
-            <!--<artifactId>geronimo-common</artifactId>-->
-            <!--<version>${version}</version>-->
-        <!--</dependency>-->
-        <!--<dependency>-->
-            <!--<groupId>org.apache.geronimo.framework</groupId>-->
-            <!--<artifactId>geronimo-crypto</artifactId>-->
-            <!--<version>${version}</version>-->
-        <!--</dependency>-->
         <dependency>
             <groupId>org.apache.geronimo.framework</groupId>
             <artifactId>geronimo-management</artifactId>
@@ -80,7 +54,7 @@
 
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-jaspi_1.0_spec</artifactId>
+            <artifactId>geronimo-jaspic_1.0_spec</artifactId>
             <scope>compile</scope>
         </dependency>
         
@@ -95,18 +69,6 @@
             <artifactId>geronimo-jaspi</artifactId>
         </dependency>
 
-<!--
-        <dependency>
-            <groupId>org.soter.rbac</groupId>
-            <artifactId>rbac-xml-model</artifactId>
-            <version>1.0-SNAPSHOT</version>
-        </dependency>
-        <dependency>
-            <groupId>org.soter.rbac</groupId>
-            <artifactId>rbac-jacc</artifactId>
-            <version>1.0-SNAPSHOT</version>
-        </dependency>
--->
         <dependency>
             <groupId>org.apache.geronimo.testsupport</groupId>
             <artifactId>testsupport-common</artifactId>

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/ContextManager.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/ContextManager.java?rev=809078&r1=809077&r2=809078&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/ContextManager.java (original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/ContextManager.java Sat Aug 29 00:51:12 2009
@@ -39,6 +39,7 @@
 import javax.security.auth.login.LoginContext;
 import javax.security.auth.login.LoginException;
 import javax.security.auth.login.Configuration;
+import javax.security.jacc.PolicyContext;
 
 import org.apache.geronimo.security.realm.providers.GeronimoCallerPrincipal;
 
@@ -49,6 +50,14 @@
 public class ContextManager {
 
     private static final ThreadLocal<Callers> callers = new ThreadLocal<Callers>();
+    private static final ThreadLocal<ThreadData> threadData = new ThreadLocal<ThreadData>() {
+        @Override
+        protected ThreadData initialValue() {
+            ThreadData threadData = new ThreadData();
+            PolicyContext.setHandlerData(threadData);
+            return threadData;
+        }
+    };
     private static Map<Subject, Context> subjectContexts = new IdentityHashMap<Subject, Context>();
     private static Map<SubjectId, Subject> subjectIds =  Collections.synchronizedMap(new HashMap<SubjectId, Subject>());
     private static long nextSubjectId = System.currentTimeMillis();
@@ -153,6 +162,12 @@
         return oldCallers;
     }
 
+    /**
+     * Pusth the run-as identity as the next identity.  If the run-as identity is not specified,
+     * push the current identity as the next identity.  Return the previous pair of current identity, next identity.
+     * @param nextCaller next run-as identity or null
+     * @return existing pair of (current identity, next identity)
+     */
     public static Callers pushNextCaller(Subject nextCaller) {
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) sm.checkPermission(SET_CONTEXT);
@@ -364,6 +379,12 @@
         return null;
     }
 
+    public static ThreadData getThreadData() {
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) sm.checkPermission(GET_CONTEXT);
+        return threadData.get();
+    }
+
     public static String getAlgorithm() {
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) sm.checkPermission(GET_CONTEXT);

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/SecurityServiceImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/SecurityServiceImpl.java?rev=809078&r1=809077&r2=809078&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/SecurityServiceImpl.java (original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/SecurityServiceImpl.java Sat Aug 29 00:51:12 2009
@@ -18,23 +18,31 @@
 package org.apache.geronimo.security;
 
 import java.security.Policy;
+
 import javax.security.jacc.PolicyConfigurationFactory;
 import javax.security.jacc.PolicyContextException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.annotation.GBean;
+import org.apache.geronimo.gbean.annotation.ParamAttribute;
+import org.apache.geronimo.gbean.annotation.ParamReference;
+import org.apache.geronimo.gbean.annotation.ParamSpecial;
+import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
 import org.apache.geronimo.security.jacc.PolicyContextHandlerContainerSubject;
+import org.apache.geronimo.security.jacc.PolicyContextHandlerEjbArguments;
+import org.apache.geronimo.security.jacc.PolicyContextHandlerEnterpriseBean;
 import org.apache.geronimo.security.jacc.PolicyContextHandlerHttpServletRequest;
 import org.apache.geronimo.security.jacc.PolicyContextHandlerSOAPMessage;
 import org.apache.geronimo.security.util.ConfigurationUtil;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * An MBean that registers the JACC factory and handlers.
  *
  * @version $Rev$ $Date$
  */
+
+@GBean
 public class SecurityServiceImpl implements SecurityService {
 
     public static boolean POLICY_INSTALLED = false;
@@ -46,11 +54,15 @@
      */
     public static final GeronimoSecurityPermission CONFIGURE = new GeronimoSecurityPermission("configure");
 
-    public SecurityServiceImpl(ClassLoader classLoader, ServerInfo serverInfo, String policyConfigurationFactory,
-                               String policyProvider, String keyStore, String keyStorePassword,
-                               String trustStore, String trustStorePassword)
-            throws PolicyContextException, ClassNotFoundException, IllegalAccessException, InstantiationException
-    {
+    public SecurityServiceImpl(@ParamSpecial(type = SpecialAttributeType.classLoader) ClassLoader classLoader,
+                               @ParamReference(name = "ServerInfo") ServerInfo serverInfo,
+                               @ParamAttribute(name = "policyConfigurationFactory") String policyConfigurationFactory,
+                               @ParamAttribute(name = "policyProvider") String policyProvider,
+                               @ParamAttribute(name = "keyStore") String keyStore,
+                               @ParamAttribute(name = "keyStorePassword") String keyStorePassword,
+                               @ParamAttribute(name = "trustStore") String trustStore,
+                               @ParamAttribute(name = "trustStorePassword") String trustStorePassword)
+            throws PolicyContextException, ClassNotFoundException, IllegalAccessException, InstantiationException {
 
         /**
          *  @see "JSR 115 4.6.1" Container Subject Policy Context Handler
@@ -58,6 +70,8 @@
         ConfigurationUtil.registerPolicyContextHandler(new PolicyContextHandlerContainerSubject(), true);
         ConfigurationUtil.registerPolicyContextHandler(new PolicyContextHandlerSOAPMessage(), true);
         ConfigurationUtil.registerPolicyContextHandler(new PolicyContextHandlerHttpServletRequest(), true);
+        ConfigurationUtil.registerPolicyContextHandler(new PolicyContextHandlerEnterpriseBean(), true);
+        ConfigurationUtil.registerPolicyContextHandler(new PolicyContextHandlerEjbArguments(), true);
 
         if (!POLICY_INSTALLED) {
             policyProvider = sysOverRide(policyProvider, POLICY_PROVIDER);
@@ -112,28 +126,4 @@
 
     }
 
-    public static final GBeanInfo GBEAN_INFO;
-
-    static {
-        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(SecurityServiceImpl.class);
-
-        infoFactory.addAttribute("classLoader", ClassLoader.class, false);
-        infoFactory.addReference("ServerInfo", ServerInfo.class);
-        infoFactory.addAttribute("policyConfigurationFactory", String.class, true);
-        infoFactory.addAttribute("policyProvider", String.class, true);
-        infoFactory.addAttribute("keyStore", String.class, true);
-        infoFactory.addAttribute("keyStorePassword", String.class, true);
-        infoFactory.addAttribute("trustStore", String.class, true);
-        infoFactory.addAttribute("trustStorePassword", String.class, true);
-
-        infoFactory.setConstructor(new String[]{"classLoader", "ServerInfo", "policyConfigurationFactory",
-                                                "policyProvider", "keyStore", "keyStorePassword", "trustStore",
-                                                "trustStorePassword"});
-
-        GBEAN_INFO = infoFactory.getBeanInfo();
-    }
-
-    public static GBeanInfo getGBeanInfo() {
-        return GBEAN_INFO;
-    }
 }

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/ca/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/credentialstore/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/deploy/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jacc/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jacc/PolicyContextHandlerHttpServletRequest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jacc/PolicyContextHandlerHttpServletRequest.java?rev=809078&r1=809077&r2=809078&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jacc/PolicyContextHandlerHttpServletRequest.java (original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jacc/PolicyContextHandlerHttpServletRequest.java Sat Aug 29 00:51:12 2009
@@ -19,6 +19,9 @@
 
 import javax.security.jacc.PolicyContextException;
 import javax.security.jacc.PolicyContextHandler;
+import javax.servlet.http.HttpServletRequest;
+import org.apache.geronimo.security.ThreadData;
+import org.apache.geronimo.security.ContextManager;
 
 
 /**
@@ -36,11 +39,21 @@
     }
 
     public Object getContext(String key, Object data) throws PolicyContextException {
-        if (HANDLER_KEY.equals(key) && data != null) {
-
-            return data;
+        if (HANDLER_KEY.equals(key)) {
+            return ((ThreadData)data).getRequest();
         }
-
         return null;
     }
+
+    public static HttpServletRequest pushContextData(HttpServletRequest httpServletRequest) {
+        ThreadData threadData = ContextManager.getThreadData();
+        HttpServletRequest oldRequest = threadData.getRequest();
+        threadData.setRequest(httpServletRequest);
+        return oldRequest;
+    }
+
+    public static void popContextData(HttpServletRequest oldRequest) {
+        ThreadData threadData = ContextManager.getThreadData();
+        threadData.setRequest(oldRequest);
+    }
 }

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jacc/PolicyContextHandlerSOAPMessage.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jacc/PolicyContextHandlerSOAPMessage.java?rev=809078&r1=809077&r2=809078&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jacc/PolicyContextHandlerSOAPMessage.java (original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jacc/PolicyContextHandlerSOAPMessage.java Sat Aug 29 00:51:12 2009
@@ -19,6 +19,10 @@
 
 import javax.security.jacc.PolicyContextException;
 import javax.security.jacc.PolicyContextHandler;
+import javax.xml.soap.SOAPMessage;
+import javax.servlet.http.HttpServletRequest;
+import org.apache.geronimo.security.ThreadData;
+import org.apache.geronimo.security.ContextManager;
 
 
 /**
@@ -36,7 +40,21 @@
     }
 
     public Object getContext(String key, Object data) throws PolicyContextException {
-        // todo: Wire in the return of the SOAPMessage object
+        if (HANDLER_KEY.equals(key)) {
+            return ((ThreadData)data).getSoapMessage();
+        }
         return null;
     }
+
+    public static SOAPMessage pushContextData(SOAPMessage SOAPMessage) {
+        ThreadData threadData = ContextManager.getThreadData();
+        SOAPMessage oldMessage = threadData.getSoapMessage();
+        threadData.setSoapMessage(SOAPMessage);
+        return oldMessage;
+    }
+
+    public static void popContextData(SOAPMessage oldMessage) {
+        ThreadData threadData = ContextManager.getThreadData();
+        threadData.setSoapMessage(oldMessage);
+    }
 }

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jacc/RunAsSource.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jacc/RunAsSource.java?rev=809078&r1=809077&r2=809078&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jacc/RunAsSource.java (original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jacc/RunAsSource.java Sat Aug 29 00:51:12 2009
@@ -21,6 +21,7 @@
 package org.apache.geronimo.security.jacc;
 
 import javax.security.auth.Subject;
+import org.apache.geronimo.security.ContextManager;
 
 /**
  * @version $Rev$ $Date$
@@ -29,15 +30,25 @@
     RunAsSource NULL = new RunAsSource() {
 
         public Subject getDefaultSubject() {
-            return null;
+            return ContextManager.EMPTY;
         }
 
         public Subject getSubjectForRole(String role) {
-            return null;
+            if (role == null) return null;
+            return ContextManager.EMPTY;
         }
     };
 
+    /**
+     *
+     * @return the non-null default subject for this security environment
+     */
     Subject getDefaultSubject();
 
+    /**
+     * If role is null, return null.  Otherwise return a non-null Subject or throw an IllegalArgumentException.
+     * @param role role to estabilish identity for
+     * @return non-null Subject embodying the identity for the supplied non-null role, or null if role is null.
+     */
     Subject getSubjectForRole(String role);
 }

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jacc/mappingprovider/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jacc/mappingprovider/ApplicationPrincipalRoleConfigurationManager.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jacc/mappingprovider/ApplicationPrincipalRoleConfigurationManager.java?rev=809078&r1=809077&r2=809078&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jacc/mappingprovider/ApplicationPrincipalRoleConfigurationManager.java (original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jacc/mappingprovider/ApplicationPrincipalRoleConfigurationManager.java Sat Aug 29 00:51:12 2009
@@ -104,7 +104,10 @@
     }
 
     public Subject getSubjectForRole(String role) {
-        return roleDesignates.get(role);
+        if (role == null) return null;
+        Subject runAs = roleDesignates.get(role);
+        if (runAs == null) throw new IllegalStateException("no run-as identity configured for role: " + role);
+        return runAs;
     }
 
     public void doStart() throws Exception {

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaspi/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/keystore/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/LDAPLoginModule.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/LDAPLoginModule.java?rev=809078&r1=809077&r2=809078&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/LDAPLoginModule.java (original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/LDAPLoginModule.java Sat Aug 29 00:51:12 2009
@@ -87,10 +87,12 @@
     private static final String ROLE_SEARCH_MATCHING = "roleSearchMatching";
     private static final String ROLE_SEARCH_SUBTREE = "roleSearchSubtree";
     private static final String USER_ROLE_NAME = "userRoleName";
+    private static final String FOLLOW_REFERRALS = "followReferrals";
+    
     public final static List<String> supportedOptions = Collections.unmodifiableList(Arrays.asList(INITIAL_CONTEXT_FACTORY, CONNECTION_URL,
             CONNECTION_USERNAME, CONNECTION_PASSWORD, CONNECTION_PROTOCOL, AUTHENTICATION, USER_BASE,
             USER_SEARCH_MATCHING, USER_SEARCH_SUBTREE, ROLE_BASE, ROLE_NAME, ROLE_SEARCH_MATCHING, ROLE_SEARCH_SUBTREE,
-            USER_ROLE_NAME));
+            USER_ROLE_NAME, FOLLOW_REFERRALS));
 
     private String initialContextFactory;
     private String connectionURL;
@@ -102,6 +104,7 @@
     private String roleBase;
     private String roleName;
     private String userRoleName;
+    private boolean followReferrals = true;
 
     private String cbUsername;
     private String cbPassword;
@@ -145,6 +148,8 @@
         roleSearchMatchingFormat = new MessageFormat(roleSearchMatching);
         userSearchSubtreeBool = Boolean.valueOf(userSearchSubtree);
         roleSearchSubtreeBool = Boolean.valueOf(roleSearchSubtree);
+        String followReferralsStr = (String) options.get(FOLLOW_REFERRALS);
+        followReferrals = (followReferralsStr == null) ? true : Boolean.valueOf(followReferralsStr);
     }
 
     /**
@@ -343,6 +348,7 @@
         } else {
             constraints.setSearchScope(SearchControls.ONELEVEL_SCOPE);
         }
+        constraints.setReturningAttributes(new String[] { roleName });
         NamingEnumeration results =
                 context.search(roleBase, filter, constraints);
         while (results.hasMore()) {
@@ -451,6 +457,7 @@
             env.put(Context.SECURITY_PROTOCOL, connectionProtocol == null ? "" : connectionProtocol);
             env.put(Context.PROVIDER_URL, connectionURL == null ? "" : connectionURL);
             env.put(Context.SECURITY_AUTHENTICATION, authentication == null ? "" : authentication);
+            env.put(Context.REFERRAL, (followReferrals) ? "follow" : "ignore");
             context = new InitialDirContext(env);
         } catch (NamingException e) {
             log.error("Failed to open context", e);

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/util/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/util/ConfigurationUtil.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/util/ConfigurationUtil.java?rev=809078&r1=809077&r2=809078&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/util/ConfigurationUtil.java (original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/util/ConfigurationUtil.java Sat Aug 29 00:51:12 2009
@@ -18,9 +18,12 @@
 package org.apache.geronimo.security.util;
 
 import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
 import java.security.AccessController;
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
+import java.security.Principal;
 
 import javax.security.auth.x500.X500Principal;
 import javax.security.jacc.PolicyContext;
@@ -34,6 +37,8 @@
 import org.apache.geronimo.security.PrimaryRealmPrincipal;
 import org.apache.geronimo.security.RealmPrincipal;
 import org.apache.geronimo.security.deploy.PrincipalInfo;
+import org.slf4j.LoggerFactory;
+import org.slf4j.Logger;
 
 
 /**
@@ -45,6 +50,7 @@
  * @see "JSR 115" Java Authorization Contract for Containers
  */
 public class ConfigurationUtil {
+    private static final Logger log = LoggerFactory.getLogger(ConfigurationUtil.class);
 
     /**
      * Create an X500Principal from a deployment description.
@@ -63,23 +69,44 @@
      * @param classLoader
      * @return a RealmPrincipal from a deployment description
      */
-    public static java.security.Principal generatePrincipal(final PrincipalInfo principalInfo, ClassLoader classLoader) {
+    public static Principal generatePrincipal(final PrincipalInfo principalInfo, ClassLoader classLoader) {
         return generatePrincipal(principalInfo.getClassName(), principalInfo.getPrincipalName(), classLoader);
     }
 
-    public static java.security.Principal generatePrincipal(final String className, final String principalName, final ClassLoader classLoader) {
+    public static Principal generatePrincipal(final String className, final String principalName, final ClassLoader classLoader) {
         try {
-            return (java.security.Principal) AccessController.doPrivileged(new PrivilegedExceptionAction() {
-                public Object run() throws Exception {
-                    Class clazz = classLoader.loadClass(className);
-                    Constructor constructor = clazz.getDeclaredConstructor(new Class[]{String.class});
-                    return (java.security.Principal) constructor.newInstance(new Object[]{principalName});
+            return AccessController.doPrivileged(new PrivilegedExceptionAction<Principal>() {
+                public Principal run() throws Exception {
+                    Class<Principal> clazz = (Class<Principal>) classLoader.loadClass(className);
+                    try {
+                        Constructor<Principal> constructor = clazz.getDeclaredConstructor(new Class[]{String.class});
+                        return constructor.newInstance(new Object[]{principalName});
+                    } catch (NoSuchMethodException e) {
+                        Constructor<Principal>[] constructors = (Constructor<Principal>[])clazz.getDeclaredConstructors();
+                        for (Constructor<Principal> constructor: constructors) {
+                            Class<?>[] paramTypes = constructor.getParameterTypes();
+                            if (paramTypes.length == 0) {
+                                Principal p = constructor.newInstance();
+                                Method m = clazz.getMethod("setName", String.class);
+                                m.invoke(p, principalName);
+                                return p;
+                            }
+                            if (paramTypes[0] == String.class) {
+                                Object[] params = new Object[paramTypes.length];
+                                params[0] = principalName;
+                                return constructor.newInstance(params);
+                            }
+                        }
+                        throw new RuntimeException("Could not construct principal of class: " + className);
+                    }
                 }
             });
         } catch (PrivilegedActionException e) {
             e.printStackTrace();
             if (e.getException() != null) {
-                e.getException().printStackTrace();
+                log.info("PrivilegedActionException containing", e.getException());
+            } else {
+                log.info("PrivilegedActionException", e);
             }
             return null;
         }
@@ -134,10 +161,10 @@
         try {
             return (PrimaryRealmPrincipal) AccessController.doPrivileged(new PrivilegedExceptionAction() {
                 public Object run() throws Exception {
-                    java.security.Principal p = null;
+                    Principal p = null;
                     Class clazz = classLoader.loadClass(className);
                     Constructor constructor = clazz.getDeclaredConstructor(new Class[]{String.class});
-                    p = (java.security.Principal) constructor.newInstance(new Object[]{principalName});
+                    p = (Principal) constructor.newInstance(new Object[]{principalName});
 
                     return new PrimaryRealmPrincipal(realm, domain, p);
                 }
@@ -164,10 +191,10 @@
         try {
             return (PrimaryDomainPrincipal) AccessController.doPrivileged(new PrivilegedExceptionAction() {
                 public Object run() throws Exception {
-                    java.security.Principal p = null;
+                    Principal p = null;
                     Class clazz = classLoader.loadClass(className);
                     Constructor constructor = clazz.getDeclaredConstructor(new Class[]{String.class});
-                    p = (java.security.Principal) constructor.newInstance(new Object[]{principalName});
+                    p = (Principal) constructor.newInstance(new Object[]{principalName});
 
                     return new PrimaryDomainPrincipal(domain, p);
                 }
@@ -192,10 +219,10 @@
         try {
             return (PrimaryPrincipal) AccessController.doPrivileged(new PrivilegedExceptionAction() {
                 public Object run() throws Exception {
-                    java.security.Principal p = null;
+                    Principal p = null;
                     Class clazz = classLoader.loadClass(className);
                     Constructor constructor = clazz.getDeclaredConstructor(new Class[]{String.class});
-                    p = (java.security.Principal) constructor.newInstance(new Object[]{principalName});
+                    p = (Principal) constructor.newInstance(new Object[]{principalName});
 
                     return new PrimaryPrincipal(p);
                 }

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/test/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/test/data/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/test/data/data/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/test/data/xml/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/test/data/xml/deployment/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/test/java/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/test/java/org/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/test/java/org/apache/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/test/java/org/apache/geronimo/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/test/java/org/apache/geronimo/security/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/test/java/org/apache/geronimo/security/AbstractTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/test/java/org/apache/geronimo/security/AbstractTest.java?rev=809078&r1=809077&r2=809078&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/test/java/org/apache/geronimo/security/AbstractTest.java (original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/test/java/org/apache/geronimo/security/AbstractTest.java Sat Aug 29 00:51:12 2009
@@ -63,7 +63,7 @@
     protected boolean needLoginConfiguration = true;
 
     protected void setUp() throws Exception {
-        kernel = KernelFactory.newInstance().createKernel("test.kernel");
+        kernel = KernelFactory.newInstance(bundle).createKernel("test.kernel");
         kernel.boot();
 
         GBeanData gbean;

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/test/java/org/apache/geronimo/security/ContextManagerTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/test/java/org/apache/geronimo/security/ContextManagerTest.java?rev=809078&r1=809077&r2=809078&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/test/java/org/apache/geronimo/security/ContextManagerTest.java (original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/test/java/org/apache/geronimo/security/ContextManagerTest.java Sat Aug 29 00:51:12 2009
@@ -80,4 +80,5 @@
             ContextManager.clearCallers();
         }
     }
+
 }

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/test/java/org/apache/geronimo/security/credentialstore/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/test/java/org/apache/geronimo/security/jaas/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/test/java/org/apache/geronimo/security/jaas/ConfigurationEntryTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/test/java/org/apache/geronimo/security/jaas/ConfigurationEntryTest.java?rev=809078&r1=809077&r2=809078&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/test/java/org/apache/geronimo/security/jaas/ConfigurationEntryTest.java (original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/test/java/org/apache/geronimo/security/jaas/ConfigurationEntryTest.java Sat Aug 29 00:51:12 2009
@@ -111,7 +111,7 @@
     }
 
     protected void setUp() throws Exception {
-        kernel = KernelFactory.newInstance().createKernel("test.kernel");
+        kernel = KernelFactory.newInstance(bundle).createKernel("test.kernel");
         kernel.boot();
 
         GBeanData gbean;

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/test/java/org/apache/geronimo/security/jacc/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/test/java/org/apache/geronimo/security/jacc/mappingprovider/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/test/java/org/apache/geronimo/security/realm/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-security/src/test/java/org/apache/geronimo/security/realm/providers/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -1,10 +1,9 @@
+.*
 *.iws
 *.ipr
 *.iml
-.classpath
-.project
-.settings
 *.log
 junit*.properties
+maven-eclipse.xml
 target
 bin

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/pom.xml?rev=809078&r1=809077&r2=809078&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/pom.xml (original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/pom.xml Sat Aug 29 00:51:12 2009
@@ -18,16 +18,18 @@
 
 <!-- $Rev$ $Date$ -->
 
-<project>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.apache.geronimo.framework</groupId>
         <artifactId>modules</artifactId>
-        <version>2.2-SNAPSHOT</version>
+        <version>3.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>geronimo-service-builder</artifactId>
+    //wipes out xmlbeans classes
+    <!--<packaging>bundle</packaging>-->
     <name>Geronimo Framework, Modules :: Service Builder</name>
     
     <dependencies>

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/plugin/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/EnvironmentBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/EnvironmentBuilder.java?rev=809078&r1=809077&r2=809078&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/EnvironmentBuilder.java (original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/EnvironmentBuilder.java Sat Aug 29 00:51:12 2009
@@ -45,6 +45,7 @@
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 import org.apache.xmlbeans.XmlOptions;
+import org.osgi.framework.Bundle;
 
 /**
  * @version $Rev$ $Date$
@@ -247,7 +248,7 @@
         return NAMESPACE;
     }
 
-    public Object getValue(XmlObject xmlObject, String type, ClassLoader cl) throws DeploymentException {
+    public Object getValue(XmlObject xmlObject, String type, Bundle bundle) throws DeploymentException {
 
         EnvironmentType environmentType;
         if (xmlObject instanceof EnvironmentType) {

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/GBeanBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/GBeanBuilder.java?rev=809078&r1=809077&r2=809078&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/GBeanBuilder.java (original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/GBeanBuilder.java Sat Aug 29 00:51:12 2009
@@ -48,6 +48,7 @@
 import org.apache.xmlbeans.QNameSet;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
+import org.osgi.framework.Bundle;
 
 /**
  * @version $Rev$ $Date$
@@ -104,16 +105,16 @@
             } catch (XmlException e) {
                 throw new DeploymentException("Could not validate gbean xml", e);
             }
-            addGBeanData(gbean, moduleContext.getModuleName(), moduleContext.getClassLoader(), moduleContext);
+            addGBeanData(gbean, moduleContext.getModuleName(), moduleContext.getBundle(), moduleContext);
         }
     }
 
-    private AbstractName addGBeanData(GbeanType gbean, AbstractName moduleName, ClassLoader cl, DeploymentContext context) throws DeploymentException {
-        GBeanInfo gBeanInfo = infoFactory.getGBeanInfo(gbean.getClass1(), cl);
+    private AbstractName addGBeanData(GbeanType gbean, AbstractName moduleName, Bundle bundle, DeploymentContext context) throws DeploymentException {
+        GBeanInfo gBeanInfo = infoFactory.getGBeanInfo(gbean.getClass1(), bundle);
         String namePart = gbean.getName();
         String j2eeType = gBeanInfo.getJ2eeType();
         AbstractName abstractName = context.getNaming().createChildName(moduleName, namePart, j2eeType);
-        SingleGBeanBuilder builder = new SingleGBeanBuilder(abstractName, gBeanInfo, cl, context, moduleName, attrRefMap , refRefMap);
+        SingleGBeanBuilder builder = new SingleGBeanBuilder(abstractName, gBeanInfo, bundle, context, moduleName, attrRefMap , refRefMap);
 
         // set up attributes
         AttributeType[] attributeArray = gbean.getAttributeArray();

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/JavaBeanXmlAttributeBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/JavaBeanXmlAttributeBuilder.java?rev=809078&r1=809077&r2=809078&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/JavaBeanXmlAttributeBuilder.java (original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/JavaBeanXmlAttributeBuilder.java Sat Aug 29 00:51:12 2009
@@ -32,6 +32,7 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.crypto.EncryptionManager;
 import org.apache.xmlbeans.XmlObject;
+import org.osgi.framework.Bundle;
 
 /**
  * @version $Rev$ $Date$
@@ -44,20 +45,20 @@
         return NAMESPACE;
     }
 
-    public Object getValue(XmlObject xmlObject, String type, ClassLoader cl) throws DeploymentException {
+    public Object getValue(XmlObject xmlObject, String type, Bundle bundle) throws DeploymentException {
         JavabeanType javabean = (JavabeanType) xmlObject.copy().changeType(JavabeanType.type);
-        return getValue(javabean, type, cl);
+        return internalGetValue(javabean, type, bundle);
     }
 
-    private Object getValue(JavabeanType javabean, String type, ClassLoader cl) throws DeploymentException {
+    private Object internalGetValue(JavabeanType javabean, String type, Bundle bundle) throws DeploymentException {
         String className = type;
         if (javabean.isSetClass1()) {
             className = javabean.getClass1();
         }
         Class clazz = null;
         try {
-            clazz = cl.loadClass(className);
-            if (!type.equals(className) && !cl.loadClass(type).isAssignableFrom(clazz)) {
+            clazz = bundle.loadClass(className);
+            if (!type.equals(className) && !bundle.loadClass(type).isAssignableFrom(clazz)) {
                 throw new DeploymentException("javabean class " + className + " is not of the expected type " + type);
             }
         } catch (ClassNotFoundException e) {
@@ -95,7 +96,7 @@
                     
                     PropertyEditor propertyEditor = null;
                     try {
-                        propertyEditor = PropertyEditors.findEditor(protertyType, cl);
+                        propertyEditor = PropertyEditors.findEditor(protertyType, bundle);
                     } catch (ClassNotFoundException e) {
                         throw new DeploymentException("Could not load editor for type " + protertyType, e);
                     }
@@ -124,7 +125,7 @@
                 PropertyDescriptor propertyDescriptor = propertyDescriptors[j];
                 if (propertyName.equals(propertyDescriptor.getName())) {
                     String propertyType = propertyDescriptor.getPropertyType().getName();
-                    Object value = getValue(innerBean, propertyType, cl);
+                    Object value = getValue(innerBean, propertyType, bundle);
                     Method m = propertyDescriptor.getWriteMethod();
                     try {
                         m.invoke(instance, new Object[] {value});

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/JavaBeanXmlAttributeEditor.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/JavaBeanXmlAttributeEditor.java?rev=809078&r1=809077&r2=809078&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/JavaBeanXmlAttributeEditor.java (original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/JavaBeanXmlAttributeEditor.java Sat Aug 29 00:51:12 2009
@@ -37,6 +37,7 @@
 import org.apache.geronimo.crypto.EncryptionManager;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlOptions;
+import org.osgi.framework.Bundle;
 
 /**
  *
@@ -57,12 +58,14 @@
 
     private final Class javaBeanClazz;
     private final XmlAttributeBuilder xmlAttributeBuilder;
-    
-    public JavaBeanXmlAttributeEditor(Class clazz) {
+    private final Bundle bundle;
+
+    public JavaBeanXmlAttributeEditor(Class clazz, Bundle bundle) {
         if (null == clazz) {
             throw new IllegalArgumentException("clazz is required");
         }
         this.javaBeanClazz = clazz;
+        this.bundle = bundle;
         
         xmlAttributeBuilder = newXmlAttributeBuilder();
     }
@@ -79,7 +82,7 @@
             
             Object javabean = xmlAttributeBuilder.getValue(javaBeanType,
                 javaBeanClazz.getName(),
-                getClass().getClassLoader());
+                bundle);
 
             setValue(javabean);
         } catch (XmlException e) {
@@ -129,7 +132,7 @@
         
         Object value;
         try {
-            value = readMethod.invoke(javaBean, null);
+            value = readMethod.invoke(javaBean, (Object[])null);
         } catch (Exception e) {
             throw new IllegalStateException("See nested", e);
         }

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java?rev=809078&r1=809077&r2=809078&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java (original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java Sat Aug 29 00:51:12 2009
@@ -17,7 +17,6 @@
 
 package org.apache.geronimo.deployment.service;
 
-import java.beans.PropertyEditorManager;
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
@@ -25,12 +24,11 @@
 import java.net.URL;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Map;
 import java.util.HashMap;
+import java.util.Map;
 import java.util.jar.JarFile;
 
 import javax.xml.namespace.QName;
-
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.ConfigurationBuilder;
 import org.apache.geronimo.deployment.DeploymentContext;
@@ -44,12 +42,14 @@
 import org.apache.geronimo.deployment.xbeans.ModuleType;
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.gbean.annotation.ParamAttribute;
+import org.apache.geronimo.gbean.annotation.ParamReference;
+import org.apache.geronimo.gbean.annotation.ParamSpecial;
+import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
+import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.Naming;
-import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.config.ConfigurationAlreadyExistsException;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
@@ -63,13 +63,14 @@
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
+import org.osgi.framework.BundleContext;
 
 /**
  * @version $Rev$ $Date$
  */
 public class ServiceConfigBuilder implements ConfigurationBuilder, GBeanLifecycle {
     private final Environment defaultEnvironment;
-    private final Collection repositories;
+    private final Collection<Repository> repositories;
 
     private static final QName MODULE_QNAME = ModuleDocument.type.getDocumentElementName();
     public static final String SERVICE_MODULE = "ServiceModule";
@@ -83,17 +84,22 @@
     private final Naming naming;
     private final ConfigurationManager configurationManager;
     private final NamespaceDrivenBuilderCollection serviceBuilders;
+    private final BundleContext bundleContext;
 
-    public ServiceConfigBuilder(Environment defaultEnvironment, Collection repositories, Naming naming) {
-        this(defaultEnvironment, repositories, Collections.EMPTY_LIST, naming, null);
+    public ServiceConfigBuilder(Environment defaultEnvironment, Collection<Repository> repositories, Naming naming, BundleContext bundleContext) {
+        this(defaultEnvironment, repositories, Collections.<NamespaceDrivenBuilder>emptyList(), naming, null, bundleContext);
     }
 
-    public ServiceConfigBuilder(Environment defaultEnvironment, Collection repositories, Collection<NamespaceDrivenBuilder> serviceBuilders, Kernel kernel) throws GBeanNotFoundException {
-        this(defaultEnvironment, repositories, serviceBuilders, kernel.getNaming(), ConfigurationUtil.getConfigurationManager(kernel));
+    public ServiceConfigBuilder(@ParamAttribute(name="defaultEnvironment")Environment defaultEnvironment,
+                                @ParamReference(name="Repository", namingType = "Repository")Collection<Repository> repositories,
+                                @ParamReference(name="ModuleBuilder", namingType = "ModuleBuilder")Collection<NamespaceDrivenBuilder> serviceBuilders,
+                                @ParamSpecial(type = SpecialAttributeType.kernel)Kernel kernel,
+                                @ParamSpecial(type = SpecialAttributeType.bundleContext) BundleContext bundleContext) throws GBeanNotFoundException {
+        this(defaultEnvironment, repositories, serviceBuilders, kernel.getNaming(), ConfigurationUtil.getConfigurationManager(kernel), bundleContext);
     }
 
-    public ServiceConfigBuilder(Environment defaultEnvironment, Collection repositories, Collection<NamespaceDrivenBuilder> serviceBuilders, Naming naming) {
-        this(defaultEnvironment, repositories, serviceBuilders, naming, null);
+    public ServiceConfigBuilder(Environment defaultEnvironment, Collection<Repository> repositories, Collection<NamespaceDrivenBuilder> serviceBuilders, Naming naming, BundleContext bundleContext) {
+        this(defaultEnvironment, repositories, serviceBuilders, naming, null, bundleContext);
     }
 
     public void doStart() throws Exception {
@@ -108,15 +114,16 @@
         doStop();
     }
 
-    private ServiceConfigBuilder(Environment defaultEnvironment, Collection repositories, Collection<NamespaceDrivenBuilder> serviceBuilders, Naming naming, ConfigurationManager configurationManager) {
+    private ServiceConfigBuilder(Environment defaultEnvironment, Collection<Repository> repositories, Collection<NamespaceDrivenBuilder> serviceBuilders, Naming naming, ConfigurationManager configurationManager, BundleContext bundleContext) {
         this.naming = naming;
         this.configurationManager = configurationManager;
 
-        EnvironmentBuilder environmentBuilder = new EnvironmentBuilder();
+//        EnvironmentBuilder environmentBuilder = new EnvironmentBuilder();
         this.defaultEnvironment = defaultEnvironment;
 
         this.repositories = repositories;
         this.serviceBuilders = new NamespaceDrivenBuilderCollection(serviceBuilders);
+        this.bundleContext = bundleContext;
     }
 
     public Object getDeploymentPlan(File planFile, JarFile jarFile, ModuleIDBuilder idBuilder) throws DeploymentException {
@@ -127,7 +134,7 @@
         try {
             XmlObject xmlObject;
             if (planFile != null) {
-                xmlObject = XmlBeansUtil.parse(planFile.toURL(), getClass().getClassLoader());
+                xmlObject = XmlBeansUtil.parse(planFile.toURI().toURL(), getClass().getClassLoader());
             } else {
                 URL path = DeploymentUtil.createJarURL(jarFile, "META-INF/geronimo-service.xml");
                 try {
@@ -194,13 +201,13 @@
         return environment.getConfigId();
     }
 
-    public DeploymentContext buildConfiguration(boolean inPlaceDeployment, Artifact configId, Object plan, JarFile jar, Collection configurationStores, ArtifactResolver artifactResolver, ConfigurationStore targetConfigurationStore) throws IOException, DeploymentException {
+    public DeploymentContext buildConfiguration(boolean inPlaceDeployment, Artifact configId, Object plan, JarFile jar, Collection<ConfigurationStore> configurationStores, ArtifactResolver artifactResolver, ConfigurationStore targetConfigurationStore) throws IOException, DeploymentException {
         ModuleType configType = (ModuleType) plan;
 
         return buildConfiguration(inPlaceDeployment, configId, configType, jar, configurationStores, artifactResolver, targetConfigurationStore);
     }
 
-    public DeploymentContext buildConfiguration(boolean inPlaceDeployment, Artifact configId, ModuleType moduleType, JarFile jar, Collection configurationStores, ArtifactResolver artifactResolver, ConfigurationStore targetConfigurationStore) throws DeploymentException, IOException {
+    public DeploymentContext buildConfiguration(boolean inPlaceDeployment, Artifact configId, ModuleType moduleType, JarFile jar, Collection<ConfigurationStore> configurationStores, ArtifactResolver artifactResolver, ConfigurationStore targetConfigurationStore) throws DeploymentException, IOException {
         ArtifactType type = moduleType.getEnvironment().isSetModuleId() ? moduleType.getEnvironment().getModuleId() : moduleType.getEnvironment().addNewModuleId();
         type.setArtifactId(configId.getArtifactId());
         type.setGroupId(configId.getGroupId());
@@ -221,7 +228,7 @@
         try {
             ConfigurationManager configurationManager = this.configurationManager;
             if (configurationManager == null) {
-                configurationManager = new SimpleConfigurationManager(configurationStores, artifactResolver, repositories);
+                configurationManager = new SimpleConfigurationManager(configurationStores, artifactResolver, repositories, bundleContext);
             }
 
             AbstractName moduleName = naming.createRootName(configId, configId.toString(), SERVICE_MODULE);
@@ -232,7 +239,7 @@
                     ConfigurationModuleType.SERVICE,
                     naming,
                     configurationManager,
-                    repositories);
+                    repositories, bundleContext);
             if(jar != null) {
                 File file = new File(jar.getName());
                 context.addIncludeAsPackedJar(URI.create(file.getName()), jar);
@@ -270,27 +277,4 @@
         }
     }
 
-    public static final GBeanInfo GBEAN_INFO;
-
-    static {
-        PropertyEditorManager.registerEditor(Environment.class, EnvironmentBuilder.class);
-
-        GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(ServiceConfigBuilder.class, CONFIG_BUILDER);
-
-        infoBuilder.addInterface(ConfigurationBuilder.class);
-
-        infoBuilder.addAttribute("defaultEnvironment", Environment.class, true);
-        infoBuilder.addReference("Repository", Repository.class, "Repository");
-        infoBuilder.addReference("ServiceBuilders", NamespaceDrivenBuilder.class, "ModuleBuilder");
-        infoBuilder.addAttribute("kernel", Kernel.class, false, false);
-
-        infoBuilder.setConstructor(new String[]{"defaultEnvironment", "Repository", "ServiceBuilders", "kernel"});
-
-        GBEAN_INFO = infoBuilder.getBeanInfo();
-    }
-
-    public static GBeanInfo getGBeanInfo() {
-        return GBEAN_INFO;
-    }
-
 }

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/SingleGBeanBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/SingleGBeanBuilder.java?rev=809078&r1=809077&r2=809078&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/SingleGBeanBuilder.java (original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/SingleGBeanBuilder.java Sat Aug 29 00:51:12 2009
@@ -39,21 +39,22 @@
 import org.apache.geronimo.gbean.ReferencePatterns;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.xmlbeans.XmlObject;
+import org.osgi.framework.Bundle;
 
 /**
  * @version $Rev$ $Date$
  */
 public class SingleGBeanBuilder {
     private final GBeanData gbean;
-    private final ClassLoader classLoader;
+    private final Bundle bundle;
     private final DeploymentContext context;
     private final AbstractName moduleName;
     private final Map xmlAttributeBuilderMap;
     private final Map xmlReferenceBuilderMap;
 
-    SingleGBeanBuilder(AbstractName abstractName, GBeanInfo gBeanInfo, ClassLoader classLoader, DeploymentContext context, AbstractName moduleName, Map xmlAttributeBuilderMap, Map xmlReferenceBuilderMap) {
+    SingleGBeanBuilder(AbstractName abstractName, GBeanInfo gBeanInfo, Bundle bundle, DeploymentContext context, AbstractName moduleName, Map xmlAttributeBuilderMap, Map xmlReferenceBuilderMap) {
 
-        this.classLoader = classLoader;
+        this.bundle = bundle;
         this.context = context;
         this.moduleName = moduleName;
         this.gbean = new GBeanData(abstractName, gBeanInfo);
@@ -75,7 +76,7 @@
                 type = attribute.getType();
             }
 
-            PropertyEditor editor = PropertyEditors.findEditor(type, classLoader);
+            PropertyEditor editor = PropertyEditors.findEditor(type, bundle);
             if (editor == null) {
                 throw new DeploymentException("Unable to find PropertyEditor for " + type);
             }
@@ -102,7 +103,7 @@
             throw new DeploymentException("Unknown attribute " + name + " on " + gbean.getAbstractName());
         }
         String type = attribute.getType();
-        Object value = builder.getValue(xmlObject, type, classLoader);
+        Object value = builder.getValue(xmlObject, type, bundle);
         gbean.setAttribute(name, value);
     }
 
@@ -112,7 +113,7 @@
         if (builder == null) {
             throw new DeploymentException("No reference builder deployed for namespace: " + namespace);
         }
-        ReferencePatterns references = builder.getReferences(xmlObject, context, moduleName, classLoader);
+        ReferencePatterns references = builder.getReferences(xmlObject, context, moduleName, bundle);
         if (references != null) {
             gbean.setReferencePatterns(name, references);
         }

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/XmlAttributeBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/XmlAttributeBuilder.java?rev=809078&r1=809077&r2=809078&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/XmlAttributeBuilder.java (original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/XmlAttributeBuilder.java Sat Aug 29 00:51:12 2009
@@ -18,6 +18,7 @@
 
 import org.apache.xmlbeans.XmlObject;
 import org.apache.geronimo.common.DeploymentException;
+import org.osgi.framework.Bundle;
 
 /**
  * @version $Rev$ $Date$
@@ -26,6 +27,6 @@
 
     String getNamespace();
 
-    Object getValue(XmlObject xmlObject, String type, ClassLoader cl) throws DeploymentException;
+    Object getValue(XmlObject xmlObject, String type, Bundle bundle) throws DeploymentException;
 
 }

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/XmlReferenceBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/XmlReferenceBuilder.java?rev=809078&r1=809077&r2=809078&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/XmlReferenceBuilder.java (original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/XmlReferenceBuilder.java Sat Aug 29 00:51:12 2009
@@ -21,6 +21,7 @@
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.ReferencePatterns;
 import org.apache.xmlbeans.XmlObject;
+import org.osgi.framework.Bundle;
 
 /**
  * @version $Rev$ $Date$
@@ -29,6 +30,6 @@
 
     String getNamespace();
 
-    ReferencePatterns getReferences(XmlObject xmlObject, DeploymentContext context, AbstractName moduleAbstractName, ClassLoader classLoader) throws DeploymentException;
+    ReferencePatterns getReferences(XmlObject xmlObject, DeploymentContext context, AbstractName moduleAbstractName, Bundle bundle) throws DeploymentException;
 
 }

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/jsr88/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/xmlbeans/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/xsd/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/main/xsdconfig/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/test/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/test/java/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/test/java/org/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/test/java/org/apache/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/test/java/org/apache/geronimo/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/test/java/org/apache/geronimo/deployment/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/test/java/org/apache/geronimo/deployment/MockGBean.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/test/java/org/apache/geronimo/deployment/MockGBean.java?rev=809078&r1=809077&r2=809078&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/test/java/org/apache/geronimo/deployment/MockGBean.java (original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/test/java/org/apache/geronimo/deployment/MockGBean.java Sat Aug 29 00:51:12 2009
@@ -95,9 +95,6 @@
         infoFactory.addAttribute("intValue", int.class, true);
         infoFactory.addAttribute("fooBarBean", FooBarBean.class, true);
 
-        infoFactory.addOperation("checkEndpoint");
-        infoFactory.addOperation("doSomething", new Class[]{String.class});
-
         infoFactory.addReference("MockEndpoint", MockEndpoint.class, null);
 
         infoFactory.setConstructor(new String[] {"name"});

Propchange: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/test/java/org/apache/geronimo/deployment/service/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 29 00:51:12 2009
@@ -0,0 +1,9 @@
+.*
+*.iws
+*.ipr
+*.iml
+*.log
+junit*.properties
+maven-eclipse.xml
+target
+bin

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/test/java/org/apache/geronimo/deployment/service/EnvironmentBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/test/java/org/apache/geronimo/deployment/service/EnvironmentBuilderTest.java?rev=809078&r1=809077&r2=809078&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/test/java/org/apache/geronimo/deployment/service/EnvironmentBuilderTest.java (original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-service-builder/src/test/java/org/apache/geronimo/deployment/service/EnvironmentBuilderTest.java Sat Aug 29 00:51:12 2009
@@ -24,6 +24,7 @@
 import org.apache.geronimo.deployment.xbeans.ArtifactType;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.gbean.GBeanData;
 
 /**
  * @version $Rev$ $Date$
@@ -69,7 +70,7 @@
     }
 
     public void testPropertyEditorRegistration() throws Exception {
-        ServiceConfigBuilder.getGBeanInfo();
+        new GBeanData(ServiceConfigBuilder.class);
         PropertyEditor propertyEditor = PropertyEditorManager.findEditor(Environment.class);
         assertTrue(propertyEditor instanceof EnvironmentBuilder);
     }



Mime
View raw message