Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2011-01-06 16:35:22 -0500
committerGreg Wilkins2011-01-06 16:35:22 -0500
commit6f0b83a272b0ce95d2f82963af730135492b9a09 (patch)
treea0385d4a4a9a7a41721793e3df9d76cdbca37cb4 /jetty-deploy/src/main
parent881e5998601c47d928fca88a5ff7a67339a8e1a7 (diff)
downloadorg.eclipse.jetty.project-6f0b83a272b0ce95d2f82963af730135492b9a09.tar.gz
org.eclipse.jetty.project-6f0b83a272b0ce95d2f82963af730135492b9a09.tar.xz
org.eclipse.jetty.project-6f0b83a272b0ce95d2f82963af730135492b9a09.zip
333679 Refactored jetty-jmx. Improved deployer mbeans
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@2630 7e9141cc-0065-0410-87d8-b60c137991c4
Diffstat (limited to 'jetty-deploy/src/main')
-rw-r--r--jetty-deploy/src/main/config/etc/jetty-webapps.xml2
-rw-r--r--jetty-deploy/src/main/java/org/eclipse/jetty/deploy/DeploymentManager.java11
-rw-r--r--jetty-deploy/src/main/java/org/eclipse/jetty/deploy/jmx/DeploymentManagerMBean.java27
-rw-r--r--jetty-deploy/src/main/resources/org/eclipse/jetty/deploy/jmx/ContextDeployer-mbean.properties (renamed from jetty-deploy/src/main/resources/org/eclipse/jetty/deploy/deploy/jmx/ContextDeployer-mbean.properties)0
-rw-r--r--jetty-deploy/src/main/resources/org/eclipse/jetty/deploy/jmx/DeploymentManager-mbean.properties4
-rw-r--r--jetty-deploy/src/main/resources/org/eclipse/jetty/deploy/jmx/WebAppDeployer-mbean.properties (renamed from jetty-deploy/src/main/resources/org/eclipse/jetty/deploy/deploy/jmx/WebAppDeployer-mbean.properties)0
-rw-r--r--jetty-deploy/src/main/resources/org/eclipse/jetty/deploy/providers/jmx/ContextProvider-mbean.properties1
-rw-r--r--jetty-deploy/src/main/resources/org/eclipse/jetty/deploy/providers/jmx/ScanningAppProvider-mbean.properties4
-rw-r--r--jetty-deploy/src/main/resources/org/eclipse/jetty/deploy/providers/jmx/WebAppProvider-mbean.properties7
9 files changed, 52 insertions, 4 deletions
diff --git a/jetty-deploy/src/main/config/etc/jetty-webapps.xml b/jetty-deploy/src/main/config/etc/jetty-webapps.xml
index 3e1b1669b5..69c943beef 100644
--- a/jetty-deploy/src/main/config/etc/jetty-webapps.xml
+++ b/jetty-deploy/src/main/config/etc/jetty-webapps.xml
@@ -11,7 +11,7 @@
<!-- =============================================================== -->
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<Ref id="DeploymentManager">
- <Call name="addAppProvider">
+ <Call id="webappprovider" name="addAppProvider">
<Arg>
<New class="org.eclipse.jetty.deploy.providers.WebAppProvider">
<Set name="monitoredDir"><Property name="jetty.home" default="." />/webapps</Set>
diff --git a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/DeploymentManager.java b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/DeploymentManager.java
index 9e34d5d29c..1e2c0acfb4 100644
--- a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/DeploymentManager.java
+++ b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/DeploymentManager.java
@@ -159,8 +159,11 @@ public class DeploymentManager extends AggregateLifeCycle
if (isRunning())
throw new IllegalStateException();
- _providers.add(provider);
- addBean(provider);
+ List<AppProvider> old = new ArrayList<AppProvider>(_providers);
+ if (_providers.add(provider) && getServer()!=null)
+ getServer().getContainer().update(this, null, provider, "provider");
+
+ addBean(provider);
}
public void setLifeCycleBindings(Collection<AppLifeCycle.Binding> bindings)
@@ -395,7 +398,11 @@ public class DeploymentManager extends AggregateLifeCycle
public void removeAppProvider(AppProvider provider)
{
if(_providers.remove(provider))
+ {
removeBean(provider);
+ if (getServer()!=null)
+ getServer().getContainer().update(this, provider,null, "provider");
+ }
try
{
provider.stop();
diff --git a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/jmx/DeploymentManagerMBean.java b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/jmx/DeploymentManagerMBean.java
index 66a1762d90..3a219215f6 100644
--- a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/jmx/DeploymentManagerMBean.java
+++ b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/jmx/DeploymentManagerMBean.java
@@ -1,7 +1,14 @@
package org.eclipse.jetty.deploy.jmx;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.jetty.deploy.App;
+import org.eclipse.jetty.deploy.AppProvider;
import org.eclipse.jetty.deploy.DeploymentManager;
import org.eclipse.jetty.jmx.ObjectMBean;
+import org.eclipse.jetty.server.handler.ContextHandler;
public class DeploymentManagerMBean extends ObjectMBean
{
@@ -13,6 +20,24 @@ public class DeploymentManagerMBean extends ObjectMBean
_manager=(DeploymentManager)managedObject;
}
+ public Collection<String> getApps()
+ {
+ List<String> apps=new ArrayList<String>();
+ for (App app: _manager.getApps())
+ apps.add(app.getOriginId());
+ return apps;
+ }
-
+ public Collection<ContextHandler> getContexts() throws Exception
+ {
+ List<ContextHandler> apps=new ArrayList<ContextHandler>();
+ for (App app: _manager.getApps())
+ apps.add(app.getContextHandler());
+ return apps;
+ }
+
+ public Collection<AppProvider> getAppProviders()
+ {
+ return _manager.getAppProviders();
+ }
}
diff --git a/jetty-deploy/src/main/resources/org/eclipse/jetty/deploy/deploy/jmx/ContextDeployer-mbean.properties b/jetty-deploy/src/main/resources/org/eclipse/jetty/deploy/jmx/ContextDeployer-mbean.properties
index 335a5ee661..335a5ee661 100644
--- a/jetty-deploy/src/main/resources/org/eclipse/jetty/deploy/deploy/jmx/ContextDeployer-mbean.properties
+++ b/jetty-deploy/src/main/resources/org/eclipse/jetty/deploy/jmx/ContextDeployer-mbean.properties
diff --git a/jetty-deploy/src/main/resources/org/eclipse/jetty/deploy/jmx/DeploymentManager-mbean.properties b/jetty-deploy/src/main/resources/org/eclipse/jetty/deploy/jmx/DeploymentManager-mbean.properties
new file mode 100644
index 0000000000..726c236b1a
--- /dev/null
+++ b/jetty-deploy/src/main/resources/org/eclipse/jetty/deploy/jmx/DeploymentManager-mbean.properties
@@ -0,0 +1,4 @@
+DeploymentManager: Deployment Manager
+apps:MBean:Deployed Apps
+contexts:MMBean:Deployed Contexts
+appProviders:MMBean:Application Providers \ No newline at end of file
diff --git a/jetty-deploy/src/main/resources/org/eclipse/jetty/deploy/deploy/jmx/WebAppDeployer-mbean.properties b/jetty-deploy/src/main/resources/org/eclipse/jetty/deploy/jmx/WebAppDeployer-mbean.properties
index a1304e1e7a..a1304e1e7a 100644
--- a/jetty-deploy/src/main/resources/org/eclipse/jetty/deploy/deploy/jmx/WebAppDeployer-mbean.properties
+++ b/jetty-deploy/src/main/resources/org/eclipse/jetty/deploy/jmx/WebAppDeployer-mbean.properties
diff --git a/jetty-deploy/src/main/resources/org/eclipse/jetty/deploy/providers/jmx/ContextProvider-mbean.properties b/jetty-deploy/src/main/resources/org/eclipse/jetty/deploy/providers/jmx/ContextProvider-mbean.properties
new file mode 100644
index 0000000000..3b3cc056fa
--- /dev/null
+++ b/jetty-deploy/src/main/resources/org/eclipse/jetty/deploy/providers/jmx/ContextProvider-mbean.properties
@@ -0,0 +1 @@
+ContextProvider: Context AppProvider for Deployment manager \ No newline at end of file
diff --git a/jetty-deploy/src/main/resources/org/eclipse/jetty/deploy/providers/jmx/ScanningAppProvider-mbean.properties b/jetty-deploy/src/main/resources/org/eclipse/jetty/deploy/providers/jmx/ScanningAppProvider-mbean.properties
new file mode 100644
index 0000000000..ecd15b31c8
--- /dev/null
+++ b/jetty-deploy/src/main/resources/org/eclipse/jetty/deploy/providers/jmx/ScanningAppProvider-mbean.properties
@@ -0,0 +1,4 @@
+ScanningAppProvider: Scanning AppProvider for Deployment manager
+monitoredDirName: The directory to monitor for new Apps
+scanInterval: The scan interval in seconds
+recursive: Look in subdirectories
diff --git a/jetty-deploy/src/main/resources/org/eclipse/jetty/deploy/providers/jmx/WebAppProvider-mbean.properties b/jetty-deploy/src/main/resources/org/eclipse/jetty/deploy/providers/jmx/WebAppProvider-mbean.properties
new file mode 100644
index 0000000000..f47065e7bf
--- /dev/null
+++ b/jetty-deploy/src/main/resources/org/eclipse/jetty/deploy/providers/jmx/WebAppProvider-mbean.properties
@@ -0,0 +1,7 @@
+WebAppProvider: Web application AppProvider for Deployment manager
+extractWars: Extract WAR files to temporary directory
+parentLoaderPriority: ClassLoaders give priority to classes from parent loader
+defaultsDescriptor: The default descriptor applied before any web.xml
+contextXmlDir: The directory of context.xml files
+configurationClasses: The configuration classes to apply
+tempDir: The temporary directory to use \ No newline at end of file

Back to the top