YPDemoJNDI.createLookupDirectory_andBindObject(
YPDemoJNDI.createORLookupDirectory_andAttributeObject(
    private void processRoles( Object obj,  YPDemoSession session, NamingService nservice ) {          if( obj instanceof Organization ) {              Organization og = (Organization)obj;              if( og.isSelf() )              {                  //System.out.println("Organization=" + og.getItemIdentificationPG().getNomenclature());                  String ret = new String();                  session.addHeader("Roles attributed to " + og.getItemIdentificationPG().getNomenclature());                  //                  // COLLECT ALL ROLES FOR ORGANIZATION (PLACE ROLES IN ATTRIBUTES OBJ)                  //                  RelationshipSchedule rs = og.getRelationshipSchedule();                  // return all Relationships                  Collection relations = rs.getMatchingRelationships(getAllPredicate() );                  Object[] arr  = relations.toArray();                  //                  //                  BasicAttributes attributes = new BasicAttributes();                  session.add("<TABLE>");                  for(int i=0; i< relations.size(); i++){                      Relationship rel = (Relationship)arr[i];                      Role role = rel.getRoleA();                      BasicAttribute attribute = new BasicAttribute(role.getName(), "true");                      attributes.put(attribute);                      session.add("<TR><TD></TD>");                      session.add( DescribeObjectAsHTML.describeWithinTableColumn(role.getName(),attribute));                      //<TD><FONT SIZE=-1 COLOR=RED>" + role.getName() + "</FONT></TD>");                      session.add("</TR>");                  }                  session.add("</TABLE>");                  session.doPrepend();                  YPDemoJNDI.createLookupDirectory_andBindObject(                                     "Agents", og.getItemIdentificationPG().getNomenclature(),                                     "Roles",                                     new AgentRole("http://www.ultralog.net"),                                     attributes,                                     nservice );                  /**                  //                  // BIND ATTRIBUTES OBJ TO NAME                  //                  try{                         DirContext  subKontext =null;                         DirContext dirc = (DirContext)nservice.getRootContext();                         try{                                  DirContext agents = (DirContext)dirc.lookup("Agents");                                  subKontext = (DirContext)agents.createSubcontext(og.getItemIdentificationPG().getNomenclature());                          } catch( NameAlreadyBoundException ex ) {                                  //                                  // catch NameAlreadyBoundException -  directory already exists                                  // perform a lookup instead of creating new                                  //                                  subKontext = (DirContext)dirc.lookup(og.getItemIdentificationPG().getNomenclature());                          }                          System.out.println("Created Subdirectory=" + subKontext.getNameInNamespace());                          //subKontext.bind("Roles", new AgentRole("http://www.ultralog.net")); //, new BasicAttributes("name", role.getName()));                          System.out.println("Binding attributes, size=" + attributes.size() );                          subKontext.bind("Roles", new AgentRole("http://www.ultralog.net"), attributes );                    } catch( NamingException ex ){                          // if already bound, ignore                    }                   **/              }          }    }