Subject s = loginContext.getSubject();
ServerEndpoint se1 = KerberosServerEndpoint.getInstance(s, null, null,
PORT);
ServerEndpoint se2 = KerberosServerEndpoint.getInstance(s, null, HOST,
PORT);
InvocationLayerFactory ilf = new BasicILFactory();
Exporter e1 = new BasicJeriExporter(se1, ilf, false, false);
Exporter e2 = new BasicJeriExporter(se2, ilf, false, false);
e1.export(new Remote() { });
e2.export(new Remote() { });
}