use of io.fabric8.openclustermanagement.api.model.multicloudoperatorschannel.apps.v1.Channel in project fabric8-maven-plugin by fabric8io.
the class SpringBootWatcher method watch.
@Override
public void watch(List<ImageConfiguration> configs, Set<HasMetadata> resources, PlatformMode mode) throws Exception {
KubernetesClient kubernetes = getContext().getKubernetesClient();
PodLogService.PodLogServiceContext logContext = new PodLogService.PodLogServiceContext.Builder().log(log).newPodLog(getContext().getNewPodLogger()).oldPodLog(getContext().getOldPodLogger()).build();
new PodLogService(logContext).tailAppPodsLogs(kubernetes, getContext().getClusterConfiguration().getNamespace(), resources, false, null, true, null, false);
String url = getServiceExposeUrl(kubernetes, resources);
if (url == null) {
url = getPortForwardUrl(resources);
}
if (url != null) {
runRemoteSpringApplication(url);
} else {
throw new IllegalStateException("Unable to open a channel to the remote pod.");
}
}
use of io.fabric8.openclustermanagement.api.model.multicloudoperatorschannel.apps.v1.Channel in project wildfly-core by wildfly.
the class JConsoleCLIPlugin method connectUsingRemoting.
private boolean connectUsingRemoting(CommandContext cmdCtx, RemotingMBeanServerConnection rmtMBeanSvrConn) throws IOException, CliInitializationException {
Connection conn = rmtMBeanSvrConn.getConnection();
Channel channel;
final IoFuture<Channel> futureChannel = conn.openChannel("management", OptionMap.EMPTY);
IoFuture.Status result = futureChannel.await(5, TimeUnit.SECONDS);
if (result == IoFuture.Status.DONE) {
channel = futureChannel.get();
} else {
futureChannel.cancel();
return false;
}
ModelControllerClient modelCtlrClient = ExistingChannelModelControllerClient.createReceiving(channel, createExecutor());
cmdCtx.bindClient(modelCtlrClient);
return true;
}
use of io.fabric8.openclustermanagement.api.model.multicloudoperatorschannel.apps.v1.Channel in project wildfly-core by wildfly.
the class ServerInventoryImpl method serverCommunicationRegistered.
@Override
public ProxyController serverCommunicationRegistered(final String serverProcessName, final ManagementChannelHandler channelAssociation) {
if (shutdown || connectionFinished) {
throw HostControllerLogger.ROOT_LOGGER.hostAlreadyShutdown();
}
final String serverName = ManagedServer.getServerName(serverProcessName);
final ManagedServer server = servers.get(serverName);
if (server == null) {
ROOT_LOGGER.noServerAvailable(serverName);
return null;
}
try {
final TransactionalProtocolClient client = server.channelRegistered(channelAssociation);
final Channel channel = channelAssociation.getChannel();
channel.addCloseHandler(new CloseHandler<Channel>() {
public void handleClose(final Channel closed, final IOException exception) {
final boolean shuttingDown = shutdown || connectionFinished;
// Unregister right away
if (server.callbackUnregistered(client, shuttingDown)) {
domainController.unregisterRunningServer(server.getServerName());
}
}
});
return server.getProxyController();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
use of io.fabric8.openclustermanagement.api.model.multicloudoperatorschannel.apps.v1.Channel in project wildfly-core by wildfly.
the class RemoteDomainConnection method connectionOpened.
@Override
public void connectionOpened(final Connection connection) throws IOException {
final Channel channel = openChannel(connection, CHANNEL_SERVICE_TYPE, configuration.getOptionMap());
if (setChannel(channel)) {
channel.receiveMessage(channelHandler.getReceiver());
channel.addCloseHandler(channelHandler);
try {
if (runningMode == RunningMode.ADMIN_ONLY) {
// Fetch the domain configuration
channelHandler.executeRequest(new FetchDomainConfigurationRequest(), null).getResult().get();
} else {
// Start the registration process
channelHandler.executeRequest(new RegisterHostControllerRequest(), null).getResult().get();
}
} catch (Exception e) {
if (e.getCause() instanceof IOException) {
throw (IOException) e.getCause();
}
throw new IOException(e);
}
// Registered
registered();
} else {
channel.closeAsync();
}
}
use of io.fabric8.openclustermanagement.api.model.multicloudoperatorschannel.apps.v1.Channel in project wildfly-core by wildfly.
the class HostControllerConnection method connectionOpened.
@Override
public void connectionOpened(final Connection connection) throws IOException {
final Channel channel = openChannel(connection, SERVER_CHANNEL_TYPE, configuration.getOptionMap());
if (setChannel(channel)) {
channel.receiveMessage(channelHandler.getReceiver());
channel.addCloseHandler(channelHandler);
} else {
channel.closeAsync();
}
}
Aggregations