geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdam...@apache.org
Subject svn commit: r596987 - in /geronimo/server/trunk: framework/configs/j2ee-system/src/main/plan/ framework/modules/geronimo-cli/ framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/ framework/modules/geronimo-de...
Date Wed, 21 Nov 2007 08:39:06 GMT
Author: gdamour
Date: Wed Nov 21 00:39:04 2007
New Revision: 596987

URL: http://svn.apache.org/viewvc?rev=596987&view=rev
Log:
When distributing w/o the explicit selection of a target, we only distribute
to the first target returned by DeploymentManager. This first target is
the default target, or configuration store, and users can specify an abstract
name query (in EditableKernelConfigurationManager) to identify this default 
target.

Now that multiple configuration stores per server are better handled 
out-of-the-box, we can re-enable the "clustered" configuration stores.

Also, let's more the rmock dependency to testsupport-common so that we
can use it from all our tests.

This fixes GERONIMO-3612 - When no target configuration store is explicitly 
specified while installing a configuration, the configuration should be 
installed to a default configuration store

Added:
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/EditableKernelConfigurationManagerTest.java
Modified:
    geronimo/server/trunk/framework/configs/j2ee-system/src/main/plan/plan.xml
    geronimo/server/trunk/framework/modules/geronimo-cli/pom.xml
    geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java
    geronimo/server/trunk/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/CommandDistribute.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/EditableKernelConfigurationManager.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/DeployModuleMojo.java
    geronimo/server/trunk/plugins/activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/handlers/CreateDestinationHandler.java
    geronimo/server/trunk/plugins/activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/handlers/RemoveDestinationHandler.java
    geronimo/server/trunk/plugins/activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/wizard/AbstractHandler.java
    geronimo/server/trunk/plugins/clustering/clustering/pom.xml
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/DeploymentPortlet.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java
    geronimo/server/trunk/plugins/hotdeploy/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/JSR88_Util.java
    geronimo/server/trunk/plugins/system-database/system-database-portlets/src/main/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
    geronimo/server/trunk/testsupport/testsupport-common/pom.xml

Modified: geronimo/server/trunk/framework/configs/j2ee-system/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/configs/j2ee-system/src/main/plan/plan.xml?rev=596987&r1=596986&r2=596987&view=diff
==============================================================================
--- geronimo/server/trunk/framework/configs/j2ee-system/src/main/plan/plan.xml (original)
+++ geronimo/server/trunk/framework/configs/j2ee-system/src/main/plan/plan.xml Wed Nov 21
00:39:04 2007
@@ -80,6 +80,8 @@
 
     <!--Configuration Manager service-->
     <gbean name="ConfigurationManager" class="org.apache.geronimo.kernel.config.EditableKernelConfigurationManager">
+        <attribute name="defaultStoreNameQuery">?name=Local</attribute>
+        <reference name="Repositories"></reference>
         <reference name="Repositories"></reference>
         <reference name="Stores"></reference>
         <reference name="Watchers"></reference>

Modified: geronimo/server/trunk/framework/modules/geronimo-cli/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-cli/pom.xml?rev=596987&r1=596986&r2=596987&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-cli/pom.xml (original)
+++ geronimo/server/trunk/framework/modules/geronimo-cli/pom.xml Wed Nov 21 00:39:04 2007
@@ -45,11 +45,6 @@
             <artifactId>commons-cli</artifactId>
         </dependency>
 
-        <dependency>
-            <groupId>com.agical.rmock</groupId>
-            <artifactId>rmock</artifactId>
-        </dependency>
-
     </dependencies>
 
 </project>

Modified: geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java?rev=596987&r1=596986&r2=596987&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java
Wed Nov 21 00:39:04 2007
@@ -97,7 +97,7 @@
             throw new IllegalStateException("Disconnected");
         }
         List stores = configurationManager.listStores();
-        if (stores.size() == 0) {
+        if (stores.isEmpty()) {
             return null;
         }
 

Modified: geronimo/server/trunk/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/CommandDistribute.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/CommandDistribute.java?rev=596987&r1=596986&r2=596987&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/CommandDistribute.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/CommandDistribute.java
Wed Nov 21 00:39:04 2007
@@ -131,7 +131,12 @@
             po = runCommand(mgr, out, inPlace, tlist, module, plan);
             waitForProgress(out, po);
         } else {
-            final Target[] tlist = mgr.getTargets();
+            Target[] tlist = mgr.getTargets();
+            if (null == tlist) {
+                throw new IllegalStateException("No target to distribute to");
+            }
+            tlist = new Target[] {tlist[0]};
+
             multipleTargets = tlist.length > 1;
             po = runCommand(mgr, out, inPlace, tlist, module, plan);
             waitForProgress(out, po);

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/EditableKernelConfigurationManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/EditableKernelConfigurationManager.java?rev=596987&r1=596986&r2=596987&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/EditableKernelConfigurationManager.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/EditableKernelConfigurationManager.java
Wed Nov 21 00:39:04 2007
@@ -16,19 +16,24 @@
  */
 package org.apache.geronimo.kernel.config;
 
+import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
 
-import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.GBeanNotFoundException;
-import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
-import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.kernel.repository.ArtifactResolver;
-import org.apache.geronimo.kernel.repository.ArtifactManager;
-import org.apache.geronimo.kernel.management.State;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
-import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
+import org.apache.geronimo.kernel.GBeanNotFoundException;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.management.State;
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.ArtifactManager;
+import org.apache.geronimo.kernel.repository.ArtifactResolver;
 
 /**
  * Standard implementation of an editable ConfigurationManager.
@@ -36,7 +41,10 @@
  * @version $Rev:386276 $ $Date$
  */
 public class EditableKernelConfigurationManager extends KernelConfigurationManager implements
EditableConfigurationManager {
+    private final AbstractNameQuery defaultStoreNameQuery;
+
     public EditableKernelConfigurationManager(Kernel kernel,
+            AbstractNameQuery defaultStoreNameQuery,
             Collection stores,
             ManageableAttributeStore attributeStore,
             PersistentConfigurationList configurationList,
@@ -45,9 +53,36 @@
             Collection repositories,
             Collection watchers,
             ClassLoader classLoader) {
-        super(kernel, stores, attributeStore, configurationList, artifactManager, artifactResolver,
repositories, watchers, classLoader);
+        super(kernel,
+            stores,
+            attributeStore,
+            configurationList,
+            artifactManager,
+            artifactResolver,
+            repositories,
+            watchers,
+            classLoader);
+        this.defaultStoreNameQuery = defaultStoreNameQuery;
     }
 
+    @Override
+    protected List getStoreList() {
+        if (null == defaultStoreNameQuery) {
+            return super.getStoreList();
+        }
+        
+        List<ConfigurationStore> storeList = new ArrayList<ConfigurationStore>();
+        for (Iterator iterator = stores.iterator(); iterator.hasNext();) {
+            ConfigurationStore configurationStore = (ConfigurationStore) iterator.next();
+            if (defaultStoreNameQuery.matches(configurationStore.getAbstractName(), Collections.EMPTY_SET))
{
+                storeList.add(0, configurationStore);
+            } else {
+                storeList.add(configurationStore);
+            }
+        }
+        return storeList;
+    }
+    
     public void addGBeanToConfiguration(Artifact configurationId, GBeanData gbean, boolean
start) throws InvalidConfigException {
         Configuration configuration = getConfiguration(configurationId);
 
@@ -153,10 +188,26 @@
 
     public static final GBeanInfo GBEAN_INFO;
 
+    public static final String GBEAN_ATTR_DEFAULT_STORE_NAME_QUERY = "defaultStoreNameQuery";
+
     static {
         GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(EditableKernelConfigurationManager.class,
KernelConfigurationManager.GBEAN_INFO, "ConfigurationManager");
+        
+        infoFactory.addAttribute(GBEAN_ATTR_DEFAULT_STORE_NAME_QUERY, AbstractNameQuery.class,
true);
+        
         infoFactory.addInterface(EditableConfigurationManager.class);
-        infoFactory.setConstructor(new String[]{"kernel", "Stores", "AttributeStore", "PersistentConfigurationList",
"ArtifactManager", "ArtifactResolver", "Repositories", "Watchers", "classLoader"});
+        
+        infoFactory.setConstructor(new String[] { "kernel",
+            GBEAN_ATTR_DEFAULT_STORE_NAME_QUERY,
+            "Stores",
+            "AttributeStore",
+            "PersistentConfigurationList",
+            "ArtifactManager",
+            "ArtifactResolver",
+            "Repositories",
+            "Watchers",
+            "classLoader" });
+
         GBEAN_INFO = infoFactory.getBeanInfo();
     }
 

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java?rev=596987&r1=596986&r2=596987&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
Wed Nov 21 00:39:04 2007
@@ -69,7 +69,10 @@
         this(stores, artifactResolver, repositories, Collections.EMPTY_SET);
     }
     
-    public SimpleConfigurationManager(Collection stores, ArtifactResolver artifactResolver,
Collection repositories, Collection watchers) {
+    public SimpleConfigurationManager(Collection stores,
+            ArtifactResolver artifactResolver,
+            Collection repositories,
+            Collection watchers) {
         if (stores == null) stores = Collections.EMPTY_SET;
         if (repositories == null) repositories = Collections.EMPTY_SET;
         if (watchers == null) watchers = Collections.EMPTY_SET;
@@ -1281,7 +1284,7 @@
     public void setOnline(boolean online) {
     }
 
-    private List getStoreList() {
+    protected List getStoreList() {
         return new ArrayList(stores);
     }
 

Added: geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/EditableKernelConfigurationManagerTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/EditableKernelConfigurationManagerTest.java?rev=596987&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/EditableKernelConfigurationManagerTest.java
(added)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/EditableKernelConfigurationManagerTest.java
Wed Nov 21 00:39:04 2007
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.kernel.config;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.ArtifactManager;
+import org.apache.geronimo.kernel.repository.ArtifactResolver;
+
+import com.agical.rmock.extension.junit.RMockTestCase;
+
+/**
+ *
+ * @version $Rev:$ $Date:$
+ */
+public class EditableKernelConfigurationManagerTest extends RMockTestCase {
+
+    private ConfigurationStore storeA;
+    private ConfigurationStore storeB;
+    private EditableKernelConfigurationManager manager;
+    private Artifact artifact;
+    private Collection<ConfigurationStore> stores;
+    private AbstractName nameA;
+    private AbstractName nameB;
+
+    @Override
+    protected void setUp() throws Exception {
+        Kernel kernel = (Kernel) mock(Kernel.class);
+        
+        ManageableAttributeStore attributeStore = (ManageableAttributeStore) mock(ManageableAttributeStore.class);
+        PersistentConfigurationList configurationList = (PersistentConfigurationList) mock(PersistentConfigurationList.class);
+        ArtifactManager artifactManager = (ArtifactManager) mock(ArtifactManager.class);
+        ArtifactResolver artifactResolver = (ArtifactResolver) mock(ArtifactResolver.class);
+        
+        storeA = (ConfigurationStore) mock(ConfigurationStore.class);
+        storeB = (ConfigurationStore) mock(ConfigurationStore.class);
+        
+        stores = new ArrayList<ConfigurationStore>();
+        
+        artifact = new Artifact("groupId", "artifactId", "2.0", "car");
+
+        storeA.getAbstractName();
+        nameA = new AbstractName(artifact, Collections.singletonMap("name", "A"));
+        modify().multiplicity(expect.from(0)).returnValue(nameA);
+        
+        storeB.getAbstractName();
+        nameB = new AbstractName(artifact, Collections.singletonMap("name", "B"));
+        modify().multiplicity(expect.from(0)).returnValue(nameB);
+
+        manager = new EditableKernelConfigurationManager(kernel,
+            new AbstractNameQuery(artifact, Collections.singletonMap("name", "B")),
+            stores,
+            attributeStore,
+            configurationList,
+            artifactManager,
+            artifactResolver,
+            Collections.EMPTY_LIST,
+            Collections.EMPTY_LIST,
+            EditableKernelConfigurationManagerTest.class.getClassLoader());
+    }
+    
+    public void testThatFirstStoreOfListStoresIsDefaultStore() throws Exception {
+        stores.add(storeA);
+        stores.add(storeB);
+
+        startVerification();
+
+        List listStores = manager.listStores();
+        assertEquals(2, listStores.size());
+        assertEquals(nameB, listStores.get(0));
+        assertEquals(nameA, listStores.get(1));
+    }
+    
+}

Modified: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/DeployModuleMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/DeployModuleMojo.java?rev=596987&r1=596986&r2=596987&view=diff
==============================================================================
--- geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/DeployModuleMojo.java
(original)
+++ geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/DeployModuleMojo.java
Wed Nov 21 00:39:04 2007
@@ -147,6 +147,11 @@
 
         DeploymentManager manager = getDeploymentManager();
         Target[] targets = manager.getTargets();
+        if (null == targets) {
+            throw new IllegalStateException("No target to distribute to");
+        }
+        targets = new Target[] {targets[0]};
+        
         ProgressObject progress = manager.distribute(targets, file, plan);
         DeploymentStatus status = waitFor(progress);
 

Modified: geronimo/server/trunk/plugins/activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/handlers/CreateDestinationHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/handlers/CreateDestinationHandler.java?rev=596987&r1=596986&r2=596987&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/handlers/CreateDestinationHandler.java
(original)
+++ geronimo/server/trunk/plugins/activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/handlers/CreateDestinationHandler.java
Wed Nov 21 00:39:04 2007
@@ -115,11 +115,11 @@
             ConfigurationManager configurationManager = ConfigurationUtil
                     .getConfigurationManager(kernel);
             List stores = configurationManager.listStores();
-            assert stores.size() == 1 : "Piling one hack on another, this code only works
with exactly one store";
-
-            ObjectName storeName = (ObjectName) stores.iterator().next();
-            File installDir = (File) kernel.invoke(storeName,
-                    "createNewConfigurationDir");
+            if (stores.isEmpty()) {
+                throw new PortletException("No configuration store");
+            }
+            ObjectName storeName = (ObjectName) stores.get(0);
+            File installDir = (File) kernel.invoke(storeName, "createNewConfigurationDir");
 //            Environment environment = new Environment();
 //            environment.setConfigId(configId);
 //            environment.addDependency(parentId, ImportType.ALL);

Modified: geronimo/server/trunk/plugins/activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/handlers/RemoveDestinationHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/handlers/RemoveDestinationHandler.java?rev=596987&r1=596986&r2=596987&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/handlers/RemoveDestinationHandler.java
(original)
+++ geronimo/server/trunk/plugins/activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/handlers/RemoveDestinationHandler.java
Wed Nov 21 00:39:04 2007
@@ -55,8 +55,10 @@
             AbstractName configurationObjectName = Configuration.getConfigurationAbstractName(destinationConfigArtifact);
 
             List stores = configurationManager.listStores();
-            assert stores.size() == 1 :"Piling one hack on another, this code only works
with exactly one store";
-            ObjectName storeName = (ObjectName) stores.iterator().next();
+            if (stores.isEmpty()) {
+                throw new PortletException("No configuration store");
+            }
+            ObjectName storeName = (ObjectName) stores.get(0);
 
             // Unsubscribe topicbrowser before uninstalling the configuration.
             DependencyManager dm = kernel.getDependencyManager();

Modified: geronimo/server/trunk/plugins/activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/wizard/AbstractHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/wizard/AbstractHandler.java?rev=596987&r1=596986&r2=596987&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/wizard/AbstractHandler.java
(original)
+++ geronimo/server/trunk/plugins/activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/wizard/AbstractHandler.java
Wed Nov 21 00:39:04 2007
@@ -617,6 +617,11 @@
                     out.flush();
                     out.close();
                     Target[] targets = mgr.getTargets();
+                    if (null == targets) {
+                        throw new IllegalStateException("No target to distribute to");
+                    }
+                    targets = new Target[] {targets[0]};
+                    
                     ProgressObject po = mgr.distribute(targets, rarFile, tempFile);
                     waitForProgress(po);
                     if(po.getDeploymentStatus().isCompleted()) {

Modified: geronimo/server/trunk/plugins/clustering/clustering/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/clustering/clustering/pom.xml?rev=596987&r1=596986&r2=596987&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/clustering/clustering/pom.xml (original)
+++ geronimo/server/trunk/plugins/clustering/clustering/pom.xml Wed Nov 21 00:39:04 2007
@@ -91,18 +91,6 @@
                                 <gbean name="ClusterInfo">
                                     <attribute name="name">#{clusterName}</attribute>
                                 </gbean>
-                                <gbean name="MasterRepository" load="false">
-                                </gbean>
-                                <gbean name="MasterConfigurationStore" load="false">
-                                </gbean>
-                                <gbean name="ClusterConfigurationStoreClient" load="false">
-                                </gbean>
-                                <gbean name="ClusterRepository" load="false">
-                                </gbean>
-                                <gbean name="ClusterStore" load="false">
-                                </gbean>
-                                <gbean name="ClusterConfigurationStore" load="false">
-                                </gbean>
                             </config-xml-content>
                             <config-substitution key="clusterNodeName">NODE</config-substitution>
                             <config-substitution key="clusterName">CLUSTER_NAME</config-substitution>

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/DeploymentPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/DeploymentPortlet.java?rev=596987&r1=596986&r2=596987&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/DeploymentPortlet.java
(original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/configmanager/DeploymentPortlet.java
Wed Nov 21 00:39:04 2007
@@ -126,6 +126,10 @@
                     ((JMXDeploymentManager)mgr).setLogConfiguration(false, true);
                 }
                 Target[] all = mgr.getTargets();
+                if (null == all) {
+                    throw new IllegalStateException("No target to distribute to");
+                }
+
                 ProgressObject progress;
                 if(isRedeploy) {
                     TargetModuleID[] targets = identifyTargets(moduleFile, planFile, mgr.getAvailableModules(null,
all));
@@ -134,7 +138,7 @@
                     }
                     progress = mgr.redeploy(targets, moduleFile, planFile);
                 } else {
-                    progress = mgr.distribute(all, moduleFile, planFile);
+                    progress = mgr.distribute(new Target[] {all[0]}, moduleFile, planFile);
                 }
                 while(progress.getDeploymentStatus().isRunning()) {
                     Thread.sleep(100);

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java?rev=596987&r1=596986&r2=596987&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java
(original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java
Wed Nov 21 00:39:04 2007
@@ -504,6 +504,11 @@
                 out.flush();
                 out.close();
                 Target[] targets = mgr.getTargets();
+                if (null == targets) {
+                    throw new IllegalStateException("No target to distribute to");
+                }
+                targets = new Target[] {targets[0]};
+                
                 ProgressObject po = mgr.distribute(targets, null, tempFile);
                 waitForProgress(po);
                 if (po.getDeploymentStatus().isCompleted()) {

Modified: geronimo/server/trunk/plugins/hotdeploy/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/hotdeploy/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java?rev=596987&r1=596986&r2=596987&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/hotdeploy/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java
(original)
+++ geronimo/server/trunk/plugins/hotdeploy/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java
Wed Nov 21 00:39:04 2007
@@ -263,6 +263,11 @@
         try {
             mgr = getDeploymentManager();
             Target[] targets = mgr.getTargets();
+            if (null == targets) {
+                throw new IllegalStateException("No target to distribute to");
+            }
+            targets = new Target[] {targets[0]};
+
             ProgressObject po;
             if (DeployUtils.isJarFile(file) || file.isDirectory()) {
                 po = mgr.distribute(targets, file, null);

Modified: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/JSR88_Util.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/JSR88_Util.java?rev=596987&r1=596986&r2=596987&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/JSR88_Util.java
(original)
+++ geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/JSR88_Util.java
Wed Nov 21 00:39:04 2007
@@ -30,6 +30,7 @@
 import javax.enterprise.deploy.shared.factories.DeploymentFactoryManager;
 import javax.enterprise.deploy.spi.DeploymentConfiguration;
 import javax.enterprise.deploy.spi.DeploymentManager;
+import javax.enterprise.deploy.spi.Target;
 import javax.enterprise.deploy.spi.exceptions.ConfigurationException;
 import javax.enterprise.deploy.spi.exceptions.InvalidModuleException;
 import javax.enterprise.deploy.spi.status.ProgressObject;
@@ -485,7 +486,14 @@
                 if (mgr instanceof JMXDeploymentManager) {
                     ((JMXDeploymentManager) mgr).setLogConfiguration(false, true);
                 }
-                ProgressObject progress = mgr.distribute(mgr.getTargets(), moduleFile, planFile);
+                
+                Target[] targets = mgr.getTargets();
+                if (null == targets) {
+                    throw new IllegalStateException("No target to distribute to");
+                }
+                targets = new Target[] {targets[0]};
+                
+                ProgressObject progress = mgr.distribute(targets, moduleFile, planFile);
                 while (progress.getDeploymentStatus().isRunning()) {
                     Thread.sleep(100);
                 }

Modified: geronimo/server/trunk/plugins/system-database/system-database-portlets/src/main/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/system-database/system-database-portlets/src/main/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java?rev=596987&r1=596986&r2=596987&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/system-database/system-database-portlets/src/main/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
(original)
+++ geronimo/server/trunk/plugins/system-database/system-database-portlets/src/main/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
Wed Nov 21 00:39:04 2007
@@ -1051,6 +1051,11 @@
                     out.flush();
                     out.close();
                     Target[] targets = mgr.getTargets();
+                    if (null == targets) {
+                        throw new IllegalStateException("No target to distribute to");
+                    }
+                    targets = new Target[] {targets[0]};
+                    
                     ProgressObject po = mgr.distribute(targets, rarFile, tempFile);
                     waitForProgress(po);
                     if (po.getDeploymentStatus().isCompleted()) {

Modified: geronimo/server/trunk/testsupport/testsupport-common/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsupport/testsupport-common/pom.xml?rev=596987&r1=596986&r2=596987&view=diff
==============================================================================
--- geronimo/server/trunk/testsupport/testsupport-common/pom.xml (original)
+++ geronimo/server/trunk/testsupport/testsupport-common/pom.xml Wed Nov 21 00:39:04 2007
@@ -51,6 +51,11 @@
             <scope>compile</scope>
         </dependency>
 
+        <dependency>
+            <groupId>com.agical.rmock</groupId>
+            <artifactId>rmock</artifactId>
+        </dependency>
+
         <!-- xmlbeans -->
         
         <dependency>



Mime
View raw message