RMRest.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:scheduling 作者:
/**
 * Returns the attributes <code>attr</code> of the mbean
 * registered as <code>name</code>.
 * @param sessionId a valid session
 * @param name mbean's object name
 * @param attrs attributes to enumerate
 * @return returns the attributes of the mbean 
 * @throws InstanceNotFoundException
 * @throws IntrospectionException
 * @throws ReflectionException
 * @throws IOException
 * @throws NotConnectedException 
 */
@Override
@GET
@GZIP
@Path("info/{name}")
@Produces("application/json")
public Object getMBeanInfo(@HeaderParam("sessionid") String sessionId, @PathParam("name") ObjectName name,
        @QueryParam("attr") List<String> attrs) throws InstanceNotFoundException, IntrospectionException,
        ReflectionException, IOException, NotConnectedException {
    RMProxyUserInterface rm = checkAccess(sessionId);

    if ((attrs == null) || (attrs.size() == 0)) {
        // no attribute is requested, we return
        // the description of the mbean
        return rm.getMBeanInfo(name);

    } else {
        return rm.getMBeanAttributes(name, attrs.toArray(new String[attrs.size()]));
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号