Author: remy.maucherat(a)jboss.com
Date: 2010-08-26 05:45:16 -0400 (Thu, 26 Aug 2010)
New Revision: 1543
Modified:
trunk/java/org/apache/catalina/startup/HostConfig.java
Log:
- Drop useless stuff which could cause some NPEs from HostConfig.
Modified: trunk/java/org/apache/catalina/startup/HostConfig.java
===================================================================
--- trunk/java/org/apache/catalina/startup/HostConfig.java 2010-08-25 13:00:37 UTC (rev
1542)
+++ trunk/java/org/apache/catalina/startup/HostConfig.java 2010-08-26 09:45:16 UTC (rev
1543)
@@ -85,12 +85,6 @@
/**
- * The JMX ObjectName of this component.
- */
- protected ObjectName oname = null;
-
-
- /**
* The string resources for this package.
*/
protected static final StringManager sm =
@@ -104,12 +98,6 @@
protected ArrayList<String> serviced = new ArrayList<String>();
- /**
- * The list of Wars in the appBase to be ignored because they are invalid
- * (e.g. contain /../ sequences).
- */
- protected Set<String> invalidWars = new HashSet<String>();
-
// ------------------------------------------------------------- Properties
@@ -167,6 +155,14 @@
*/
public void lifecycleEvent(LifecycleEvent event) {
+ // Identify the context we are associated with
+ try {
+ host = (Host) event.getLifecycle();
+ } catch (ClassCastException e) {
+ log.error(sm.getString("hostConfig.cce", event.getLifecycle()),
e);
+ return;
+ }
+
if (event.getType().equals(Lifecycle.PERIODIC_EVENT))
check();
@@ -275,16 +271,6 @@
if (log.isDebugEnabled())
log.debug(sm.getString("hostConfig.start"));
- try {
- ObjectName hostON = new ObjectName(host.getObjectName());
- oname = new ObjectName
- (hostON.getDomain() + ":type=Deployer,host=" +
host.getName());
- Registry.getRegistry(null, null).registerComponent
- (this, oname, this.getClass().getName());
- } catch (Exception e) {
- log.error(sm.getString("hostConfig.jmx.register", oname), e);
- }
-
}
@@ -298,14 +284,6 @@
undeployApps();
- if (oname != null) {
- try {
- Registry.getRegistry(null, null).unregisterComponent(oname);
- } catch (Exception e) {
- log.error(sm.getString("hostConfig.jmx.unregister", oname),
e);
- }
- }
- oname = null;
appBase = null;
configBase = null;
Show replies by date