• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Using System Properties in a multithreaded environment

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

My application is using a sun-provided API which requires me to set some system properties before calling it. Now, I'll be running multiple threads, so I'm pretty sure I'll run into issues given that System is a global object. Is there a way to set system properties on a thread-by-thread basis?? That solution would be ideal.

Another solution is to use synchronization, but I really DON'T want to do this because it would hurt performance considerably.

Another solution I thought about was to create a wrapper around the underlying sun-provided source. This is not good enough, though, because these properties are fetched by internal classes that I don't even have access to (nor can I see their documentation).

I hope someone can help me out before I'm forced to reinvent the wheel...
 
Ranch Hand
Posts: 218
VI Editor Ruby Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Depend on what exactly you are trying to do. Maybe if you can give a little more detail on what you are trying to do exactly. What are you using System for? When are you using them? etc.
 
Ed Zeval
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using JAAS to perform Kerberos authentication.

JAAS requires me to set the java.security.krb5.realm and java.security.krb5.kdc properties. Then I use a LoginContext to perform the authentication. The LoginContext instantiates a Krb5LoginModule, which gets the Kerberos realm and KDC info from a call to PrincipalName (which, I assume, gets it from the system properties).

I have the source for LoginContext and the Krb5LoginModule, but I cannot access (nor find documentation about) the PrincipalName class (in the sun.security.krb5 package).

If you're not familiar with JAAS, this probably didn't make any sense, but at least now you know the properties I'm using.

Thanks!
 
I'm doing laundry! Look how clean this tiny ad is:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic