java - JAX-WS Thread safe -


i found questions regarding this, without concrete answer. have code bellow:

1: qname qname = new qname(uri, service_name);

2: service service = service.create(wsdl_document_location, qname);

3: testport1 port = service.getport(testport1.class);

times:

  • line 2 16 msec

  • line 3 27 msec

now, in situation time important, question is, possible have qname , service initialized once, , defined static field , port every time need make ws call or not?

any other proposal?

i use standard java jax-ws annotations.

update:

maybe solution use object pooling apache commons pool library , save created ports future use?

qname holds strings internally , doesn't offer method change them after constructor has been called, can treat immutable class if not.


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -