geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r829691 - in /geronimo/server/trunk/plugins: activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/ activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/handlers/ activemq/activemq-portle...
Date Mon, 26 Oct 2009 02:45:30 GMT
Author: xuhaihong
Date: Mon Oct 26 02:45:29 2009
New Revision: 829691

URL: http://svn.apache.org/viewvc?rev=829691&view=rev
Log:
Cleanup some codes in the ActiveMQ plug-in

Modified:
    geronimo/server/trunk/plugins/activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/AbstractJMSManager.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/wizard/AbstractHandler.java
    geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/util/PortletManager.java

Modified: geronimo/server/trunk/plugins/activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/AbstractJMSManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/AbstractJMSManager.java?rev=829691&r1=829690&r2=829691&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/AbstractJMSManager.java
(original)
+++ geronimo/server/trunk/plugins/activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/AbstractJMSManager.java
Mon Oct 26 02:45:29 2009
@@ -40,10 +40,20 @@
     protected static final Artifact ACTIVEMQ_ARTIFACT = new Artifact("geronimo", "activemq",
org.apache.geronimo.system.serverinfo.ServerConstants.getVersion(), "car");
     protected static final Kernel kernel = KernelRegistry.getSingleKernel();
 
-    protected static final ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
+    protected static final ConfigurationManager configurationManager;
+    static {
+        try {
+            configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
+        } catch (GBeanNotFoundException e) {
+            throw new IllegalStateException(e);
+        }
+    }
+
     protected final Configuration BROKER_CONFIGURATION = configurationManager.getConfiguration(ACTIVEMQ_BROKER_ARTIFACT);
-    protected final Configuration CONNECTOR_CONFIGURATION = configurationManager.getConfiguration(ACTIVEMQ_ARTIFACT);
 
+    protected final Configuration CONNECTOR_CONFIGURATION = configurationManager.getConfiguration(ACTIVEMQ_ARTIFACT);
+    
+    
     private static final AbstractName earName = kernel.getNaming().createRootName(ACTIVEMQ_ARTIFACT,
NameFactory.NULL, NameFactory.J2EE_APPLICATION);
     protected static final AbstractName RESOURCE_ADAPTER_MODULE_NAME = kernel.getNaming().createChildName(earName,
ACTIVEMQ_ARTIFACT.toString(), NameFactory.RESOURCE_ADAPTER_MODULE);
     protected static final AbstractName RESOURCE_ADAPTER_NAME = kernel.getNaming().createChildName(RESOURCE_ADAPTER_MODULE_NAME,
ACTIVEMQ_ARTIFACT.toString(), NameFactory.RESOURCE_ADAPTER);

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=829691&r1=829690&r2=829691&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
Mon Oct 26 02:45:29 2009
@@ -28,9 +28,6 @@
 import javax.portlet.ActionResponse;
 import javax.portlet.PortletException;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.geronimo.console.core.jms.TopicBrowserGBean;
 import org.apache.geronimo.console.jmsmanager.AbstractJMSManager;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.GBeanData;
@@ -41,6 +38,8 @@
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.Dependency;
 import org.apache.geronimo.kernel.repository.ImportType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class CreateDestinationHandler extends AbstractJMSManager implements PortletResponseHandler
{
     protected final Logger log = LoggerFactory.getLogger(getClass());
@@ -90,6 +89,7 @@
                 adminObjectData = getTopicGBeanData();
                 // If we are adding a topic we have to add a browser so we can view
                 // its messages later.
+                /*
                 AbstractName browserName = kernel.getNaming().createChildName(adminObjectName,
destinationName, "TopicBrowser");
                 GBeanData tBrowserBeanData = new GBeanData(browserName, TopicBrowserGBean.GBEAN_INFO);
                 tBrowserBeanData.setAttribute("subscriberName", destinationName);
@@ -98,6 +98,7 @@
                         adminObjectName);
 
                 configurationData.addGBean(tBrowserBeanData);
+                */
             } else if (Queue.class.getName().equals(destinationType)) {
                 adminObjectData = getQueueGBeanData();
             } else {

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=829691&r1=829690&r2=829691&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
Mon Oct 26 02:45:29 2009
@@ -56,6 +56,7 @@
 import org.apache.geronimo.deployment.tools.loader.ConnectorDeployable;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.naming.deployment.jsr88.GBeanLocator;
+import org.osgi.framework.Bundle;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -495,7 +496,8 @@
             DeploymentManager mgr = ManagementHelper.getManagementHelper(request).getDeploymentManager();
             try {
                 File rarFile = PortletManager.getRepositoryEntry(request, data.getRarURI());
-                ConnectorDeployable deployable = new ConnectorDeployable(rarFile.toURL());
+                Bundle rarBundle = PortletManager.getRepositoryEntryBundle(request, data.getRarURI());
+                ConnectorDeployable deployable = new ConnectorDeployable(rarBundle);
                 DeploymentConfiguration config = mgr.createConfiguration(deployable);
                 final DDBeanRoot ddBeanRoot = deployable.getDDBeanRoot();
                 Connector15DCBRoot root = (Connector15DCBRoot) config.getDConfigBeanRoot(ddBeanRoot);

Modified: geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/util/PortletManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/util/PortletManager.java?rev=829691&r1=829690&r2=829691&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/util/PortletManager.java
(original)
+++ geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/util/PortletManager.java
Mon Oct 26 02:45:29 2009
@@ -17,6 +17,7 @@
 package org.apache.geronimo.console.util;
 
 import java.io.File;
+import java.util.Collections;
 import java.util.Map;
 
 import javax.naming.InitialContext;
@@ -56,6 +57,7 @@
 import org.apache.geronimo.management.geronimo.WebContainer;
 import org.apache.geronimo.management.geronimo.WebManager;
 import org.apache.geronimo.system.logging.SystemLog;
+import org.osgi.framework.Bundle;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -372,6 +374,21 @@
         }
         return null;
     }
+    
+    public static Bundle getRepositoryEntryBundle(PortletRequest request, String repositoryURI)
{
+        J2EEServer server = getCurrentServer(request);
+        Repository[] repos = server.getRepositories();
+        Artifact uri = Artifact.create(repositoryURI);
+        if (!uri.isResolved()) {
+            Artifact[] all = server.getConfigurationManager().getArtifactResolver().queryArtifacts(uri);
+            if (all.length == 0) {
+                return null;
+            } else {
+                uri = all[all.length - 1];
+            }
+        }
+        return getConfigurationManager().getBundle(uri);
+    }
 
     public static J2EEDeployedObject getModule(PortletRequest request, Artifact configuration)
{
         ManagementHelper helper = getManagementHelper(request);



Mime
View raw message