Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Frost2012-07-19 18:13:43 +0000
committerChristopher Frost2012-07-19 18:13:43 +0000
commit4bff78c60d2867204a0a951a5da416484e4f5d4b (patch)
tree12b53af1e86366e879b19fe78b52d5f7f6bf48e3
parent6e5df132ed44b311654d449b60310fb1151ed523 (diff)
downloadorg.eclipse.virgo.kernel-4bff78c60d2867204a0a951a5da416484e4f5d4b.tar.gz
org.eclipse.virgo.kernel-4bff78c60d2867204a0a951a5da416484e4f5d4b.tar.xz
org.eclipse.virgo.kernel-4bff78c60d2867204a0a951a5da416484e4f5d4b.zip
(352217) Fixes to the QuasiMBean but not including Region information
-rw-r--r--org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/JMXQuasiBundle.java (renamed from org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/BundleMXBean.java)18
-rw-r--r--org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/JMXQuasiMinimalBundle.java (renamed from org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/QuasiBundle.java)25
-rw-r--r--org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/JMXQuasiResolutionFailure.java35
-rw-r--r--org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/JMXQuasiStateDump.java84
-rw-r--r--org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/QuasiStateDump.java96
-rw-r--r--org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/StateDumpMXBean.java14
-rw-r--r--org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/StateDumpMXBeanExporter.java (renamed from org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/StateDumpJMXExporter.java)18
-rw-r--r--org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/management/JMXQuasiStateDumpTests.java (renamed from org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/management/QuasiStateDumpMBeanTests.java)28
-rw-r--r--org.eclipse.virgo.management.console/.classpath1
-rw-r--r--org.eclipse.virgo.management.console/ivy.xml6
-rw-r--r--org.eclipse.virgo.management.console/src/main/java/org/eclipse/virgo/management/console/UploadServlet.java18
-rw-r--r--org.eclipse.virgo.management.console/src/main/webapp/js/dumps.js13
12 files changed, 211 insertions, 145 deletions
diff --git a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/BundleMXBean.java b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/JMXQuasiBundle.java
index 80a50748..7be99795 100644
--- a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/BundleMXBean.java
+++ b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/JMXQuasiBundle.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2011 VMware Inc.
+ * Copyright (c) 2008, 2012 VMware Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,19 @@
*******************************************************************************/
package org.eclipse.virgo.kernel.userregion.internal.management;
-import javax.management.MXBean;
+import org.eclipse.virgo.kernel.osgi.quasi.QuasiBundle;
-@MXBean
-public interface BundleMXBean {
+/**
+ *
+ *
+ */
+public final class JMXQuasiBundle extends JMXQuasiMinimalBundle{
+
+ private final QuasiBundle quasiBundle;
+ protected JMXQuasiBundle(QuasiBundle quasiBundle) {
+ super(quasiBundle);
+ this.quasiBundle = quasiBundle;
+ }
+
}
diff --git a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/QuasiBundle.java b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/JMXQuasiMinimalBundle.java
index 67b5b84b..b56a1cf1 100644
--- a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/QuasiBundle.java
+++ b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/JMXQuasiMinimalBundle.java
@@ -10,6 +10,29 @@
*******************************************************************************/
package org.eclipse.virgo.kernel.userregion.internal.management;
-public class QuasiBundle implements BundleMXBean{
+import org.eclipse.virgo.kernel.osgi.quasi.QuasiBundle;
+/**
+ *
+ *
+ */
+public class JMXQuasiMinimalBundle {
+
+ private final QuasiBundle quasiBundle;
+
+ public JMXQuasiMinimalBundle(QuasiBundle quasiBundle) {
+ this.quasiBundle = quasiBundle;
+ }
+
+ public final long getIdentifier(){
+ return this.quasiBundle.getBundleId();
+ }
+
+ public final String getSymbolicName(){
+ return this.quasiBundle.getSymbolicName();
+ }
+
+ public final String getVersion() {
+ return this.quasiBundle.getVersion().toString();
+ }
}
diff --git a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/JMXQuasiResolutionFailure.java b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/JMXQuasiResolutionFailure.java
new file mode 100644
index 00000000..4d177fe8
--- /dev/null
+++ b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/JMXQuasiResolutionFailure.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2012 VMware Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VMware Inc. - initial contribution
+ *******************************************************************************/
+package org.eclipse.virgo.kernel.userregion.internal.management;
+
+import org.eclipse.virgo.kernel.osgi.quasi.QuasiResolutionFailure;
+
+/**
+ *
+ *
+ */
+public class JMXQuasiResolutionFailure {
+
+ private final QuasiResolutionFailure quasiResolutionFailure;
+
+ public JMXQuasiResolutionFailure(QuasiResolutionFailure quasiResolutionFailure) {
+ this.quasiResolutionFailure = quasiResolutionFailure;
+ }
+
+ public long getIdentifier(){
+ return this.quasiResolutionFailure.getUnresolvedQuasiBundle().getBundleId();
+ }
+
+ public String getDescription(){
+ return this.quasiResolutionFailure.getDescription();
+ }
+
+}
diff --git a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/JMXQuasiStateDump.java b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/JMXQuasiStateDump.java
new file mode 100644
index 00000000..8119017d
--- /dev/null
+++ b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/JMXQuasiStateDump.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2012 VMware Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VMware Inc. - initial contribution
+ *******************************************************************************/
+package org.eclipse.virgo.kernel.userregion.internal.management;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.zip.ZipException;
+
+import org.eclipse.virgo.kernel.osgi.quasi.QuasiBundle;
+import org.eclipse.virgo.kernel.osgi.quasi.QuasiFramework;
+import org.eclipse.virgo.kernel.osgi.quasi.QuasiFrameworkFactory;
+import org.eclipse.virgo.kernel.osgi.quasi.QuasiResolutionFailure;
+
+/**
+ *
+ * MBean that allows for the exploration of state dumps using the QuasiFramework
+ */
+public class JMXQuasiStateDump implements StateDumpMXBean {
+
+ private final QuasiFrameworkFactory quasiFrameworkFactory;
+
+ public JMXQuasiStateDump(QuasiFrameworkFactory quasiFrameworkFactory) {
+ this.quasiFrameworkFactory = quasiFrameworkFactory;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public JMXQuasiResolutionFailure[] getUnresolvedBundleIds(String dumpFile) {
+ QuasiFramework quasiFramework = this.getQuasiFramework(dumpFile);
+ List<QuasiResolutionFailure> resolve = quasiFramework.resolve();
+ List<JMXQuasiResolutionFailure> fails = new ArrayList<JMXQuasiResolutionFailure>();
+ for (QuasiResolutionFailure quasiResolutionFailure : resolve) {
+ fails.add(new JMXQuasiResolutionFailure(quasiResolutionFailure));
+ }
+ return fails.toArray(new JMXQuasiResolutionFailure[fails.size()]);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public JMXQuasiMinimalBundle[] listBundles(String dumpFile) {
+ QuasiFramework quasiFramework = this.getQuasiFramework(dumpFile);
+ List<QuasiBundle> bundles = quasiFramework.getBundles();
+ List<JMXQuasiMinimalBundle> jmxBundles = new ArrayList<JMXQuasiMinimalBundle>();
+ for (QuasiBundle minimalBundleMXBean : bundles) {
+ jmxBundles.add(new JMXQuasiMinimalBundle(minimalBundleMXBean));
+ }
+ return jmxBundles.toArray(new JMXQuasiMinimalBundle[jmxBundles.size()]);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public JMXQuasiBundle getBundle(String dumpFile, long bundleId) {
+ QuasiFramework quasiFramework = this.getQuasiFramework(dumpFile);
+ QuasiBundle quasiBundle = quasiFramework.getBundle(bundleId);
+ return new JMXQuasiBundle(quasiBundle);
+ }
+
+ private QuasiFramework getQuasiFramework(String dumpFile){
+ File dumpDir = new File(dumpFile);
+ if(dumpDir.exists() && dumpDir.isDirectory()){
+ try {
+ return this.quasiFrameworkFactory.create(dumpDir);
+ } catch (ZipException e) {
+ throw new RuntimeException("Unable to extract the state dump: " + e.getMessage(), e);
+ } catch (IOException e) {
+ throw new RuntimeException("Error reading the state dump: " + e.getMessage(), e);
+ }
+ }
+ throw new RuntimeException("Not a valid dump directory: " + dumpFile);
+ }
+}
diff --git a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/QuasiStateDump.java b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/QuasiStateDump.java
deleted file mode 100644
index f66d5bc8..00000000
--- a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/QuasiStateDump.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 VMware Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * VMware Inc. - initial contribution
- *******************************************************************************/
-package org.eclipse.virgo.kernel.userregion.internal.management;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.zip.ZipException;
-
-import org.eclipse.virgo.kernel.osgi.quasi.QuasiBundle;
-import org.eclipse.virgo.kernel.osgi.quasi.QuasiFramework;
-import org.eclipse.virgo.kernel.osgi.quasi.QuasiFrameworkFactory;
-import org.eclipse.virgo.kernel.osgi.quasi.QuasiResolutionFailure;
-
-/**
- *
- * MBean that allows for the exploration of state dumps using the QuasiFramework
- */
-public class QuasiStateDump implements StateDumpMXBean {
-
- private static final String INDENT = " ";
-
- private final QuasiFrameworkFactory quasiFrameworkFactory;
-
- public QuasiStateDump(QuasiFrameworkFactory quasiFrameworkFactory) {
- this.quasiFrameworkFactory = quasiFrameworkFactory;
- }
-
- public String[] getSummary(String dumpPath){
- File dumpDir = new File(dumpPath);
- if(dumpDir.exists() && dumpDir.isDirectory()){
- QuasiFramework quasiFramework;
- try {
- quasiFramework = this.quasiFrameworkFactory.create(dumpDir);
- } catch (ZipException e) {
- return new String[]{"Unable to extract the state dump: " + e.getMessage()};
- } catch (IOException e) {
- return new String[]{"Error reading the state dump: " + e.getMessage()};
- }
- quasiFramework.resolve();
- List<QuasiBundle> bundles = quasiFramework.getBundles();
- List<String> lines = new ArrayList<String>();
- for(QuasiBundle bundle: bundles){
- if(!bundle.isResolved()){
- lines.add(String.format("Bundle: %s_%s", bundle.getSymbolicName(), bundle.getVersion().toString()));
- File bundleFile = bundle.getBundleFile();
- if(bundleFile != null){
- lines.add(String.format("From location: %s", bundleFile.getPath()));
- }
- for(QuasiResolutionFailure fail: quasiFramework.diagnose(bundle.getBundleId())){
- lines.add(INDENT + fail.getDescription());
- lines.add("");
- }
- }
- }
- if(lines.size() > 0){
- lines.remove(lines.size() - 1);
- } else {
- lines.add("All Bundles were resolved at the time of this state dump.");
- }
- return lines.toArray(new String[lines.size()]);
- }
- return new String[0];
- }
-
- /**
- * {@inheritDoc}
- */
- public long[] getUnresolvedBundleIds(String dumpFile) {
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- public BundleMXBean[] listBundles(String dumpFile) {
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- public BundleMXBean getBundle(String dumpFile, long bundleId) {
- return null;
- }
-
-}
diff --git a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/StateDumpMXBean.java b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/StateDumpMXBean.java
index 17a2c1cb..c51b5390 100644
--- a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/StateDumpMXBean.java
+++ b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/StateDumpMXBean.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2011 VMware Inc.
+ * Copyright (c) 2008, 2012 VMware Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -20,16 +20,10 @@ import javax.management.MXBean;
@MXBean
public interface StateDumpMXBean {
- /**
- * Get a list of the unresolved BundleIds
- *
- * @param dumpFile
- * @return
- */
- public long[] getUnresolvedBundleIds(String dumpFile);
+ public JMXQuasiResolutionFailure[] getUnresolvedBundleIds(String dumpFile);
- public BundleMXBean[] listBundles(String dumpFile);
+ public JMXQuasiMinimalBundle[] listBundles(String dumpFile);
- public BundleMXBean getBundle(String dumpFile, long bundleId);
+ public JMXQuasiBundle getBundle(String dumpFile, long bundleId);
}
diff --git a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/StateDumpJMXExporter.java b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/StateDumpMXBeanExporter.java
index 5ccfcd97..7a824a25 100644
--- a/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/StateDumpJMXExporter.java
+++ b/org.eclipse.virgo.kernel.userregion/src/main/java/org/eclipse/virgo/kernel/userregion/internal/management/StateDumpMXBeanExporter.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2012 VMware Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VMware Inc. - initial contribution
+ *******************************************************************************/
package org.eclipse.virgo.kernel.userregion.internal.management;
import java.lang.management.ManagementFactory;
@@ -14,8 +24,8 @@ import org.slf4j.LoggerFactory;
*
*
*/
-public class StateDumpJMXExporter {
- private final Logger logger = LoggerFactory.getLogger(StateDumpJMXExporter.class);
+public class StateDumpMXBeanExporter {
+ private final Logger logger = LoggerFactory.getLogger(StateDumpMXBeanExporter.class);
private static final String DOMAIN = "org.eclipse.virgo.kernel";
@@ -27,10 +37,10 @@ public class StateDumpJMXExporter {
*
* @param serverHome
*/
- public StateDumpJMXExporter(QuasiFrameworkFactory quasiFrameworkFactory) {
+ public StateDumpMXBeanExporter(QuasiFrameworkFactory quasiFrameworkFactory) {
try {
ObjectName dumpMBeanName = new ObjectName(String.format("%s:type=Medic,name=StateDumpInspector", DOMAIN));
- registeredMBean = this.server.registerMBean(new QuasiStateDump(quasiFrameworkFactory), dumpMBeanName);
+ registeredMBean = this.server.registerMBean(new JMXQuasiStateDump(quasiFrameworkFactory), dumpMBeanName);
} catch (Exception e) {
logger.error("Unable to register the DumpInspectorMBean", e);
}
diff --git a/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/management/QuasiStateDumpMBeanTests.java b/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/management/JMXQuasiStateDumpTests.java
index f77a19ad..8b1de797 100644
--- a/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/management/QuasiStateDumpMBeanTests.java
+++ b/org.eclipse.virgo.kernel.userregion/src/test/java/org/eclipse/virgo/kernel/userregion/internal/management/JMXQuasiStateDumpTests.java
@@ -23,12 +23,12 @@ import static org.junit.Assert.*;
*
*
*/
-public class QuasiStateDumpMBeanTests {
+public class JMXQuasiStateDumpTests {
- private final QuasiStateDump quasiStateDumpMBean;
+ private final JMXQuasiStateDump quasiStateDumpMBean;
- public QuasiStateDumpMBeanTests() {
- quasiStateDumpMBean = new QuasiStateDump(new QuasiFrameworkFactory() {
+ public JMXQuasiStateDumpTests() {
+ quasiStateDumpMBean = new JMXQuasiStateDump(new QuasiFrameworkFactory() {
@Override
public QuasiFramework create(File stateDump) throws ZipException, IOException {
@@ -43,14 +43,18 @@ public class QuasiStateDumpMBeanTests {
}
@Test
- public void testGetSummary(){
- String[] summary = this.quasiStateDumpMBean.getSummary("src/test/resources/testDump");
- for (String string : summary) {
- System.out.println(string);
- }
- assertEquals(2, summary.length);
- assertEquals("Bundle: foo_0.0.0", summary[0]);
- assertEquals(" Description", summary[1]);
+ public void testGetUnresolvedBundleIds(){
+
+ }
+
+ @Test
+ public void testListBundles(){
+
+ }
+
+ @Test
+ public void testGetBundle(){
+
}
}
diff --git a/org.eclipse.virgo.management.console/.classpath b/org.eclipse.virgo.management.console/.classpath
index 48e93a91..1f64a1a0 100644
--- a/org.eclipse.virgo.management.console/.classpath
+++ b/org.eclipse.virgo.management.console/.classpath
@@ -22,7 +22,6 @@
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.jolokia/org.jolokia.osgi/1.0.2/org.jolokia.osgi-1.0.2.jar"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.mirrored/javax.servlet/3.0.0.v201112011016/javax.servlet-3.0.0.v201112011016.jar" sourcepath="/APPS_IVY_CACHE/javax.servlet/com.springsource.javax.servlet/2.5.0/com.springsource.javax.servlet-sources-2.5.0.jar"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.mirrored/org.slf4j.api/1.6.4.v20120130-2120/org.slf4j.api-1.6.4.v20120130-2120.jar" sourcepath="/KERNEL_IVY_CACHE/org.slf4j/com.springsource.slf4j.api/1.6.1/com.springsource.slf4j.api-sources-1.6.1.jar"/>
- <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.io/3.6.0.D-20120711093140/org.eclipse.virgo.util.io-3.6.0.D-20120711093140.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.io/2.1.0.D-20100218173020/org.eclipse.virgo.util.io-sources-2.1.0.D-20100218173020.jar"/>
<classpathentry kind="var" path="KERNEL_IVY_CACHE/org.junit/com.springsource.org.junit/4.7.0/com.springsource.org.junit-4.7.0.jar" sourcepath="/KERNEL_IVY_CACHE/org.junit/com.springsource.org.junit/4.7.0/com.springsource.org.junit-sources-4.7.0.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
diff --git a/org.eclipse.virgo.management.console/ivy.xml b/org.eclipse.virgo.management.console/ivy.xml
index a74542c2..efc70a99 100644
--- a/org.eclipse.virgo.management.console/ivy.xml
+++ b/org.eclipse.virgo.management.console/ivy.xml
@@ -18,14 +18,10 @@
<dependency org="org.eclipse.virgo.mirrored" name="org.eclipse.osgi" rev="${org.eclipse.osgi}" conf="provided->runtime"/>
<dependency org="org.eclipse.virgo.mirrored" name="org.eclipse.osgi.services" rev="${org.eclipse.osgi.services}" conf="provided->runtime"/>
<dependency org="org.eclipse.virgo.mirrored" name="org.slf4j.api" rev="${org.slf4j.api}" conf="provided->runtime"/>
- <dependency org="org.eclipse.virgo.util" name="org.eclipse.virgo.util.io" rev="${org.eclipse.virgo.util}" conf="provided->runtime"/>
-
- <dependency org="org.apache.commons" name="com.springsource.org.apache.commons.fileupload" rev="${org.apache.commons.fileupload}" conf="provided->runtime"/>
<dependency org="org.eclipse.virgo.mirrored" name="javax.servlet" rev="${javax.servlet}" conf="provided->runtime"/>
+ <dependency org="org.apache.commons" name="com.springsource.org.apache.commons.fileupload" rev="${org.apache.commons.fileupload}" conf="provided->runtime"/>
<dependency org="org.jolokia" name="org.jolokia.osgi" rev="${org.jolokia.osgi}" conf="provided->runtime"/>
-
-
<dependency org="org.eclipse.gemini" name="org.eclipse.gemini.management" rev="${org.eclipse.gemini.management}" conf="provided->runtime"/>
<dependency org="org.eclipse.osgi" name="org.eclipse.equinox.http" rev="${org.eclipse.equinox.http}" conf="provided->runtime"/>
<!-- === TEST ====================================================== -->
diff --git a/org.eclipse.virgo.management.console/src/main/java/org/eclipse/virgo/management/console/UploadServlet.java b/org.eclipse.virgo.management.console/src/main/java/org/eclipse/virgo/management/console/UploadServlet.java
index edf07752..f8923ea8 100644
--- a/org.eclipse.virgo.management.console/src/main/java/org/eclipse/virgo/management/console/UploadServlet.java
+++ b/org.eclipse.virgo.management.console/src/main/java/org/eclipse/virgo/management/console/UploadServlet.java
@@ -25,7 +25,6 @@ import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
-import org.eclipse.virgo.util.io.PathReference;
import org.osgi.framework.BundleContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -69,12 +68,10 @@ public class UploadServlet extends HttpServlet {
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
-
- createStagingDirectory();
-
- FileItemFactory factory = new DiskFileItemFactory();
- ServletFileUpload upload = new ServletFileUpload(factory);
try {
+ createStagingDirectory();
+ FileItemFactory factory = new DiskFileItemFactory();
+ ServletFileUpload upload = new ServletFileUpload(factory);
response.setContentType("text/html");
PrintWriter writer = response.getWriter();
writer.append("<ol id=\"uploadLocations\">");
@@ -95,15 +92,16 @@ public class UploadServlet extends HttpServlet {
writer.close();
} catch (Exception e) {
log.error(e.toString());
- e.printStackTrace();
response.sendError(HTTP_RESPONSE_INTERNAL_SERVER_ERROR);
}
}
- private void createStagingDirectory() {
- PathReference pathReference = new PathReference(new File(String.format("%s%s", this.serverHome, STAGING_DIR)));
+ private void createStagingDirectory() throws IOException {
+ File pathReference = new File(String.format("%s%s", this.serverHome, STAGING_DIR));
if (!pathReference.exists()) {
- pathReference.createDirectory();
+ if (!pathReference.mkdirs()) {
+ throw new IOException("Unable to create directory " + pathReference.getPath());
+ }
}
}
diff --git a/org.eclipse.virgo.management.console/src/main/webapp/js/dumps.js b/org.eclipse.virgo.management.console/src/main/webapp/js/dumps.js
index b0a82775..732f80d0 100644
--- a/org.eclipse.virgo.management.console/src/main/webapp/js/dumps.js
+++ b/org.eclipse.virgo.management.console/src/main/webapp/js/dumps.js
@@ -21,6 +21,7 @@ function pageinit(){
dataType: 'json',
success: function (response) {
$('#dumpLocation').text("Location: " + response.value);
+ dumpViewer.setDumpLocation(response.value);
}
});
}
@@ -31,6 +32,10 @@ var DumpViewer = function(){
self.selectedDump = null;
+ self.setDumpLocation = function(dumpLocation){
+ self.dumpLocation = dumpLocation;
+ };
+
self.displayDumps = function(){
$('#dumps').empty();
$.ajax({
@@ -160,7 +165,7 @@ var DumpViewer = function(){
var height = 562;
$('#bundle-canvas').css({'width' : width, 'height' : height + 18});
- var dataSource = new QuasiDataSource();
+ var dataSource = new QuasiDataSource(self.dumpLocation + '/' + dumpId);
dataSource.updateData(function(){
new LayoutManager(Raphael('bundle-canvas', width, height), dataSource).displayBundle(5);
});
@@ -203,10 +208,14 @@ var DumpViewer = function(){
* UpdateBundle
*
*/
-var QuasiDataSource = function(){
+var QuasiDataSource = function(dumpFolder){
var self = this;
+ self.dumpFolder = dumpFolder;
+
+ alert(self.dumpFolder);
+
self.bundles = {};
self.services = {};

Back to the top