mil.dod.th.ose.remote/src/mil/dod/th/ose/remote/mp/MissionProgrammingMessageService.java
private Message execute(final TerraHarvestMessage message, final MissionProgrammingNamespace missionMessage,
            final RemoteChannel channel) throws IOException
    {
        //parse the request message
        final ExecuteRequestData request = ExecuteRequestData.parseFrom(missionMessage.getData());
        
        //get the program name
        final String programName = request.getMissionName();
        
        //get the program
        final Program program = m_Manager.getProgram(programName);
        
        //try to execute the program, happens on a different thread
        try
        {
            program.execute();
        }
        catch (final IllegalStateException e)
        {
            m_MessageFactory.createBaseErrorMessage(message, ErrorCode.INTERNAL_ERROR,
                    e.getMessage()).queue(channel);
            m_Logging.error(e, "Remote mission shutdown error.");
            return request;
        }
        catch (final MissionProgramException e)
        { 
            throw new IllegalStateException(e);
        }
        
        final ExecuteResponseData response = ExecuteResponseData.newBuilder().setMissionName(programName).build();
        m_MessageFactory.createMissionProgrammingResponseMessage(
                message, MissionProgrammingMessageType.ExecuteResponse, response).queue(channel);
        return request;
    }
/**
     * Handle the request to execute a mission program.
     * @param message
     *     original request message that contains all information needed to complete the request
     * @param missionMessage
     *     the mission program message that contains data about what program to execute
     * @param channel
     *     the channel from which the request was received
     * @return
     *     the parsed data message
     * @throws IOException
     *     thrown in the event that an error is experienced while attempting to send the response message 
     */
Handle the request to execute a mission program.
Handle the request to execute a mission program .
private Message execute(final TerraHarvestMessage message, final MissionProgrammingNamespace missionMessage,
            final RemoteChannel channel) throws IOException
    {
        final ExecuteRequestData request = ExecuteRequestData.parseFrom(missionMessage.getData());
        final String programName = request.getMissionName();
        final Program program = m_Manager.getProgram(programName);
        try
        {
            program.execute();
        }
        catch (final IllegalStateException e)
        {
            m_MessageFactory.createBaseErrorMessage(message, ErrorCode.INTERNAL_ERROR,
                    e.getMessage()).queue(channel);
            m_Logging.error(e, "Remote mission shutdown error.");
            return request;
        }
        catch (final MissionProgramException e)
        { 
            throw new IllegalStateException(e);
        }
        final ExecuteResponseData response = ExecuteResponseData.newBuilder().setMissionName(programName).build();
        m_MessageFactory.createMissionProgrammingResponseMessage(
                message, MissionProgrammingMessageType.ExecuteResponse, response).queue(channel);
        return request;
    }
private Message execute ( final TerraHarvestMessage message , final MissionProgrammingNamespace missionMessage , final RemoteChannel channel ) throws IOException { final ExecuteRequestData request = ExecuteRequestData . parseFrom ( missionMessage . getData ( ) ) ; final String programName = request . getMissionName ( ) ; final Program program = m_Manager . getProgram ( programName ) ; try { program . execute ( ) ; } catch ( final IllegalStateException e ) { m_MessageFactory . createBaseErrorMessage ( message , ErrorCode . INTERNAL_ERROR , e . getMessage ( ) ) . queue ( channel ) ; m_Logging . error ( e , "Remote mission shutdown error." ) ; return request ; } catch ( final MissionProgramException e ) { throw new IllegalStateException ( e ) ; } final ExecuteResponseData response = ExecuteResponseData . newBuilder ( ) . setMissionName ( programName ) . build ( ) ; m_MessageFactory . createMissionProgrammingResponseMessage ( message , MissionProgrammingMessageType . ExecuteResponse , response ) . queue ( channel ) ; return request ; }
Handle the request to execute a mission program.
Handle the request to execute a mission program .
//parse the request message //get the program name //get the program //try to execute the program, happens on a different thread