mil.dod.th.ose.remote/src/mil/dod/th/ose/remote/osgi/EventAdminMessageService.java
private void cleanup(final TerraHarvestMessage request, final RemoteChannel channel) throws IOException
    {
        final List<Integer> registrationsToRemove = new ArrayList<Integer>();
        //clean up registrations
        for (int regId : m_Registrations.keySet())
        {
            final RemoteEventRegistration eventReg = m_Registrations.get(regId);
            if (eventReg.getSystemId() == request.getSourceId())
            {
                // only remove if request is from the same source as the previous registration
                final ServiceRegistration<EventHandler> serviceReg = eventReg.getServiceRegistration();
                serviceReg.unregister();
                registrationsToRemove.add(regId);
            }
        }
        
        // clean up map, only for those unregistered above
        for (int regId : registrationsToRemove)
        {
            m_Registrations.remove(regId);
            removePersistedRegistration(regId);
        }
        
        //construct response message
        m_MessageFactory.createEventAdminResponseMessage(request, EventAdminMessageType.CleanupResponse, null).
            queue(channel);
    }
/**
     * Method responsible for cleaning up event registrations by unregistering all event registrations.
     * @param request
     *      entire remote message for the request
     * @param channel
     *      channel to use for sending a response
     * @throws IOException 
     *      if remote message sender cannot send response message
     */
Method responsible for cleaning up event registrations by unregistering all event registrations.
@param request
entire remote message for the request
@param channel
channel to use for sending a response
@throws IOException
if remote message sender cannot send response message
Method responsible for cleaning up event registrations by unregistering all event registrations . @param request entire remote message for the request @param channel channel to use for sending a response @throws IOException if remote message sender cannot send response message
private void cleanup(final TerraHarvestMessage request, final RemoteChannel channel) throws IOException
    {
        final List<Integer> registrationsToRemove = new ArrayList<Integer>();
        for (int regId : m_Registrations.keySet())
        {
            final RemoteEventRegistration eventReg = m_Registrations.get(regId);
            if (eventReg.getSystemId() == request.getSourceId())
            {
                final ServiceRegistration<EventHandler> serviceReg = eventReg.getServiceRegistration();
                serviceReg.unregister();
                registrationsToRemove.add(regId);
            }
        }
        for (int regId : registrationsToRemove)
        {
            m_Registrations.remove(regId);
            removePersistedRegistration(regId);
        }
        m_MessageFactory.createEventAdminResponseMessage(request, EventAdminMessageType.CleanupResponse, null).
            queue(channel);
    }
private void cleanup ( final TerraHarvestMessage request , final RemoteChannel channel ) throws IOException { final List < Integer > registrationsToRemove = new ArrayList < Integer > ( ) ; for ( int regId : m_Registrations . keySet ( ) ) { final RemoteEventRegistration eventReg = m_Registrations . get ( regId ) ; if ( eventReg . getSystemId ( ) == request . getSourceId ( ) ) { final ServiceRegistration < EventHandler > serviceReg = eventReg . getServiceRegistration ( ) ; serviceReg . unregister ( ) ; registrationsToRemove . add ( regId ) ; } } for ( int regId : registrationsToRemove ) { m_Registrations . remove ( regId ) ; removePersistedRegistration ( regId ) ; } m_MessageFactory . createEventAdminResponseMessage ( request , EventAdminMessageType . CleanupResponse , null ) . queue ( channel ) ; }
Method responsible for cleaning up event registrations by unregistering all event registrations.
Method responsible for cleaning up event registrations by unregistering all event registrations .
//clean up registrations // only remove if request is from the same source as the previous registration // clean up map, only for those unregistered above //construct response message