Examples of RelationSupport


Examples of javax.management.relation.RelationSupport

    createRelationTypeB(service);
    createRolesB(server);
    RoleList result = null;
    try
    {
      RelationSupport support = new RelationSupport("id", service, server,
                                  "relationTypeB", rolesB);
      addRelation(server, service, support, "test:type=support");
      result = support.retrieveAllRoles();
    }
    catch(Exception e)
    {
      fail(e.toString());
    }
View Full Code Here

Examples of javax.management.relation.RelationSupport

      {
         ObjectName service = createRelationService("test:type=service", server);
         createRelationTypeC(service);
         createRolesC(server);
         createRolesCX(server);
         RelationSupport support = null;
         ObjectName on = null;
         Listener listener = new Listener(RelationNotification.RELATION_MBEAN_UPDATE);
         try
         {
            support = new RelationSupport("id1", service, server,
                                          "relationTypeC", rolesC);
            addRelation(server, service, support, "test:type=support1");
            server.addNotificationListener(service, listener, null, null);
            support.setRole(roleCX2);
            on = new ObjectName("test:type=support1");
         }
         catch(Exception e)
         {
            fail(e.toString());
         }
         RoleList shouldBe = new RoleList();
         shouldBe.add(roleC1);
         shouldBe.add(roleCX2);
         compare(shouldBe, support.retrieveAllRoles());
         RelationNotification rn = listener.check(1);
         assertEquals(new ArrayList(), rn.getMBeansToUnregister());
         assertEquals(roleCX2.getRoleValue(), rn.getNewRoleValue());
         assertEquals(on, rn.getObjectName());
         assertEquals(roleC2.getRoleValue(), rn.getOldRoleValue());
View Full Code Here

Examples of javax.management.relation.RelationSupport

      {
         ObjectName service = createRelationService("test:type=service", server);
         createRelationTypeC(service);
         createRolesC(server);
         createRolesCX(server);
         RelationSupport support = null;
         ObjectName on = null;
         Listener listener = new Listener(RelationNotification.RELATION_MBEAN_UPDATE);
         RoleList shouldBe = new RoleList();
         shouldBe.add(roleC1);
         shouldBe.add(roleCX2);
         try
         {
            support = new RelationSupport("id1", service, server,
                                          "relationTypeC", rolesC);
            addRelation(server, service, support, "test:type=support1");
            server.addNotificationListener(service, listener, null, null);
           
            support.setRoles(shouldBe);
            on = new ObjectName("test:type=support1");
         }
         catch(Exception e)
         {
            fail(e.toString());
         }
         compare(shouldBe, support.retrieveAllRoles());
         RelationNotification rn = listener.check(1);
      }
      finally
      {
         MBeanServerFactory.releaseMBeanServer(server);
View Full Code Here

Examples of javax.management.relation.RelationSupport

      try
      {
         ObjectName service = createRelationService("test:type=service", server);
         createRelationTypeB(service);
         createRolesB(server);
         RelationSupport support = null;
         ObjectName rsupp = null;
         String result = null;
         Listener listener = new Listener(RelationNotification.RELATION_MBEAN_CREATION);
         RelationService rs = (RelationService) services.get(service);
         server.addNotificationListener(service, listener, null, null);
         support = new RelationSupport("id", service, server, "relationTypeB",
                                       rolesB);
         rsupp = new ObjectName("test:add=relation");
         server.registerMBean(support, rsupp);
         rs.addRelation(rsupp);
         result = rs.isRelation(rsupp);
View Full Code Here

Examples of javax.management.relation.RelationSupport

      {
         ObjectName service = createRelationService("test:type=service", null);
         RelationService rs = (RelationService) services.get(service);
         createRelationTypeB(service);
         createRolesB(server);
         RelationSupport support = null;
         ObjectName name = null;
         support = new RelationSupport("id", service, server, "relationTypeB",
                                          rolesB);
         name = new ObjectName("test:type=relation");
         server.registerMBean(support, name);

         boolean caught = false;
         try
         {
            rs.addRelation(null);
         }
         catch (IllegalArgumentException e)
         {
            caught = true;
         }
         if (caught == false)
            fail("addRelation allows null relation");

         caught = false;
         try
         {
            rs.addRelation(name);
         }
         catch (RelationServiceNotRegisteredException e)
         {
            caught = true;
         }
         if (caught == false)
            fail("addRelation allowed when not registered");

         ObjectName badRelation = null;
         server.registerMBean(rs, service);
         badRelation = new ObjectName("test:type=bad");
         server.registerMBean(new Trivial(), badRelation);

         caught = false;
         try
         {
            rs.addRelation(badRelation);
         }
         catch (NoSuchMethodException e)
         {
            caught = true;
         }
         if (caught == false)
            fail("addRelation allowed when not a relation");

         caught = false;
         try
         {
            rs.addRelation(name);
            rs.addRelation(name);
         }
         catch (InvalidRelationIdException e)
         {
            caught = true;
         }
         if (caught == false)
            fail("addRelation allows duplicate relation ids");

         rs.removeRelation("id");
         server.unregisterMBean(name);

         caught = false;
         try
         {
            rs.addRelation(name);
         }
         catch (InstanceNotFoundException e)
         {
            caught = true;
         }
         if (caught == false)
            fail("addRelation allows unregistered relation");

         ObjectName service2 = createRelationService("test:type=service2", null);
         RelationService rs2 = (RelationService) services.get(service);
         createRelationTypeB(service2);
         RelationSupport support2 = null;
         ObjectName name2 = null;
         support = new RelationSupport("id", service2, server, "relationTypeB",
                                          rolesB);
         name2 = new ObjectName("test:type=relation2");
         server.registerMBean(support, name2);

         caught = false;
         try
         {
            rs.addRelation(name2);
         }
         catch (InvalidRelationServiceException e)
         {
            caught = true;
         }
         if (caught == false)
            fail("addRelation allows registration in the wrong relation service");

         support = new RelationSupport("id", service, server, "relationTypeX",
                                          rolesB);
         name = new ObjectName("test:type=relationX");
         server.registerMBean(support, name);

         caught = false;
         try
         {
            rs.addRelation(name);
         }
         catch (RelationTypeNotFoundException e)
         {
            caught = true;
         }
         if (caught == false)
            fail("addRelation allows registration with invalid relation type");

         createRelationTypeC(service);
         createRolesC(server);
         createRolesCZ(server);
         support = new RelationSupport("idC", service, server, "relationTypeB",
                                          rolesC);
         name = new ObjectName("test:type=relationC");
         server.registerMBean(support, name);

         caught = false;
         try
         {
            rs.addRelation(name);
         }
         catch (RoleNotFoundException e)
         {
            caught = true;
         }
         if (caught == false)
            fail("addRelation allows registration with invalid role name");

         support = new RelationSupport("idCZ", service, server, "relationTypeC",
                                          rolesCZ);
         name = new ObjectName("test:type=relationCZ");
         server.registerMBean(support, name);

         caught = false;
View Full Code Here

Examples of javax.management.relation.RelationSupport

      try
      {
         ObjectName service = createRelationService("test:type=service", server);
         createRelationTypeB(service);
         createRolesB(server);
         RelationSupport support = null;
         Integer readB1 = null;
         Integer readB2 = null;
         RelationService rs = (RelationService) services.get(service);
         support = new RelationSupport("id", service, server,
                                          "relationTypeB", rolesB);
         addRelation(server, service, support, "test:type=support");
         readB1 = rs.checkRoleReading("roleB1", "relationTypeB");
         readB2 = rs.checkRoleReading("roleB2", "relationTypeB");
View Full Code Here

Examples of javax.management.relation.RelationSupport

      try
      {
         ObjectName service = createRelationService("test:type=service", server);
         createRelationTypeB(service);
         createRolesB(server);
         RelationSupport support = null;
         Integer writeB1normal = null;
         Integer writeB2normal = null;
         Integer writeB1init = null;
         Integer writeB2init = null;
         RelationService rs = (RelationService) services.get(service);
         support = new RelationSupport("id", service, server,
                                       "relationTypeB", rolesB);
         addRelation(server, service, support, "test:type=support");
         writeB1normal = rs.checkRoleWriting(roleB1, "relationTypeB", new Boolean(false));
         writeB2normal = rs.checkRoleWriting(roleB2, "relationTypeB", new Boolean(false));
         writeB1init = rs.checkRoleWriting(roleB1, "relationTypeB", new Boolean(true));
View Full Code Here

Examples of javax.management.relation.RelationSupport

      try
      {
         ObjectName service = createRelationService("test:type=service", server);
         createRelationTypeB(service);
         createRolesB(server);
         RelationSupport support = null;
         Listener listener = new Listener(RelationNotification.RELATION_BASIC_CREATION);
         RelationService rs = (RelationService) services.get(service);
         server.addNotificationListener(service, listener, null, null);
         rs.createRelation("id", "relationTypeB", rolesB);
         boolean result = rs.hasRelation("id").booleanValue();
View Full Code Here

Examples of javax.management.relation.RelationSupport

         Map result12 = null;
         Map result13 = null;
         Map result14 = null;
         Map result15 = null;
         Map result16 = null;
         RelationSupport supportCX = new RelationSupport("idcx", service, server,
                                       "relationTypeCX", rolesCX);
         RelationSupport supportC = new RelationSupport("idc", service, server,
                                       "relationTypeC", rolesC);
         addRelation(server, service, supportCX, "test:type=supportCX");
         addRelation(server, service, supportC, "test:type=supportC");
         RelationService rs = (RelationService) services.get(service);
         result1 = rs.findAssociatedMBeans(new ObjectName("x:relation=c,role=1,bean=1"), null, null);
View Full Code Here

Examples of javax.management.relation.RelationSupport

         Map result12 = null;
         Map result13 = null;
         Map result14 = null;
         Map result15 = null;
         Map result16 = null;
         RelationSupport supportCX = new RelationSupport("idcx", service, server,
                                       "relationTypeCX", rolesCX);
         RelationSupport supportC = new RelationSupport("idc", service, server,
                                       "relationTypeC", rolesC);
         addRelation(server, service, supportCX, "test:type=supportCX");
         addRelation(server, service, supportC, "test:type=supportC");
         RelationService rs = (RelationService) services.get(service);
         result1 = rs.findReferencingRelations(new ObjectName("x:relation=c,role=1,bean=1"), null, null);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.