Permalink
Browse files

Initial Undertow integration with AS

* webservices subsystem does not compile
* make arq work again
* fix resolving socket binding
* fix default configs
* only use client api
* fix import dependancies
* change tests to look for subsystem=undertow instead of subsystem=web
* fix managed domain
* proper xsd
* improve xsd and use proper schemas
* upgrade to servlet spec 3.1
* fix root context test
* fix default config
* Rename io.undertow module to io.undertow.core
* enable file welcome content
* fix bad tests
* Fix also https testcase
* Fix TransportGuaranteeTestCase
* Update default config
* fix marshalling testcase
* @Ignore for stuff that we know that it does not work
* initial merge of undertow subsystem from undertow-io/undertow-subsystem
  • Loading branch information...
1 parent 3c7bc48 commit 192118e4a6673f5e9847daa0ef39b6507f8e86e1 @ctomc ctomc committed with kabir Feb 20, 2013
Showing with 17,973 additions and 422 deletions.
  1. +1 −1 arquillian/common-domain/pom.xml
  2. +3 −3 ...illian/common-domain/src/main/java/org/jboss/as/arquillian/container/domain/ManagementClient.java
  3. +47 −56 arquillian/common/src/main/java/org/jboss/as/arquillian/container/ManagementClient.java
  4. +1 −1 arquillian/container-managed-domain/pom.xml
  5. +1 −1 arquillian/container-managed/pom.xml
  6. +1 −1 arquillian/container-remote-domain/pom.xml
  7. +1 −1 arquillian/container-remote/pom.xml
  8. +1 −1 arquillian/protocol-servlet/pom.xml
  9. +18 −2 build/build.xml
  10. +37 −2 build/pom.xml
  11. +4 −4 build/src/main/resources/configuration/domain/subsystems.xml
  12. +1 −1 build/src/main/resources/configuration/standalone/subsystems-full-ha.xml
  13. +1 −1 build/src/main/resources/configuration/standalone/subsystems-full.xml
  14. +1 −1 build/src/main/resources/configuration/standalone/subsystems-ha.xml
  15. +1 −1 build/src/main/resources/configuration/standalone/subsystems-osgi.xml
  16. +1 −1 build/src/main/resources/configuration/standalone/subsystems.xml
  17. +31 −0 build/src/main/resources/configuration/subsystems/undertow.xml
  18. +112 −0 build/src/main/resources/docs/schema/jboss-as-undertow_1_0.xsd
  19. +2 −4 build/src/main/resources/modules/system/layers/base/io/undertow/{ → core}/main/module.xml
  20. +43 −0 build/src/main/resources/modules/system/layers/base/io/undertow/servlet/main/module.xml
  21. +36 −0 build/src/main/resources/modules/system/layers/base/io/undertow/websocket/main/module.xml
  22. +1 −0 build/src/main/resources/modules/system/layers/base/javaee/api/main/module.xml
  23. +29 −0 build/src/main/resources/modules/system/layers/base/javax/websocket/api/main/module.xml
  24. +1 −1 .../src/main/resources/modules/system/layers/base/org/jboss/as/domain-http-interface/main/module.xml
  25. +67 −0 build/src/main/resources/modules/system/layers/base/org/jboss/as/undertow/main/module.xml
  26. +1 −1 build/src/main/resources/modules/system/layers/base/org/jboss/security/negotiation/main/module.xml
  27. +1 −1 build/src/main/resources/modules/system/layers/base/org/picketlink/main/module.xml
  28. +1 −1 ...n-http/interface/src/main/java/org/jboss/as/domain/http/server/security/RealmIdentityManager.java
  29. +1 −0 jpa/core/pom.xml
  30. +1 −0 jpa/pom.xml
  31. +1 −1 jsf/subsystem/pom.xml
  32. +127 −51 pom.xml
  33. +1 −1 spec-api/pom.xml
  34. +2 −0 ...c/src/test/java/org/jboss/as/test/integration/ee/initializeinorder/InitializeInOrderTestCase.java
  35. +99 −66 ...org/jboss/as/test/integration/management/api/web/{ConnectorTestCase.java → ListenerTestCase.java}
  36. +7 −5 ...n/basic/src/test/java/org/jboss/as/test/integration/management/api/web/VirtualServerTestCase.java
  37. +23 −27 ...tegration/basic/src/test/java/org/jboss/as/test/integration/management/cli/GlobalOpsTestCase.java
  38. +9 −11 ...ion/basic/src/test/java/org/jboss/as/test/integration/management/http/HttpGetMgmtOpsTestCase.java
  39. +46 −51 ...on/basic/src/test/java/org/jboss/as/test/integration/management/http/HttpPostMgmtOpsTestCase.java
  40. +1 −1 ...est/java/org/jboss/as/test/integration/security/common/AbstractSecurityRealmsServerSetupTask.java
  41. +2 −2 ...basic/src/test/java/org/jboss/as/test/integration/web/rootcontext/RootContextEarUnitTestCase.java
  42. +11 −12 ...ntegration/basic/src/test/java/org/jboss/as/test/integration/web/rootcontext/RootContextUtil.java
  43. +2 −2 ...basic/src/test/java/org/jboss/as/test/integration/web/rootcontext/RootContextWarUnitTestCase.java
  44. +3 −2 .../basic/src/test/java/org/jboss/as/test/integration/web/rootcontext/resources/application-root.xml
  45. +5 −3 ...gration/basic/src/test/java/org/jboss/as/test/integration/web/rootcontext/resources/jboss-web.xml
  46. +4 −3 ...egration/basic/src/test/java/org/jboss/as/test/integration/web/rootcontext/resources/root-web.xml
  47. +1 −0 .../basic/src/test/java/org/jboss/as/test/integration/web/security/cert/WebSecurityCERTTestCase.java
  48. +2 −0 .../src/test/java/org/jboss/as/test/integration/web/security/ssl/HttpsConnectorSettingsTestCase.java
  49. +41 −50 ...basic/src/test/java/org/jboss/as/test/integration/web/security/tg/TransportGuaranteeTestCase.java
  50. +2 −0 ...te/integration/basic/src/test/java/org/jboss/as/test/integration/web/valve/ValveUnitTestCase.java
  51. +4 −0 testsuite/integration/manualmode/pom.xml
  52. +1 −1 testsuite/integration/pom.xml
  53. +3 −1 testsuite/integration/smoke/src/test/java/org/jboss/as/test/smoke/jms/SendToJMSQueueTest.java
  54. +7 −5 ...ite/integration/smoke/src/test/java/org/jboss/as/test/smoke/mgmt/BasicOperationsUnitTestCase.java
  55. +2 −2 testsuite/pom.xml
  56. +2 −2 ...te/shared/src/main/java/org/jboss/as/test/integration/management/{Connector.java → Listener.java}
  57. +89 −30 testsuite/shared/src/main/java/org/jboss/as/test/integration/management/ServerManager.java
  58. +5 −2 testsuite/shared/src/main/java/org/jboss/as/test/integration/management/util/HttpMgmtProxy.java
  59. +99 −0 undertow/pom.xml
  60. +25 −0 undertow/src/main/java/org/jboss/as/controller/PersistentResourceDefinition.java
  61. +199 −0 undertow/src/main/java/org/jboss/as/controller/SimplePersistentResourceDefinition.java
  62. +38 −0 undertow/src/main/java/org/jboss/as/undertow/AJPListenerAdd.java
  63. +18 −0 undertow/src/main/java/org/jboss/as/undertow/AJPListenerResourceDefinition.java
  64. +54 −0 undertow/src/main/java/org/jboss/as/undertow/AJPListenerService.java
  65. +123 −0 undertow/src/main/java/org/jboss/as/undertow/AbstractHandlerResourceDefinition.java
  66. +68 −0 undertow/src/main/java/org/jboss/as/undertow/AbstractListenerAdd.java
  67. +83 −0 undertow/src/main/java/org/jboss/as/undertow/AbstractListenerResourceDefinition.java
  68. +152 −0 undertow/src/main/java/org/jboss/as/undertow/AbstractListenerService.java
  69. +99 −0 undertow/src/main/java/org/jboss/as/undertow/BufferPoolResourceDefinition.java
  70. +40 −0 undertow/src/main/java/org/jboss/as/undertow/BufferPoolService.java
  71. +105 −0 undertow/src/main/java/org/jboss/as/undertow/Constants.java
  72. +176 −0 undertow/src/main/java/org/jboss/as/undertow/DeploymentDefinition.java
  73. +115 −0 undertow/src/main/java/org/jboss/as/undertow/DeploymentServletDefinition.java
  74. +18 −0 undertow/src/main/java/org/jboss/as/undertow/EventType.java
  75. +18 −0 undertow/src/main/java/org/jboss/as/undertow/Handler.java
  76. +105 −0 undertow/src/main/java/org/jboss/as/undertow/HandlerFactory.java
  77. +184 −0 undertow/src/main/java/org/jboss/as/undertow/Host.java
  78. +62 −0 undertow/src/main/java/org/jboss/as/undertow/HostAdd.java
  79. +115 −0 undertow/src/main/java/org/jboss/as/undertow/HostDefinition.java
  80. +38 −0 undertow/src/main/java/org/jboss/as/undertow/HostRemove.java
  81. +47 −0 undertow/src/main/java/org/jboss/as/undertow/HttpListenerAdd.java
  82. +18 −0 undertow/src/main/java/org/jboss/as/undertow/HttpListenerResourceDefinition.java
  83. +77 −0 undertow/src/main/java/org/jboss/as/undertow/HttpListenerService.java
  84. +61 −0 undertow/src/main/java/org/jboss/as/undertow/HttpsListenerAdd.java
  85. +61 −0 undertow/src/main/java/org/jboss/as/undertow/HttpsListenerResourceDefinition.java
  86. +93 −0 undertow/src/main/java/org/jboss/as/undertow/HttpsListenerService.java
  87. +259 −0 undertow/src/main/java/org/jboss/as/undertow/JSPDefinition.java
  88. +21 −0 undertow/src/main/java/org/jboss/as/undertow/ListenerRemoveHandler.java
  89. +62 −0 undertow/src/main/java/org/jboss/as/undertow/LocationAdd.java
  90. +62 −0 undertow/src/main/java/org/jboss/as/undertow/LocationDefinition.java
  91. +44 −0 undertow/src/main/java/org/jboss/as/undertow/LocationService.java
  92. +73 −0 undertow/src/main/java/org/jboss/as/undertow/Namespace.java
  93. +90 −0 undertow/src/main/java/org/jboss/as/undertow/OptionAttributeDefinition.java
  94. +130 −0 undertow/src/main/java/org/jboss/as/undertow/Server.java
  95. +48 −0 undertow/src/main/java/org/jboss/as/undertow/ServerAdd.java
  96. +111 −0 undertow/src/main/java/org/jboss/as/undertow/ServerDefinition.java
  97. +45 −0 undertow/src/main/java/org/jboss/as/undertow/ServletContainerAdd.java
  98. +30 −0 undertow/src/main/java/org/jboss/as/undertow/ServletContainerDefinition.java
  99. +98 −0 undertow/src/main/java/org/jboss/as/undertow/ServletContainerService.java
  100. +423 −0 undertow/src/main/java/org/jboss/as/undertow/SharedWebMetaDataBuilder.java
  101. +34 −0 undertow/src/main/java/org/jboss/as/undertow/UndertowEventListener.java
  102. +71 −0 undertow/src/main/java/org/jboss/as/undertow/UndertowExtension.java
  103. +239 −0 undertow/src/main/java/org/jboss/as/undertow/UndertowLogger.java
  104. +194 −0 undertow/src/main/java/org/jboss/as/undertow/UndertowMessages.java
  105. +67 −0 undertow/src/main/java/org/jboss/as/undertow/UndertowRootDefinition.java
  106. +152 −0 undertow/src/main/java/org/jboss/as/undertow/UndertowService.java
  107. +126 −0 undertow/src/main/java/org/jboss/as/undertow/UndertowSubsystemAdd.java
  108. +87 −0 undertow/src/main/java/org/jboss/as/undertow/UndertowSubsystemParser.java
  109. +37 −0 undertow/src/main/java/org/jboss/as/undertow/WebServerService.java
  110. +73 −0 undertow/src/main/java/org/jboss/as/undertow/WorkerAdd.java
  111. +102 −0 undertow/src/main/java/org/jboss/as/undertow/WorkerResourceDefinition.java
  112. +44 −0 undertow/src/main/java/org/jboss/as/undertow/WorkerService.java
  113. +57 −0 undertow/src/main/java/org/jboss/as/undertow/deployment/DeploymentResourceLoader.java
  114. +119 −0 undertow/src/main/java/org/jboss/as/undertow/deployment/ELExpressionFactoryProcessor.java
  115. +97 −0 undertow/src/main/java/org/jboss/as/undertow/deployment/EarContextRootProcessor.java
  116. +49 −0 undertow/src/main/java/org/jboss/as/undertow/deployment/FileResourceLoader.java
  117. +105 −0 undertow/src/main/java/org/jboss/as/undertow/deployment/JBossWebParsingDeploymentProcessor.java
  118. +40 −0 undertow/src/main/java/org/jboss/as/undertow/deployment/JspConfigDescriptorImpl.java
  119. +78 −0 undertow/src/main/java/org/jboss/as/undertow/deployment/JspPropertyGroupDescriptorImpl.java
  120. +64 −0 undertow/src/main/java/org/jboss/as/undertow/deployment/ScisMetaData.java
  121. +66 −0 undertow/src/main/java/org/jboss/as/undertow/deployment/SecurityActions.java
  122. +243 −0 ...rc/main/java/org/jboss/as/undertow/deployment/ServletContainerInitializerDeploymentProcessor.java
  123. +27 −0 undertow/src/main/java/org/jboss/as/undertow/deployment/TaglibDescriptorImpl.java
  124. +244 −0 undertow/src/main/java/org/jboss/as/undertow/deployment/TldParsingDeploymentProcessor.java
  125. +65 −0 undertow/src/main/java/org/jboss/as/undertow/deployment/TldsMetaData.java
  126. +86 −0 undertow/src/main/java/org/jboss/as/undertow/deployment/UndertowDependencyProcessor.java
  127. +947 −0 undertow/src/main/java/org/jboss/as/undertow/deployment/UndertowDeploymentProcessor.java
  128. +270 −0 undertow/src/main/java/org/jboss/as/undertow/deployment/UndertowDeploymentService.java
  129. +48 −0 undertow/src/main/java/org/jboss/as/undertow/deployment/UndertowJSPInstanceManager.java
  130. +68 −0 undertow/src/main/java/org/jboss/as/undertow/deployment/UndertowWebSocketDeploymentProcessor.java
  131. +588 −0 undertow/src/main/java/org/jboss/as/undertow/deployment/WarAnnotationDeploymentProcessor.java
  132. +59 −0 undertow/src/main/java/org/jboss/as/undertow/deployment/WarDeploymentInitializingProcessor.java
  133. +716 −0 undertow/src/main/java/org/jboss/as/undertow/deployment/WarMetaDataProcessor.java
  134. +177 −0 undertow/src/main/java/org/jboss/as/undertow/deployment/WarStructureDeploymentProcessor.java
  135. +182 −0 undertow/src/main/java/org/jboss/as/undertow/deployment/WebComponentProcessor.java
  136. +106 −0 undertow/src/main/java/org/jboss/as/undertow/deployment/WebFragmentParsingDeploymentProcessor.java
  137. +52 −0 undertow/src/main/java/org/jboss/as/undertow/deployment/WebJBossAllParser.java
  138. +135 −0 undertow/src/main/java/org/jboss/as/undertow/deployment/WebParsingDeploymentProcessor.java
  139. +36 −0 undertow/src/main/java/org/jboss/as/undertow/handlers/BasicAuthHandler.java
  140. +46 −0 undertow/src/main/java/org/jboss/as/undertow/handlers/ConnectionLimitHandler.java
  141. +43 −0 undertow/src/main/java/org/jboss/as/undertow/handlers/FileErrorPageHandler.java
  142. +58 −0 undertow/src/main/java/org/jboss/as/undertow/handlers/FileHandler.java
  143. +42 −0 undertow/src/main/java/org/jboss/as/undertow/handlers/ResponseHeaderHandler.java
  144. +22 −0 undertow/src/main/java/org/jboss/as/undertow/handlers/SimpleErrorPageHandler.java
  145. +132 −0 undertow/src/main/java/org/jboss/as/undertow/security/AccountImpl.java
  146. +71 −0 undertow/src/main/java/org/jboss/as/undertow/security/AuditNotificationReceiver.java
  147. +194 −0 undertow/src/main/java/org/jboss/as/undertow/security/JAASIdentityManagerImpl.java
  148. +180 −0 undertow/src/main/java/org/jboss/as/undertow/security/SecurityActions.java
  149. +117 −0 undertow/src/main/java/org/jboss/as/undertow/security/SecurityContextAssociationHandler.java
  150. +48 −0 undertow/src/main/java/org/jboss/as/undertow/security/SecurityContextCreationHandler.java
  151. +13 −0 undertow/src/main/java/org/jboss/as/undertow/security/UndertowSecurityAttachments.java
  152. +76 −0 undertow/src/main/java/org/jboss/as/undertow/security/WebUtil.java
  153. +265 −0 undertow/src/main/java/org/jboss/as/undertow/session/AbstractSessionManager.java
  154. +34 −0 undertow/src/main/java/org/jboss/as/undertow/session/AskSessionOutdatedSessionChecker.java
  155. +159 −0 undertow/src/main/java/org/jboss/as/undertow/session/AttributeBasedClusteredSession.java
  156. +1,298 −0 undertow/src/main/java/org/jboss/as/undertow/session/ClusteredSession.java
  157. +159 −0 undertow/src/main/java/org/jboss/as/undertow/session/ClusteredSessionHandler.java
  158. +69 −0 undertow/src/main/java/org/jboss/as/undertow/session/ClusteredSessionManager.java
  159. +1,556 −0 undertow/src/main/java/org/jboss/as/undertow/session/DistributableSessionManager.java
  160. +197 −0 undertow/src/main/java/org/jboss/as/undertow/session/DistributableSessionManagerMBean.java
  161. +60 −0 undertow/src/main/java/org/jboss/as/undertow/session/InstantSnapshotManager.java
  162. +192 −0 undertow/src/main/java/org/jboss/as/undertow/session/IntervalSnapshotManager.java
  163. +177 −0 undertow/src/main/java/org/jboss/as/undertow/session/JvmRouteHandler.java
  164. +60 −0 undertow/src/main/java/org/jboss/as/undertow/session/JvmRouteRegistryEntryProviderService.java
  165. +73 −0 undertow/src/main/java/org/jboss/as/undertow/session/LockingHandler.java
  166. +134 −0 undertow/src/main/java/org/jboss/as/undertow/session/NonSerializableAttributeTester.java
  167. +39 −0 undertow/src/main/java/org/jboss/as/undertow/session/OutdatedSessionChecker.java
  168. +66 −0 undertow/src/main/java/org/jboss/as/undertow/session/OutgoingDistributableSessionDataImpl.java
  169. +56 −0 undertow/src/main/java/org/jboss/as/undertow/session/OwnedSessionUpdate.java
  170. +184 −0 undertow/src/main/java/org/jboss/as/undertow/session/ReplicationStatistics.java
  171. +105 −0 undertow/src/main/java/org/jboss/as/undertow/session/SessionBasedClusteredSession.java
  172. +78 −0 undertow/src/main/java/org/jboss/as/undertow/session/SessionInvalidationTracker.java
  173. +69 −0 undertow/src/main/java/org/jboss/as/undertow/session/SessionManager.java
  174. +250 −0 undertow/src/main/java/org/jboss/as/undertow/session/SessionManagerStatistics.java
  175. +187 −0 undertow/src/main/java/org/jboss/as/undertow/session/SessionReplicationContext.java
  176. +67 −0 undertow/src/main/java/org/jboss/as/undertow/session/SnapshotManager.java
  177. +96 −0 ...ow/src/main/java/org/jboss/as/undertow/session/notification/ClusteredSessionManagementStatus.java
  178. +92 −0 .../main/java/org/jboss/as/undertow/session/notification/ClusteredSessionNotificationCapability.java
  179. +110 −0 ...w/src/main/java/org/jboss/as/undertow/session/notification/ClusteredSessionNotificationCause.java
  180. +91 −0 .../src/main/java/org/jboss/as/undertow/session/notification/ClusteredSessionNotificationPolicy.java
  181. +40 −0 .../main/java/org/jboss/as/undertow/session/notification/ClusteredSessionNotificationPolicyBase.java
  182. +49 −0 ...boss/as/undertow/session/notification/IgnoreUndeployLegacyClusteredSessionNotificationPolicy.java
  183. +65 −0 ...ain/java/org/jboss/as/undertow/session/notification/LegacyClusteredSessionNotificationPolicy.java
  184. +2 −0 undertow/src/main/resources/META-INF/services/org.jboss.as.controller.Extension
  185. +7 −0 undertow/src/main/resources/META-INF/services/org.jboss.as.undertow.Handler
  186. +27 −0 undertow/src/main/resources/org/jboss/as/undertow/extension/LocalDescriptions.properties
  187. +25 −0 undertow/src/test/java/org/jboss/as/undertow/extension/UndertowSubsystemTestCase.java
  188. +48 −0 undertow/src/test/resources/org/jboss/as/undertow/extension/undertow-1.0.xml
  189. +48 −0 undertow/src/test/resources/org/jboss/as/undertow/extension/undertow-wish.xml
  190. +1 −1 web-common/pom.xml
  191. +1 −1 web/pom.xml
  192. +8 −2 webservices/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSSubsystemAdd.java
  193. +1 −1 weld/pom.xml
@@ -89,7 +89,7 @@
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.servlet</groupId>
- <artifactId>jboss-servlet-api_3.0_spec</artifactId>
+ <artifactId>jboss-servlet-api_3.1_spec</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
@@ -66,7 +66,7 @@
public class ManagementClient {
private static final String SUBDEPLOYMENT = "subdeployment";
- private static final String WEB = "web";
+ private static final String UNDERTOW = "undertow";
private static final String JMX = "jmx";
@@ -339,8 +339,8 @@ private void extractWebArchiveContexts(HTTPContext context, ModelNode deployment
private void extractWebArchiveContexts(HTTPContext context, String deploymentName, ModelNode deploymentNode) {
if (deploymentNode.hasDefined(SUBSYSTEM)) {
ModelNode subsystem = deploymentNode.get(SUBSYSTEM);
- if (subsystem.hasDefined(WEB)) {
- ModelNode webSubSystem = subsystem.get(WEB);
+ if (subsystem.hasDefined(UNDERTOW)) {
+ ModelNode webSubSystem = subsystem.get(UNDERTOW);
if (webSubSystem.isDefined() && webSubSystem.hasDefined("context-root")) {
final String contextName = webSubSystem.get("context-root").asString();
if (webSubSystem.hasDefined(SERVLET)) {
@@ -16,12 +16,26 @@
*/
package org.jboss.as.arquillian.container;
+import static org.jboss.as.controller.client.helpers.ClientConstants.CONTROLLER_PROCESS_STATE_STARTING;
+import static org.jboss.as.controller.client.helpers.ClientConstants.CONTROLLER_PROCESS_STATE_STOPPING;
+import static org.jboss.as.controller.client.helpers.ClientConstants.DEPLOYMENT;
+import static org.jboss.as.controller.client.helpers.ClientConstants.FAILURE_DESCRIPTION;
+import static org.jboss.as.controller.client.helpers.ClientConstants.OP;
+import static org.jboss.as.controller.client.helpers.ClientConstants.OP_ADDR;
+import static org.jboss.as.controller.client.helpers.ClientConstants.OUTCOME;
+import static org.jboss.as.controller.client.helpers.ClientConstants.READ_ATTRIBUTE_OPERATION;
+import static org.jboss.as.controller.client.helpers.ClientConstants.READ_RESOURCE_OPERATION;
+import static org.jboss.as.controller.client.helpers.ClientConstants.RECURSIVE;
+import static org.jboss.as.controller.client.helpers.ClientConstants.RESULT;
+import static org.jboss.as.controller.client.helpers.ClientConstants.SUBSYSTEM;
+import static org.jboss.as.controller.client.helpers.ClientConstants.SUCCESS;
+
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
+import java.util.List;
import java.util.Set;
-
import javax.management.Attribute;
import javax.management.AttributeList;
import javax.management.AttributeNotFoundException;
@@ -52,22 +66,9 @@
import org.jboss.arquillian.container.spi.client.protocol.metadata.Servlet;
import org.jboss.as.controller.client.ModelControllerClient;
import org.jboss.dmr.ModelNode;
+import org.jboss.dmr.Property;
import org.jboss.logging.Logger;
-import static org.jboss.as.controller.client.helpers.ClientConstants.CONTROLLER_PROCESS_STATE_STARTING;
-import static org.jboss.as.controller.client.helpers.ClientConstants.CONTROLLER_PROCESS_STATE_STOPPING;
-import static org.jboss.as.controller.client.helpers.ClientConstants.DEPLOYMENT;
-import static org.jboss.as.controller.client.helpers.ClientConstants.FAILURE_DESCRIPTION;
-import static org.jboss.as.controller.client.helpers.ClientConstants.OP;
-import static org.jboss.as.controller.client.helpers.ClientConstants.OP_ADDR;
-import static org.jboss.as.controller.client.helpers.ClientConstants.OUTCOME;
-import static org.jboss.as.controller.client.helpers.ClientConstants.READ_ATTRIBUTE_OPERATION;
-import static org.jboss.as.controller.client.helpers.ClientConstants.READ_RESOURCE_OPERATION;
-import static org.jboss.as.controller.client.helpers.ClientConstants.RECURSIVE;
-import static org.jboss.as.controller.client.helpers.ClientConstants.RESULT;
-import static org.jboss.as.controller.client.helpers.ClientConstants.SUBSYSTEM;
-import static org.jboss.as.controller.client.helpers.ClientConstants.SUCCESS;
-
/**
* A helper class to join management related operations, like extract sub system ip/port (web/jmx)
* and deployment introspection.
@@ -80,7 +81,7 @@
private static final String SUBDEPLOYMENT = "subdeployment";
- private static final String WEB = "web";
+ private static final String WEB = "undertow";
private static final String NAME = "name";
private static final String SERVLET = "servlet";
@@ -129,8 +130,12 @@ public URI getWebUri() {
} catch (Exception e) {
throw new RuntimeException(e);
}
- ModelNode socketBinding = rootNode.get("subsystem").get("web").get("connector").get("http").get("socket-binding");
- if(!socketBinding.isDefined()) {
+ List<Property> vhosts = rootNode.get("subsystem", WEB).get("server").asPropertyList();
+ ModelNode socketBinding = new ModelNode();
+ if (!vhosts.isEmpty()) {//if empty no virtual hosts defined
+ socketBinding = vhosts.get(0).getValue().get("http-listener", "default").get("socket-binding");
+ }
+ if (!socketBinding.isDefined()) {
try {
webUri = new URI("http://localhost:8080");
} catch (URISyntaxException e) {
@@ -143,14 +148,6 @@ public URI getWebUri() {
return webUri;
}
- /**
- * @deprecated use {@link #getProtocolMetaData(String)}
- */
- @Deprecated
- public ProtocolMetaData getDeploymentMetaData(String deploymentName) {
- return getProtocolMetaData(deploymentName);
- }
-
public ProtocolMetaData getProtocolMetaData(String deploymentName) {
URI webURI = getWebUri();
@@ -210,33 +207,26 @@ private void readRootNode() throws Exception {
}
private static ModelNode defined(final ModelNode node, final String message) {
- if (!node.isDefined())
- throw new IllegalStateException(message);
+ if (!node.isDefined()) { throw new IllegalStateException(message); }
return node;
}
private URI getBinding(final String protocol, final String socketBinding) {
try {
- //TODO: resolve socket binding group correctly
final String socketBindingGroupName = rootNode.get("socket-binding-group").keys().iterator().next();
-
final ModelNode operation = new ModelNode();
operation.get(OP_ADDR).get("socket-binding-group").set(socketBindingGroupName);
operation.get(OP_ADDR).get("socket-binding").set(socketBinding);
- operation.get(OP).set(READ_ATTRIBUTE_OPERATION);
- operation.get(NAME).set("bound-address");
- String ip = executeForResult(operation).asString();
+ operation.get(OP).set(READ_RESOURCE_OPERATION);
+ operation.get("include-runtime").set(true);
+ ModelNode binding = executeForResult(operation);
+ String ip = binding.get("bound-address").asString();
//it appears some system can return a binding with the zone specifier on the end
- if(ip.contains(":") && ip.contains("%")) {
+ if (ip.contains(":") && ip.contains("%")) {
ip = ip.split("%")[0];
}
- final ModelNode portOp = new ModelNode();
- portOp.get(OP_ADDR).get("socket-binding-group").set(socketBindingGroupName);
- portOp.get(OP_ADDR).get("socket-binding").set(socketBinding);
- portOp.get(OP).set(READ_ATTRIBUTE_OPERATION);
- portOp.get(NAME).set("bound-port");
- final int port = defined(executeForResult(portOp), socketBindingGroupName + " -> " + socketBinding + " -> bound-port is undefined").asInt();
+ final int port = defined(binding.get("bound-port"), socketBindingGroupName + " -> " + socketBinding + " -> bound-port is undefined").asInt();
return URI.create(protocol + "://" + NetworkUtils.formatPossibleIpv6Address(ip) + ":" + port);
} catch (Exception e) {
@@ -281,7 +271,7 @@ private void extractWebArchiveContexts(HTTPContext context, String deploymentNam
if (deploymentNode.hasDefined(SUBSYSTEM)) {
ModelNode subsystem = deploymentNode.get(SUBSYSTEM);
if (subsystem.hasDefined(WEB)) {
- ModelNode webSubSystem = subsystem.get(WEB);
+ ModelNode webSubSystem = subsystem.get(WEB);//todo undertow!
if (webSubSystem.isDefined() && webSubSystem.hasDefined("context-root")) {
final String contextName = webSubSystem.get("context-root").asString();
if (webSubSystem.hasDefined(SERVLET)) {
@@ -384,6 +374,7 @@ public URI getRemoteEjbURL() {
}
return ejbUri;
}
+
//-------------------------------------------------------------------------------------||
// Helper classes ---------------------------------------------------------------------||
//-------------------------------------------------------------------------------------||
@@ -395,7 +386,7 @@ public UnSuccessfulOperationException(String message) {
}
}
- private class MBeanConnectionProxy implements MBeanServerConnection{
+ private class MBeanConnectionProxy implements MBeanServerConnection {
private MBeanServerConnection connection;
/**
@@ -432,7 +423,7 @@ public ObjectInstance createMBean(String className, ObjectName name, Object[] pa
@Override
public ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, Object[] params,
- String[] signature) throws ReflectionException, InstanceAlreadyExistsException,
+ String[] signature) throws ReflectionException, InstanceAlreadyExistsException,
MBeanException, NotCompliantMBeanException, InstanceNotFoundException, IOException {
checkConnection();
return connection.createMBean(className, name, loaderName, params, signature);
@@ -559,7 +550,7 @@ public String getDefaultDomain() throws IOException {
@Override
public void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter,
- Object handback) throws InstanceNotFoundException, IOException {
+ Object handback) throws InstanceNotFoundException, IOException {
try {
connection.addNotificationListener(name, listener, filter, handback);
} catch (IOException e) {
@@ -629,7 +620,7 @@ public void removeNotificationListener(ObjectName name, NotificationListener lis
@Override
public void removeNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter,
- Object handback) throws InstanceNotFoundException, ListenerNotFoundException, IOException {
+ Object handback) throws InstanceNotFoundException, ListenerNotFoundException, IOException {
try {
connection.removeNotificationListener(name, listener, filter, handback);
} catch (IOException e) {
@@ -662,25 +653,25 @@ public boolean isInstanceOf(ObjectName name, String className) throws InstanceNo
}
}
- private boolean checkConnection(){
- try{
+ private boolean checkConnection() {
+ try {
this.connection.getMBeanCount();
return true;
- }catch(IOException ioe){
+ } catch (IOException ioe) {
}
this.connection = this.getConnection();
return false;
}
private MBeanServerConnection getConnection() {
- try {
- final HashMap<String, Object> env = new HashMap<String, Object>();
- env.put(CallbackHandler.class.getName(), Authentication.getCallbackHandler());
- connector = JMXConnectorFactory.connect(getRemoteJMXURL(), env);
- connection = connector.getMBeanServerConnection();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
+ try {
+ final HashMap<String, Object> env = new HashMap<String, Object>();
+ env.put(CallbackHandler.class.getName(), Authentication.getCallbackHandler());
+ connector = JMXConnectorFactory.connect(getRemoteJMXURL(), env);
+ connection = connector.getMBeanServerConnection();
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
return connection;
}
}
@@ -75,7 +75,7 @@
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.servlet</groupId>
- <artifactId>jboss-servlet-api_3.0_spec</artifactId>
+ <artifactId>jboss-servlet-api_3.1_spec</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
@@ -87,7 +87,7 @@
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.servlet</groupId>
- <artifactId>jboss-servlet-api_3.0_spec</artifactId>
+ <artifactId>jboss-servlet-api_3.1_spec</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
@@ -68,7 +68,7 @@
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.servlet</groupId>
- <artifactId>jboss-servlet-api_3.0_spec</artifactId>
+ <artifactId>jboss-servlet-api_3.1_spec</artifactId>
<scope>test</scope>
</dependency>
@@ -73,7 +73,7 @@
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.servlet</groupId>
- <artifactId>jboss-servlet-api_3.0_spec</artifactId>
+ <artifactId>jboss-servlet-api_3.1_spec</artifactId>
<scope>test</scope>
</dependency>
@@ -62,7 +62,7 @@
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.servlet</groupId>
- <artifactId>jboss-servlet-api_3.0_spec</artifactId>
+ <artifactId>jboss-servlet-api_3.1_spec</artifactId>
</dependency>
</dependencies>
View
@@ -177,7 +177,7 @@
~ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-->
- <module-def name="io.undertow">
+ <module-def name="io.undertow.core">
<maven-resource group="io.undertow" artifact="undertow-core"/>
</module-def>
@@ -498,7 +498,7 @@
</module-def>
<module-def name="javax.servlet.api">
- <maven-resource group="org.jboss.spec.javax.servlet" artifact="jboss-servlet-api_3.0_spec"/>
+ <maven-resource group="org.jboss.spec.javax.servlet" artifact="jboss-servlet-api_3.1_spec"/>
</module-def>
<module-def name="javax.servlet.jsp.api">
@@ -1327,6 +1327,22 @@
<module-def name="ibm.jdk"/>
+ <module-def name="org.jboss.as.undertow">
+ <maven-resource group="org.jboss.as" artifact="jboss-as-undertow"/>
+ </module-def>
+ <module-def name="io.undertow.servlet">
+ <maven-resource group="io.undertow" artifact="undertow-servlet"/>
+ <maven-resource group="io.undertow" artifact="undertow-jsp"/>
+ <maven-resource group="io.undertow.jastow" artifact="jastow"/>
+ <maven-resource group="org.jboss.web" artifact="jasper-jdt"/>
+ </module-def>
+ <module-def name="io.undertow.websocket">
+ <maven-resource group="io.undertow" artifact="undertow-websockets-jsr"/>
+ </module-def>
+ <module-def name="javax.websocket.api">
+ <maven-resource group="org.jboss.spec.javax.websocket" artifact="jboss-websocket-api_1.0_spec"/>
+ </module-def>
+
</target>
<target name="bundles">
View
@@ -1607,7 +1607,7 @@
<dependency>
<groupId>org.jboss.spec.javax.servlet</groupId>
- <artifactId>jboss-servlet-api_3.0_spec</artifactId>
+ <artifactId>jboss-servlet-api_3.1_spec</artifactId>
</dependency>
<dependency>
@@ -1665,6 +1665,41 @@
<artifactId>jbossweb</artifactId>
</dependency>
+ <dependency>
+ <groupId>io.undertow</groupId>
+ <artifactId>undertow-servlet</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>io.undertow</groupId>
+ <artifactId>undertow-jsp</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>io.undertow</groupId>
+ <artifactId>undertow-websockets-jsr</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.spec.javax.websocket</groupId>
+ <artifactId>jboss-websocket-api_1.0_spec</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-undertow</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.web</groupId>
+ <artifactId>jasper-jdt</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>io.undertow.jastow</groupId>
+ <artifactId>jastow</artifactId>
+ </dependency>
+
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-api</artifactId>
@@ -2048,7 +2083,7 @@
<include>org.jboss.spec.javax.rmi:jboss-rmi-api_1.0_spec</include>
<include>org.jboss.spec.javax.security.auth.message:jboss-jaspi-api_1.0_spec</include>
<include>org.jboss.spec.javax.security.jacc:jboss-jacc-api_1.4_spec</include>
- <include>org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec</include>
+ <include>org.jboss.spec.javax.servlet:jboss-servlet-api_3.1_spec</include>
<include>org.jboss.spec.javax.servlet.jsp:jboss-jsp-api_2.2_spec</include>
<include>org.jboss.spec.javax.servlet.jstl:jboss-jstl-api_1.2_spec</include>
<include>org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec</include>
Oops, something went wrong.

0 comments on commit 192118e

Please sign in to comment.