0

I was wondering getPort call creates a new port or just serves the same one all the time, thus making it not thread-safe?

dmitry.sergeyev
  • 439
  • 5
  • 11

1 Answers1

1

the thread safety nature of the JAX-WS seems to be depend on the underlying implementation. see this question. Are you trying to reduce the GC overhead or reusing the Service object?

ST. Kee
  • 256
  • 2
  • 8
  • I want to reuse the Service object and just create proxies by calling getPort on that Service object. We sometimes modify the headers to add authentication and sometimes the credentials get swapped. – dmitry.sergeyev Jan 30 '18 at 17:47
  • That seems to be okay if you are not sharing the port. Seems like the port isn't really thread safe. check [here](https://developer.jboss.org/thread/148073) – ST. Kee Jan 31 '18 at 09:39
  • that's what i figured. I also looked the the instance ids for the classes that i am interested in - they are always new instances. so i think it's safe – dmitry.sergeyev Feb 01 '18 at 22:16