/**
* create a reference and return its details as string printed using dior.
*/
private String getProfileDetails(Properties props) throws Exception, InvalidPolicy, AdapterAlreadyExists, WrongPolicy
{
ORBSetup setup = new ORBSetup(this, props);
try
{
setup.setUp();
POA rootPOA = setup.getRootPOA();
POA testPOA = rootPOA.create_POA("MyPOA", rootPOA.the_POAManager(), new Policy[] {rootPOA.create_id_assignment_policy(IdAssignmentPolicyValue.USER_ID)});
byte[] key = new byte[] {1, 2, 3, 4};
org.omg.CORBA.Object object = testPOA.create_reference_with_id(key, BasicServerHelper.id());
ObjectImpl objectImpl = (ObjectImpl) object;
Delegate delegate = (Delegate) objectImpl._get_delegate();
ParsedIOR parsedIOR = delegate.getParsedIOR();
StringWriter out = new StringWriter();
final PrintWriter printWriter = new PrintWriter(out);
PrintIOR.printIOR(parsedIOR, printWriter);
printWriter.close();
return out.toString();
}
finally
{
setup.tearDown();
}
}