Skip to content

Commit 78a9e0a

Browse files
committed
Save current work
1 parent 5d2a5f9 commit 78a9e0a

File tree

19 files changed

+2720
-295
lines changed

19 files changed

+2720
-295
lines changed

build/src/main/resources/modules/org/hornetq/main/module.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
2323
-->
2424

25-
<module xmlns="urn:jboss:module:1.0" name="org.jboss.messaging">
25+
<module xmlns="urn:jboss:module:1.0" name="org.hornetq">
2626
<resources>
2727
<!-- Insert resources here -->
2828
</resources>
2929

3030
<dependencies>
31+
<module name="javax.jms.api" />
3132
<module name="org.hornetq"/>
32-
<module name="javax.jms
3333
</dependencies>
3434
</module>

build/src/main/resources/modules/org/jboss/as/messaging/main/module.xml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,18 @@
2222
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
2323
-->
2424

25-
<module xmlns="urn:jboss:module:1.0" name="org.jboss.as.transactions">
25+
<module xmlns="urn:jboss:module:1.0" name="org.jboss.as.messaging">
2626

2727
<resources>
2828
<!-- Insert resources here -->
2929
</resources>
3030

3131
<dependencies>
32-
<module name="javax.transaction.api"/>
3332
<module name="org.jboss.staxmapper"/>
3433
<module name="org.jboss.as.domain"/>
35-
<module name="org.jboss.integration.jboss-transaction-spi"/>
3634
<module name="org.jboss.msc"/>
3735
<module name="org.jboss.logging"/>
38-
<module name="org.jboss.jts"/>
39-
<module name="org.jboss.jts.integration"/>
36+
<module name="org.hornetq"/>
4037
<module name="system"/>
4138
</dependencies>
4239
</module>

domain/src/main/java/org/jboss/as/services/net/SocketBinding.java

Lines changed: 122 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -43,136 +43,136 @@
4343
*/
4444
public class SocketBinding {
4545

46-
public static final ServiceName JBOSS_BINDING_NAME = ServiceName.JBOSS.append("binding");
47-
48-
private final String name;
49-
private int port;
50-
private boolean isFixedPort;
51-
private InetAddress multicastAddress;
52-
private int multicastPort;
53-
private final NetworkInterfaceBinding networkInterface;
54-
private final SocketBindingManager socketBindings;
55-
56-
SocketBinding(final String name, int port, boolean isFixedPort,
57-
InetAddress multicastAddress, int multicastPort,
58-
final NetworkInterfaceBinding networkInterface, SocketBindingManager socketBindings) {
59-
this.name = name;
60-
this.port = port;
61-
this.isFixedPort = isFixedPort;
62-
this.multicastAddress = multicastAddress;
63-
this.multicastPort = multicastPort;
64-
this.socketBindings = socketBindings;
65-
this.networkInterface = networkInterface;
66-
}
46+
public static final ServiceName JBOSS_BINDING_NAME = ServiceName.JBOSS.append("binding");
47+
48+
private final String name;
49+
private int port;
50+
private boolean isFixedPort;
51+
private InetAddress multicastAddress;
52+
private int multicastPort;
53+
private final NetworkInterfaceBinding networkInterface;
54+
private final SocketBindingManager socketBindings;
55+
56+
SocketBinding(final String name, int port, boolean isFixedPort,
57+
InetAddress multicastAddress, int multicastPort,
58+
final NetworkInterfaceBinding networkInterface, SocketBindingManager socketBindings) {
59+
this.name = name;
60+
this.port = port;
61+
this.isFixedPort = isFixedPort;
62+
this.multicastAddress = multicastAddress;
63+
this.multicastPort = multicastPort;
64+
this.socketBindings = socketBindings;
65+
this.networkInterface = networkInterface;
66+
}
6767

6868
/**
6969
* Return the name of the SocketBinding used in the configuration
70+
*
7071
* @return the SocketBinding configuration name
7172
*/
7273
public String getName() {
7374
return name;
7475
}
7576

76-
/**
77-
* Get the socket binding manager.
78-
*
79-
* @return the socket binding manger
80-
*/
81-
public SocketBindingManager getSocketBindings() {
82-
return socketBindings;
83-
}
84-
85-
/**
86-
* Get the socket address.
87-
*
88-
* @return the socket address
89-
*/
90-
public InetSocketAddress getSocketAddress() {
91-
int port = this.port;
92-
if(port > 0 && isFixedPort == false) {
93-
port += socketBindings.getPortOffset();
94-
}
95-
return new InetSocketAddress(networkInterface.getAddress(), port);
96-
}
97-
98-
/**
99-
* Get the multicast socket address.
100-
*
101-
* @return
102-
*/
103-
public InetSocketAddress getMulticastSocketAddress() {
104-
if(multicastAddress == null) {
105-
throw new IllegalStateException("no multicast binding: " + name);
106-
}
107-
return new InetSocketAddress(multicastAddress, multicastPort);
108-
}
109-
110-
/**
111-
* Create and bind a socket.
112-
*
113-
* @return the socket
114-
* @throws IOException
115-
*/
116-
public Socket createSocket() throws IOException {
117-
final Socket socket = getSocketFactory().createSocket();
118-
socket.bind(getSocketAddress());
119-
return socket;
120-
}
121-
122-
/**
123-
* Create and bind a server socket
124-
*
125-
* @return the server socket
126-
* @throws IOException
127-
*/
128-
public ServerSocket createServerSocket() throws IOException {
129-
final ServerSocket socket = getServerSocketFactory().createServerSocket();
130-
socket.bind(getSocketAddress());
131-
return socket;
132-
}
133-
134-
/**
135-
* Create and bind a server socket.
136-
*
137-
* @param backlog the backlog
138-
* @return the server socket
139-
* @throws IOException
140-
*/
141-
public ServerSocket createServerSocket(int backlog) throws IOException {
142-
final ServerSocket socket = getServerSocketFactory().createServerSocket();
143-
socket.bind(getSocketAddress(), backlog);
144-
return socket;
145-
}
146-
147-
/**
148-
* Create and bind a datagrap socket.
149-
*
150-
* @return the datagram socket
151-
* @throws SocketException
152-
*/
153-
public DatagramSocket createDatagramSocket() throws SocketException {
154-
return new ManagedDatagramSocketBinding(socketBindings, getSocketAddress());
155-
}
156-
157-
/**
158-
* Create and bind a multicast socket. This will also join the given
159-
* multicast address.
160-
*
161-
* @return the multicast socket
162-
* @throws IOException
163-
*/
164-
public MulticastSocket createMulticastSocket() throws IOException {
165-
final MulticastSocket socket = new ManagedMulticastSocketBinding(socketBindings, getSocketAddress());
166-
socket.joinGroup(getMulticastSocketAddress(), networkInterface.getNetworkInterface());
167-
return socket;
168-
}
169-
170-
SocketFactory getSocketFactory() {
171-
return socketBindings.getSocketFactory();
172-
}
173-
174-
ServerSocketFactory getServerSocketFactory() {
175-
return socketBindings.getServerSocketFactory();
176-
}
77+
/**
78+
* Get the socket binding manager.
79+
*
80+
* @return the socket binding manger
81+
*/
82+
public SocketBindingManager getSocketBindings() {
83+
return socketBindings;
84+
}
85+
86+
/**
87+
* Get the socket address.
88+
*
89+
* @return the socket address
90+
*/
91+
public InetSocketAddress getSocketAddress() {
92+
int port = this.port;
93+
if (port > 0 && isFixedPort == false) {
94+
port += socketBindings.getPortOffset();
95+
}
96+
return new InetSocketAddress(networkInterface.getAddress(), port);
97+
}
98+
99+
/**
100+
* Get the multicast socket address.
101+
*
102+
* @return
103+
*/
104+
public InetSocketAddress getMulticastSocketAddress() {
105+
if (multicastAddress == null) {
106+
throw new IllegalStateException("no multicast binding: " + name);
107+
}
108+
return new InetSocketAddress(multicastAddress, multicastPort);
109+
}
110+
111+
/**
112+
* Create and bind a socket.
113+
*
114+
* @return the socket
115+
* @throws IOException
116+
*/
117+
public Socket createSocket() throws IOException {
118+
final Socket socket = getSocketFactory().createSocket();
119+
socket.bind(getSocketAddress());
120+
return socket;
121+
}
122+
123+
/**
124+
* Create and bind a server socket
125+
*
126+
* @return the server socket
127+
* @throws IOException
128+
*/
129+
public ServerSocket createServerSocket() throws IOException {
130+
final ServerSocket socket = getServerSocketFactory().createServerSocket();
131+
socket.bind(getSocketAddress());
132+
return socket;
133+
}
134+
135+
/**
136+
* Create and bind a server socket.
137+
*
138+
* @param backlog the backlog
139+
* @return the server socket
140+
* @throws IOException
141+
*/
142+
public ServerSocket createServerSocket(int backlog) throws IOException {
143+
final ServerSocket socket = getServerSocketFactory().createServerSocket();
144+
socket.bind(getSocketAddress(), backlog);
145+
return socket;
146+
}
147+
148+
/**
149+
* Create and bind a datagrap socket.
150+
*
151+
* @return the datagram socket
152+
* @throws SocketException
153+
*/
154+
public DatagramSocket createDatagramSocket() throws SocketException {
155+
return new ManagedDatagramSocketBinding(socketBindings, getSocketAddress());
156+
}
157+
158+
/**
159+
* Create and bind a multicast socket. This will also join the given multicast address.
160+
*
161+
* @return the multicast socket
162+
* @throws IOException
163+
*/
164+
public MulticastSocket createMulticastSocket() throws IOException {
165+
final MulticastSocket socket = new ManagedMulticastSocketBinding(socketBindings, getSocketAddress());
166+
socket.joinGroup(getMulticastSocketAddress(), networkInterface.getNetworkInterface());
167+
return socket;
168+
}
169+
170+
SocketFactory getSocketFactory() {
171+
return socketBindings.getSocketFactory();
172+
}
173+
174+
ServerSocketFactory getServerSocketFactory() {
175+
return socketBindings.getServerSocketFactory();
176+
}
177177

178178
}

domain/src/main/resources/schema/jboss_7_0.xsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
2626
xmlns="urn:jboss:domain:1.0"
2727
targetNamespace="urn:jboss:domain:1.0"
28-
elementFormDefault="qualified"
28+
elementFormDefault="unqualified"
2929
attributeFormDefault="unqualified"
3030
>
3131

messaging/.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.java ident

messaging/src/main/java/org/jboss/as/messaging/AcceptorsElement.java

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.jboss.as.messaging;
22

3+
import org.hornetq.api.core.TransportConfiguration;
34
import org.hornetq.core.config.Configuration;
45
import org.hornetq.core.config.ConnectorServiceConfiguration;
56
import org.hornetq.core.config.impl.ConfigurationImpl;
@@ -15,6 +16,7 @@
1516
import javax.xml.stream.XMLStreamException;
1617
import java.util.Collection;
1718
import java.util.List;
19+
import java.util.Set;
1820

1921
/**
2022
@@ -24,21 +26,36 @@ public class AcceptorsElement extends AbstractModelElement<AcceptorsElement> imp
2426
private static final long serialVersionUID = 1L;
2527
private static final Logger log = Logger.getLogger("org.jboss.as.messaging");
2628

27-
Configuration config = new ConfigurationImpl();
28-
29-
3029
public AcceptorsElement(final Location location) {
3130
super(location);
3231
}
3332

34-
public AcceptorsElement(final XMLExtendedStreamReader reader) throws XMLStreamException {
33+
public AcceptorsElement(final XMLExtendedStreamReader reader, Configuration config) throws XMLStreamException {
3534
super(reader);
36-
System.out.println("Begin "+reader.getLocation()+reader.getLocalName());
37-
reader.discardRemainder();
38-
}
35+
System.out.println("Begin " + reader.getLocation() + reader.getLocalName());
36+
// Handle elements
37+
int tag = reader.getEventType();
38+
String localName = null;
39+
do {
40+
tag = reader.nextTag();
41+
localName = reader.getLocalName();
42+
final org.jboss.as.messaging.Element element = org.jboss.as.messaging.Element.forName(reader.getLocalName());
43+
/*
44+
<acceptor name="netty">
45+
<factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
46+
<param key="host" value="${jboss.bind.address:localhost}"/>
47+
<param key="port" value="${hornetq.remoting.netty.port:5445}"/>
48+
</acceptor>
49+
*/
50+
switch (element) {
51+
case ACCEPTOR:
52+
String name = reader.getAttributeValue(0);
53+
TransportConfiguration acceptorConfig = ElementUtils.parseTransportConfiguration(reader, name, Element.ACCEPTOR);
54+
config.getAcceptorConfigurations().add(acceptorConfig);
55+
break;
56+
}
57+
} while (reader.hasNext() && localName.equals(Element.ACCEPTOR.getLocalName()));
3958

40-
public List<ConnectorServiceConfiguration> getConnectorServiceConfigurations() {
41-
return null; //To change body of created methods use File | Settings | File Templates.
4259
}
4360

4461
@Override
@@ -65,4 +82,5 @@ public void writeContent(XMLExtendedStreamWriter streamWriter) throws XMLStreamE
6582
public void activate(ServiceActivatorContext serviceActivatorContext) {
6683
//To change body of implemented methods use File | Settings | File Templates.
6784
}
85+
6886
}

0 commit comments

Comments
 (0)