SasServer server = (SasServer) serverRef.get();
server.providerConnected(sender, clientID);
} else if (message instanceof SasProviderLaunchStatusMessage) {
SasProviderLaunchStatusMessage msg = (SasProviderLaunchStatusMessage) message;
SasProviderLaunchStatusMessage.LaunchStatus status = msg.getStatus();
MessageID launchMsgID = msg.getLaunchMessageID();
String connInfo = msg.getConnectionInfo();
logger.info("ProviderConnectionHandler: Launch status message received");
logger.info("status = " + status);
logger.info("launchMsgID = " + launchMsgID);
logger.info("connInfo = " + connInfo);
ProviderMessagesInFlight messagesInFlight = getProviderMessagesInFlight();
ProviderMessagesInFlight.MessageInfo msgInfo = messagesInFlight.getMessageInfo(launchMsgID);
if (msgInfo == null || msgInfo.providerRef == null) {
logger.warning("Cannot find provider proxy for message " + launchMsgID);
return;
}
messagesInFlight.removeMessageInfo(launchMsgID);
// If app launch succeeded, transition the app to the running apps list. It will
// stay there until the app exits or the provider disconnects
if (status == SasProviderLaunchStatusMessage.LaunchStatus.SUCCESS) {
getRunningApps().addAppInfo(launchMsgID, msgInfo.providerRef, msgInfo.cellID);
}
ProviderProxy provider = (ProviderProxy) msgInfo.providerRef.get();
provider.appLaunchResult(status, msgInfo.cellID, connInfo);
} else if (message instanceof SasProviderAppExittedMessage) {
SasProviderAppExittedMessage msg = (SasProviderAppExittedMessage) message;
MessageID launchMsgID = msg.getLaunchMessageID();
int exitValue = msg.getExitValue();
RunningAppInfo.AppInfo appInfo = getRunningApps().getAppInfo(launchMsgID);
if (appInfo != null) {
getRunningApps().removeAppInfo(launchMsgID);