How can we make one object as synchronizable?

Hi!
I am new to java.How can we make one object as synchronizable?
Thanx

Synchronize is used to make an object and/or a functional sequence thread safe. By itself it does not make something thread safe.
So the point is to make something thread safe not just to synchronize it.
You can either sychronize a method like so....
      public synchronized void doit()
Or you synchronize on an object (where 'Object' below is solely as an example, any object can be used)...
      Object lockObject = new Object();
      public void doit()
         sychronized (lockObject)

Similar Messages

  • How can you make one button preform different actions in Xcode?

    How can you make one button "preform a click" and "orderfront"? Is that possible? Because what I am doing is making a welcome window to my application for Mac OS X 10.6, and I have two buttons in that window, one says "Connect" which connects a a WebView to a url and the other button opens up the main window. So how can I a make a button do multiple things at once??

    Ah - If you are just using bindings between various objects from Interface Builder, you can reduce your application code a bit (sometimes quite a bit), but there is only so far you can go. Typically variables and routines are defined in your application that Interface Builder hooks into, so that your application code (usually Objective-C, but can be others) can use these variables and routines to determine what is happening in the user interface.
    I'm not sure how up-to-date the project code is (or what programming code you are familiar with), but you can take a look at Apple's Cocoa Application Tutorial to see what is (usually) involved in creating an application.

  • Mountain Lion Recovery DVD - How can I make one, ML was installed on my iMac and BBP

    Mountain Lion Recovery DVD - How can I make one, ML was installed on my iMac and MBP when I purchased them. When I look at the App Store, it dose not show ML as purchased (to download again) - do I have to purchase it again to make a Recovery DVD?
    Thanks for your help.
    Regards
    NGI

    do i have to purchase it again to make a Recovery DVD?
    No. You can still make a bootable recovery DVD, but you will not be able to make a full bootable copy of ML without purchase.
    1) Enable the debug menu for Disk Utility via Terminal Application. Navigate to terminal by typing "terminal" in   spotlight. Copy the bolded text below and enter it into the command prompt:
    defaults write com.apple.DiskUtility DUDebugMenuEnabled -bool true ; open -a "Disk Utility" ; exit
    2) From the Debug Menu > Select Show every Partition > Recovery HD should appear
    3) Right click (control + click) the Recovery HD partition and select "Mount"
    4) Right click again the partition again > "Reveal Recovery HD in Finder". Leave this window open
    5) At this point, you will need open terminal again and enter the following command:
    sudo chflags nohidden /Volumes/Recovery\ HD/com.apple.recovery.boot/BaseSystem.dmg ; exit
         Type your password when prompted.
    6) Navigate back to the Recovery HD finder Window > com.apple.recovery.boot > BaseSystem.dmg
    7) Drag "BaseSystem.dmg" into Disk Utility's sidebar.
    8) Insert your DVD
    9) Select "BaseSystem.dmg" in the sidebar and hit "Burn"
    Once the burn is completed, hold option down at startup and select the DVD to boot. This is a bootable Recovery partition, not a bootable copy of ML.
    Note: to disable the debug menu,
    defaults write com.apple.DiskUtility DUDebugMenuEnabled -bool false

  • How can I make one list of all events I have in over 30 libraries I made

    How can I make one list of all events I have in over 30 libraries I made?

    The only way I know of is to take a screenshot of the Photo mode with the View ➙ Show Event Titles selected.  That will give you a list of sorts.  Might take more than one screenshot per library.
                   Click to view full sized
    OT

  • How can i make my object appear as a mesh?

    How can I make an object appear as a mesh? I dont want anything as complicated as a coloured gradient I just want a flat object to appear like a net. Is there an easy way to do this?
    Thanks
    J

    Jules,
    Depending on the shape, and upon the appearance (varying width and/or knotting or whatever), it may be anything from a Rectangular/Polar Grid (bundled with the Line Segment Tool) to something intricate and difficult.

  • How can 1 make an object of user defined class immutable?

    Hi All,
    How can one make an object of user defined class immutable?
    Whats the implementation logic with strings as immutable?
    Regards,

    Hi All,
    How can one make an object of user defined class
    immutable?The simple answer is you can't. That is, you can't make the object itself immutable, but what you can do is make a wrapper so that the client never sees the object to begin with.
    A classic example of a mutable class:
    class MutableX {
        private String name = "None";
        public String getName() {
            return name;
        public void setName(String name) {
            this.name = name;
    }I don't think it's possible to make this immutable, but you can create a wrapper that is:
    class ImmutableX {
        private final MutableX wrappedInstance;
        public ImmutableX (String name) {
            wrappedInstance = new MutableX();
            wrappedInstance.setName(name);
        public String getName() {
            return wrappedInstance.getName();
        // Don't give them a way to set the name and never expose wrappedInstance.
    }Of course, if you're asking how you can make your own class immutable then the simple answer is to not make any public or protected methods that can mutate it and don't expose any mutable members.
    Whats the implementation logic with strings as
    immutable?
    Regards,I don't understand the question.

  • How can I make one slide that contains multiple slides?

    Hi, I want to make slideshow for presentation. And I want to know how can I make this slide.
    For example in this picture, have 1 main slide and 6 sub slides. I want to make slide like this, and all slides should be in one slide. And I want to zoom in to sub slide when I click and then zoom out when I click one more. And then second slide should be zoom in when I click and zoom out when I click again. And then slide 3 etc.
    I want to know how can I do this.

    There are two ways to do this.
    1. Duplicate the main or first slide numerous times - as many as you'll need for the show, which looks like 6 including the first "overview slide".
    2. You know have two choices - either use the Magic Move transition between the first slide and the next, which has the main box centre screen and enlarged proportionally.
    3. Or enlarge the slides so that the main point is central, but use hyperlinks to move between the slides. This also gives you the liberty of changing the order spontaneously should the situation demand. Using the main first slide, place an invisible box around each element and use a link to move to that slide which is enlarged. Then you have to decide if you will come back each time to slide 1 (the overview) by having the whole slide hyperlinked to slide 1, or the whole slide linked to the next slide. That way you don't have to go looking for the hyperlink area.
    The Magic Move effect will give your presentation a "Prezi" like effect, while the hyperlinked version I've described will just use gentle dissolves between each slide.
    I will sometimes use 3 because I want to encourage audience participation and let them choose where to go next... e.g., the various elements of a 747 wing assembly, or the interior of a large cruise ship, showing state rooms, dining, pool area, ballroom, etc.
    Les

  • How can I make one entity attribute change trigger another's default value?

    Guys and Gals,
    Using JDev 11.1.2.1.0
    I have an order form which has a LOV (Customers) and an address field. The address field should contain the default address associated with the selected key in the LOV.
    To do this, I have an entity (Order) with two attributes (CustomerID & Address). Address has its default value set to "adf.object.getDefaultAddress" which returns the default address for the CustomerID. This only works on initial load.
    How would I make this adf.object.getDefaultAddress trigger when I select a different LOV CustomerID in the View Object?
    I've tried various things but am a little confused. Is there something akin to partial triggers for entity objects?
    I can provide pictures, code, etc.
    Thanks,
    Will

    you can try this.
    go the the setter method in your EntityImpl class for the LOV attribute
    public void setCustomerID(Number value) {
            setAttributeInternal(CustomerID, value);
            //here call the setAddress() method
        }in your page, set the customerID autosubmit to true and make the Address field PPR the customer Id.
    <af:selectOneChoice value="#{bindings.CustomerID.inputValue}"
                               id="soc1"
                               autoSubmit="true">
            </af:selectOneChoice>
            <af:inputText value="#{bindings.Address.inputValue}"
                                   partialTriggers="soc1">
            </af:inputText>

  • How can i make one of my itune songs my ring tone on my apple iphone 3gs-32gb

    HI is there anyone out there that can help me step by step how i can make one of my downloaded itune songs on my iphone as my RINGTONE on my iphone 3gs-32gb please my phone as been upgraded to a ios 6 id be very grateful if you could help me as ive been trying all day with no joy as this is my very first iphone you see and im so blind to all this lol thanks susan.

    http://www.ehow.com/how_2160460_custom-iphone-ringtones-free.html

  • Hello how can i make one button work

    hello , please
    i would like to know if i have three buttons working but i need to make when i push one of them the others just don't work unless the first or the button i pressed finish its action
    thx

    Hi, redcrowdesign-
    Part of the problem is that you're using ActionScript syntax in a JavaScript environment.  Instead of using _root, you can access the Stage object.  If your symbol is only one level down, you can use sym.getParentSymbol().stop("label");.  If you have a nested symbol, you may find sym.getComposition().getStage().stop("label"); more effective.
    That being said, you might want to rethink your UI model and focus your iPad interactions on the touch events, which are much more performant than the mouse events.
    Hope that helps,
    -Elaine

  • How can I make one computer server at Home for access of SQL Server 2012/2008

    Hi All,
    Sorry for this basic question but I am zero in networking. I will be very grateful if someone guides what should I do to make one of my home PC as server. Scenario is as follows:
    I want to give training to few students about SQL SERVER T-SQL.
    I have one Laptop using SQL Server 2012 having Windows 7 Pro(Laptop Master-want to make this server). I have other laptop running Windows 7 pro and got SQL SERVER 2008. My students have mix of laptops including Windows XP, Windows Vista, Windows 7 and Windows
    8. All students have SQL SERVER 2008 installed and working.
    Q1: I actually want to make Laptop Master(explained in above paragraph) as server and want other laptops to access that master server in home network. I will install sample exercise database on server and students will be writing queries to access
    data.
    Q2: can I secure sample database from students who can copy sample database from server?
    Q3: can students run queries remotely sitting their home?
    Thanks in advance.
    Kind Regards
    A K
    Adnan

    Hi itsadnan,
    According to your description, if you want to make your Laptop as Server, and your student can log in your SQL Server 2012 instance, you need to ensure that your computer and student’s computers are the same domain, and you enable TCP/IP, name pipes protocol
    in SQL Server Configuration Manager, your SQL Server 2012 instance is allowed to connect remotely and your student install SQL Server Manager Studio 2012 as client tool in their computer, and you create the related login name for your students. For more information,
    see:
    http://blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx
    According to your requirement, in actual, since your students install SQL Server 2008 on their computer, you totally can ask your student to install the sample exercise database in their SQL Server. For example, there are many resource about sample database
    in Website, which is helpful for student to learn database technology, such as
    AdventureWorks databases for SQL Server 2008. From SQL Server Management Studio, they can attach an AdventureWorks database, then write queries to access data.
    Since you have SQL Server 2008 in your other laptop, you can create the sample exercise database, and student can install this database via backup and restore, then write queries to access data and send to you for checking if it is right.
    Note:  Due to backwards compatibility, The students could not restore SQL Server 2012 database in their SQL Server 2008 instance.
    Thanks,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • How can we make smart objects smarter?

    Smart objects are great and can be a really useful time saver. That said, i'm having a problem and I'm hoping that there is a solution out there. I'll preface this with the statement that, I may not be using smart objects as they were intended, but I feel like this is how they should work:
    A basic example - say you have a "Login" button.
    It would be great/obvious to have that as a smart object. It would be greater still to have the on, off, rollover, clicked states to be within that smart object.
    Now, if you place that smart object as a linked object into a document, there is no way to say "in this instance, I want to show the off state of the button". If you open the smart object and change the state to that and save - then it will update all instances everywhere in all PSDs where it exists and all of your buttons are now in an off state.
    Now, clearly, in this example, the easy answer is just make 4 smart objects. Easy peasy.
    The problem with that is two fold:
    1. if "Login" changes to "Logon" I need to make that change in 4 places instead of just one.
    2. The button example is simple, but what if my smart object is more complicated than that? What if there a complex set of layers that make up that object? Making changes to multiple complex layer files kind of defeats the purpose of having smart objects no?
    You can embed the object and thus break the external link and change things to your heart's content without effecting other instances - but then what really is the value of creating the smart object then? You might as well just have a layer group that you drag from PSD to PSD.
    The way smart objects should work, IMHO, is that you should be able to toggle layers on and off per instance of the object, BUT any pixel modifications to a layer within, bubble up to all instances that are displaying that layer  (say - a colour change, or text change, etc).
    Thoughts?

    Hi,
    Check the below links.
    http://sharepoint.aspcode.net/view/635399286724222582123340/sso-between-2-host-named-sitecollections-with-different-subdomains
    http://blogs.msdn.com/b/russmax/archive/2013/10/31/guide-to-sharepoint-2013-host-name-site-collections.aspx
    http://blog.repsaj.nl/index.php/2014/07/sp2013-host-named-site-collections-adfs-claims-and-aam/
    Krishana Kumar http://www.mosstechnet-kk.com
    Please mark the replies and Proposed as answer if they help and solve your issue

  • How can I make one cell search multiple other cells for a string of text and return whether or not the string appeared in the cells searched?

    https://www.icloud.com/iw/#numbers/BAI31boMQXsGKc8NH22BlqWRzbs8PdgWBs-F/2014-15_ Curriculum_Planning_w_CCSS_(Web_Shared)
    My document is above, if anyone wants to help this crazy teacher invent a better lesson planner.
    Here's my predicament.  The state in which I teach requires teachers to keep up with which of the Common Core State Standards (CCSS) their instruction is addressing and when the standards were addressed.  I got the bright idea to do this through a spreadsheet in Numbers because our school is getting iPads this year, so it'd be pretty sweet to be able to assemble all of my lesson plans in one massive spreadsheet.  On the "AP Lesson Plans" sheet, I've got a few weeks worth of lesson plans entered in.  I'm planning on going in and using the drop-down menu next to each lesson plan to add all the CCSS on a per-day basis.  This is simple enough, but here's where I run into a problem.
    I want the "AP Standards" sheet to concatenate, in cells D3 through G76, the dates on which a standard was covered.  What I need is some way for, say, Cell D3 to look at the table on the "AP Lesson Plans" sheet and concatenate the dates of every lesson which has the standard in column A (In this instance, RL.11-12.1).  At the end of the day, the functionality I need is that I can enter my lessons and CCSS on the "AP Lesson Plans" sheet and go to the other sheet and see a summary of which standards have been addressed, when, and how often.
    If that's as clear as mud, well, I teach literature, not technical writing, so my apologies.  I'm more at home with Jonathan Swift than spreadsheets.  I'll gladly help you help me if you'd let me know what you need to know.  Oh, and to illustrate my knowledge level (just enough to be dangerous), I've left you the formula of my best stab at making cell D3 behave as desired.  It's the gray box on the "AP Standards" sheet.  Yikes.

    Hi Arrdenet,
    Congratulations on the nested IFs. I haven't tested that formula, but it is impressive. It will be very difficult to debug if it doesn't work, and I think it would make Numbers very slow.
    Here is a different approach. After you enter all the CCSS, add another column with HLOOKUP.
    Edit:
    B2 (and Fill Down)
    A2 (and Fill Down)
    =IFERROR(HLOOKUP(A$1,C2:E2,1,0),"")
    HLOOKUP looks for the value in A1 in all the CCSS columns.
    IFERROR is to stop the error triangles appearing and returns "" (NULL) instead.
    Then sort by column A.
    Not a complete answer, but it might get you started.
    Regards,
    Ian.

  • MPEG 1 (!) How can I make one?

    Hi Folks
    I'm still wrestling trying to help a client embed movies in a PowerPoint presentation. The client cannot upgrade their systems (they work in a large firm, their computers [windows XP] have software installed by their IT dept and only centrally approved software is available). So I need to make files compatible with QT 6.5. The ONLY files I've managed to get to work so far are QT compressed with H.261 and AVI. The problem with the QT file is that it is only viewable in an external window in QT player.(the AVI file is huge and ugly).
    Now someone today pointed out to me that MPEG1 files will play when embedded in PowerPoint slides on the client's computer.
    All fine and dandy, but I don't have the foggiest idea how I can make an MPEG1 file.
    I do have MPEG streamclip, but it only seems to be able to make MPEG4.
    Any ideas?
    Thanks a lot
    C

    The only way I know of is to take a screenshot of the Photo mode with the View ➙ Show Event Titles selected.  That will give you a list of sorts.  Might take more than one screenshot per library.
                   Click to view full sized
    OT

  • How can I make background objects in a template selectable

    I have a Pages template with my signature embedded. It should move with the text but I cannot select it to make it do so.
    Does anyone know how this can be done in the new Pages 5?

    Thank you for the suggestions, Peter, but I'm afraid it doesn't work.
    I guess I'll just wait for Apple to re-install this feature, and meanwhile revert to my older, perfectly reliable Pages 09.
    Robert

Maybe you are looking for

  • Songs in my Itunes show up as separate folders.  How do I combine them into one album?

    Songs in my Itunes show up as separate folders.  How do I combine them into one album?

  • When trying to download it says binary file download and it starts but doesnt finish

    as i try to download the little box pops up and says binary file save or cancel . So i save and it starts downloading the little line starts across and it gets to the end and disappears and leaves a empty box and nothing else happens

  • Webdynpro to oracle db

    hi experts, created one webdynpro application which connect to Oracle database, directly without webservices and ejbs. my code is as follows: Connection con = null;     Statement stmt = null;     DataSource ds=null;     ResultSet rs=null;     try    

  • Rfc log on failed user SAPSYS

    Hi, We are getting below alerts RFC/CPIC logon failed Reason=24 Type=R client:000 user:SAPSYS Also RFC/CPIC logon failed Reason=1 Type=S client:000 user:SAPSYS what is the diff between these two alerts and what is the reason for getting this. Regards

  • Elements 7 on windows 7

    When I'm in full fix and have the hand tool slected from the tools, I get three hands not one, is there a fix for this. Also my photoshop membership log in on the left will not work, I have downloaded the fix for it and it doesn' fix it. Need help.