Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Frost2012-07-11 10:36:26 -0400
committerChristopher Frost2012-07-11 10:36:26 -0400
commitd03b353845b93fb7f83f13b0c3c13d15dc74316a (patch)
treec92382abcdd39ab18e989bfac3f43b6a0aed9535 /org.eclipse.virgo.management.console
parentf53cfb29392111ebf019dffa5f169e2e4bf3c9bc (diff)
downloadorg.eclipse.virgo.kernel-d03b353845b93fb7f83f13b0c3c13d15dc74316a.tar.gz
org.eclipse.virgo.kernel-d03b353845b93fb7f83f13b0c3c13d15dc74316a.tar.xz
org.eclipse.virgo.kernel-d03b353845b93fb7f83f13b0c3c13d15dc74316a.zip
Moving management code to a initialArtifacts plan instead of base bundles
Diffstat (limited to 'org.eclipse.virgo.management.console')
-rw-r--r--org.eclipse.virgo.management.console/ivy.xml5
-rw-r--r--org.eclipse.virgo.management.console/src/main/java/org/eclipse/virgo/management/console/Activator.java21
-rw-r--r--org.eclipse.virgo.management.console/src/main/java/org/eclipse/virgo/management/console/UploadServlet.java19
-rw-r--r--org.eclipse.virgo.management.console/src/main/webapp/js/common.js1
4 files changed, 21 insertions, 25 deletions
diff --git a/org.eclipse.virgo.management.console/ivy.xml b/org.eclipse.virgo.management.console/ivy.xml
index 98a38f98..a74542c2 100644
--- a/org.eclipse.virgo.management.console/ivy.xml
+++ b/org.eclipse.virgo.management.console/ivy.xml
@@ -18,12 +18,15 @@
<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.gemini" name="org.eclipse.gemini.management" rev="${org.eclipse.gemini.management}" 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.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 ====================================================== -->
<dependency org="org.junit" name="com.springsource.org.junit" rev="${org.junit}" conf="test->runtime"/>
diff --git a/org.eclipse.virgo.management.console/src/main/java/org/eclipse/virgo/management/console/Activator.java b/org.eclipse.virgo.management.console/src/main/java/org/eclipse/virgo/management/console/Activator.java
index 80cda564..f42b70f2 100644
--- a/org.eclipse.virgo.management.console/src/main/java/org/eclipse/virgo/management/console/Activator.java
+++ b/org.eclipse.virgo.management.console/src/main/java/org/eclipse/virgo/management/console/Activator.java
@@ -35,8 +35,6 @@ import org.jolokia.osgi.servlet.JolokiaServlet;
public class Activator implements BundleActivator {
private static final Logger log = LoggerFactory.getLogger(Activator.class);
-
- private static final String ORG_ECLIPSE_VIRGO_KERNEL_HOME = "org.eclipse.virgo.kernel.home";
protected static final String APPLICATION_NAME = "Virgo Admin Console";
@@ -60,13 +58,13 @@ public class Activator implements BundleActivator {
private final Object lock = new Object();
- private BundleContext context;
+ private BundleContext bundleContext;
@Override
public void start(BundleContext context) throws Exception {
- this.context = context;
+ this.bundleContext = context;
- Activator.contextPath = this.context.getBundle().getHeaders().get("Web-ContextPath");
+ Activator.contextPath = this.bundleContext.getBundle().getHeaders().get("Web-ContextPath");
this.httpServiceTracker = new ServiceTracker<HttpService, HttpService>(context, HttpService.class, new HttpServiceTrackerCustomizer(context));
Filter createFilter = context.createFilter("(&(" + Constants.OBJECTCLASS + "=" + URLStreamHandlerService.class.getSimpleName() + ")(url.handler.protocol=webbundle))");
@@ -86,17 +84,16 @@ public class Activator implements BundleActivator {
synchronized (this.lock) {
if(this.registeredHttpService != null){
try {
- AdminHttpContext adminHttpContext = new AdminHttpContext(this.context.getBundle());
+ AdminHttpContext adminHttpContext = new AdminHttpContext(this.bundleContext.getBundle());
Dictionary<String, String> contentServletInitParams = new Hashtable<String, String>();
contentServletInitParams.put(ContentServlet.CONTENT_SERVLET_PREFIX, "/WEB-INF/layouts");
contentServletInitParams.put(ContentServlet.CONTENT_SERVLET_SUFFIX, ".html");
ContentServlet contentServlet = new ContentServlet();
- this.registeredHttpService.registerServlet(Activator.contextPath, new IndexServlet(contentServlet), null, adminHttpContext);
- this.registeredHttpService.registerServlet(Activator.contextPath + CONTENT_CONTEXT_PATH, contentServlet, contentServletInitParams, adminHttpContext);
- this.registeredHttpService.registerServlet(Activator.contextPath + RESOURCES_CONTEXT_PATH, new ResourceServlet(), null, adminHttpContext);
- String serverHome = this.context.getProperty(ORG_ECLIPSE_VIRGO_KERNEL_HOME);
- this.registeredHttpService.registerServlet(Activator.contextPath + UPLOAD_CONTEXT_PATH, new UploadServlet(serverHome), null, adminHttpContext);
- this.registeredHttpService.registerServlet(Activator.contextPath + JOLOKIA_CONTEXT_PATH, new JolokiaServlet(this.context), null, adminHttpContext);
+ this.registeredHttpService.registerServlet(Activator.contextPath, new IndexServlet(contentServlet), null, adminHttpContext);
+ this.registeredHttpService.registerServlet(Activator.contextPath + CONTENT_CONTEXT_PATH, contentServlet, contentServletInitParams, adminHttpContext);
+ this.registeredHttpService.registerServlet(Activator.contextPath + RESOURCES_CONTEXT_PATH, new ResourceServlet(), null, adminHttpContext);
+ this.registeredHttpService.registerServlet(Activator.contextPath + UPLOAD_CONTEXT_PATH, new UploadServlet(this.bundleContext), null, adminHttpContext);
+ this.registeredHttpService.registerServlet(Activator.contextPath + JOLOKIA_CONTEXT_PATH, new JolokiaServlet(this.bundleContext), null, adminHttpContext);
this.isRegisteredWithHttpService = true;
log.info("Admin console registered to HttpService: " + Activator.contextPath);
} catch (Exception e) {
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 4a3e24bc..9513ef63 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
@@ -13,7 +13,6 @@ package org.eclipse.virgo.management.console;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
-import java.lang.reflect.Method;
import java.util.List;
import javax.servlet.ServletConfig;
@@ -48,12 +47,14 @@ public class UploadServlet extends HttpServlet {
private static final Logger log = LoggerFactory.getLogger(UploadServlet.class);
private String serverHome = null;
+
+ private BundleContext bundleContext = null;
public UploadServlet() {
}
- public UploadServlet(String serverHome) {
- this.serverHome = serverHome;
+ public UploadServlet(BundleContext bundleContext) {
+ this.bundleContext = bundleContext;
}
/**
@@ -61,16 +62,10 @@ public class UploadServlet extends HttpServlet {
*/
public void init(ServletConfig config) throws ServletException {
super.init(config);
- System.out.println("this.getServletContext().getClass() " + this.getServletContext().getClass());
- Method[] declaredMethods = this.getServletContext().getClass().getDeclaredMethods();
- for (int i = 0; i < declaredMethods.length; i++) {
- System.out.println(declaredMethods[i].getName());
- }
- System.out.println("done");
- if(serverHome == null){
- BundleContext bc = (BundleContext) this.getServletContext().getAttribute("osgi-bundlecontext");
- this.serverHome = bc.getProperty(ORG_ECLIPSE_VIRGO_KERNEL_HOME);
+ if(bundleContext == null){
+ this.bundleContext = (BundleContext) config.getServletContext().getAttribute("osgi-bundlecontext");
}
+ this.serverHome = this.bundleContext.getProperty(ORG_ECLIPSE_VIRGO_KERNEL_HOME);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
diff --git a/org.eclipse.virgo.management.console/src/main/webapp/js/common.js b/org.eclipse.virgo.management.console/src/main/webapp/js/common.js
index a6d034ef..f8b87cb6 100644
--- a/org.eclipse.virgo.management.console/src/main/webapp/js/common.js
+++ b/org.eclipse.virgo.management.console/src/main/webapp/js/common.js
@@ -128,6 +128,7 @@ var Util = function(){
* @param callback
*/
self.doBulkQuery = function(query, successCallback, errorCallback){
+ console.log(JSON.stringify(query));
$.ajax({
type: 'POST',
url: self.getCurrentHost() + '/jolokia',

Back to the top