ThreadReaper object used with finalizer rather than finalizer on Timer?

Timer class has threadReaper object used with finalizer rather than finalizer on Timer itself, can anyone explain the following snippet. what is the advantage of keeping the finalize in its references rathe rthan in the original object itself.
     * This object causes the timer's task execution thread to exit
     * gracefully when there are no live references to the Timer object and no
     * tasks in the timer queue.  It is used in preference to a finalizer on
     * Timer as such a finalizer would be susceptible to a subclass's
     * finalizer forgetting to call it.
    private Object threadReaper = new Object() {
        protected void finalize() throws Throwable {
            synchronized(queue) {
                thread.newTasksMayBeScheduled = false;
                queue.notify(); // In case queue is empty.
    };

skakita wrote:
Now I am getting something. If some-one subclass the Timer class and they forgot to call the finalize on the Timer... So they have done in this way. Thank u kayaman.Just in case you're interested, that pattern is called a 'finalizer guardian'. You may find it on Google.
Winston

Similar Messages

  • How can I use the database default time rather than Java supplied time

    I've searched over and over and nobody seems to have this issue so maybe its just me!
    When inserting a record I would like the a create_date column to automatically use the database time rather than a supplied time via JPA. That was all times a relative to the database which makes sense.
    The trouble is I cant figure out how to do this in a sensible manor.
    If I specify an column like :
         @Temporal(TemporalType.TIMESTAMP)
         @Column(name = "CREATE_DATE")
         private Date createDate;
    and IDL
    CREATE_DATE TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_DATE NOT NULL
    If I leave createDate null I get an exception. If modify the column to allow Nullable then column is set as Null.
    If I leave the column out of the entity bean and then and create a row then the database current time is inserted. The trouble then is that if I want to read the date I'm going to have to create a copy of the bean but with the CREATE_DATE in it, and this doesn't make sense.

    I should also mention that TopLink has always supported the ability to retrieve the current time from the database for use in optimistic locking. The TimestampLockingPolicy offers the ability to configure the next value being retrieved from the database instead of using the local time from the JVM. Our extended optimistic locking configuration does not currently support setting this option but it could be done using a descriptor customizer which can be configured in your persistence unit properties.
    Using optimistic locking may be a good solution for the last modified date since it will also ensure that you do not corrupt the database if someone else has incremented this value since your last read.
    Doug

  • How to set iPhoto to use yahoo webmail rather than mail.app

    When emailing from within iPhoto using the email icon or via the share menu option in the task bar, mail.app launches. I prefer to use (Yahoo) webmail, rather than use an email client, so how do I change this setting?
    Thx in advance.

    Mansel
    Simply: you can’t, I’m afraid. This feature requires an E-Mail Client that supports Apple Script. Yahoo Mail is a service (not an client) that’s accessed via a Web Browser and it’s not Apple Scriptable.
    FYI:
    There are many, many ways to access your files in iPhoto:
    *For Users of 10.5 Only*
    You can use any Open / Attach / Browse dialogue. On the left there's a Media heading, your pics can be accessed there. Apple-Click for selecting multiple pics.
    Uploaded with plasq's Skitch!
    You can access the Library from the New Message Window in Mail:
    Uploaded with plasq's Skitch!
    *For users of 10.4 and 10.5* ...
    Many internet sites such as Flickr and SmugMug have plug-ins for accessing the iPhoto Library. If the site you want to use doesn’t then some, one or any of these will also work:
    To upload to a site that does not have an iPhoto Export Plug-in the recommended way is to Select the Pic in the iPhoto Window and go File -> Export and export the pic to the desktop, then upload from there. After the upload you can trash the pic on the desktop. It's only a copy and your original is safe in iPhoto.
    This is also true for emailing with Web-based services. However, if you're using Gmail you can use iPhoto2GMail
    If you use Apple's Mail, Entourage, AOL or Eudora you can email from within iPhoto.
    If you use a Cocoa-based Browser such as Safari, you can drag the pics from the iPhoto Window to the Attach window in the browser.
    *If you want to access the files with iPhoto not running*:
    Create a Media Browser using Automator (takes about 10 seconds) or use this free utility Karelia iMedia Browser
    Other options include:
    1. *Drag and Drop*: Drag a photo from the iPhoto Window to the desktop, there iPhoto will make a full-sized copy of the pic.
    2. *File -> Export*: Select the files in the iPhoto Window and go File -> Export. The dialogue will give you various options, including altering the format, naming the files and changing the size. Again, producing a copy.
    3. *Show File*: Right- (or Control-) Click on a pic and in the resulting dialogue choose 'Show File'. A Finder window will pop open with the file already selected.
    Regards
    TD

  • Can iWeb publish with JPEGS rather than PNG?

    Is there any way to make iWeb use only jpegs rather than PNG files when publishing? Also, I think a picture quality slider would be helpfull for compression and site size management... thanks

    You can minimize the chances of iWeb converting your jpgs into PNGs if you pay attention to the following things...
    1. Scale your jpgs to the resolution they are to be used...don't let iWeb do the scaling if possible (like dropping a photo in and then adjusting the size handles). Target your resolution and then drop the photo in and select "Use Original Size" in the Inspector Shape tab.
    2. Do not apply effects to your jpgs....if you do, iWeb will automatically convert to PNG and the file size will be even bigger! These effects include drop shadows, rotation, frames, opacity changes, etc.
    3. Be aware that in some templates, dropping a photo into iWeb automatically applies frames, drop shadows, and/or reflections. You can deselect these enhancements in the Inspector panel after dropping the photos in. If you don't, iWeb will convert to PNG.
    4. Do not use the "Use image as background" option. Better to drag an exactly sized jpg photo into iWeb and push it to the very back layer than to use this option.
    You are right, iWeb or at least iPhoto needs to have some sort of user control over jpg compression. I use another app for this purpose called "Downsize". On the plus side, it also lets me apply shadows and frames to photos and saves the finished image with effects and all as a jpg.

  • HT4863 Can I use g-mail rather than outlook?

    Can I use g-mail rather than outlook with icloud?

    Welcome to the Apple Support Communities
    Outlook is a mail program, and Gmail is a mail service. You can't use an iCloud mail with Gmail because Gmail can only be used with Google mail. If you don't want to use Outlook, you can set up your iCloud mail using this information > http://support.apple.com/kb/HT4864?viewlocale=en_US
    Also, you can access to your iCloud email on http://www.icloud.com

  • How can i move songs to my playlists using my iphone rather than computer?

    How can I move songs to my playlist using my iphone rather than my computer?

    @allamb & stephanW
    I found this thread via a search, I have a new iphone 5 (also i am completely new to iphone, having been the last few years on android) and i have spent 20 minutes trying to figure out how to add a song to a playlist.
    You see i sit a work and listen to dozens of tunes, and i want to add a paticular song to a particular play list, and low and behold I can't, excuse my special characters but "What the f#%k itunes/apple??? - how can this be? Such a commonly needed function and for itunes to be the number music player in the world not to have this feature is ludicrus.
    I am lucky that i only have about 500 songs on my iphone thus far, i feel sorry for stephanW with 4000+ !!
    Apple - please fix  - this is schoolboy programming stuff...

  • HT202225 I keep getting pop ups on my iMac for the first time in 6 years after one of my kids tried to watch football through crichd tv. safari now opens with smart search engine rather than google every time i try to open a new web page.

    Ever since one of my kids tried to watch football on a website called crichd tv I keep getting pop us come up like Mackeeper and every time i try to open a web page it comes up with Smartsearch rather than google which is my preferred search engine in preferences. I have blocked extensions and changed homepage to google but this Smartsearch keeps overriding. Also a thing called MacKeeper keeps popping up I have followed the instructions to uninstall but the file it says to move to trash from the Applications folder but it simply isn't there or anywhere else. The file to uninstall Smartsearch is also not where they say it is in Library>frameworks>
    Very frustrating from going from a perfectly working system to a now very frustrating and annoying pop ups coming uo after every time i open a new web page.
    Any help or assistance in this matter would be very much appreciated.
    Russ

    You (or your kids) inadvertently installed adware. You do not need to download or install anything to fix it.
    Any tips on how to stop it from happening?
    Yes. To learn how to avoid it in the future read How to install adware.
    If you require them, Apple's removal instructions are linked in the Recovery Procedure near the end of that document. Read and follow them carefully. Pay particular attention to the easily overlooked passages directing you to restart your Mac when required.

  • I have a separate apple id and my daughter bought a song using my ID rather than hers.  Now I've got this song that I don't care for and have no use for.  Is there a way to get it to her ID short of burning it on to CD and then uploading it to her phone?

    I have a separate apple id and my daughter bought a song using my ID rather than hers. She was playing on my computer and bought it, thinking it would download to her phone through the cloud. Now I've got this song that I don't care for and have no use for.  Is there a way to get it to her ID short of burning it on to CD and then uploading it to her phone?

    sure pretty simple.  make a backup of your current settings
    http://support.apple.com/kb/HT1766?viewlocale=en_US
    then restore device from old backup you need pics off of
    then import pics to computer
    http://support.apple.com/kb/HT4083
    you may need to save pics to camera roll first
    then restore the new backup and sync pics back to phone via itunes
    Peace, Clyde

  • Is it possible to create a drop down menu using form fields rather than text?

    Is it possible to create a drop down menu using form fields rather than text?

    Yes, correct - values of form fields. If one is blank, then the field would be blank - yes? If two or more have the same value that is fine.
    A standard dropdown ... As shown here. If there is an easier way to do this, I'd love to hear your suggestions. Thank you!

  • How to tell AE CS6 to use bundled Mocha rather than Pro?

    I recently upgraded my bundled Mocha from AE CS6 to Mocha Pro 4, but for some unknown reason, it won't let me export shape data in Mocha.  There seems to be no data at all, as even trying to paste in Notepad results in nothing.  Tracking data, however, works fine (both in AE and Notepad).
    Since I cannot figure out any solution in Mocha, the only thing I can do is use bundled Mocha rather than Pro... but I do not know how to tell AE to use bundled Mocha rather than Pro when I click 'Track In Mocha' (...a setting which was changed when Pro was installed).
    Does anyone know where/how I can switch it to Mocha bundled when you click on Track In Mocha?  (or, does anyone have any idea why Pro would not export shape data, whereas the same project in bundled Mocha did?)
    If anyone has any answers or theories, please let me know ASAP, as I have a project I'm trying to complete, and (as luck always has it) the weekend is now upon us, and support is closed over the weekend.

    I tried connecting MBP and TC via Ethernet - after verifying the settings that you suggested - and it does not work: if I turn Airport off, Time Machine says it can't find the TC
    Any other sugestions?
    Ok, then ethernet is not getting an ip address from the TC and is plugged in wrongly..
    You still didn't give me any idea of what actual model the linksys is.. and why is it in the network.. Is it a modem router?? If you have cable internet just throw it away and use the TC.
    If you have the linksys as modem, then bridge it.. turn off wireless and run pppoe client on the TC.
    If the ISP does not allow pppoe client mode then simply use the TC in bridge. Turn off all wireless in the linksys and just use the TC.
    Still need info on how everything is setup to analyse the problem.

  • [svn:fx-trunk] 7120: Switched to using "use namespace mx_internal" rather than using explicit namespace scoping (e.g.,  mx_internal::foo) in RichEditableText and its related classes.

    Revision: 7120
    Author:   [email protected]
    Date:     2009-05-19 23:46:06 -0700 (Tue, 19 May 2009)
    Log Message:
    Switched to using "use namespace mx_internal" rather than using explicit namespace scoping (e.g.,  mx_internal::foo) in RichEditableText and its related classes.
    Removed stale import statements.
    QE Notes: None
    Doc Notes: None
    Bugs: None
    Reviewer: Carol
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/TextArea.as
        flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/TextBase.as
        flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/RichEditableText.as
        flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/supportClasses/RichEditable TextContainerManager.as

    I'm more of a 1.3 chick myself, but the words are the same just in a different language.
    1. Is Tomcat running?
    2. Have you configured the ajp13 connector on 8009 in Tomcat? (Should it be ajp13 for Apache 2.0? - I really must upgrade)

  • How to play SWF with AxShockwaveFlash control using a stream rather than a file path?

    My WinForm app downloads and plays SWF files from my server. Currently, I have an object of type AxShockwaveFlash called "flash" display the movie. The code I use to load the SWF is:
    flash.Movie = "http://example.com/file.swf"
    The URL is generated dynamically by the module based on what the user wants to watch.  I'd like to know how can I load the SWF using a memory stream rather than a file path? I have already configured my server to process the url and return the contents
    of the file. What I don't know is how to read those contents within my WinForm application as a stream instead of the default which is to just provide a URL path to the movie.
    For instance I think I can use the Net.HttpWebRequest object to make an HTTP request, and read the response contained in the resulting Net.HttpWebResponse into a stream, but I have no idea what I could do to that stream to feed it to AxShockwaveFlash
    A very similar question was posed on
    stackOverflow but I cannot make sense of the answer (I'm quite inexperienced).
    I'd appreciate your help,
    -Patrick

    Hi Patrick,
    Since this issue is mainly related to a control which belongs to third-party, I would recommend you consider posting this issue on the same site like the following thread because issues related to third-party are not supported.
    https://forums.adobe.com/thread/717505?tstart=0
    Regards.
    Carl
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Can I use album artist rather than Artist on my iPod160?

    The Artist selection on the iPod has its problems as "Album Artist" is not always the same as "Artist". I know I can correct the Cover Flow problems with Artist View by use of the Sort Artist option but I do have a few questions.
    I would rather display the Album Artist rather than Artist. Is this possible? I can do it in ITunes but cannot seem to do it on the iPod itself.
    Also, is it possible to do mass changes on Sort Artist rather than hit "next", paste the change, etc. Everything I try to mass change, Sort Artist is not an option.

    Hi,
    Unfortunately, the 'album artist' field is ignored on the iPod (I hope it one day will be 'solved'). If you mark albums with multiple artists as 'compilation', the album artist in iPod coverflow is automatically set to 'various artists'. And I haven't found a way to mass-edit the sort fields either

  • N8 - Use of WLAN rather than USB lead or Bluetooth

    Is there an application available for the N8 to allow the use of WLAN to copy files across to a PC, rather than having to use Bluetooth or the USB lead.
    I quite often use Bluetooth to transfer files such as Images but WLAN would be much faster.
    History: Always Nokia since 1994 including Nokia 2140, 7110e, 6150, 6210, 6310i, 6230i, N82
    Current: Nokia N8 (Anna - I have no intention of going to Belle) - and delighted with it!

    Dukto http://store.ovi.com/content/67131?clickSource=sea​rch will do that. You will need to also install it on your computer, link is in the store description. There was an issue with it defaulting to C: on the phone and filling the memory when transferring files to the phone, so make sure you check the settings - Although I think the developer was intending to solve the problem with this newer release - there is a thread about this somewhere on here, a search for Dukto should find it.
    There is a review at http://www.symbiantweet.com/dukto-r4-transfer-file​s-over-lan-between-clients-running-symbian-windows​...
    N8-00 pc059C9F6 Belle
    808 PureView pc059P6W5

  • Opening two windows with "_blank" rather than one...

    While setting up external links, I am finding that every time
    I have the link open in a new (_blank) window, two windows will
    open up with the same link rather than one. I guess two is better
    than none, but does anyone know why this is happening? And also how
    to fix the problem? I tried using _parent and it does the same
    thing. I'm new at flash but understand the principles, though is
    there something I'm missing?

    I know of no reason why that would happen other than having
    the getURL, LoadVars or whatever being called twice - e.g once with
    an onPress and then again with onRelease or something like that.
    If you want someone to look at your relevant code, feel free
    to post it here using the attach Code button (if you don't do it
    this way then the formatting of your code can get messed up).

Maybe you are looking for

  • Problem you may have in iTunes 7

    If the ituneslibrary data file is missing from your my music folder..go to the previous library folder and copy ALL the files there and put it into the itunes folder, then delete the previous libraries folder...that should help...it did that to me on

  • Which Technology was selected then creating Master Repository for ODI?

    Hi, Which Technology was selected then creating Master Repository for ODI SQL Server 2003? Which technolgy must be selected? First of all I created master repository for ODI on SQL Server 2003 via Microsoft SQL Server, it did not work. I checked the

  • Hand gesture for closing apps not working in ios8

    Since updating to ios8 (latest update), the hand gesture for closing apps (3 or 4 fingers) does not work most of the time On my gen 4 iPad. I have to use the 'home' button to close apps and I hate that it now takes two steps to close a web page in Sa

  • Receiver FCC: Ignore first field

    Hi Experts, Is it possible to ignore only the first field in receiver fcc? Thanks, Vishal

  • Ibook sparks when plugged in

    My Ibook sparks inside the case when the power supply gets plugged in. I am using a power supply from Macally. The power supply from my Dad's G3 Ibook also sparked when I tried that one. By sparking I mean that I can see blue light in the corner of t