Package org.jdesktop.wonderland.common.messages

Examples of org.jdesktop.wonderland.common.messages.MessageID


            CellMO cellMO = getCell();
            CellServerState cellSetup = cellMO.getServerState(null);

            // Formulate a response message, fill in the cell setup, and return
            // to the client.
            MessageID messageID = message.getMessageID();
            CellServerStateResponseMessage response = new CellServerStateResponseMessage(messageID, cellSetup);
            sender.send(clientID, response);
        }
View Full Code Here


            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);
View Full Code Here

    // Given an an app identified by a provider and a cell, returns the launch message ID
    // for that app. TODO: someday: assumes only one app launched per cell.
    static MessageID getLaunchMessageIDForCellAndProvider (ManagedReference providerRef, CellID cellID) {

        // First check the running app list
        MessageID msgID = getRunningApps().getLaunchMessageIDForCellAndProvider(providerRef, cellID);
        if (msgID != null) return msgID;

        // Then check the list of launch messages in flight
        msgID = getProviderMessagesInFlight().getLaunchMessageIDForCellAndProvider(providerRef, cellID);
        if (msgID != null) return msgID;
View Full Code Here

     */
    public void appStop (CellID cellID) {

        // Get the launch message ID which will identify the app to the provider
        ManagedReference thisRef = AppContext.getDataManager().createReference(this);
        MessageID launchMessageID = SasProviderConnectionHandler.getLaunchMessageIDForCellAndProvider(
                                                                      thisRef, cellID);

        // Send a stop message to the provider
        if (launchMessageID != null) {
            SasProviderAppStopMessage msg = new SasProviderAppStopMessage(launchMessageID);
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.common.messages.MessageID

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.