Java RMI connection-pooling details

I´m working on a Java RMI topic and need some information about the connection pooling on the client side. In the literature and the documentation there are no clear answers to these topics. I know that connection pooling is not a part of the RMI specification. But in some implementations (e.g. in SUN´s implementation) it is done. So my questions refer to this implementation.

I suppose that the socket (java.net.Socket) which is created by the RMI socket factory is cached in the pool. Is that correct?

How are these connections saved? I would except that a HashMap is used with the destination ip/port as key and the socket as value.

Sockets are closed by using a timeout. How is the information on the connection idle time gained? Possibly there is some kind of timestamp when the connection is used the last time.

Answers


Bearing in mind that I am talking about the Sun implementation only:

I suppose that the socket (java.net.Socket) which is created by the RMI socket factory is cached in the pool. Is that correct?

Yes, after it is released from the remote call, and of course the remote call looks in the pool first before it asks the socket factory to create a new Socket.

How are these connections saved? I would except that a HashMap is used with the destination ip/port as key and the socket as value.

Let's just say there must logically be a Map from ip:port to Socket. The implementation details aren't actually important.

Sockets are closed by using a timeout. How is the information on the connection idle time gained?

By noting the time when the connection was put into the pool.


Need Your Help

ASP.NET MVC Authorization

c# asp.net-mvc authorization

How do I achieve authorization with MVC asp.net?

Reusing RSpec behavior validation

ruby-on-rails rspec code-reuse

In my Rails 3 application, I have a RSpec spec that checks behavior of a given field (role in the User model) to guarantee that the value is within a list of valid values.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.