Skip to content

Commit f014189

Browse files
committed
[AS7-2866] Move remoting subsystem element attributes into a child element
1 parent b43af2e commit f014189

File tree

11 files changed

+263
-176
lines changed

11 files changed

+263
-176
lines changed

build/src/main/resources/docs/schema/jboss-as-remoting_1_0.xsd

+21-19
Original file line numberDiff line numberDiff line change
@@ -36,29 +36,31 @@
3636
<![CDATA[
3737
The configuration of the Remoting subsystem.
3838
39+
The 'worker-thread-pool' element configures the worker thread pool.
3940
The nested "connector" element(s) define connectors for this subsystem.
40-
41-
The attributes correspond to the following xnio options:
42-
org.xnio.Options#WORKER_READ_THREADS (normally 1 or maybe 2-3 for an exceptionally busy server)
43-
org.xnio.Options#WORKER_WRITE_THREADS (same)
44-
org.xnio.Options#WORKER_ACCEPT_THREADS (we can just leave this at 1, it doesn't have to be tunable for Remoting)
45-
org.xnio.Options#WORKER_TASK_CORE_THREADS (core pool size)
46-
org.xnio.Options#WORKER_TASK_MAX_THREADS (max pool size)
47-
org.xnio.Options#WORKER_TASK_KEEPALIVE (keepalive time in milliseconds)
48-
org.xnio.Options#WORKER_TASK_LIMIT (worker queue length)
4941
]]>
5042
</xs:documentation>
5143
</xs:annotation>
52-
<xs:choice minOccurs="0" maxOccurs="unbounded">
53-
<xs:element name="connector" type="connector"/>
54-
</xs:choice>
55-
<xs:attribute name="worker-read-threads" type="xs:integer" use="optional"/>
56-
<xs:attribute name="worker-write-threads" type="xs:integer" use="optional"/>
57-
<xs:attribute name="worker-task-core-threads" type="xs:integer" use="optional"/>
58-
<xs:attribute name="worker-task-max-threads" type="xs:integer" use="optional"/>
59-
<xs:attribute name="worker-task-keepalive" type="xs:integer" use="optional"/>
60-
<xs:attribute name="worker-task-limit" type="xs:integer" use="optional"/>
61-
44+
<xs:sequence>
45+
<xs:element name="worker-thread-pool" type="workerThreadsType" minOccurs="0"/>
46+
<xs:element name="connector" type="connector" minOccurs="0" maxOccurs="unbounded"/>
47+
</xs:sequence>
48+
</xs:complexType>
49+
50+
<xs:complexType name="workerThreadsType">
51+
<xs:annotation>
52+
<xs:documentation>
53+
<![CDATA[
54+
The configuration of the worker thread pool.
55+
]]>
56+
</xs:documentation>
57+
</xs:annotation>
58+
<xs:attribute name="read-threads" type="xs:integer" use="optional"/>
59+
<xs:attribute name="write-threads" type="xs:integer" use="optional"/>
60+
<xs:attribute name="task-core-threads" type="xs:integer" use="optional"/>
61+
<xs:attribute name="task-max-threads" type="xs:integer" use="optional"/>
62+
<xs:attribute name="task-keepalive" type="xs:integer" use="optional"/>
63+
<xs:attribute name="task-limit" type="xs:integer" use="optional"/>
6264
</xs:complexType>
6365

6466
<xs:complexType name="connector">

build/src/main/resources/docs/schema/jboss-as-remoting_1_1.xsd

+24-19
Original file line numberDiff line numberDiff line change
@@ -36,31 +36,36 @@
3636
<![CDATA[
3737
The configuration of the Remoting subsystem.
3838
39+
The 'worker-thread-pool' element configures the worker thread pool.
3940
The nested "connector" element(s) define connectors for this subsystem.
40-
41+
]]>
42+
</xs:documentation>
43+
</xs:annotation>
44+
<xs:sequence>
45+
<xs:element name="worker-thread-pool" type="workerThreadsType" minOccurs="0"/>
46+
<xs:element name="connector" type="connector" minOccurs="0" maxOccurs="unbounded"/>
47+
<xs:element name="outbound-connections" minOccurs="0" type="outbound-connectionsType" />
48+
</xs:sequence>
49+
</xs:complexType>
50+
51+
<xs:complexType name="workerThreadsType">
52+
<xs:annotation>
53+
<xs:documentation>
54+
<![CDATA[
55+
The configuration of the worker thread pool.
56+
4157
The attributes correspond to the following xnio options:
42-
org.xnio.Options#WORKER_READ_THREADS (normally 1 or maybe 2-3 for an exceptionally busy server)
43-
org.xnio.Options#WORKER_WRITE_THREADS (same)
44-
org.xnio.Options#WORKER_ACCEPT_THREADS (we can just leave this at 1, it doesn't have to be tunable for Remoting)
45-
org.xnio.Options#WORKER_TASK_CORE_THREADS (core pool size)
46-
org.xnio.Options#WORKER_TASK_MAX_THREADS (max pool size)
47-
org.xnio.Options#WORKER_TASK_KEEPALIVE (keepalive time in milliseconds)
48-
org.xnio.Options#WORKER_TASK_LIMIT (worker queue length)
4958
]]>
5059
</xs:documentation>
5160
</xs:annotation>
52-
<xs:choice minOccurs="0" maxOccurs="unbounded">
53-
<xs:element name="connector" type="connector"/>
54-
<xs:element name="outbound-connections" type="outbound-connectionsType" />
55-
</xs:choice>
56-
<xs:attribute name="worker-read-threads" type="xs:integer" use="optional"/>
57-
<xs:attribute name="worker-write-threads" type="xs:integer" use="optional"/>
58-
<xs:attribute name="worker-task-core-threads" type="xs:integer" use="optional"/>
59-
<xs:attribute name="worker-task-max-threads" type="xs:integer" use="optional"/>
60-
<xs:attribute name="worker-task-keepalive" type="xs:integer" use="optional"/>
61-
<xs:attribute name="worker-task-limit" type="xs:integer" use="optional"/>
62-
61+
<xs:attribute name="read-threads" type="xs:integer" use="optional"/>
62+
<xs:attribute name="write-threads" type="xs:integer" use="optional"/>
63+
<xs:attribute name="task-core-threads" type="xs:integer" use="optional"/>
64+
<xs:attribute name="task-max-threads" type="xs:integer" use="optional"/>
65+
<xs:attribute name="task-keepalive" type="xs:integer" use="optional"/>
66+
<xs:attribute name="task-limit" type="xs:integer" use="optional"/>
6367
</xs:complexType>
68+
6469

6570
<xs:complexType name="connector">
6671
<xs:annotation>

remoting-test/src/test/java/org/jboss/as/remoting/RemotingSubsystemTestCase.java

+22-1
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@
3939
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.VALUE;
4040
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.WRITE_ATTRIBUTE_OPERATION;
4141

42+
import java.io.File;
4243
import java.io.IOException;
4344

45+
import org.jboss.as.server.ServerEnvironment;
46+
import org.jboss.as.server.services.path.AbsolutePathService;
4447
import org.jboss.as.subsystem.test.AbstractSubsystemBaseTest;
4548
import org.jboss.as.subsystem.test.AdditionalInitialization;
4649
import org.jboss.as.subsystem.test.ControllerInitializer;
@@ -49,6 +52,7 @@
4952
import org.jboss.msc.service.ServiceController;
5053
import org.jboss.msc.service.ServiceName;
5154
import org.jboss.msc.service.ServiceNotFoundException;
55+
import org.jboss.msc.service.ServiceTarget;
5256
import org.junit.Ignore;
5357
import org.junit.Test;
5458

@@ -77,6 +81,12 @@ protected void setupController(ControllerInitializer controllerInitializer) {
7781
controllerInitializer.addSocketBinding("test", port);
7882
}
7983

84+
@Override
85+
protected void addExtraServices(ServiceTarget target) {
86+
//Needed for initialization of the RealmAuthenticationProviderService
87+
AbsolutePathService.addService(ServerEnvironment.CONTROLLER_TEMP_DIR, new File("target/temp" + System.currentTimeMillis()).getAbsolutePath(), target);
88+
}
89+
8090
},readResource("remoting-with-threads.xml"));
8191

8292
ServiceController<?> endPointService = services.getContainer().getRequiredService(RemotingServices.SUBSYSTEM_ENDPOINT);
@@ -108,6 +118,12 @@ protected void setupController(ControllerInitializer controllerInitializer) {
108118
controllerInitializer.addSocketBinding("test", port);
109119
}
110120

121+
@Override
122+
protected void addExtraServices(ServiceTarget target) {
123+
//Needed for initialization of the RealmAuthenticationProviderService
124+
AbsolutePathService.addService(ServerEnvironment.CONTROLLER_TEMP_DIR, new File("target/temp" + System.currentTimeMillis()).getAbsolutePath(), target);
125+
}
126+
111127
},readResource("remoting-with-threads.xml"));
112128

113129
CurrentConnectorAndController current = CurrentConnectorAndController.create(services, RemotingServices.SUBSYSTEM_ENDPOINT, RemotingServices.serverServiceName("test-connector"));
@@ -147,6 +163,11 @@ protected void setupController(ControllerInitializer controllerInitializer) {
147163
controllerInitializer.addSocketBinding("test", port);
148164
}
149165

166+
@Override
167+
protected void addExtraServices(ServiceTarget target) {
168+
//Needed for initialization of the RealmAuthenticationProviderService
169+
AbsolutePathService.addService(ServerEnvironment.CONTROLLER_TEMP_DIR, new File("target/temp" + System.currentTimeMillis()).getAbsolutePath(), target);
170+
}
150171
},readResource("remoting-with-threads.xml"));
151172

152173
CurrentConnectorAndController current = CurrentConnectorAndController.create(services, RemotingServices.SUBSYSTEM_ENDPOINT, RemotingServices.serverServiceName("test-connector"));
@@ -213,7 +234,7 @@ protected void setupController(ControllerInitializer controllerInitializer) {
213234
/**
214235
* Tests that the outbound connections configured in the remoting subsytem are processed and services
215236
* are created for them
216-
*
237+
*
217238
* @throws Exception
218239
*/
219240
@Test

remoting-test/src/test/resources/org/jboss/as/remoting/remoting-with-bad-connector-property.xml

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
<subsystem xmlns="urn:jboss:domain:remoting:1.0"
2-
worker-read-threads="5"
3-
worker-task-core-threads="6"
4-
worker-task-keepalive="7"
5-
worker-task-limit="8"
6-
worker-task-max-threads="9"
7-
worker-write-threads="10"
8-
>
1+
<subsystem xmlns="urn:jboss:domain:remoting:1.0">
2+
3+
<worker-thread-pool
4+
read-threads="5"
5+
task-core-threads="6"
6+
task-keepalive="7"
7+
task-limit="8"
8+
task-max-threads="9"
9+
write-threads="10"
10+
/>
911
<connector name="test-connector" socket-binding="test">
1012
<properties>
1113
<property name="WORKER_ACCEPT_THREADS" value="1"/>

remoting-test/src/test/resources/org/jboss/as/remoting/remoting-with-outbound-connections.xml

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
<subsystem xmlns="urn:jboss:domain:remoting:1.1"
2-
worker-read-threads="5"
3-
worker-task-core-threads="6"
4-
worker-task-keepalive="7"
5-
worker-task-limit="8"
6-
worker-task-max-threads="9"
7-
worker-write-threads="10"
8-
>
1+
<subsystem xmlns="urn:jboss:domain:remoting:1.1">
92
<connector name="test-connector" socket-binding="test"/>
103

114
<outbound-connections>

remoting-test/src/test/resources/org/jboss/as/remoting/remoting-with-threads.xml

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
<subsystem xmlns="urn:jboss:domain:remoting:1.0"
2-
worker-read-threads="5"
3-
worker-task-core-threads="6"
4-
worker-task-keepalive="7"
5-
worker-task-limit="8"
6-
worker-task-max-threads="9"
7-
worker-write-threads="10"
8-
>
1+
<subsystem xmlns="urn:jboss:domain:remoting:1.0">
2+
<worker-thread-pool
3+
read-threads="5"
4+
task-core-threads="6"
5+
task-keepalive="7"
6+
task-limit="8"
7+
task-max-threads="9"
8+
write-threads="10"
9+
/>
910
<connector name="test-connector" socket-binding="test">
1011
<properties>
1112
<!-- This must be smaller than worker-read-threads -->

remoting/src/main/java/org/jboss/as/remoting/Attribute.java

+7-6
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@ public enum Attribute {
3636
SOCKET_BINDING(CommonAttributes.SOCKET_BINDING),
3737
URI("uri"),
3838
VALUE(CommonAttributes.VALUE),
39-
WORKER_READ_THREADS(CommonAttributes.WORKER_READ_THREADS),
40-
WORKER_TASK_CORE_THREADS(CommonAttributes.WORKER_TASK_CORE_THREADS),
41-
WORKER_TASK_KEEPALIVE(CommonAttributes.WORKER_TASK_KEEPALIVE),
42-
WORKER_TASK_LIMIT(CommonAttributes.WORKER_TASK_LIMIT),
43-
WORKER_TASK_MAX_THREADS(CommonAttributes.WORKER_TASK_MAX_THREADS),
44-
WORKER_WRITE_THREADS(CommonAttributes.WORKER_WRITE_THREADS)
39+
WORKER_READ_THREADS("read-threads"),
40+
WORKER_TASK_CORE_THREADS("task-core-threads"),
41+
WORKER_TASK_KEEPALIVE("task-keepalive"),
42+
WORKER_TASK_LIMIT("task-limit"),
43+
WORKER_TASK_MAX_THREADS("task-max-threads"),
44+
WORKER_WRITE_THREADS("write-threads")
4545
;
46+
4647
private final String name;
4748

4849
Attribute(final String name) {

remoting/src/main/java/org/jboss/as/remoting/Element.java

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public enum Element {
5757
SERVER_AUTH("server-auth"),
5858
STRENGTH("strength"),
5959
SUBSYSTEM("subsystem"),
60+
WORKER_THREAD_POOL("worker-thread-pool")
6061
;
6162

6263
private final String name;

0 commit comments

Comments
 (0)