geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r1096946 - in /geronimo/server/trunk: ./ framework/modules/geronimo-common/ framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/ framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/ frame...
Date Tue, 26 Apr 2011 23:15:46 GMT
Author: djencks
Date: Tue Apr 26 23:15:45 2011
New Revision: 1096946

URL: http://svn.apache.org/viewvc?rev=1096946&view=rev
Log:
Reduce dependency on gbean framework

Modified:
    geronimo/server/trunk/framework/modules/geronimo-common/pom.xml
    geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanData.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/Kernel.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/KernelGBean.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/BasicKernel.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/BasicRegistry.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/jmx/KernelDelegate.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
    geronimo/server/trunk/pom.xml

Modified: geronimo/server/trunk/framework/modules/geronimo-common/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-common/pom.xml?rev=1096946&r1=1096945&r2=1096946&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-common/pom.xml (original)
+++ geronimo/server/trunk/framework/modules/geronimo-common/pom.xml Tue Apr 26 23:15:45 2011
@@ -34,11 +34,34 @@
     
     <dependencies>
         <dependency>
+            <groupId> org.ops4j.pax.logging</groupId>
+            <artifactId>pax-logging-api</artifactId>
+        </dependency>
+        <dependency>
             <groupId>org.apache.geronimo.framework</groupId>
             <artifactId>geronimo-kernel</artifactId>
             <version>${project.version}</version>
         </dependency>
     </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <configuration>
+                    <instructions>
+                        <Import-Package>
+                            org.apache.geronimo.gbean.*;resolution:=optional,
+                            org.apache.geronimo.kernel.*;resolution:=optional,
+                            *
+                        </Import-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+
+        </plugins>
+    </build>
     
 </project>
 

Modified: geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java?rev=1096946&r1=1096945&r2=1096946&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
Tue Apr 26 23:15:45 2011
@@ -346,7 +346,7 @@ public class DeploymentContext {
     }
 
     public LinkedHashSet<GBeanData> findGBeanDatas(Configuration configuration, AbstractNameQuery
pattern) {
-        return configuration.findGBeanDatas(configuration, Collections.singleton(pattern));
+        return configuration.findGBeanDatas(Collections.singleton(pattern));
     }
 
     public LinkedHashSet<AbstractName> findGBeans(Set<AbstractNameQuery> patterns)
{
@@ -482,6 +482,10 @@ public class DeploymentContext {
         resourceContext.addFile(targetPath, source);
     }
 
+    public void addFile(URI targetPath, byte[] source) throws IOException {
+        resourceContext.addFile(targetPath, source);
+    }
+
     public File getTargetFile(URI targetPath) {
         return resourceContext.getTargetFile(targetPath);
     }
@@ -538,15 +542,15 @@ public class DeploymentContext {
      * @throws DeploymentException if configuration is invalid
      */
     public ConfigurationData getConfigurationData() throws DeploymentException {
-        List<String> failures = verify(configuration);
-        if (!failures.isEmpty()) {
-            StringBuffer message = new StringBuffer();
-            for (String failure : failures) {
-                if (message.length() > 0) message.append("\n");
-                message.append(failure);
-            }
-            throw new DeploymentException(message.toString());
-        }
+//        List<String> failures = verify(configuration);
+//        if (!failures.isEmpty()) {
+//            StringBuffer message = new StringBuffer();
+//            for (String failure : failures) {
+//                if (message.length() > 0) message.append("\n");
+//                message.append(failure);
+//            }
+//            throw new DeploymentException(message.toString());
+//        }
 
         // TODO OSGI figure out exports
         environment.addToBundleClassPath(bundleClassPath);

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanData.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanData.java?rev=1096946&r1=1096945&r2=1096946&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanData.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanData.java
Tue Apr 26 23:15:45 2011
@@ -110,6 +110,38 @@ public class GBeanData implements Extern
         }
     }
 
+//    @Override
+//    public boolean equals(Object o) {
+//        if (this == o) return true;
+//        if (o == null || getClass() != o.getClass()) return false;
+//
+//        GBeanData gBeanData = (GBeanData) o;
+//
+//        if (priority != gBeanData.priority) return false;
+//        if (abstractName != null ? !abstractName.equals(gBeanData.abstractName) : gBeanData.abstractName
!= null) return false;
+//        if (attributes != null ? !attributes.equals(gBeanData.attributes) : gBeanData.attributes
!= null) return false;
+//        if (dependencies != null ? !dependencies.equals(gBeanData.dependencies) : gBeanData.dependencies
!= null) return false;
+//        if (gbeanInfo != null ? !gbeanInfo.equals(gBeanData.gbeanInfo) : gBeanData.gbeanInfo
!= null) return false;
+//        if (references != null ? !references.equals(gBeanData.references) : gBeanData.references
!= null) return false;
+//        if (!Arrays.equals(serviceInterfaces, gBeanData.serviceInterfaces)) return false;
+//        if (serviceProperties != null ? !serviceProperties.equals(gBeanData.serviceProperties)
: gBeanData.serviceProperties != null) return false;
+//
+//        return true;
+//    }
+//
+//    @Override
+//    public int hashCode() {
+//        int result = gbeanInfo != null ? gbeanInfo.hashCode() : 0;
+//        result = 31 * result + (attributes != null ? attributes.hashCode() : 0);
+//        result = 31 * result + (references != null ? references.hashCode() : 0);
+//        result = 31 * result + (dependencies != null ? dependencies.hashCode() : 0);
+//        result = 31 * result + (abstractName != null ? abstractName.hashCode() : 0);
+//        result = 31 * result + priority;
+//        result = 31 * result + (serviceInterfaces != null ? Arrays.hashCode(serviceInterfaces)
: 0);
+//        result = 31 * result + (serviceProperties != null ? serviceProperties.hashCode()
: 0);
+//        return result;
+//    }
+
     public AbstractName getAbstractName() {
         return abstractName;
     }

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/Kernel.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/Kernel.java?rev=1096946&r1=1096945&r2=1096946&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/Kernel.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/Kernel.java
Tue Apr 26 23:15:45 2011
@@ -18,6 +18,7 @@ package org.apache.geronimo.kernel;
 
 import java.util.Collections;
 import java.util.Date;
+import java.util.LinkedHashSet;
 import java.util.Set;
 
 import javax.management.ObjectName;
@@ -377,4 +378,7 @@ public interface Kernel {
     Object invoke(ObjectName name, String methodName, Object[] args, String[] types) throws
GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception;
 
     String getStateReason(AbstractName abstractName);
+
+    //delegated from Configuration
+    LinkedHashSet<GBeanData> findGBeanDatas(Set<AbstractNameQuery> patterns);
 }

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/KernelGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/KernelGBean.java?rev=1096946&r1=1096945&r2=1096946&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/KernelGBean.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/KernelGBean.java
Tue Apr 26 23:15:45 2011
@@ -17,6 +17,7 @@
 package org.apache.geronimo.kernel;
 
 import java.util.Date;
+import java.util.LinkedHashSet;
 import java.util.Set;
 import javax.management.ObjectName;
 
@@ -340,6 +341,11 @@ public class KernelGBean implements Kern
         return kernel.getStateReason(abstractName);
     }
 
+    @Override
+    public LinkedHashSet<GBeanData> findGBeanDatas(Set<AbstractNameQuery> patterns)
{
+        return kernel.findGBeanDatas(patterns);
+    }
+
     public Object invoke(AbstractName abstractName, String methodName, Object[] args, String[]
types) throws GBeanNotFoundException, NoSuchOperationException, InternalKernelException, Exception
{
         return kernel.invoke(abstractName, methodName, args, types);
     }

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/BasicKernel.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/BasicKernel.java?rev=1096946&r1=1096945&r2=1096946&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/BasicKernel.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/BasicKernel.java
Tue Apr 26 23:15:45 2011
@@ -19,6 +19,7 @@ package org.apache.geronimo.kernel.basic
 
 import java.util.Date;
 import java.util.HashSet;
+import java.util.LinkedHashSet;
 import java.util.LinkedList;
 import java.util.Set;
 import javax.management.ObjectName;
@@ -280,6 +281,13 @@ public class BasicKernel implements Kern
         }
     }
 
+    //delegated from Configuration
+    @Override
+    public LinkedHashSet<GBeanData> findGBeanDatas(Set<AbstractNameQuery> patterns)
{
+        return registry.findGBeanDatas(patterns);
+    }
+
+
     public Object getGBean(String shortName) throws GBeanNotFoundException, InternalKernelException,
IllegalStateException {
         return getGBean(shortName, null);
     }

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/BasicRegistry.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/BasicRegistry.java?rev=1096946&r1=1096945&r2=1096946&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/BasicRegistry.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/BasicRegistry.java
Tue Apr 26 23:15:45 2011
@@ -16,10 +16,13 @@
  */
 package org.apache.geronimo.kernel.basic;
 
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.IdentityHashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
@@ -28,11 +31,13 @@ import javax.management.ObjectName;
 
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.runtime.GBeanInstance;
 import org.apache.geronimo.gbean.runtime.InstanceRegistry;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.repository.Artifact;
 
 /**
  * @version $Rev$ $Date$
@@ -215,6 +220,27 @@ public class BasicRegistry implements In
         return result;
     }
 
+    public LinkedHashSet<GBeanData> findGBeanDatas(Set<AbstractNameQuery> patterns)
{
+        LinkedHashSet<GBeanData> result = new LinkedHashSet<GBeanData>();
+
+        List<Map.Entry<AbstractName, GBeanInstance>> gbeanNames;
+        synchronized (this) {
+            gbeanNames = new ArrayList<Map.Entry<AbstractName, GBeanInstance>>(infoRegistry.entrySet());
+        }
+        for (AbstractNameQuery abstractNameQuery : patterns) {
+                // Search the GBeans
+                for (Map.Entry<AbstractName, GBeanInstance> entry : gbeanNames) {
+                    AbstractName abstractName = entry.getKey();
+                    GBeanInstance gBeanInstance = entry.getValue();
+                    if (abstractNameQuery.matches(abstractName, gBeanInstance.getGBeanInfo().getInterfaces()))
{
+                        result.add(gBeanInstance.getGBeanData());
+                    }
+                }
+        }
+        return result;
+    }
+
+
     private ObjectName normalizeObjectName(ObjectName objectName) {
         if (objectName != null && objectName.getDomain().length() == 0) {
             try {

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java?rev=1096946&r1=1096945&r2=1096946&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
Tue Apr 26 23:15:45 2011
@@ -40,6 +40,8 @@ import org.apache.geronimo.gbean.annotat
 import org.apache.geronimo.gbean.annotation.ParamAttribute;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.KernelRegistry;
 import org.apache.geronimo.kernel.Naming;
 import org.apache.xbean.osgi.bundle.util.DelegatingBundle;
 import org.apache.geronimo.kernel.repository.Artifact;
@@ -169,6 +171,8 @@ public class Configuration implements GB
 
     private Bundle bundle;
 
+    private Kernel kernel;
+
     /**
      * Creates a configuration.
      *
@@ -191,6 +195,8 @@ public class Configuration implements GB
             throw new NullPointerException("configurationData is null");
         }
 
+        this.kernel = KernelRegistry.getSingleKernel();
+
         this.configurationData = configurationData;
         this.naming = configurationData.getNaming();
         this.attributeStore = attributeStore;
@@ -523,7 +529,7 @@ public class Configuration implements GB
 
     public GBeanData findGBeanData(Set<AbstractNameQuery> patterns) throws GBeanNotFoundException
{
         if (patterns == null) throw new NullPointerException("patterns is null");
-        Set<GBeanData> result = findGBeanDatas(this, patterns);
+        Set<GBeanData> result = findGBeanDatasHere(patterns);
         if (result.size() > 1) {
             throw new GBeanNotFoundException("More than one match to referencePatterns in
local configuration", patterns, mapToNames(result));
         } else if (result.size() == 1) {
@@ -531,10 +537,8 @@ public class Configuration implements GB
         }
 
         // search all parents
-        for (Configuration configuration : allServiceParents) {
-            result.addAll(findGBeanDatas(configuration, patterns));
+        result.addAll(findGBeanDatasInKernel(patterns));
 
-        }
         // if we already found a match we have an ambiguous query
         if (result.size() > 1) {
             List<AbstractName> names = new ArrayList<AbstractName>(result.size());
@@ -591,32 +595,60 @@ public class Configuration implements GB
 
     public LinkedHashSet<GBeanData> findGBeanDatas(Set<AbstractNameQuery> patterns)
{
         if (patterns == null) throw new NullPointerException("patterns is null");
-        LinkedHashSet<GBeanData> datas = findGBeanDatas(this, patterns);
+        LinkedHashSet<GBeanData> datas = findGBeanDatasHere(patterns);
 
         // search all parents
-        for (Configuration configuration : allServiceParents) {
-            Set<GBeanData> match = findGBeanDatas(configuration, patterns);
-            datas.addAll(match);
-        }
+        Set<GBeanData> match = findGBeanDatasInKernel(patterns);
+        datas.addAll(match);
         return datas;
     }
 
     /**
      * Find the gbeanDatas matching the patterns in this configuration only, ignoring parents.
      *
-     * @param configuration configuration to look in
+     *
      * @param patterns      patterns to look for
      * @return set of gbeandatas matching one of the patterns from this configuration only,
not including parents.
      */
-    public LinkedHashSet<GBeanData> findGBeanDatas(Configuration configuration, Set<AbstractNameQuery>
patterns) {
+    @Deprecated
+    public LinkedHashSet<GBeanData> findGBeanDatas(Configuration ignored, Set<AbstractNameQuery>
patterns) {
+        return findGBeanDatasInKernel(patterns);
+    }
+
+
+    public LinkedHashSet<GBeanData> findGBeanDatasInKernel(Set<AbstractNameQuery>
patterns) {
+        return kernel.findGBeanDatas(patterns);
+//        LinkedHashSet<GBeanData> result = new LinkedHashSet<GBeanData>();
+//
+//        Set<Map.Entry<AbstractName, GBeanData>> gbeanNames = configuration.getGBeans().entrySet();
+//        for (AbstractNameQuery abstractNameQuery : patterns) {
+//            Artifact queryArtifact = abstractNameQuery.getArtifact();
+//
+//            // Does this query apply to this configuration
+//            if (queryArtifact == null || queryArtifact.matches(configuration.getId()))
{
+//
+//                // Search the GBeans
+//                for (Map.Entry<AbstractName, GBeanData> entry : gbeanNames) {
+//                    AbstractName abstractName = entry.getKey();
+//                    GBeanData gbeanData = entry.getValue();
+//                    if (abstractNameQuery.matches(abstractName, gbeanData.getGBeanInfo().getInterfaces()))
{
+//                        result.add(gbeanData);
+//                    }
+//                }
+//            }
+//        }
+//        return result;
+    }
+
+    private LinkedHashSet<GBeanData> findGBeanDatasHere(Set<AbstractNameQuery>
patterns) {
         LinkedHashSet<GBeanData> result = new LinkedHashSet<GBeanData>();
 
-        Set<Map.Entry<AbstractName, GBeanData>> gbeanNames = configuration.getGBeans().entrySet();
+        Set<Map.Entry<AbstractName, GBeanData>> gbeanNames = getGBeans().entrySet();
         for (AbstractNameQuery abstractNameQuery : patterns) {
             Artifact queryArtifact = abstractNameQuery.getArtifact();
 
             // Does this query apply to this configuration
-            if (queryArtifact == null || queryArtifact.matches(configuration.getId())) {
+            if (queryArtifact == null || queryArtifact.matches(getId())) {
 
                 // Search the GBeans
                 for (Map.Entry<AbstractName, GBeanData> entry : gbeanNames) {

Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java?rev=1096946&r1=1096945&r2=1096946&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java
Tue Apr 26 23:15:45 2011
@@ -413,7 +413,12 @@ public class DependencyManager implement
                         if (!BundleUtils.isResolved(currentBundle)) {
                             BundleUtils.resolve(currentBundle);
                             if (!BundleUtils.isResolved(currentBundle)) {
-                                log.error("Could not resolve the dependency bundle" + currentBundle.getLocation());
+                                log.error("Could not resolve the dependency bundle " + currentBundle.getLocation());
+                                StringBuilder buf = new StringBuilder("known bundles: ");
+                                for (Bundle b: bundleContext.getBundles()) {
+                                    buf.append("\n   ").append(b.getLocation()).append("
 state: ").append(b.getState());
+                                }
+                                log.error(buf.toString());
                             }
                         }
                     }
@@ -536,3 +541,4 @@ public class DependencyManager implement
         }
     }
 }
+

Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/jmx/KernelDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/jmx/KernelDelegate.java?rev=1096946&r1=1096945&r2=1096946&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/jmx/KernelDelegate.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/jmx/KernelDelegate.java
Tue Apr 26 23:15:45 2011
@@ -17,6 +17,7 @@
 package org.apache.geronimo.system.jmx;
 
 import java.util.Date;
+import java.util.LinkedHashSet;
 import java.util.Set;
 import javax.management.AttributeNotFoundException;
 import javax.management.InstanceNotFoundException;
@@ -66,6 +67,17 @@ public class KernelDelegate implements K
         return (Naming) getKernelAttribute("naming");
     }
 
+    @Override
+    public LinkedHashSet<GBeanData> findGBeanDatas(Set<AbstractNameQuery> patterns)
{
+        try {
+            return (LinkedHashSet<GBeanData>)invokeKernel("findGBeanDatas", new Object[]
{patterns}, new String[] {Set.class.getName()});
+        } catch (RuntimeException e) {
+            throw e;
+        } catch (Exception e) {
+            throw new InternalKernelException(e);
+        }
+    }
+
     @Deprecated
     public Object getGBean(ObjectName name) throws GBeanNotFoundException, InternalKernelException,
IllegalStateException {
         try {

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java?rev=1096946&r1=1096945&r2=1096946&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
(original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
Tue Apr 26 23:15:45 2011
@@ -1309,7 +1309,9 @@ public class ConnectorModuleBuilder impl
         connectionFactoryGBeanData.setServiceInterfaces(implementedInterfaces.toArray(new
String[implementedInterfaces.size()]));
         String jndiName = connectiondefinitionInstance.getJndiName();
         if (jndiName == null) {
-            jndiName = naming.toOsgiJndiName(connectionFactoryAbstractName);
+//            jndiName = naming.toOsgiJndiName(connectionFactoryAbstractName);
+            //TODO hack
+            jndiName = connectiondefinitionInstance.getName().trim();
         } else {
             jndiName = jndiName.trim();
         }

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java?rev=1096946&r1=1096945&r2=1096946&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
(original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
Tue Apr 26 23:15:45 2011
@@ -225,42 +225,42 @@ public class ResourceRefBuilder extends 
 //                j2eeType = NameFactory.JCA_CONNECTION_FACTORY;
                 j2eeType = NameFactory.JCA_CONNECTION_MANAGER;
             }
-            try {
-                AbstractNameQuery containerId = getResourceContainerId(name, j2eeType, null,
gerResourceRef);
+//            try {
+//                AbstractNameQuery containerId = getResourceContainerId(name, j2eeType,
null, gerResourceRef);
 
-                AbstractName abstractName = module.getEarContext().findGBean(containerId);
-                String osgiJndiName = module.getEarContext().getNaming().toOsgiJndiName(abstractName);
-                String filter = "(osgi.jndi.service.name=" + osgiJndiName + ')';
+//                AbstractName abstractName = module.getEarContext().findGBean(containerId);
+//                String osgiJndiName = module.getEarContext().getNaming().toOsgiJndiName(abstractName);
+                String filter = "(osgi.jndi.service.name=" + name + ')';
 
                 return new ResourceReference(filter, type);
                         //ResourceReferenceFactory<ResourceException>(module.getConfigId(),
containerId, iface);
-            } catch (GBeanNotFoundException e) {
-                StringBuffer errorMessage = new StringBuffer("Unable to resolve resource
reference '");
-                errorMessage.append(name);
-                errorMessage.append("' (");
-                if (e.hasMatches()) {
-                    errorMessage.append("Found multiple matching resources.  Try being more
specific in a resource-ref mapping in your Geronimo deployment plan.\n");
-                    for (AbstractName match : e.getMatches()) {
-                        errorMessage.append(match).append("\n");
-                    }
-                } else if (gerResourceRef == null) {
-                    errorMessage.append("Could not auto-map to resource.  Try adding a resource-ref
mapping to your Geronimo deployment plan.");
-                } else if (gerResourceRef.isSetResourceLink()) {
-                    errorMessage.append("Could not find resource '");
-                    errorMessage.append(gerResourceRef.getResourceLink());
-                    errorMessage.append("'.  Perhaps it has not yet been configured, or your
application does not have a dependency declared for that resource module?");
-                } else {
-                    errorMessage.append("Could not find the resource specified in your Geronimo
deployment plan:");
-                    errorMessage.append(gerResourceRef.getPattern());
-                }
-                errorMessage.append("\nSearch conducted in current module and dependencies:\n");
-                for (Dependency dependency : module.getEnvironment().getDependencies()) {
-                    errorMessage.append(dependency).append("\n");
-                }
-                errorMessage.append(")");
-
-                throw new DeploymentException(errorMessage.toString());
-            }
+//            } catch (GBeanNotFoundException e) {
+//                StringBuffer errorMessage = new StringBuffer("Unable to resolve resource
reference '");
+//                errorMessage.append(name);
+//                errorMessage.append("' (");
+//                if (e.hasMatches()) {
+//                    errorMessage.append("Found multiple matching resources.  Try being
more specific in a resource-ref mapping in your Geronimo deployment plan.\n");
+//                    for (AbstractName match : e.getMatches()) {
+//                        errorMessage.append(match).append("\n");
+//                    }
+//                } else if (gerResourceRef == null) {
+//                    errorMessage.append("Could not auto-map to resource.  Try adding a
resource-ref mapping to your Geronimo deployment plan.");
+//                } else if (gerResourceRef.isSetResourceLink()) {
+//                    errorMessage.append("Could not find resource '");
+//                    errorMessage.append(gerResourceRef.getResourceLink());
+//                    errorMessage.append("'.  Perhaps it has not yet been configured, or
your application does not have a dependency declared for that resource module?");
+//                } else {
+//                    errorMessage.append("Could not find the resource specified in your
Geronimo deployment plan:");
+//                    errorMessage.append(gerResourceRef.getPattern());
+//                }
+//                errorMessage.append("\nSearch conducted in current module and dependencies:\n");
+//                for (Dependency dependency : module.getEnvironment().getDependencies())
{
+//                    errorMessage.append(dependency).append("\n");
+//                }
+//                errorMessage.append(")");
+//
+//                throw new DeploymentException(errorMessage.toString());
+//            }
         }
 
         return null;

Modified: geronimo/server/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/pom.xml?rev=1096946&r1=1096945&r2=1096946&view=diff
==============================================================================
--- geronimo/server/trunk/pom.xml (original)
+++ geronimo/server/trunk/pom.xml Tue Apr 26 23:15:45 2011
@@ -59,8 +59,8 @@
 
         <geronimoSchemaVersion>1.2</geronimoSchemaVersion>
         <warnOnDependencyChange>true</warnOnDependencyChange>
-        <logDependencyChanges>true</logDependencyChanges>
-        <overwriteChangedDependencies>true</overwriteChangedDependencies>
+        <logDependencyChanges>false</logDependencyChanges>
+        <overwriteChangedDependencies>false</overwriteChangedDependencies>
 
         <!--
         FIXME: STOP using properties for dependency versions unless you absolutly need them,
@@ -2024,13 +2024,15 @@ only found in cxf
                 <plugin>
                     <groupId>org.apache.felix</groupId>
                     <artifactId>maven-bundle-plugin</artifactId>
-                    <version>2.0.1</version>
+                    <version>2.3.4</version>
                     <extensions>true</extensions>
                     <configuration>
                         <instructions>
                             <Implementation-Title>${project.name}</Implementation-Title>
                             <Implementation-Version>${project.version}</Implementation-Version>
                             <Bundle-DocURL>${project.url}</Bundle-DocURL>
+                            <_versionpolicy-impl>[$(version;==;$(@)),$(version;=+;$(@)))</_versionpolicy-impl>
+                            <_versionpolicy-uses>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy-uses>
                         </instructions>
                     </configuration>
                 </plugin>



Mime
View raw message