Skip to content

Commit

Permalink
AS7-3613 fix remaining mgmt protocol uris
Browse files Browse the repository at this point in the history
  • Loading branch information
Emanuel Muckenhuber authored and bstansberry committed Feb 7, 2012
1 parent 569bf4d commit 7effc2e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Expand Up @@ -23,6 +23,7 @@
package org.jboss.as.host.controller;

import java.io.OutputStream;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.security.SecureRandom;
import java.util.Collections;
Expand All @@ -49,6 +50,7 @@
import org.jboss.as.protocol.mgmt.ManagementRequestHandler;
import org.jboss.as.protocol.mgmt.ManagementRequestHandlerFactory;
import org.jboss.as.protocol.mgmt.ManagementRequestHeader;
import org.jboss.as.protocol.mgmt.ProtocolUtils;
import org.jboss.as.server.ServerStartTask;
import org.jboss.dmr.ModelNode;
import org.jboss.marshalling.Marshaller;
Expand Down Expand Up @@ -665,7 +667,9 @@ private class ReconnectTask implements TransitionTask {
public void execute(ManagedServer server) throws Exception {
assert Thread.holdsLock(ManagedServer.this); // Call under lock
// Reconnect
processControllerClient.reconnectProcess(serverProcessName, managementSocket.getAddress().getHostName(), managementSocket.getPort(), bootConfiguration.isManagementSubsystemEndpoint(), authKey);
final String hostName = InetAddress.getByName(managementSocket.getHostName()).getHostName();
final int port = managementSocket.getPort();
processControllerClient.reconnectProcess(serverProcessName, ProtocolUtils.formatPossibleIpv6Address(hostName), port, bootConfiguration.isManagementSubsystemEndpoint(), authKey);
}
}

Expand Down
Expand Up @@ -35,6 +35,7 @@

import org.jboss.as.controller.ModelController;
import org.jboss.as.process.protocol.StreamUtils;
import org.jboss.as.protocol.mgmt.ProtocolUtils;
import org.jboss.as.remoting.EndpointService;
import org.jboss.as.remoting.RemotingServices;
import org.jboss.as.remoting.management.ManagementRemotingServices;
Expand Down Expand Up @@ -140,7 +141,7 @@ public void activate(final ServiceActivatorContext serviceActivatorContext) {
for (;;) try {
String hostName = StreamUtils.readUTFZBytes(initialInput);
int port = StreamUtils.readInt(initialInput);
// TODO remove managementSubsystemEndpoint !?
// TODO remove managementSubsystemEndpoint ?
// This property does not make sense on reconnect, since there can't be any configuration changes
// while the channel is down. Other changes are either applied to the runtime directly or require a restart.
boolean managementSubsystemEndpoint = StreamUtils.readBoolean(initialInput);
Expand Down Expand Up @@ -173,7 +174,6 @@ public void activate(final ServiceActivatorContext serviceActivatorContext) {
private static void addCommunicationServices(final ServiceTarget serviceTarget, final String serverName, final String serverProcessName, final byte[] authKey,
final InetSocketAddress managementSocket, final boolean managementSubsystemEndpoint, final boolean isReconnect) {


final ServiceName endpointName;
if (!managementSubsystemEndpoint) {
endpointName = ManagementRemotingServices.MANAGEMENT_ENDPOINT;
Expand All @@ -187,7 +187,7 @@ private static void addCommunicationServices(final ServiceTarget serviceTarget,

try {
final int port = managementSocket.getPort();
final String host = InetAddress.getByName(managementSocket.getHostName()).getHostName();
final String host = ProtocolUtils.formatPossibleIpv6Address(InetAddress.getByName(managementSocket.getHostName()).getHostName());
final HostControllerServerClient client = new HostControllerServerClient(serverName, serverProcessName, host, port, authKey);
serviceTarget.addService(HostControllerServerClient.SERVICE_NAME, client)
.addDependency(endpointName, Endpoint.class, client.getEndpointInjector())
Expand Down

0 comments on commit 7effc2e

Please sign in to comment.