How can I do something at exit ?

Hi everyone,
In C, we can do something at program exit with exit handler (atexit() function).
In our Java application, we use JNI to invoke a native c function. In the C
function, we attach an exit handler, then call a Java method through JNI.
And, the System.exit() method is called in the java method called from C native function.
In the case, we expect that the thread is terminated because of System.exit()
and the exit handler ,which has been attached in C native code, do something.
However, we can't see anything to be done by the exit handler.
How can I do something at the exit in Java method called in a native C function?
Thanks in advance

Sorry....
In the Runtime Class:
Runtime.addShutdownHook(Thread hook)

Similar Messages

  • How can i transfer something from my iphone to my ipad using bluethooth??

    how can i transfer something from my iphone to my ipad using bluethooth??

    You can use iTransfer.
    https://itunes.apple.com/sg/app/itransfer-share-files-ease/id480195086?mt=8

  • How can I remove something from my iTunes download list permanently?

    Same as title: how can I remove something from my download list FOREVA! Why would I want to do this? Because it's a piece of poo free sampler from Best Buy that is effing huge, and terrible and I don't want it, ever (it's been stuck to my list since 08, and it must die). Every time I buy something I have to remember to go and remove that from my list, otherwise iTunes gets caught up downloading that thing, which is many times larger than any video/cd/app that I have ever downloaded on iTunes before. It wouldn't be as much an issue if I had a good ISP but I don't, so any non-apple employee people giving some smarmy "get better internets" advice need not apply.

    Once an item enters the download queue, the user cannot remove it. Either let it complete the download (easiest) or contact the iTunes Store customer support department through the Contact page and ask them if they'll remove the item(s) from your queue for you.

  • How can i remove something from the favourite in finder?

    how can i remove something from the favourite in finder?

    previously you solved my problem but this time my preferneces>side bar is not displaying the item which i want to remove

  • HT201343 When I mirror my macbook pro to my apple tv the only thing that shows up is one video that's on my desktop.  How can I watch something that's online on my laptop, on my apple tv?

    When I mirror my macbook pro to my apple tv the only thing that shows up is one video that's on my desktop.  How can I watch something that's online on my laptop, on my apple tv?

    Are you using mirroring or using airplay within iTunes? If you are truly mirroring then you can view anything that is displayed on your computer through Apple Tv
    Or provide more info on your issue

  • HT5887 How can I find something I airdropped to someone vis email. I cannot find it in my email

    How can I find something I airdropped to another via email. I cannot find it in my email box?

    I thought AirDrop uses Bluetooth.

  • The create facility in iPhoto is very basic - how can I download something like MS Publisher for my Mac Air?

    The create facility in iPhoto is pretty basic for cards & books etc. - how can I download something like MS Publisher for my Mac Air?

    Pages works pretty well, which should be on the App store:
    http://www.apple.com/iwork/pages/

  • How can I find the USer Exit...

    Hi,
    How can I find the USer Exit...
    I need to do changes for this User Exit :EXIT_SAPLKEII_002
    In which T-code I can open this Exit
    Ex: Go to some Transcation code and then give the name of the Exit ato access this Exit
    ...any sugesstions will be apprecaited!
    Thanks & Regards,
    Kittu

    Hi,
        the EXIT : EXIT_SAPLKEII_002 is the exit,in this SAPLKEII is the standard Program.Copy this program and go to transactio SE38 and press Enter and then go for the option Where used list and check the check box Transaction. It displays the possible Transactions that the Exit triggers
    Regards,
    Vijaya Lakshmi.T

  • HT4352 how can i watch something i've downloaded on Apple tv on my laptop?

    how can i watch something i've downloaded on Apple tv on my laptop?

    If it's a purchase then you would need to download it to your laptop by visiting the iTunes store - purchased (under quick links).
    If it's a rental it will only be viewable on the Apple TV.

  • How can I put something in for the last Wednesday of every month

    How can I put something in for the last Wednesday of every month

    I don't believe there is such a custom repeat option with the iPhone's Calendar app, but if you are syncing calendar events with a supported calendar app on your computer or syncing calendar events over the air with an email account that supports it with an option to create such a custom repeating event with the online calendar, set up the custom repeating event there.

  • How can I recover something I put in trash accidentally?

    How can I recover something I put in trash accidentally?

    DriveSavers Data Recovery | Service Plans
    Recover iPod - iPod Data Recovery Software for Windows & Mac OS X
    not cheap or may not be possible

  • How Can I Create Something In This Style?

    HI guys, I am currently working on graphics for a mobile game I am making. I have some skill in vector, mostly through Inkscape, but I am trying to use Illustrator more. The thing is despite what program I use I can't figure out how to create something in the style I desire. I would like it to look something like this...
    I can create the vector objects, like the saws,door, and chest pretty well, It is just the background and foreground in which I am lost. I notice they have a texture to them, with various colors, and almost a hand drawn look. Can this be accomplished in Illustrator, or will I need to use Photoshop? If so, how can I go about getting something similar to this. Are there any tutorials for work in this style, because I haven't been able to find any? Any information would be great. Even if their are any vector tutorials in this cartoon style, that would be nice too,since I can always improve. Thanks in advance!

    There are many ways you can achieve this effect you just need to learn.
    Here are some useful links for you to teach yourself some trick and effects:
    Tutorials - Adobe Illustrator - Digital Arts (lots of useful tutorials for adding textures & effects!)
    How to Create a Cartoon House in Illustrator - Illustrator Tutorials - Vectorboom
    Hope these help you achieve what you want.

  • How can i bind something to caps lock in AwesomeWM?

    Recently i've aquired new notebook which doesn't have caps_lock, num_lock and scroll_lock LEDs, so i decided to put keyboard layout indicator to system tray.
    Currently i am using Xorg config to set XkbLayout and XkbOptions (like so http://paste.pocoo.org/show/478789/ ).
    I tried first widget from http://awesome.naquadah.org/wiki/Change_keyboard_maps but soon realized that it does not detect layout change in any way, so i would like to bind kbdcfg.switch function to caps_lock, but i can't find any documentation on binding something to caps_lock.
    Also i've noticed a strange thing, when i change my layout with this function i am unable to use shortcuts that use latin letters. They are obviously remapped to by сyrillic, but they do work if i change my layout with caps_toggle. Why do the work with caps_toggle, and how can i make them work with kbdcfg.switch?

    blin wrote:
    filam wrote:Is there a reason you're not using xmodmap? You may also want to read the Extra Keyboard Keys in Xorg article.
    The only reason i have for not using xmodmap is, i don't understand how it can help me, with the task i have. The other article didn't help me either.
    Did you read the "How to find capslock status?" thread?
    blin wrote:Is suspect the answer is not what you want because your question is not very clear. I understand that you have a keyboard that is lacking certain keys. What is it that you want to achieve? Let some key act as capslock?
    I had to read the OP twice to understand it. I didn't notice that he wrote "LED" in the first sentence. What he wants is for his Awesome status bar to display the current activity (i.e. on/off) of the Caps Lock, Num Lock and Scroll Lock keys. He does not need to remap any keys.
    Edit: Check Retrieving CAPS LOCK info using Xlib or just do a Google search for "linux caps lock status -map -disable".
    Last edited by filam (2011-09-20 19:43:45)

  • How can i remove Go and Exit buttons as well as Advanced text from OVS help

    Hi Gurus,
    Once i have impleted OVS code in my webdynpro, i am able to see Go and Exit buttons as well as Advanced Search Text, but i do not want see buttons and Text in my screen, How can i remove the same?
    Thanks
    Venkat.

    Hi Venkat,
    Create a context attribute say Va_Attr1 in the parent view, popup view and component controller. Map both the context in 2views to the component controller. So, the context variable which is bound to input field is passed via component controller to popup view and is stored in there as context attribute.
    Now, you can just get the context attribute value set in the input field in parent view and use it for search in popup view.
    In order, to have tables with multi-selection. Goto table properties and in selectionMode, set multiNoLead instead of auto.
    Then in the wdDoInit() of popup view put,
    wdContext.node<Table>().setLeadSelection(-1);
    Loop through the table node and find out at what all index rows are selected for table using
    int count=0;
    String s = "";
    for(int i1=0; i1<wdContext.node<Table>().size();i++){
       if(wdContext.node<Table>().isMultiSelected(i1)==true){
        count = count+ 1;
        s=s+ i1;
    count will give you no. of rows selected which would be equal to s.length.
    s.CharAt(0) will give the first row selected and similarly
    s.CharAt(n) will give the nth row selected
    Using Integer.parseInt(s.CharAt(n)) will give you back the index int type where s.length will give No. of rows selected.
    For rows which are selected append the text values of all those separated by ";" using
    StringBuffer strBf = new StringBuffer();
    for(int i=0; i< <No. of rows selected>; i++){
    if(i=0){
    strBf.append(wdContext.node<Table>().get<Table>ElementAt(Integer.parseInt(s.CharAt(i))).get<Text>());
    }else{
    strBf.append(";" + wdContext.node<Table>().get<Table>ElementAt(Integer.parseInt(s.CharAt(i))).get<Text>());
    Finally when 1 or more row is selected and needs to be populated in the input field then set in the context attribute which will pass the value through context mapping using
    wdContext.currentContextElement().setVa_Attr(strBf.toString);
    Regards,
    Tushar Sinha

  • How can we fnd wich user exit yo use for

    hi ABAP masters
    how can we find out which user exit to use or a particular requirment.

    Hello Devender,
    The procedure followed is usually by reading the documentation
    eg: consider a user exit or BADI definition
    We get a hint from the text of the same...if not we refer the documentation given
    if documentation is not available we check the signature of the enhancement i.e, which all fields are importing,exporting,which tables can be changed which cannot ....etc
    Finally ,if none works out we do what abapers do best
    Put a break point and see if it works or in case of BADI ,create a test implementation and see if it works out..
    so here is the summary
    Check description ->  Check documentation  -> Check signatures -> debugg/Trial and error
    Hope it helped you out
    Regards
    Byju

Maybe you are looking for