Package javax.management.relation

Examples of javax.management.relation.RoleInfo


      Iterator iterator = unresolved.iterator();
      while (iterator.hasNext())
      {
         RoleUnresolved roleUnresolved = (RoleUnresolved) iterator.next();
         String roleName = roleUnresolved.getRoleName();
         RoleInfo info = (RoleInfo) infos.get(roleName);
         if (info == null)
            fail("unknown role " + roleName);
         if (info.isReadable() == true)
            fail("role should be readable " + roleName);
         removeRole(copy, roleName);
      }

      iterator = copy.iterator();
      while (iterator.hasNext())
      {
         Role role = (Role) iterator.next();
         String roleName = role.getRoleName();
         RoleInfo info = (RoleInfo) infos.get(roleName);
         if (info.isReadable() == false)
            fail("missing unresolved role " + roleName);
      }
   }
View Full Code Here


   private void createRelationTypeA(ObjectName relationService)
   {
      try
      {
         RoleInfo roleInfoA1 = createRoleInfo("roleA1", Trivial.class, true, true, 1, 1);
         RoleInfo[] roleInfos = new RoleInfo[] { roleInfoA1 };
         createRelationType(relationService, "relationTypeA", roleInfos);
         for (int i=0; i < roleInfos.length; i++)
            roleInfosA.put(roleInfos[i].getName(), roleInfos[i]);
      }
View Full Code Here

   private void createRelationTypeB(ObjectName relationService)
   {
      try
      {
         RoleInfo roleInfoB1 = createRoleInfo("roleB1", Trivial.class, true, false, 1, 2);
         RoleInfo roleInfoB2 = createRoleInfo("roleB2", Trivial.class, false, true, 3, 4);
         RoleInfo[] roleInfos = new RoleInfo[] { roleInfoB1, roleInfoB2 };
         createRelationType(relationService, "relationTypeB", roleInfos );
         for (int i=0; i < roleInfos.length; i++)
         roleInfosB.put(roleInfos[i].getName(), roleInfos[i]);
      }
View Full Code Here

   private void createRelationTypeC(ObjectName relationService)
   {
      try
      {
         RoleInfo roleInfoC1 = createRoleInfo("roleC1", Trivial.class, true, false, 1, 2);
         RoleInfo roleInfoC2 = createRoleInfo("roleC2", Trivial.class, false, true, 3, 4);
         RoleInfo[] roleInfos = new RoleInfo[] { roleInfoC1, roleInfoC2 };
         createRelationType(relationService, "relationTypeC", roleInfos );
         for (int i=0; i < roleInfos.length; i++)
            roleInfosC.put(roleInfos[i].getName(), roleInfos[i]);
      }
View Full Code Here

   private void createRelationTypeCX(ObjectName relationService)
   {
      try
      {
         RoleInfo roleInfoCX1 = createRoleInfo("roleC1", Trivial.class, true, false, 1, 2);
         RoleInfo roleInfoCX2 = createRoleInfo("roleC2", Trivial.class, false, true, 3, 4);
         RoleInfo[] roleInfos = new RoleInfo[] { roleInfoCX1, roleInfoCX2 };
         createRelationType(relationService, "relationTypeCX", roleInfos );
         for (int i=0; i < roleInfos.length; i++)
            roleInfosCX.put(roleInfos[i].getName(), roleInfos[i]);
      }
View Full Code Here

   private static final QName READABLE_QNAME = new QName("", READABLE);
   private static final QName WRITABLE_QNAME = new QName("", WRITEABLE);

   public void serialize(QName name, Attributes attributes, Object value, SerializationContext context) throws IOException
   {
      RoleInfo roleInfo = (RoleInfo)value;
      context.startElement(name, attributes);
      context.serialize(MAX_DEGREE_QNAME, null, new Integer(roleInfo.getMaxDegree()));
      context.serialize(MIN_DEGREE_QNAME, null, new Integer(roleInfo.getMaxDegree()));
      context.serialize(NAME_QNAME, null, roleInfo.getName());
      context.serialize(DESCRIPTION_QNAME, null, roleInfo.getDescription());
      context.serialize(REF_MBEAN_CLASS_NAME_QNAME, null, roleInfo.getRefMBeanClassName());
      context.serialize(READABLE_QNAME, null, roleInfo.isReadable() ? Boolean.TRUE : Boolean.FALSE);
      context.serialize(WRITABLE_QNAME, null, roleInfo.isWritable() ? Boolean.TRUE : Boolean.FALSE);
      context.endElement();
   }
View Full Code Here

      RoleInfo[] roleInfos = createRoleInfos("car", "owner");

      /* create the relationType */
      m_relationService.createRelationType("relationTypeName", roleInfos);

      RoleInfo info = m_relationService.getRoleInfo("relationTypeName", "owner");

      assertEquals(info, roleInfos[1]);
   }
View Full Code Here

   private RoleInfo[] createRoleInfos(String roleName1,
                                      String roleName2) throws Exception
   {
      RoleInfo[] roleInfos = new RoleInfo[2];
      roleInfos[0] = new RoleInfo(roleName1, "test.javax.management.relation.SimpleStandard", true, true, 1, -1, null);
      roleInfos[1] = new RoleInfo(roleName2, "test.javax.management.relation.SimpleStandard", true, true, 0, -1, null);
      return roleInfos;
   }
View Full Code Here

      public TestRelationType(String relationTypeName)
      {
         super(relationTypeName);
         try
         {
            RoleInfo primaryRoleInfo = new RoleInfo("primary",
                                                    "test.javax.management.relation.SimpleStandard",
                                                    false, //read
                                                    true, //write
                                                    2,
                                                    2,
                                                    "Primary :)");
            addRoleInfo(primaryRoleInfo);

            RoleInfo secondaryRoleInfo = new RoleInfo("secondary",
                                                      "test.javax.management.relation.SimpleStandard",
                                                      true,
                                                      false,
                                                      2,
                                                      2,
View Full Code Here

   public SimpleRelationType(String relationTypeName)
   {
      super(relationTypeName);
      try
      {
         RoleInfo primaryRoleInfo = new RoleInfo("primary",
                                                 "test.javax.management.relation.SimpleStandard",
                                                 true, //read
                                                 true, //write
                                                 2,
                                                 2,
                                                 "Primary :)");
         addRoleInfo(primaryRoleInfo);

         RoleInfo secondaryRoleInfo = new RoleInfo("secondary",
                                                   "test.javax.management.relation.SimpleStandard",
                                                   true,
                                                   false,
                                                   2,
                                                   2,
View Full Code Here

TOP

Related Classes of javax.management.relation.RoleInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.