Java 类javax.management.relation.RoleResult 实例源码

项目:cacheonix-core    文件:RelationServiceExample.java   
private void testAllAccessQueries(String relationId)
{
   Logger logger = getLogger();
   // retrieve all roles
   try
   {
      Object[] params = {relationId};
      String[] signature = {"java.lang.String"};
      RoleResult roleResult = (RoleResult)(m_server.invoke(m_relationObjectName, "getAllRoles", params, signature));
      RoleList roleList = roleResult.getRoles();
      for (Iterator i = roleList.iterator(); i.hasNext();)
      {
         Role currentRole = (Role)i.next();
         System.out.println(">>>> role name: " + currentRole.getRoleName());
         System.out.println(">>>> role values: " + currentRole.getRoleValue().toString());
      }
      System.out.println("No unresolved Roles roleUnresolved size: " + roleResult.getRolesUnresolved().size());
   }
   catch (Exception ex)
   {
      logger.error("Exception printing the results from relationId: " + relationId);
      System.out.println("Printing the Exception message to validate exception: " + ex.getMessage());
   }

}
项目:windup-rulesets    文件:RelationServiceExample.java   
private void testAllAccessQueries(String relationId)
{
   Logger logger = getLogger();
   // retrieve all roles
   try
   {
      Object[] params = {relationId};
      String[] signature = {"java.lang.String"};
      RoleResult roleResult = (RoleResult)(m_server.invoke(m_relationObjectName, "getAllRoles", params, signature));
      RoleList roleList = roleResult.getRoles();
      for (Iterator i = roleList.iterator(); i.hasNext();)
      {
         Role currentRole = (Role)i.next();
         System.out.println(">>>> role name: " + currentRole.getRoleName());
         System.out.println(">>>> role values: " + currentRole.getRoleValue().toString());
      }
      System.out.println("No unresolved Roles roleUnresolved size: " + roleResult.getRolesUnresolved().size());
   }
   catch (Exception ex)
   {
      logger.error("Exception printing the results from relationId: " + relationId);
      System.out.println("Printing the Exception message to validate exception: " + ex.getMessage());
   }

}