final String servantName = args[0];
log("use ServantClass: " + servantName);
Class<?> servantClass = TestUtils.classForName(servantName);
Servant servant = ( Servant ) servantClass.newInstance();
log("using Servant: " + servant);
if (servant instanceof Configurable && orb instanceof org.jacorb.orb.ORB)
{
((Configurable)servant).configure (((org.jacorb.orb.ORB)orb).getConfiguration());
log("configured Servant");
}
final String ior;
if (useCorbaloc())
{
String oid = System.getProperty ("jacorb.test.corbaloc.objectid");
poa.activate_object_with_id (oid.getBytes(), servant);
String shortcut = System.getProperty ("jacorb.test.corbaloc.shortcut");
if (shortcut != null)
((org.jacorb.orb.ORB)orb).addObjectKey(shortcut,
System.getProperty ("jacorb.test.corbaloc.implname")
+ "/" + System.getProperty ("jacorb.test.corbaloc.poaname")
+ "/" + System.getProperty ("jacorb.test.corbaloc.objectid"));
ior = "SERVER IOR: " + getCorbaloc();
}
else
{
// create the object reference
org.omg.CORBA.Object obj = null;
if (useIMR())
{
poa.activate_object_with_id (servant.getClass().getName().getBytes(), servant);
obj = poa.id_to_reference (servant.getClass().getName().getBytes());
}
else
{
obj = poa.servant_to_reference( servant );
}