* @return new VMTransport
* @throws IOException
* @param options
*/
public VMTransport connect(Map options) throws IOException {
TransportAcceptListener al;
synchronized (this) {
if( disposed )
throw new IOException("Server has been disposed.");
al = acceptListener;
}
if( al == null)
throw new IOException("Server TransportAcceptListener is null.");
connectionCount.incrementAndGet();
VMTransport client = new VMTransport(location) {
public void stop() throws Exception {
if( disposed )
return;
super.stop();
if( connectionCount.decrementAndGet()==0 && disposeOnDisconnect ) {
VMTransportServer.this.stop();
}
};
};
VMTransport server = new VMTransport(location);
client.setPeer(server);
server.setPeer(client);
IntrospectionSupport.setProperties(server,new HashMap(options));
IntrospectionSupport.setProperties(client,options);
al.onAccept(configure(server));
return client;
}