mil.dod.th.ose.remote.integration/src/mil/dod/th/ose/remote/integration/BundleNamespaceUtils.java
public static void startBundle(final long bundleId, final Socket socket) throws IOException, InterruptedException
    {
        final MessageListener listener = new MessageListener(socket);
                
        //register for the bundle started event
        final int regId = 
                RemoteEventRegistration.regRemoteEventMessages(socket, OSGiEventConstants.TOPIC_BUNDLE_STARTED);
        
        try
        {
            StartRequestData request = StartRequestData.newBuilder().setBundleId(bundleId).build();
            TerraHarvestMessage message = createBundleMessage(request, BundleMessageType.StartRequest);

            // send message
            message.writeDelimitedTo(socket.getOutputStream());

            listener.waitForMessages(1800, new MessageMatchers.BasicMessageMatcher(Namespace.Bundle,
                    BundleMessageType.StartResponse), new MessageMatchers.EventMessageMatcher(
                            OSGiEventConstants.TOPIC_BUNDLE_STARTED));
        }
        finally
        {
            MessageListener.unregisterEvent(regId, socket);
        }
    }
/**
     * Start a bundle with the given bundle ID.
     * @param bundleId
     *      start the bundle with the given ID
     * @param socket
     *      the socket to use for communication to the controller
     */
Start a bundle with the given bundle ID.
@param bundleId
start the bundle with the given ID
@param socket
the socket to use for communication to the controller
Start a bundle with the given bundle ID . @param bundleId start the bundle with the given ID @param socket the socket to use for communication to the controller
public static void startBundle(final long bundleId, final Socket socket) throws IOException, InterruptedException
    {
        final MessageListener listener = new MessageListener(socket);
        final int regId = 
                RemoteEventRegistration.regRemoteEventMessages(socket, OSGiEventConstants.TOPIC_BUNDLE_STARTED);
        try
        {
            StartRequestData request = StartRequestData.newBuilder().setBundleId(bundleId).build();
            TerraHarvestMessage message = createBundleMessage(request, BundleMessageType.StartRequest);
            message.writeDelimitedTo(socket.getOutputStream());
            listener.waitForMessages(1800, new MessageMatchers.BasicMessageMatcher(Namespace.Bundle,
                    BundleMessageType.StartResponse), new MessageMatchers.EventMessageMatcher(
                            OSGiEventConstants.TOPIC_BUNDLE_STARTED));
        }
        finally
        {
            MessageListener.unregisterEvent(regId, socket);
        }
    }
public static void startBundle ( final long bundleId , final Socket socket ) throws IOException , InterruptedException { final MessageListener listener = new MessageListener ( socket ) ; final int regId = RemoteEventRegistration . regRemoteEventMessages ( socket , OSGiEventConstants . TOPIC_BUNDLE_STARTED ) ; try { StartRequestData request = StartRequestData . newBuilder ( ) . setBundleId ( bundleId ) . build ( ) ; TerraHarvestMessage message = createBundleMessage ( request , BundleMessageType . StartRequest ) ; message . writeDelimitedTo ( socket . getOutputStream ( ) ) ; listener . waitForMessages ( 1800 , new MessageMatchers . BasicMessageMatcher ( Namespace . Bundle , BundleMessageType . StartResponse ) , new MessageMatchers . EventMessageMatcher ( OSGiEventConstants . TOPIC_BUNDLE_STARTED ) ) ; } finally { MessageListener . unregisterEvent ( regId , socket ) ; } }
Start a bundle with the given bundle ID.
Start a bundle with the given bundle ID .
//register for the bundle started event // send message