×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Apr 2007
    Posts
    16

    Collections.synchronizedList

    Hello,

    I'm porting an applicatin from JavaSE to JavaME. I'm having a bad time trying to find a way to implement Collections.synchronizedList() into ME.

    Does anyone know how to do this?

  2. #2
    Registered User
    Join Date
    Dec 2005
    Location
    Brazil
    Posts
    1,884

    Re: Collections.synchronizedList

    Hi bigodines,

    If I got it correctly you just need to encapsulate access to a given unsynchronized collection using a method with the synchronized keyword available in Java spec.

    When building your custom list it is just a matter of making access to it thread-safe.

    Note that Vector and Hashtable have sync access by default.

    Br,
    Juarez Alvares Barbosa Junior - Brazil

  3. #3
    Registered User
    Join Date
    Apr 2007
    Posts
    16

    Re: Collections.synchronizedList

    I'm sorry. I didn't get it.

    I'm importing everything from java.util and using Collections.synchronized() and it can find it. It looks like its not there. So I will need to implement it, won't I?

  4. #4
    Registered User
    Join Date
    Dec 2005
    Location
    Brazil
    Posts
    1,884

    Re: Collections.synchronizedList

    HI,

    I'm importing everything from java.util and using Collections.synchronized() and it can find it. It looks like its not there. So I will need to implement it, won't I?
    The Collections class is not available in JME. Yes, you need to create your own solution, if really required.

    Br,
    Juarez Alvares Barbosa Junior - Brazil

  5. #5
    Registered User
    Join Date
    Apr 2007
    Posts
    16

    Re: Collections.synchronizedList

    Does anyone have it implemented or could give me some directions?

  6. #6
    Registered User
    Join Date
    Dec 2005
    Location
    Brazil
    Posts
    1,884

    Re: Collections.synchronizedList

    Hi,

    I gave you the directions, please read my first reply once again.

    Br,
    Juarez Alvares Barbosa Junior - Brazil

  7. #7
    Registered User
    Join Date
    Apr 2007
    Posts
    16

    Re: Collections.synchronizedList

    ok. done. thanks.

    até mais Juarez.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×