java类javax.management.relation.RelationTypeNotFoundException的实例源码

StructureTest.java 文件源码 项目:freeVM 阅读 29 收藏 0 点赞 0 评论 0
public Result testUnknownRelationType() throws Exception {

        MBeanServer server = MBeanServerFactory.createMBeanServer();

        ObjectName unitName = new ObjectName("a:b=c");
        server.registerMBean(new Unit(), unitName);

        RelationService rService = new RelationService(true);
        server.registerMBean(rService, new ObjectName("a:b=d"));

        RoleList unitRoles = new RoleList();
        unitRoles.add(new Role("role", Collections.singletonList(unitName)));

        /* Try to create relation with unknown relation type */
        try {
            rService.createRelation("relation", "relationType", unitRoles);
            return failed("");
        } catch (RelationTypeNotFoundException e) {
            return passed();
        } catch (Throwable t) {
            return failed(t.toString());
        }
    }
ERelationMBean.java 文件源码 项目:freeVM 阅读 35 收藏 0 点赞 0 评论 0
void unregisterMBean(ObjectName mBeanName, String roleName)
throws RoleNotFoundException, InvalidRoleValueException,
RelationServiceNotRegisteredException,
RelationTypeNotFoundException, RelationNotFoundException,
IllegalArgumentException;


问题


面经


文章

微信
公众号

扫码关注公众号