Skip to content

Commit 7c3ef25

Browse files
Dele Olajideakrherz
authored andcommitted
Updated jmxweb plugin to be compatible with Openfire 4.x (igniterealtime#583)
1 parent 687f633 commit 7c3ef25

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

src/plugins/jmxweb/changelog.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@
4343
<h1>
4444
</h1>
4545

46+
<p><b>0.0.3</b> -- April 29 2016</p>
47+
48+
<ul>
49+
<li>Made compatible with Openfire 4.x</li>
50+
<li>Updated jolokia to 1.3.3</li>
51+
</ul>
52+
4653
<p><b>0.0.2</b> -- December 1st 2015</p>
4754

4855
<ul>

src/plugins/jmxweb/plugin.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<class>com.ifsoft.jmxweb.plugin.JmxWebPlugin</class>
55
<name>JmxWeb Plugin</name>
66
<description>JmxWeb plugin is web based platform for managing and monitoring openfire via JMX.</description>
7-
<version>0.0.2</version>
7+
<version>0.0.3</version>
88
<licenseType>Apache 2.0</licenseType>
9-
<date>01/09/2015</date>
10-
<minServerVersion>3.9.9</minServerVersion>
9+
<date>04/29/2016</date>
10+
<minServerVersion>4.0.1</minServerVersion>
1111
<author>igniterealtime.org</author>
1212
</plugin>
-303 KB
Binary file not shown.

src/plugins/jmxweb/src/java/com/ifsoft/jmxweb/plugin/JmxWebPlugin.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,13 @@
2828
import org.jivesoftware.openfire.http.HttpBindManager;
2929

3030
import java.io.File;
31+
import java.util.*;
3132

3233
import org.slf4j.Logger;
3334
import org.slf4j.LoggerFactory;
3435

36+
import org.eclipse.jetty.apache.jsp.JettyJasperInitializer;
37+
import org.eclipse.jetty.plus.annotation.ContainerInitializer;
3538
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
3639
import org.eclipse.jetty.webapp.WebAppContext;
3740
import org.eclipse.jetty.util.security.*;
@@ -46,6 +49,8 @@
4649
import com.javamonitor.openfire.mbeans.Openfire;
4750
import com.javamonitor.openfire.mbeans.PacketCounter;
4851

52+
import org.apache.tomcat.InstanceManager;
53+
import org.apache.tomcat.SimpleInstanceManager;
4954

5055
public class JmxWebPlugin implements Plugin {
5156

@@ -115,10 +120,19 @@ public void initializePlugin(PluginManager manager, File pluginDirectory) {
115120
try {
116121
Log.info( "["+ NAME + "] starting jolokia");
117122
WebAppContext context = new WebAppContext(contexts, pluginDirectory.getPath(), "/jolokia");
123+
124+
final List<ContainerInitializer> initializers = new ArrayList<>();
125+
initializers.add(new ContainerInitializer(new JettyJasperInitializer(), null));
126+
context.setAttribute("org.eclipse.jetty.containerInitializers", initializers);
127+
context.setAttribute(InstanceManager.class.getName(), new SimpleInstanceManager());
118128
context.setWelcomeFiles(new String[]{"index.html"});
119129

120130
Log.info( "["+ NAME + "] starting hawtio");
121131
WebAppContext context2 = new WebAppContext(contexts, pluginDirectory.getPath() + "/hawtio", "/hawtio");
132+
final List<ContainerInitializer> initializers2 = new ArrayList<>();
133+
initializers2.add(new ContainerInitializer(new JettyJasperInitializer(), null));
134+
context2.setAttribute("org.eclipse.jetty.containerInitializers", initializers2);
135+
context2.setAttribute(InstanceManager.class.getName(), new SimpleInstanceManager());
122136
context2.setWelcomeFiles(new String[]{"index.html"});
123137

124138
if (JiveGlobals.getBooleanProperty("xmpp.jmx.secure", true))

0 commit comments

Comments
 (0)