Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MODCLUSTER-315 Convert project to use i18n logging and exceptions

Drop ha module.
Update pom to use git.
  • Loading branch information...
commit 8bdebac67b29f59098fba3332e42ccbda4c6d6fa 1 parent 088f844
@pferraro pferraro authored
Showing with 1,108 additions and 5,095 deletions.
  1. +3 −20 ...atalina-standalone/src/main/java/org/jboss/modcluster/container/catalina/standalone/ModClusterListener.java
  2. +24 −0 container/catalina/src/main/java/org/jboss/modcluster/container/catalina/CatalinaConnectorFactory.java
  3. +24 −0 container/catalina/src/main/java/org/jboss/modcluster/container/catalina/CatalinaContextFactory.java
  4. +24 −0 container/catalina/src/main/java/org/jboss/modcluster/container/catalina/CatalinaEngineFactory.java
  5. +24 −0 container/catalina/src/main/java/org/jboss/modcluster/container/catalina/CatalinaEventHandler.java
  6. +25 −0 container/catalina/src/main/java/org/jboss/modcluster/container/catalina/CatalinaFactory.java
  7. +24 −1 container/catalina/src/main/java/org/jboss/modcluster/container/catalina/CatalinaFactoryRegistry.java
  8. +24 −0 container/catalina/src/main/java/org/jboss/modcluster/container/catalina/CatalinaHostFactory.java
  9. +24 −0 container/catalina/src/main/java/org/jboss/modcluster/container/catalina/CatalinaServerFactory.java
  10. +24 −0 container/catalina/src/main/java/org/jboss/modcluster/container/catalina/ConnectorFactory.java
  11. +24 −0 container/catalina/src/main/java/org/jboss/modcluster/container/catalina/ContextFactory.java
  12. +24 −0 container/catalina/src/main/java/org/jboss/modcluster/container/catalina/EngineFactory.java
  13. +24 −0 container/catalina/src/main/java/org/jboss/modcluster/container/catalina/HostFactory.java
  14. +25 −0 container/catalina/src/main/java/org/jboss/modcluster/container/catalina/JMXServerProvider.java
  15. +24 −0 container/catalina/src/main/java/org/jboss/modcluster/container/catalina/LifecycleListenerFactory.java
  16. +24 −0 container/catalina/src/main/java/org/jboss/modcluster/container/catalina/RequestListenerValveFactory.java
  17. +24 −0 container/catalina/src/main/java/org/jboss/modcluster/container/catalina/ServerFactory.java
  18. +24 −0 container/catalina/src/main/java/org/jboss/modcluster/container/catalina/ServerProvider.java
  19. +24 −0 container/catalina/src/main/java/org/jboss/modcluster/container/catalina/ServiceLoaderCatalinaFactory.java
  20. +24 −0 container/catalina/src/main/java/org/jboss/modcluster/container/catalina/SimpleServerProvider.java
  21. +3 −0  container/jbossweb/src/main/java/org/jboss/modcluster/container/jbossweb/JBossWebConnector.java
  22. +3 −0  container/jbossweb/src/main/java/org/jboss/modcluster/container/jbossweb/JBossWebConnectorFactory.java
  23. +24 −0 container/jbossweb/src/main/java/org/jboss/modcluster/container/jbossweb/JBossWebContext.java
  24. +24 −0 container/jbossweb/src/main/java/org/jboss/modcluster/container/jbossweb/JBossWebContextFactory.java
  25. +24 −0 container/jbossweb/src/main/java/org/jboss/modcluster/container/jbossweb/JBossWebEventHandlerAdapter.java
  26. +24 −0 container/jbossweb/src/main/java/org/jboss/modcluster/container/jbossweb/JBossWebLifecycleListenerFactory.java
  27. +24 −0 container/tomcat6/src/main/java/org/jboss/modcluster/container/tomcat/TomcatConnector.java
  28. +3 −0  container/tomcat6/src/main/java/org/jboss/modcluster/container/tomcat/TomcatConnectorFactory.java
  29. +24 −0 container/tomcat6/src/main/java/org/jboss/modcluster/container/tomcat/TomcatContext.java
  30. +24 −0 container/tomcat6/src/main/java/org/jboss/modcluster/container/tomcat/TomcatContextFactory.java
  31. +3 −0  container/tomcat6/src/main/java/org/jboss/modcluster/container/tomcat/TomcatEventHandlerAdapter.java
  32. +3 −0  container/tomcat6/src/main/java/org/jboss/modcluster/container/tomcat/TomcatLifecycleListenerFactory.java
  33. +24 −0 container/tomcat7/src/main/java/org/jboss/modcluster/container/tomcat/TomcatConnector.java
  34. +24 −0 container/tomcat7/src/main/java/org/jboss/modcluster/container/tomcat/TomcatConnectorFactory.java
  35. +24 −0 container/tomcat7/src/main/java/org/jboss/modcluster/container/tomcat/TomcatContext.java
  36. +24 −0 container/tomcat7/src/main/java/org/jboss/modcluster/container/tomcat/TomcatContextFactory.java
  37. +24 −0 container/tomcat7/src/main/java/org/jboss/modcluster/container/tomcat/TomcatEventHandlerAdapter.java
  38. +3 −0  container/tomcat7/src/main/java/org/jboss/modcluster/container/tomcat/TomcatLifecycleListenerFactory.java
  39. +19 −0 core/pom.xml
  40. +156 −0 core/src/main/java/org/jboss/modcluster/ModClusterLogger.java
  41. +52 −0 core/src/main/java/org/jboss/modcluster/ModClusterMessages.java
  42. +37 −46 core/src/main/java/org/jboss/modcluster/ModClusterService.java
  43. +0 −83 core/src/main/java/org/jboss/modcluster/Strings.java
  44. +0 −58 core/src/main/java/org/jboss/modcluster/advertise/impl/AdvertiseEventType.java
  45. +6 −6 core/src/main/java/org/jboss/modcluster/advertise/impl/AdvertiseListenerImpl.java
  46. +4 −11 core/src/main/java/org/jboss/modcluster/advertise/impl/MulticastSocketFactoryImpl.java
  47. +1 −1  core/src/main/java/org/jboss/modcluster/load/impl/DynamicLoadBalanceFactorProvider.java
  48. +3 −2 core/src/main/java/org/jboss/modcluster/load/metric/impl/AbstractLoadMetric.java
  49. +9 −6 core/src/main/java/org/jboss/modcluster/mcmp/MCMPRequestType.java
  50. +37 −42 core/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java
  51. +5 −6 core/src/main/java/org/jboss/modcluster/mcmp/impl/JSSESocketFactory.java
  52. +0 −61 core/src/test/java/org/jboss/modcluster/StringsTestCase.java
  53. +2 −3 core/src/test/java/org/jboss/modcluster/advertise/MulticastSocketFactoryImplTestCase.java
  54. +2 −2 demo/server/src/main/java/org/jboss/modcluster/demo/servlet/BusyConnectorsLoadServlet.java
  55. +0 −67 docs/userguide/src/main/docbook/modules/java/config.xml
  56. +0 −26 docs/userguide/src/main/docbook/modules/java/properties.xml
  57. +0 −56 ha/pom.xml
  58. +0 −34 ha/src/main/java/org/jboss/modcluster/config/ha/HAConfiguration.java
  59. +0 −40 ha/src/main/java/org/jboss/modcluster/config/ha/impl/HAModClusterConfig.java
  60. +0 −48 ha/src/main/java/org/jboss/modcluster/ha/ClusteredMCMPHandler.java
  61. +0 −438 ha/src/main/java/org/jboss/modcluster/ha/ClusteredMCMPHandlerImpl.java
  62. +0 −110 ha/src/main/java/org/jboss/modcluster/ha/ClusteredResetRequestSource.java
  63. +0 −1,254 ha/src/main/java/org/jboss/modcluster/ha/HAModClusterService.java
  64. +0 −68 ha/src/main/java/org/jboss/modcluster/ha/HAModClusterServiceMBean.java
  65. +0 −153 ha/src/main/java/org/jboss/modcluster/ha/ModClusterServiceDRMEntry.java
  66. +0 −46 ha/src/main/java/org/jboss/modcluster/ha/rpc/ClusteredMCMPHandlerRpcHandler.java
  67. +0 −122 ha/src/main/java/org/jboss/modcluster/ha/rpc/DefaultRpcResponse.java
  68. +0 −102 ha/src/main/java/org/jboss/modcluster/ha/rpc/MCMPServerDiscoveryEvent.java
  69. +0 −52 ha/src/main/java/org/jboss/modcluster/ha/rpc/ModClusterServiceRpcHandler.java
  70. +0 −72 ha/src/main/java/org/jboss/modcluster/ha/rpc/ModClusterServiceStatus.java
  71. +0 −60 ha/src/main/java/org/jboss/modcluster/ha/rpc/PeerMCMPDiscoveryStatus.java
  72. +0 −35 ha/src/main/java/org/jboss/modcluster/ha/rpc/ResetRequestSourceRpcHandler.java
  73. +0 −35 ha/src/main/java/org/jboss/modcluster/ha/rpc/RpcResponse.java
  74. +0 −49 ha/src/main/java/org/jboss/modcluster/ha/rpc/RpcResponseFilter.java
  75. +0 −535 ha/src/test/java/org/jboss/modcluster/ha/ClusteredMCMPHandlerTestCase.java
  76. +0 −240 ha/src/test/java/org/jboss/modcluster/ha/ClusteredResetRequestSourceTestCase.java
  77. +0 −950 ha/src/test/java/org/jboss/modcluster/ha/HAModClusterServiceTestCase.java
  78. +0 −126 ha/src/test/java/org/jboss/modcluster/ha/rpc/DefaultRpcResponseTestCase.java
  79. +7 −16 pom.xml
  80. +0 −1  src/assembly/sar.xml
  81. +1 −12 src/main/resources/mod_cluster-jboss-beans.xml
View
23 .../src/main/java/org/jboss/modcluster/container/catalina/standalone/ModClusterListener.java
@@ -43,7 +43,6 @@
import org.jboss.logging.Logger;
import org.jboss.modcluster.ModClusterService;
import org.jboss.modcluster.ModClusterServiceMBean;
-import org.jboss.modcluster.Strings;
import org.jboss.modcluster.config.JvmRouteFactory;
import org.jboss.modcluster.config.impl.ModClusterConfig;
import org.jboss.modcluster.container.catalina.LifecycleListenerFactory;
@@ -59,22 +58,6 @@
* @author Paul Ferraro
*/
public class ModClusterListener extends ModClusterConfig implements LifecycleListener, LoadBalanceFactorProviderFactory, ModClusterServiceMBean {
-/*
- static {
- Logger logger = Logger.getLogger(ModClusterListener.class);
- // We expect to run in a JBoss Web/Tomcat environment where
- // server logging is done via java.util.logging. So, try to
- // initialize JBoss Logging to use the JDK logging plugin.
- // But only if it isn't already initialized to something else!
- if (logger.getLoggerPlugin().getClass().equals(NullLoggerPlugin.class)) {
- Logger.setPluginClassName("org.jboss.logging.jdk.JDK14LoggerPlugin");
-
- logger = Logger.getLogger(ModClusterListener.class);
- }
-
- log = logger;
- }
-*/
private static final Logger log = Logger.getLogger(ModClusterListener.class);
private final ModClusterServiceMBean service;
@@ -102,7 +85,7 @@ public LifecycleListenerFactory run() {
for (LifecycleListenerFactory factory: ServiceLoader.load(LifecycleListenerFactory.class, LifecycleListenerFactory.class.getClassLoader())) {
return factory;
}
- throw new ServiceConfigurationError(String.format("No %s service provider found.", LifecycleListenerFactory.class.getName()));
+ throw new ServiceConfigurationError(LifecycleListenerFactory.class.getName());
}
};
return AccessController.doPrivileged(action);
@@ -165,7 +148,7 @@ public void lifecycleEvent(LifecycleEvent event) {
Registry.getRegistry(null, null).registerComponent(this, name, null);
} catch (Exception e) {
- log.error(Strings.ERROR_JMX_REGISTER.getString(), e);
+ log.error(e.getLocalizedMessage(), e);
}
} else if (Lifecycle.STOP_EVENT.equals(type)) {
try {
@@ -173,7 +156,7 @@ public void lifecycleEvent(LifecycleEvent event) {
Registry.getRegistry(null, null).unregisterComponent(name);
} catch (Exception e) {
- log.error(Strings.ERROR_JMX_UNREGISTER.getString(), e);
+ log.error(e.getLocalizedMessage(), e);
}
}
}
View
24 ...alina/src/main/java/org/jboss/modcluster/container/catalina/CatalinaConnectorFactory.java
@@ -1,7 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.catalina;
import org.jboss.modcluster.container.Connector;
+/**
+ * @author Paul Ferraro
+ */
public class CatalinaConnectorFactory implements ConnectorFactory {
@Override
public Connector createConnector(org.apache.catalina.connector.Connector connector) {
View
24 ...atalina/src/main/java/org/jboss/modcluster/container/catalina/CatalinaContextFactory.java
@@ -1,8 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.catalina;
import org.jboss.modcluster.container.Context;
import org.jboss.modcluster.container.Host;
+/**
+ * @author Paul Ferraro
+ */
public class CatalinaContextFactory implements ContextFactory {
@Override
public Context createContext(org.apache.catalina.Context context, Host host) {
View
24 ...catalina/src/main/java/org/jboss/modcluster/container/catalina/CatalinaEngineFactory.java
@@ -1,8 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.catalina;
import org.jboss.modcluster.container.Engine;
import org.jboss.modcluster.container.Server;
+/**
+ * @author Paul Ferraro
+ */
public class CatalinaEngineFactory implements EngineFactory {
@Override
public Engine createEngine(CatalinaFactoryRegistry registry, org.apache.catalina.Engine engine, Server server) {
View
24 .../catalina/src/main/java/org/jboss/modcluster/container/catalina/CatalinaEventHandler.java
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.catalina;
import java.beans.PropertyChangeListener;
@@ -5,6 +26,9 @@
import org.apache.catalina.ContainerListener;
import org.apache.catalina.LifecycleListener;
+/**
+ * @author Paul Ferraro
+ */
public interface CatalinaEventHandler extends LifecycleListener, ContainerListener, PropertyChangeListener {
void start();
View
25 ...ainer/catalina/src/main/java/org/jboss/modcluster/container/catalina/CatalinaFactory.java
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.catalina;
import org.jboss.modcluster.container.Context;
@@ -5,6 +26,10 @@
import org.jboss.modcluster.container.Host;
import org.jboss.modcluster.container.Server;
+/**
+ * Factory methods for creating container objects from their Catalina equivalents.
+ * @author Paul Ferraro
+ */
public interface CatalinaFactory {
Server createServer(org.apache.catalina.Server server);
View
25 ...talina/src/main/java/org/jboss/modcluster/container/catalina/CatalinaFactoryRegistry.java
@@ -1,6 +1,29 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.catalina;
-
+/**
+ * @author Paul Ferraro
+ */
public interface CatalinaFactoryRegistry {
ServerFactory getServerFactory();
View
24 ...r/catalina/src/main/java/org/jboss/modcluster/container/catalina/CatalinaHostFactory.java
@@ -1,8 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.catalina;
import org.jboss.modcluster.container.Engine;
import org.jboss.modcluster.container.Host;
+/**
+ * @author Paul Ferraro
+ */
public class CatalinaHostFactory implements HostFactory {
@Override
public Host createHost(CatalinaFactoryRegistry registry, org.apache.catalina.Host host, Engine engine) {
View
24 ...catalina/src/main/java/org/jboss/modcluster/container/catalina/CatalinaServerFactory.java
@@ -1,7 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.catalina;
import org.jboss.modcluster.container.Server;
+/**
+ * @author Paul Ferraro
+ */
public class CatalinaServerFactory implements ServerFactory {
@Override
public Server createServer(CatalinaFactoryRegistry registry, org.apache.catalina.Server server) {
View
24 ...iner/catalina/src/main/java/org/jboss/modcluster/container/catalina/ConnectorFactory.java
@@ -1,7 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.catalina;
import org.jboss.modcluster.container.Connector;
+/**
+ * @author Paul Ferraro
+ */
public interface ConnectorFactory {
Connector createConnector(org.apache.catalina.connector.Connector connector);
}
View
24 container/catalina/src/main/java/org/jboss/modcluster/container/catalina/ContextFactory.java
@@ -1,8 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.catalina;
import org.jboss.modcluster.container.Context;
import org.jboss.modcluster.container.Host;
+/**
+ * @author Paul Ferraro
+ */
public interface ContextFactory {
Context createContext(org.apache.catalina.Context context, Host host);
}
View
24 container/catalina/src/main/java/org/jboss/modcluster/container/catalina/EngineFactory.java
@@ -1,8 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.catalina;
import org.jboss.modcluster.container.Engine;
import org.jboss.modcluster.container.Server;
+/**
+ * @author Paul Ferraro
+ */
public interface EngineFactory {
Engine createEngine(CatalinaFactoryRegistry registry, org.apache.catalina.Engine engine, Server server);
}
View
24 container/catalina/src/main/java/org/jboss/modcluster/container/catalina/HostFactory.java
@@ -1,8 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.catalina;
import org.jboss.modcluster.container.Engine;
import org.jboss.modcluster.container.Host;
+/**
+ * @author Paul Ferraro
+ */
public interface HostFactory {
Host createHost(CatalinaFactoryRegistry registry, org.apache.catalina.Host host, Engine engine);
}
View
25 ...ner/catalina/src/main/java/org/jboss/modcluster/container/catalina/JMXServerProvider.java
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.catalina;
import javax.management.JMException;
@@ -7,6 +28,10 @@
import org.apache.catalina.Server;
import org.apache.catalina.Service;
+/**
+ * {@link ServerProvider} that uses JMX to locate the {@link Server}.
+ * @author Paul Ferraro
+ */
public class JMXServerProvider implements ServerProvider {
private final ObjectName name;
private final MBeanServer mbeanServer;
View
24 ...alina/src/main/java/org/jboss/modcluster/container/catalina/LifecycleListenerFactory.java
@@ -1,8 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.catalina;
import org.apache.catalina.LifecycleListener;
import org.jboss.modcluster.container.ContainerEventHandler;
+/**
+ * @author Paul Ferraro
+ */
public interface LifecycleListenerFactory {
LifecycleListener createListener(ContainerEventHandler handler);
}
View
24 ...na/src/main/java/org/jboss/modcluster/container/catalina/RequestListenerValveFactory.java
@@ -1,9 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.catalina;
import javax.servlet.ServletRequestListener;
import org.apache.catalina.Valve;
+/**
+ * @author Paul Ferraro
+ */
public interface RequestListenerValveFactory {
Valve createValve(ServletRequestListener listener);
}
View
24 container/catalina/src/main/java/org/jboss/modcluster/container/catalina/ServerFactory.java
@@ -1,7 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.catalina;
import org.jboss.modcluster.container.Server;
+/**
+ * @author Paul Ferraro
+ */
public interface ServerFactory {
Server createServer(CatalinaFactoryRegistry registry, org.apache.catalina.Server server);
}
View
24 container/catalina/src/main/java/org/jboss/modcluster/container/catalina/ServerProvider.java
@@ -1,7 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.catalina;
import org.apache.catalina.Server;
+/**
+ * @author Paul Ferraro
+ */
public interface ServerProvider {
Server getServer();
}
View
24 ...a/src/main/java/org/jboss/modcluster/container/catalina/ServiceLoaderCatalinaFactory.java
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.catalina;
import java.security.AccessController;
@@ -9,6 +30,9 @@
import org.jboss.modcluster.container.Host;
import org.jboss.modcluster.container.Server;
+/**
+ * @author Paul Ferraro
+ */
public class ServiceLoaderCatalinaFactory implements CatalinaFactory, CatalinaFactoryRegistry {
private final ServerFactory serverFactory;
private final EngineFactory engineFactory;
View
24 .../catalina/src/main/java/org/jboss/modcluster/container/catalina/SimpleServerProvider.java
@@ -1,7 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.catalina;
import org.apache.catalina.Server;
+/**
+ * @author Paul Ferraro
+ */
public class SimpleServerProvider implements ServerProvider {
private final Server server;
View
3  ...ner/jbossweb/src/main/java/org/jboss/modcluster/container/jbossweb/JBossWebConnector.java
@@ -25,6 +25,9 @@
import org.apache.catalina.connector.Connector;
import org.jboss.modcluster.container.catalina.CatalinaConnector;
+/**
+ * @author Paul Ferraro
+ */
public class JBossWebConnector extends CatalinaConnector {
public JBossWebConnector(Connector connector) {
View
3  ...ssweb/src/main/java/org/jboss/modcluster/container/jbossweb/JBossWebConnectorFactory.java
@@ -25,6 +25,9 @@
import org.jboss.modcluster.container.Connector;
import org.jboss.modcluster.container.catalina.ConnectorFactory;
+/**
+ * @author Paul Ferraro
+ */
public class JBossWebConnectorFactory implements ConnectorFactory {
@Override
public Connector createConnector(org.apache.catalina.connector.Connector connector) {
View
24 ...ainer/jbossweb/src/main/java/org/jboss/modcluster/container/jbossweb/JBossWebContext.java
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.jbossweb;
import java.io.IOException;
@@ -16,6 +37,9 @@
import org.jboss.modcluster.container.catalina.RequestListenerValveFactory;
import org.jboss.servlet.http.HttpEvent;
+/**
+ * @author Paul Ferraro
+ */
public class JBossWebContext extends CatalinaContext {
public JBossWebContext(Context context, Host host) {
View
24 ...bossweb/src/main/java/org/jboss/modcluster/container/jbossweb/JBossWebContextFactory.java
@@ -1,9 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.jbossweb;
import org.jboss.modcluster.container.Context;
import org.jboss.modcluster.container.Host;
import org.jboss.modcluster.container.catalina.ContextFactory;
+/**
+ * @author Paul Ferraro
+ */
public class JBossWebContextFactory implements ContextFactory {
@Override
public Context createContext(org.apache.catalina.Context context, Host host) {
View
24 ...eb/src/main/java/org/jboss/modcluster/container/jbossweb/JBossWebEventHandlerAdapter.java
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.jbossweb;
import java.lang.management.ManagementFactory;
@@ -21,6 +42,9 @@
import org.jboss.modcluster.container.catalina.JMXServerProvider;
import org.jboss.modcluster.container.catalina.ServerProvider;
+/**
+ * @author Paul Ferraro
+ */
public class JBossWebEventHandlerAdapter extends CatalinaEventHandlerAdapter implements NotificationListener {
private volatile ObjectName serviceObjectName = toObjectName("jboss.web:service=WebServer");
View
24 ...c/main/java/org/jboss/modcluster/container/jbossweb/JBossWebLifecycleListenerFactory.java
@@ -1,9 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.jbossweb;
import org.apache.catalina.LifecycleListener;
import org.jboss.modcluster.container.ContainerEventHandler;
import org.jboss.modcluster.container.catalina.LifecycleListenerFactory;
+/**
+ * @author Paul Ferraro
+ */
public class JBossWebLifecycleListenerFactory implements LifecycleListenerFactory {
@Override
View
24 container/tomcat6/src/main/java/org/jboss/modcluster/container/tomcat/TomcatConnector.java
@@ -1,8 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.tomcat;
import org.apache.catalina.connector.Connector;
import org.jboss.modcluster.container.catalina.CatalinaConnector;
+/**
+ * @author Paul Ferraro
+ */
public class TomcatConnector extends CatalinaConnector {
public TomcatConnector(Connector connector) {
View
3  ...r/tomcat6/src/main/java/org/jboss/modcluster/container/tomcat/TomcatConnectorFactory.java
@@ -25,6 +25,9 @@
import org.jboss.modcluster.container.Connector;
import org.jboss.modcluster.container.catalina.ConnectorFactory;
+/**
+ * @author Paul Ferraro
+ */
public class TomcatConnectorFactory implements ConnectorFactory {
@Override
public Connector createConnector(org.apache.catalina.connector.Connector connector) {
View
24 container/tomcat6/src/main/java/org/jboss/modcluster/container/tomcat/TomcatContext.java
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.tomcat;
import java.io.IOException;
@@ -16,6 +37,9 @@
import org.jboss.modcluster.container.catalina.CatalinaContext;
import org.jboss.modcluster.container.catalina.RequestListenerValveFactory;
+/**
+ * @author Paul Ferraro
+ */
public class TomcatContext extends CatalinaContext {
public TomcatContext(Context context, Host host) {
View
24 ...ner/tomcat6/src/main/java/org/jboss/modcluster/container/tomcat/TomcatContextFactory.java
@@ -1,9 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.tomcat;
import org.jboss.modcluster.container.Context;
import org.jboss.modcluster.container.Host;
import org.jboss.modcluster.container.catalina.ContextFactory;
+/**
+ * @author Paul Ferraro
+ */
public class TomcatContextFactory implements ContextFactory {
@Override
public Context createContext(org.apache.catalina.Context context, Host host) {
View
3  ...omcat6/src/main/java/org/jboss/modcluster/container/tomcat/TomcatEventHandlerAdapter.java
@@ -30,6 +30,9 @@
import org.jboss.modcluster.container.catalina.CatalinaFactory;
import org.jboss.modcluster.container.catalina.ServerProvider;
+/**
+ * @author Paul Ferraro
+ */
public class TomcatEventHandlerAdapter extends CatalinaEventHandlerAdapter {
public TomcatEventHandlerAdapter(ContainerEventHandler eventHandler) {
View
3  ...6/src/main/java/org/jboss/modcluster/container/tomcat/TomcatLifecycleListenerFactory.java
@@ -26,6 +26,9 @@
import org.jboss.modcluster.container.ContainerEventHandler;
import org.jboss.modcluster.container.catalina.LifecycleListenerFactory;
+/**
+ * @author Paul Ferraro
+ */
public class TomcatLifecycleListenerFactory implements LifecycleListenerFactory {
@Override
View
24 container/tomcat7/src/main/java/org/jboss/modcluster/container/tomcat/TomcatConnector.java
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.tomcat;
import java.util.concurrent.Executor;
@@ -9,6 +30,9 @@
import org.apache.tomcat.util.threads.ResizableExecutor;
import org.jboss.modcluster.container.catalina.CatalinaConnector;
+/**
+ * @author Paul Ferraro
+ */
public class TomcatConnector extends CatalinaConnector {
public TomcatConnector(Connector connector) {
View
24 ...r/tomcat7/src/main/java/org/jboss/modcluster/container/tomcat/TomcatConnectorFactory.java
@@ -1,8 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.tomcat;
import org.jboss.modcluster.container.Connector;
import org.jboss.modcluster.container.catalina.ConnectorFactory;
+/**
+ * @author Paul Ferraro
+ */
public class TomcatConnectorFactory implements ConnectorFactory {
@Override
public Connector createConnector(org.apache.catalina.connector.Connector connector) {
View
24 container/tomcat7/src/main/java/org/jboss/modcluster/container/tomcat/TomcatContext.java
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.tomcat;
import java.io.IOException;
@@ -16,6 +37,9 @@
import org.jboss.modcluster.container.catalina.CatalinaContext;
import org.jboss.modcluster.container.catalina.RequestListenerValveFactory;
+/**
+ * @author Paul Ferraro
+ */
public class TomcatContext extends CatalinaContext {
public TomcatContext(Context context, Host host) {
View
24 ...ner/tomcat7/src/main/java/org/jboss/modcluster/container/tomcat/TomcatContextFactory.java
@@ -1,9 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.tomcat;
import org.jboss.modcluster.container.Context;
import org.jboss.modcluster.container.Host;
import org.jboss.modcluster.container.catalina.ContextFactory;
+/**
+ * @author Paul Ferraro
+ */
public class TomcatContextFactory implements ContextFactory {
@Override
public Context createContext(org.apache.catalina.Context context, Host host) {
View
24 ...omcat7/src/main/java/org/jboss/modcluster/container/tomcat/TomcatEventHandlerAdapter.java
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.modcluster.container.tomcat;
import org.apache.catalina.Lifecycle;
@@ -7,6 +28,9 @@
import org.jboss.modcluster.container.catalina.CatalinaFactory;
import org.jboss.modcluster.container.catalina.ServerProvider;
+/**
+ * @author Paul Ferraro
+ */
public class TomcatEventHandlerAdapter extends CatalinaEventHandlerAdapter {
public TomcatEventHandlerAdapter(ContainerEventHandler eventHandler) {
View
3  ...7/src/main/java/org/jboss/modcluster/container/tomcat/TomcatLifecycleListenerFactory.java
@@ -26,6 +26,9 @@
import org.jboss.modcluster.container.ContainerEventHandler;
import org.jboss.modcluster.container.catalina.LifecycleListenerFactory;
+/**
+ * @author Paul Ferraro
+ */
public class TomcatLifecycleListenerFactory implements LifecycleListenerFactory {
@Override
View
19 core/pom.xml
@@ -48,5 +48,24 @@
<artifactId>jcip-annotations</artifactId>
<scope>compile</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-processor</artifactId>
+ <scope>compile</scope>
+ <optional>true</optional>
+ </dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemPropertyVariables>
+ <java.net.preferIPv4Stack>true</java.net.preferIPv4Stack>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
View
156 core/src/main/java/org/jboss/modcluster/ModClusterLogger.java
@@ -0,0 +1,156 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.modcluster;
+
+import static org.jboss.logging.Logger.Level.DEBUG;
+import static org.jboss.logging.Logger.Level.ERROR;
+import static org.jboss.logging.Logger.Level.INFO;
+import static org.jboss.logging.Logger.Level.WARN;
+
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+
+import org.jboss.logging.Logger;
+import org.jboss.logging.annotations.Cause;
+import org.jboss.logging.annotations.LogMessage;
+import org.jboss.logging.annotations.Message;
+import org.jboss.logging.annotations.MessageLogger;
+import org.jboss.modcluster.container.Context;
+import org.jboss.modcluster.container.Engine;
+import org.jboss.modcluster.container.Host;
+import org.jboss.modcluster.mcmp.MCMPRequestType;
+
+/**
+ * @author Paul Ferraro
+ */
+@MessageLogger(projectCode = "MODCLUSTER")
+public interface ModClusterLogger {
+ ModClusterLogger LOGGER = Logger.getMessageLogger(ModClusterLogger.class, ModClusterLogger.class.getPackage().getName());
+
+ @LogMessage(level = INFO)
+ @Message(id = 1, value = "Initializing mod_cluster ${project.version}")
+ void init();
+
+ @LogMessage(level = INFO)
+ @Message(id = 2, value = "Initiating mod_cluster shutdown")
+ void shutdown();
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 3, value = "Received server start event")
+ void startServer();
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 4, value = "Received server stop event")
+ void stopServer();
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 5, value = "Received add context event for %s:%s")
+ void addContext(Host host, Context context);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 6, value = "Received remove context event for %s:%s")
+ void removeContext(Host host, Context context);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 7, value = "Received start context event for %s:%s")
+ void startContext(Host host, Context context);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 8, value = "Received stop context event for %s:%s")
+ void stopContext(Host host, Context context);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 9, value = "Sending %s for %s")
+ void sendEngineCommand(MCMPRequestType command, Engine engine);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 10, value = "Sending %s for %s:%s")
+ void sendContextCommand(MCMPRequestType command, Host host, Context context);
+
+ @LogMessage(level = INFO)
+ @Message(id = 11, value = "%s will use %s as jvm-route")
+ void detectJvmRoute(Engine engine, String jvmRoute);
+
+ @LogMessage(level = INFO)
+ @Message(id = 12, value = "%s connector will use %s")
+ void detectConnectorAddress(Engine engine, InetAddress address);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 20, value = "Waiting to drain %d pending requests from %s:%s")
+ void drainRequests(int requests, Host host, Context context);
+
+ @LogMessage(level = INFO)
+ @Message(id = 21, value = "All pending requests drained from %s:%s in %f.1 seconds")
+ void requestsDrained(Host host, Context context, float seconds);
+
+ @LogMessage(level = WARN)
+ @Message(id = 22, value = "Failed to drain %d remaining pending requests from %s:%s within %f.1 seconds")
+ void requestDrainTimeout(int requests, Host host, Context context, float seconds);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 23, value = "Waiting to drain %d active sessions from %s:%s")
+ void drainSessions(int sessions, Host host, Context context);
+
+ @LogMessage(level = INFO)
+ @Message(id = 24, value = "All active sessions drained from %s:%s in %f.1 seconds")
+ void sessionsDrained(Host host, Context context, float seconds);
+
+ @LogMessage(level = WARN)
+ @Message(id = 25, value = "Failed to drain %d remaining active sessions from %s:%s within %f.1 seconds")
+ void sessionDrainTimeout(int sessions, Host host, Context context, float seconds);
+
+ @LogMessage(level = WARN)
+ @Message(id = 30, value = "Attempted to bind multicast socket to a unicast address: %s. Multicast socket will not be bound to an address.")
+ void createMulticastSocketWithUnicastAddress(InetAddress address);
+
+ @LogMessage(level = WARN)
+ @Message(id = 31, value = "Could not bind multicast socket to %s (%s address); make sure your multicast address is of the same type as the IP stack (IPv4 or IPv6). Multicast socket will not be bound to an address, but this may lead to cross talking (see http://www.jboss.org/community/docs/DOC-9469 for details).")
+ void potentialCrossTalking(@Cause Throwable cause, InetAddress address, String addressType);
+
+ @LogMessage(level = INFO)
+ @Message(id = 32, value = "Listening to proxy advertisements on %s")
+ void startAdvertise(InetSocketAddress address);
+
+ @LogMessage(level = WARN)
+ @Message(id = 33, value = "Failed to interrupt socket reception.")
+ void socketInterruptFailed(@Cause Throwable cause);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 34, value = "Failed to start advertise listener")
+ void advertiseStartFailed(@Cause Throwable cause);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 40, value = "Failed to parse response header from %2$s for %1$s command")
+ void parseHeaderFailed(@Cause Throwable cause, MCMPRequestType command, InetSocketAddress proxy);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 41, value = "Unrecoverable syntax error %s sending %s command to %s: %s")
+ void unrecoverableErrorResponse(String errorType, MCMPRequestType type, InetSocketAddress proxy, String message);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 42, value = "Error %s sending %s command to %s, configuration will be reset: %s")
+ void recoverableErrorResponse(String errorType, MCMPRequestType type, InetSocketAddress proxy, String message);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 43, value = "Failed to send %s to %s")
+ void sendFailed(@Cause Throwable cause, MCMPRequestType type, InetSocketAddress proxy);
+}
View
52 core/src/main/java/org/jboss/modcluster/ModClusterMessages.java
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.modcluster;
+
+import java.security.cert.CRLException;
+
+import org.jboss.logging.Messages;
+import org.jboss.logging.annotations.Message;
+import org.jboss.logging.annotations.MessageBundle;
+import org.jboss.modcluster.container.Host;
+
+/**
+ * @author Paul Ferraro
+ */
+@MessageBundle(projectCode = "MODCLUSTER")
+public interface ModClusterMessages {
+ ModClusterMessages MESSAGES = Messages.getBundle(ModClusterMessages.class);
+
+ @Message(id = 100, value = "Unable to locate host %s")
+ IllegalArgumentException hostNotFound(String host);
+
+ @Message(id = 101, value = "Unable to locate context %s within %s")
+ IllegalArgumentException contextNotFound(String context, Host host);
+
+ @Message(id = 102, value = "Load metric weight must be greater than or equal to zero.")
+ IllegalArgumentException invalidWeight();
+
+ @Message(id = 103, value = "Load metric capacity must be greater than zero.")
+ IllegalArgumentException invalidCapacity();
+
+ @Message(id = 104, value = "%s algorithm does not support certificate revocation lists.")
+ CRLException crlNotSupported(String algorithm);
+}
View
83 core/src/main/java/org/jboss/modcluster/ModClusterService.java
@@ -39,7 +39,6 @@
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
-import org.jboss.logging.Logger;
import org.jboss.modcluster.advertise.AdvertiseListener;
import org.jboss.modcluster.advertise.AdvertiseListenerFactory;
import org.jboss.modcluster.advertise.impl.AdvertiseListenerFactoryImpl;
@@ -61,6 +60,7 @@
import org.jboss.modcluster.mcmp.MCMPHandler;
import org.jboss.modcluster.mcmp.MCMPRequest;
import org.jboss.modcluster.mcmp.MCMPRequestFactory;
+import org.jboss.modcluster.mcmp.MCMPRequestType;
import org.jboss.modcluster.mcmp.MCMPResponseParser;
import org.jboss.modcluster.mcmp.MCMPServerState;
import org.jboss.modcluster.mcmp.ResetRequestSource;
@@ -73,8 +73,6 @@
MCMPConnectionListener, ContextFilter {
public static final int DEFAULT_PORT = 8000;
- protected final Logger log = Logger.getLogger(this.getClass());
-
private final NodeConfiguration nodeConfig;
private final BalancerConfiguration balancerConfig;
private final MCMPHandlerConfiguration mcmpConfig;
@@ -137,7 +135,7 @@ protected ModClusterService(NodeConfiguration nodeConfig, BalancerConfiguration
*/
@Override
public synchronized void init(Server server) {
- this.log.info(Strings.SERVER_INIT.getString());
+ ModClusterLogger.LOGGER.init();
this.server = server;
@@ -183,7 +181,7 @@ public synchronized void init(Server server) {
this.advertiseListener.start();
} catch (IOException e) {
// TODO What now?
- this.log.error(Strings.ERROR_ADVERTISE_START.getString(), e);
+ ModClusterLogger.LOGGER.advertiseStartFailed(e);
}
}
}
@@ -214,7 +212,7 @@ public boolean isAutoEnableContexts() {
*/
@Override
public synchronized void shutdown() {
- this.log.debug(Strings.SHUTDOWN.getString());
+ ModClusterLogger.LOGGER.shutdown();
this.server = null;
@@ -233,7 +231,7 @@ public synchronized void shutdown() {
*/
@Override
public void start(Server server) {
- this.log.debug(Strings.SERVER_START.getString());
+ ModClusterLogger.LOGGER.startServer();
if (this.established) {
for (Engine engine : server.getEngines()) {
@@ -255,7 +253,7 @@ public void start(Server server) {
*/
@Override
public void stop(Server server) {
- this.log.debug(Strings.SERVER_STOP.getString());
+ ModClusterLogger.LOGGER.stopServer();
if (this.established) {
for (Engine engine : server.getEngines()) {
@@ -280,7 +278,7 @@ public void stop(Server server) {
* @param engine
*/
protected void config(Engine engine) {
- this.log.debug(Strings.ENGINE_CONFIG.getString(engine));
+ ModClusterLogger.LOGGER.sendEngineCommand(MCMPRequestType.CONFIG, engine);
try {
MCMPRequest request = this.requestFactory.createConfigRequest(engine, this.nodeConfig, this.balancerConfig);
@@ -288,8 +286,6 @@ protected void config(Engine engine) {
this.mcmpHandler.sendRequest(request);
} catch (Exception e) {
this.mcmpHandler.markProxiesInError();
-
- this.log.info(Strings.ERROR_ADDRESS_JVMROUTE.getString(), e);
}
}
@@ -318,7 +314,7 @@ public void connectionEstablished(InetAddress localAddress) {
if ((address == null) || address.isAnyLocalAddress()) {
connector.setAddress(localAddress);
- this.log.info(Strings.DETECT_CONNECTOR_ADDRESS.getString(engine, localAddress.getHostAddress()));
+ ModClusterLogger.LOGGER.detectConnectorAddress(engine, localAddress);
}
this.establishJvmRoute(engine);
@@ -334,7 +330,7 @@ protected void establishJvmRoute(Engine engine) {
engine.setJvmRoute(jvmRoute);
- this.log.info(Strings.DETECT_JVMROUTE.getString(engine, jvmRoute));
+ ModClusterLogger.LOGGER.detectJvmRoute(engine, jvmRoute);
}
}
@@ -345,11 +341,11 @@ protected void establishJvmRoute(Engine engine) {
*/
@Override
public void add(Context context) {
+ ModClusterLogger.LOGGER.addContext(context.getHost(), context);
+
if (this.include(context)) {
// Send ENABLE-APP if state is started
if (this.established && context.isStarted()) {
- this.log.debug(Strings.CONTEXT_ENABLE.getString(context, context.getHost()));
-
this.enable(context);
}
}
@@ -362,11 +358,10 @@ public void add(Context context) {
*/
@Override
public void start(Context context) {
+ ModClusterLogger.LOGGER.startContext(context.getHost(), context);
+
if (this.include(context)) {
if (this.established) {
- // Send ENABLE-APP
- this.log.debug(Strings.CONTEXT_START.getString(context, context.getHost()));
-
this.enable(context);
}
@@ -379,16 +374,15 @@ public void start(Context context) {
}
private void enable(Context context) {
- MCMPRequest request = this.autoEnableContexts ? this.requestFactory.createEnableRequest(context) : this.requestFactory
- .createDisableRequest(context);
+ ModClusterLogger.LOGGER.sendContextCommand(this.autoEnableContexts ? MCMPRequestType.ENABLE_APP : MCMPRequestType.DISABLE_APP, context.getHost(), context);
- this.mcmpHandler.sendRequest(request);
+ this.mcmpHandler.sendRequest(this.autoEnableContexts ? this.requestFactory.createEnableRequest(context) : this.requestFactory.createDisableRequest(context));
}
private void disable(Context context) {
- MCMPRequest request = this.requestFactory.createDisableRequest(context);
+ ModClusterLogger.LOGGER.sendContextCommand(MCMPRequestType.DISABLE_APP, context.getHost(), context);
- this.mcmpHandler.sendRequest(request);
+ this.mcmpHandler.sendRequest(this.requestFactory.createDisableRequest(context));
}
/**
@@ -398,9 +392,9 @@ private void disable(Context context) {
*/
@Override
public void stop(Context context) {
- if (this.established && this.include(context)) {
- this.log.debug(Strings.CONTEXT_STOP.getString(context, context.getHost()));
+ ModClusterLogger.LOGGER.stopContext(context.getHost(), context);
+ if (this.established && this.include(context)) {
this.disable(context);
long start = System.currentTimeMillis();
@@ -425,13 +419,13 @@ public void stop(Context context) {
*/
@Override
public void remove(Context context) {
+ ModClusterLogger.LOGGER.removeContext(context.getHost(), context);
+
if (this.include(context)) {
if (this.established) {
- this.log.debug(Strings.CONTEXT_DISABLE.getString(context, context.getHost()));
-
- MCMPRequest request = this.requestFactory.createRemoveRequest(context);
+ ModClusterLogger.LOGGER.sendContextCommand(MCMPRequestType.REMOVE_APP, context.getHost(), context);
- this.mcmpHandler.sendRequest(request);
+ this.mcmpHandler.sendRequest(this.requestFactory.createRemoveRequest(context));
}
EnablableRequestListener listener = this.requestListeners.remove(context);
@@ -448,12 +442,10 @@ public void remove(Context context) {
* @param engine
*/
protected void removeAll(Engine engine) {
- this.log.debug(Strings.ENGINE_STOP.getString(engine));
+ ModClusterLogger.LOGGER.sendEngineCommand(MCMPRequestType.REMOVE_APP, engine);
// Send REMOVE-APP * request
- MCMPRequest request = this.requestFactory.createRemoveRequest(engine);
-
- this.mcmpHandler.sendRequest(request);
+ this.mcmpHandler.sendRequest(this.requestFactory.createRemoveRequest(engine));
}
/**
@@ -463,8 +455,6 @@ protected void removeAll(Engine engine) {
*/
@Override
public void status(Engine engine) {
- this.log.debug(Strings.ENGINE_STATUS.getString(engine));
-
this.mcmpHandler.status();
if (this.established) {
@@ -473,6 +463,8 @@ public void status(Engine engine) {
int lbf = (connector != null) && connector.isAvailable() ? this.getLoadBalanceFactor(engine) : -1;
+ ModClusterLogger.LOGGER.sendEngineCommand(MCMPRequestType.STATUS, engine);
+
this.mcmpHandler.sendRequest(this.requestFactory.createStatusRequest(engine.getJvmRoute(), lbf));
}
}
@@ -777,7 +769,7 @@ public boolean stopContext(String host, String path, long timeout, TimeUnit unit
int requests = this.stop(request);
while ((requests > 0) && (noTimeout || (timeout > 0))) {
- this.log.debug(Strings.DRAIN_REQUESTS_WAIT.getString(context, requests));
+ ModClusterLogger.LOGGER.drainRequests(requests, context.getHost(), context);
// Wait to be notified of a destroyed request
listener.wait(noTimeout ? 0 : timeout);
@@ -792,9 +784,9 @@ public boolean stopContext(String host, String path, long timeout, TimeUnit unit
float duration = ((success ? System.currentTimeMillis() : end) - start) / 1000f;
if (success) {
- this.log.info(Strings.DRAIN_REQUESTS.getString(context, duration));
+ ModClusterLogger.LOGGER.requestsDrained(context.getHost(), context, duration);
} else {
- this.log.warn(Strings.DRAIN_REQUESTS_TIMEOUT.getString(context, duration));
+ ModClusterLogger.LOGGER.requestDrainTimeout(requests, context.getHost(), context, duration);
}
return success;
@@ -846,7 +838,7 @@ private boolean drainSessions(Context context, long start, long end) {
remainingSessions = context.getActiveSessionCount();
while ((remainingSessions > 0) && (noTimeout || (timeout > 0))) {
- this.log.debug(Strings.DRAIN_SESSIONS_WAIT.getString(context, remainingSessions));
+ ModClusterLogger.LOGGER.drainSessions(remainingSessions, context.getHost(), context);
listener.wait(noTimeout ? 0 : timeout);
@@ -857,12 +849,12 @@ private boolean drainSessions(Context context, long start, long end) {
}
boolean success = (remainingSessions == 0);
- long seconds = TimeUnit.MILLISECONDS.toSeconds((success ? System.currentTimeMillis() : end) - start);
+ float duration = ((success ? System.currentTimeMillis() : end) - start) / 1000f;
if (success) {
- this.log.info(Strings.DRAIN_SESSIONS.getString(context, seconds));
+ ModClusterLogger.LOGGER.sessionsDrained(context.getHost(), context, duration);
} else {
- this.log.warn(Strings.DRAIN_SESSIONS_TIMEOUT.getString(context, seconds));
+ ModClusterLogger.LOGGER.sessionDrainTimeout(remainingSessions, context.getHost(), context, duration);
}
return success;
@@ -878,18 +870,17 @@ private Host findHost(String name) {
for (Engine engine : this.server.getEngines()) {
Host host = engine.findHost(name);
- if (host != null)
- return host;
+ if (host != null) return host;
}
- throw new IllegalArgumentException();
+ throw ModClusterMessages.MESSAGES.hostNotFound(name);
}
private Context findContext(Host host, String path) {
Context context = host.findContext(path);
if (context == null) {
- throw new IllegalArgumentException();
+ throw ModClusterMessages.MESSAGES.contextNotFound(path, host);
}
return context;
View
83 core/src/main/java/org/jboss/modcluster/Strings.java
@@ -1,83 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.modcluster;
-
-import java.text.MessageFormat;
-import java.util.ResourceBundle;
-
-/**
- * Enumeration of externalized exception and log messages.
- *
- * @author Paul Ferraro
- */
-public enum Strings {
- ADVERTISE_START("modcluster.advertise.start"), CONTEXT_DISABLE("modcluster.context.disable"), CONTEXT_ENABLE(
- "modcluster.context.enable"), CONTEXT_START("modcluster.context.start"), CONTEXT_STOP("modcluster.context.stop"), ENGINE_CONFIG(
- "modcluster.engine.config"), ENGINE_STATUS("modcluster.engine.status"), ENGINE_STOP("modcluster.engine.stop"), REQUEST_SEND(
- "modcluster.request"), SERVER_INIT("modcluster.server.init"), SERVER_START("modcluster.server.start"), SERVER_STOP(
- "modcluster.server.stop"), SHUTDOWN("modcluster.shutdown"), SINGLETON_IGNORE_STOP("modcluster.singleton.ignorestop"), DETECT_JVMROUTE(
- "modcluster.detect.jvmRoute"), DETECT_CONNECTOR_ADDRESS("modcluster.detect.connectorAddress"), DEPRECATED(
- "modcluster.deprecated"), ENGINE_REMOVE_CRASHED("modcluster.engine.removeCrashed"), DRAIN_SESSIONS(
- "modcluster.drain.requests"), DRAIN_SESSIONS_TIMEOUT("modcluster.drain.requests.timeout"), DRAIN_SESSIONS_WAIT(
- "modcluster.drain.requests.wait"), DRAIN_REQUESTS("modcluster.drain.sessions"), DRAIN_REQUESTS_TIMEOUT(
- "modcluster.drain.sessions.timeout"), DRAIN_REQUESTS_WAIT("modcluster.drain.sessions.wait"),
-
- ERROR_ADDRESS_JVMROUTE("modcluster.error.addressJvmRoute"), ERROR_CONTEXT_NOT_FOUND("modcluster.error.context.notfound"), ERROR_DISCOVERY_ADD(
- "modcluster.error.discovery.add"), ERROR_DISCOVERY_REMOVE("modcluster.error.discovery.remove"), ERROR_DRM(
- "modcluster.error.drm"), ERROR_HOST_INVALID("modcluster.error.host.invalid"), ERROR_HOST_NOT_FOUND(
- "modcluster.error.host.notfound"), ERROR_REQUEST_SEND_IO("modcluster.error.io"), ERROR_JMX_REGISTER(
- "modcluster.error.jmxRegister"), ERROR_JMX_UNREGISTER("modcluster.error.jmxUnregister"), ERROR_NO_PROXY(
- "modcluster.error.noproxy"), ERROR_ATTRIBUTE_NOT_POSITIVE("modcluster.error.nonPositiveAttribute"), ERROR_ATTRIBUTE_NULL(
- "modcluster.error.nullAttribute"), ERROR_REQUEST_SEND_OTHER("modcluster.error.other"), ERROR_ARGUMENT_NULL(
- "modcluster.error.iae.null"), ERROR_ARGUMENT_INVALID("modcluster.error.iae.invalid"), ERROR_HEADER_PARSE(
- "modcluster.error.parse"), ERROR_RPC_KNOWN("modcluster.error.rpc.known"), ERROR_RPC_NO_RESPONSE(
- "modcluster.error.rpc.noresp"), ERROR_RPC_UNKNOWN("modcluster.error.rpc.unknown"), ERROR_RPC_UNEXPECTED(
- "modcluster.error.rpc.unexpected"), ERROR_ADVERTISE_START("modcluster.error.startListener"), ERROR_STATUS_COMPLETE(
- "modcluster.error.status.complete"), ERROR_STATUS_UNSUPPORTED("modcluster.error.status.unsupported"), ERROR_ADVERTISE_STOP(
- "modcluster.error.stopListener"), ERROR_STOP_OLD_MASTER("modcluster.error.stopOldMaster"), ERROR_REQUEST_SYNTAX(
- "modcluster.error.syntax");
-
- private static ResourceBundle resource = ResourceBundle.getBundle(Strings.class.getName());
-
- private String key;
-
- private Strings(String key) {
- this.key = key;
- }
-
- @Override
- public String toString() {
- return this.key;
- }
-
- /**
- * Returns the localized message using the supplied arguments.
- *
- * @param args a variable number of arguments
- * @return a localized message
- */
- public String getString(Object... args) {
- String pattern = resource.getString(this.key);
-
- return (args.length == 0) ? pattern : MessageFormat.format(pattern, args);
- }
-}
View
58 core/src/main/java/org/jboss/modcluster/advertise/impl/AdvertiseEventType.java
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.modcluster.advertise.impl;
-
-/**
- * Set what type of event the AdvertiseEvent signals.
- *
- * @param type The type of event. One of:
- *
- * <PRE>
- * ON_NEW_SERVER -- New AdvertisedServer detected
- * ON_STATUS_CHANGE -- AdvertisedServer server changed status
- * </PRE>
- */
-public enum AdvertiseEventType {
- /** New AdvertisedServer detected */
- ON_NEW_SERVER(0),
- /** AdvertisedServer server changed status */
- ON_STATUS_CHANGE(1);
-
- private int value;
-
- private AdvertiseEventType(int v) {
- this.value = v;
- }
-
- public int valueOf() {
- return this.value;
- }
-
- public static AdvertiseEventType valueOf(int value) {
- for (AdvertiseEventType e : values()) {
- if (e.value == value)
- return e;
- }
-
- throw new IllegalArgumentException("Invalid initializer: " + value);
- }
-}
View
12 core/src/main/java/org/jboss/modcluster/advertise/impl/AdvertiseListenerImpl.java
@@ -41,7 +41,7 @@
import net.jcip.annotations.GuardedBy;
import org.jboss.logging.Logger;
-import org.jboss.modcluster.Strings;
+import org.jboss.modcluster.ModClusterLogger;
import org.jboss.modcluster.Utils;
import org.jboss.modcluster.advertise.AdvertiseListener;
import org.jboss.modcluster.advertise.MulticastSocketFactory;
@@ -107,8 +107,8 @@ public AdvertiseListenerImpl(MCMPHandler commHandler, AdvertiseConfiguration con
private MessageDigest getMessageDigest() throws IOException {
try {
return MessageDigest.getInstance("MD5");
- } catch (NoSuchAlgorithmException ex) {
- throw new IOException("can't create MD: NoSuchAlgorithmException");
+ } catch (NoSuchAlgorithmException e) {
+ throw new IllegalStateException(e);
}
}
@@ -170,7 +170,7 @@ public synchronized void start() throws IOException {
this.listening = true;
- log.info(Strings.ADVERTISE_START.getString(this.config.getAdvertiseSocketAddress().getAddress().getHostAddress(), this.config.getAdvertiseSocketAddress().getPort()));
+ ModClusterLogger.LOGGER.startAdvertise(this.config.getAdvertiseSocketAddress());