Win a copy of Terraform in Action this week in the Cloud forum!

Nikita Dutt

Greenhorn
+ Follow
since Dec 24, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nikita Dutt

Thanks to all of you ; really enjoy being a part of java ranch
I agree with you rajesh , but i what i was looking ; for the same object can i have a synchronized and un synchronized methods being executed parallel y.
Hi all,


I am confused ; In a multiple threaded environment if a thread acquires a lock on instance ("this") of an object in a method. will an other thread can execute non synchronized methods on the same ("this") object.


Thanks in advance
Thanks Paul,

As you said "need a Protocol Handler" ; which i was able to write , inline the source code of the same ; this logic will push the SOAP request / response to standard console.







That's all i needed , thanks to all of you
10 years ago
Thanks Paul,

As you said "need a Protocol Handler" ; which i was able to write , inline the source code of the same ; this logic will push the SOAP request / response to standard console.








10 years ago
Hi All,


I have a requirement where in have to convert the JAX-WS SOAP response to a SOAP XML string. Have goggled but couldn't find any way . the client program-me who will invoke the web-service wants to convert the Java Object of response to SOAP XML string. I am using sun Java1.6


Please help


thanks in advance
10 years ago
Hi All,

How do call back clients work in JAX-WS web-services ? . I have managed to write some sample code but unable to understand how does it work. Inline in the code






If i don't invoke method mySynchronized after invoking getUserDetailsAsyncCC , i will not get a response from my hosted web service.


Output if invoke in order


new TestWebService().getUserDetailsAsyncCC(parameters);
new TestWebService().mySynchronized(parameters);

IS

Calling clients --------------->
Callback client called the webservice
Callback client has got a response
-------------------------------------------------------------------------
Webservice Response = Hello Luke Murphy Today's Date = Tue Aug 16 11:18:34 IST 2011
-------------------------------------------------------------------------
Main method ends



Output if invoke just


new TestWebService().getUserDetailsAsyncCC(parameters);

IS

Calling clients --------------->
Callback client called the webservice
Main method ends


This time it didn't get a response from webservice and i didnt get Callback client has got a response


Now output if invoke in order

new TestWebService().getUserDetailsAsyncCC(parameters);
new TestWebService().mySynchronized(parameters);
new TestWebService().mySynchronized(parameters);


Calling clients --------------->
Callback client called the webservice
Callback client has got a response
-------------------------------------------------------------------------
Webservice Response = Hello Luke Murphy Today's Date = Tue Aug 16 11:22:55 IST 2011
-------------------------------------------------------------------------
-------------------------------------------------------------------------
Webservice Response = Hello Luke Murphy Today's Date = Tue Aug 16 11:22:55 IST 2011
-------------------------------------------------------------------------
Main method ends

This time it didn't invoke the callback client twice ?


Please explain how do callback client works ?


Webservice server side code is





Thanks in advance
10 years ago

Hi All,

I have a requirement where in i would have to add 4 property files in the weblogic class-path so that i can use them them at run-time , the issue is each property file will have 65000 unique key/value pairs. This would be a one time activity as in the contents of the property file will not be changed once the server starts-up .

Will this effect my performance in terms of getting response back from the application ? Memory utilization would be high but that is ok from my senior perspective.


Please help me in this , any ideas suggestion to improve this ?


Regards
10 years ago
Hi All,

I am trying to understand how a JAX-WS protocol handler gets executed on the server side. Have written a code where i thought the


output would be

------------------------------------
In SOAPHandler SOAPHandlerOne method:handleMessage - direction = inbound
------------------------------------
------------------------------------
In SOAPHandler SOAPHandlerTwo method:handleMessage - direction = inbound
------------------------------------


but am getting the output as


------------------------------------
In SOAPHandler SOAPHandlerTwo method:handleMessage - direction = inbound
------------------------------------
------------------------------------
In SOAPHandler SOAPHandlerOne method:handleMessage - direction = inbound
------------------------------------


Please let me know what am i missing , if this is an expected behavior ? then why ?

Handlers Code


First Handler





Second Handler






The handler-chain.xml file

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<javaee:handler-chains xmlns:javaee="http://java.sun.com/xml/ns/javaee" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<javaee:handler-chain>
<javaee:handler>
<javaee:handler-class>com.company.jaxws.handler.cardservice.common.SOAPHandlerOne</javaee:handler-class>
</javaee:handler>
<javaee:handler>
<javaee:handler-class>com.company.jaxws.handler.cardservice.common.SOAPHandlerTwo</javaee:handler-class>
</javaee:handler>
</javaee:handler-chain>
</javaee:handler-chains>


Why is it calling SOAPHandlerTwo before SOAPHandlerOne ?


similary if i have LogicalHandler along with the SOAPHandlerOne the output is coming as

------------------------------------
In SOAPHandler SOAPHandlerTwo method:handleMessage - direction = inbound
------------------------------------
------------------------------------
In SOAPHandler SOAPHandlerOne method:handleMessage - direction = inbound
------------------------------------
------------------------------------
In SOAPHandler LogicalHandlerThree method:handleMessage - direction = inbound
------------------------------------
------------------------------------
In SOAPHandler LogicalHandlerTwo method:handleMessage - direction = inbound
------------------------------------
------------------------------------
In SOAPHandler LogicalHandlerOne method:handleMessage - direction = inbound
------------------------------------



and not as


------------------------------------
In SOAPHandler SOAPHandlerOne method:handleMessage - direction = inbound
------------------------------------
------------------------------------
In SOAPHandler SOAPHandlerTwo method:handleMessage - direction = inbound
------------------------------------
------------------------------------
In SOAPHandler LogicalHandlerOne method:handleMessage - direction = inbound
------------------------------------
------------------------------------
In SOAPHandler LogicalHandlerTwo method:handleMessage - direction = inbound
------------------------------------
------------------------------------
In SOAPHandler LogicalHandlerThree method:handleMessage - direction = inbound
------------------------------------

Complete handler-chain.xml


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<javaee:handler-chains xmlns:javaee="http://java.sun.com/xml/ns/javaee" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<javaee:handler-chain>
<javaee:handler>
<javaee:handler-class>com.company.jaxws.handler.cardservice.common.SOAPHandlerOne</javaee:handler-class>
</javaee:handler>
<javaee:handler>
<javaee:handler-class>com.company.jaxws.handler.cardservice.common.SOAPHandlerTwo</javaee:handler-class>
</javaee:handler>
<javaee:handler>
<javaee:handler-class>com.company.jaxws.handler.cardservice.common.LogicalHandlerOne</javaee:handler-class>
</javaee:handler>
<javaee:handler>
<javaee:handler-class>com.company.jaxws.handler.cardservice.common.LogicalHandlerTwo</javaee:handler-class>
</javaee:handler>
<javaee:handler>
<javaee:handler-class>com.company.jaxws.handler.cardservice.common.LogicalHandlerThree</javaee:handler-class>
</javaee:handler>
</javaee:handler-chain>
</javaee:handler-chains>






Thanks in advance.

10 years ago

Hi All,

Just to sum up things

Reference variable cL will be stored on heap and will refer to an object of MyClass which will again be on Heap.

Reference variable C2 will be stored on stack and will refer to an object of MyClass which will be on Heap.



Hope i make sense


Regards
10 years ago

Thanks what i have understood after reading the post and some googling is

"When we inherit behavior by sub classing, that behavior is set statically at compile time. In addition, all subclasses must inherit the same behavior. If however we can extend an object’s behavior through composition, then I can do this dynamically at runtime."

So if we are looking for some runtime behavior only , interfaces are better option ; if a type matching is required for example Car , Van are kinds of Vehicle ; go for abstract class


Hope i make sense
10 years ago

Hi All,

May be this is not a very appropriate question for this forum but not sure where to post it. In terms of design (Gang of Four) when should we use an interface and when should go for a abstract class. ? I know one lame explanation its better to with interface always as we can implement multiple interface in a Java Class where multiple inheritance of class is not possible.


Would really appreciate if i can get some better pointers on this .


Thanks in advance
10 years ago
Sorry Rob for the inconvenience ; thanks to all of you ; esp my fellow greenhorn ; to add to it am i right when i say that the reference variable inside the method will be stored on the stack and the actual object it points to is on heap
10 years ago