Delay destruction of client invokers
Multiple clients may share a single client invoker. For example, in the code InvokerLocator locator = new InvokerLocator("socket://127.0.0.1:5555"); Client client1 = new Client(locator); Client client2 = new Client(locator); client1 and client2 will both communicate with the server through a single org.jboss.remoting.transport.socket.MicroSocketClientInvoker. The number of Clients using a single client invoker is tracked, and the invoker is destroyed when the count goes to zero. It may be useful to delay the destruction of the invoker when it is known that another Client will want to use it in the near future. The delayed destruction of a client invoker may be achieved through the use of the key Client.INVOKER_DESTRUCTION_DELAY (actual value "invokerDestructionDelay"). For example, InvokerLocator locator = new InvokerLocator("socket://127.0.0.1:5555/?invokerDestructionDelay=5000"); Client client = new Client(locator); client.connect(); ... client.disconnect(); will cause client to delay the destruction of its client invoker (assuming client is the only user), by 5000 milliseconds. Of course, "invokerDestructionDelay" may be passed to the Client by way of a configuration map, as well.