Win a copy of Serverless Applications with Node.js this week in the NodeJS forum!

Abhineet Kapil

Ranch Hand
+ Follow
since Feb 08, 2010
Abhineet likes ...
Eclipse IDE Java Spring
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Abhineet Kapil

Hey, Did you finally join TW ?
4 years ago

If we are checking the boolean status inside synchronized block, do we still need to use the volatile variable ?

I would believe synchronized should be enough.

Your suggestions ?
Array could have been used as a backing structure in a HashSet.
My point is, one doesnt need K,V pair for HashSet. We only need to store values.

But I think Oracle wanted to reuse HashMap for HashSet.
Ha ha... Thats a huge time.. I dint notice the date of post.
4 years ago

Any specific reason for creating custom class and not using LinkedHashMap ?
4 years ago
I am wondering why would one consume extra memory in java.lang.TreeSet by using a java.lang.TreeMap underneath and assigning dummy objects for each key.

Yes you are right. It is take() operation.

I used word 'poll' in the sense of data removal operation.

So, unbounded queues will have one way blocking ie removal operations (and not addition operations)

4 years ago
Can an unbounded queue be a blocking queue ?

If so, how ?

As per my understanding, blocking queue means the offer/poll operations can be blocked if the queue is full/empty respectively.

which might mean, that poll operation will still hold as blocking operation for unbounded blocking queue.
4 years ago

I wanted to check if there is a central maven repository where I can upload my jars and access then over the internet from anywhere.

5 years ago

I am Java 5 certified.
Is it advisable to skip Java 6 certification and do Java 7 certification ?

Does a Java 6 certification provide much value when you are already Java 5 certified ?
Are there major features released in Java 6 ?
Yes, I have defined a root context as well.
And I understand that all the beans defined in the root context are shared across all the WebApplicationContexts.

But was just wondering if there was a possibility to peek into another WebAppContext. Thanks for Confirming !!

6 years ago

I have defined two WebApplicationContexts(i.e. Dispatcher Servlets) in my SpringWebMVC app with different url-patterns.
Each dispatcher servlet has its own config file defining beans in it.

Now I make a web request for the first dispatcher servlet. The targeted handler defined in first WebApplicationContext is invoked.
In that handler, Can I programatically get a reference to the bean defined in the other WebApplicationContext ?

I have tried using WebApplicationContextUtils, RequestContextUtils helpers and also ApplicationContextAware interface.
In all above cases, I always get the currently active WebApplicationContext.

6 years ago
Arrays are co-variant and Collections are invariant.

I am try to assign an array of java.lang.Short to an array of java.lang.Integer.
But I am getting a compile time error.

Type mismatch: cannot convert from Short[] to Integer[]

Can someone please explain why this error is coming if Arrays are co-variant.

6 years ago

I have a webapp1 deployed in an application server with context say /WebApp1 .

Now I want to write another webapp2 and deploy in the same server.

And I want to intercept the requests meant for webapp1 ( /WebApp1) and filter them through webapp2 servlet.

Is there any remote possibility of such kind of interception ?
6 years ago