} catch (MicroKernelException e) {
MicroKernelFactory.disposeInstance(mk);
throw e;
}
} else if (head.equals("http")) {
return new Client(url);
} else if (head.equals("http-bridge")) {
final MicroKernel mk = getInstance(tail);
final Server server = new Server(mk);
try {
server.start();
} catch (IOException e) {
throw new IllegalArgumentException(e.getMessage());
}
return new Client(server.getAddress()) {
@Override
public synchronized void dispose() {
super.dispose();
server.stop();
MicroKernelFactory.disposeInstance(mk);