Bundle Loading/Unloading at runtime

  • Hi All,

      We are developing an application that has to run on both Tiger and
    the Leopard.  The application has quite a few Cocoa bundles ,each
    representing a separate service.
    We have reasons to believe that the services that the bundles support
    will undergo constant update.  Hence we have a need to update the
    bundles frequently through  software update.
    We want this update to take effect while the application is running.

    However in terms of loading and unloading the bundles at run time, we
    would like to have the following behavior:

    1. We identify the bundle that is not busy and unload it.
    2. We block all further calls to the bundle
    3. We download the latest bundle
    3. We load the new bundle in the place of the old one
    4. All this happening in the background when the application is
    running .
    5. This is repeated for each of the bundle

    The bundles contain mostly Objective-C code. We know that a Cocoa
    loadable bundle cannot be unloaded (the documentation under "CFBundle
    and NSBundle" talks about it) . This we believe is the crux of the
    problem.  We tried in vain to
    move the Objective-C code to a carbon bundle and then use the CFBundle
    calls to load/unload the bundle . We create an Cocoa object through a
    function exported from the bundle and proceed
    to access the services of the other Cocoa classes through this  .  We
    are facing random crashes even in this method. This might be due to
    the issue of the CFBundle being unable to
    load and register all the Cocoa classes.

    The harder option is to rewrite the bundle code in C++ and using
    CoreFoundation classes. However, we would like to keep this as the
    last option.

    Can you provide us with any inputs into how we could go about solving
    the issue?

    Thank you.

    Regards,
    Rahul.

    -----------------------------------------------
    Robosoft Technologies - Come home to Technology

    Disclaimer: This email may contain confidential material. If you were not an intended recipient, please notify the sender and delete all copies. Emails to and from our network may be logged and monitored. This email and its attachments are scanned for virus by our scanners and are believed to be safe. However, no warranty is given that this email is free of malicious content or virus.
  • Le 4 janv. 08 à 17:19, Rahul Shetty a écrit :

    > Hi All,
    >
    > We are developing an application that has to run on both Tiger and
    > the Leopard.  The application has quite a few Cocoa bundles ,each
    > representing a separate service.
    > We have reasons to believe that the services that the bundles
    > support will undergo constant update.  Hence we have a need to
    > update the bundles frequently through  software update.
    > We want this update to take effect while the application is running.
    >
    >
    > However in terms of loading and unloading the bundles at run time,
    > we would like to have the following behavior:
    >
    > 1. We identify the bundle that is not busy and unload it.
    > 2. We block all further calls to the bundle
    > 3. We download the latest bundle
    > 3. We load the new bundle in the place of the old one
    > 4. All this happening in the background when the application is
    > running .
    > 5. This is repeated for each of the bundle
    >
    > The bundles contain mostly Objective-C code. We know that a Cocoa
    > loadable bundle cannot be unloaded (the documentation under
    > "CFBundle and NSBundle" talks about it) . This we believe is the
    > crux of the problem.  We tried in vain to
    > move the Objective-C code to a carbon bundle and then use the
    > CFBundle calls to load/unload the bundle .

    I think you do not understand what Carbon Bundle and Cocoa Bundle means.
    There is no differences between Cocoa and Carbon bundles. The term
    "Cocoa Bundle" is generally used for a bundles linked on Cocoa and
    "Carbon Bundle" for bundles linked on Carbon, but they really are the
    same thing.

    AFAK, a bundle that uses obj-c cannot be unload (prior to 10.5)
    because the obj-c runtime do not support it. So you cannot use obj-c
    in a bundle that have to be unloaded (and that must support Mac OS
    10.4).

    > We create an Cocoa object through a function exported from the
    > bundle and proceed
    > to access the services of the other Cocoa classes through this  .
    > We are facing random crashes even in this method. This might be due
    > to the issue of the CFBundle being unable to
    > load and register all the Cocoa classes.
    >
    > The harder option is to rewrite the bundle code in C++ and using
    > CoreFoundation classes. However, we would like to keep this as the
    > last option.
    >
    > Can you provide us with any inputs into how we could go about
    > solving the issue?
    >
    > Thank you.
    >
    > Regards,
    > Rahul.
    >
    >
    >
previous month january 2008 next month
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Go to today