本文整理汇总了Java中com.sun.jmx.remote.util.EnvHelp.filterAttributes方法的典型用法代码示例。如果您正苦于以下问题:Java EnvHelp.filterAttributes方法的具体用法?Java EnvHelp.filterAttributes怎么用?Java EnvHelp.filterAttributes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.jmx.remote.util.EnvHelp
的用法示例。
在下文中一共展示了EnvHelp.filterAttributes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toJMXConnector
import com.sun.jmx.remote.util.EnvHelp; //导入方法依赖的package包/类
/**
* <p>Returns a client stub for this connector server. A client
* stub is a serializable object whose {@link
* JMXConnector#connect(Map) connect} method can be used to make
* one new connection to this connector server.</p>
*
* @param env client connection parameters of the same sort that
* could be provided to {@link JMXConnector#connect(Map)
* JMXConnector.connect(Map)}. Can be null, which is equivalent
* to an empty map.
*
* @return a client stub that can be used to make a new connection
* to this connector server.
*
* @exception UnsupportedOperationException if this connector
* server does not support the generation of client stubs.
*
* @exception IllegalStateException if the JMXConnectorServer is
* not started (see {@link #isActive()}).
*
* @exception IOException if a communications problem means that a
* stub cannot be created.
**/
public JMXConnector toJMXConnector(Map<String,?> env) throws IOException {
// The serialized for of rmiServerImpl is automatically
// a RMI server stub.
if (!isActive()) throw new
IllegalStateException("Connector is not active");
// Merge maps
Map<String, Object> usemap = new HashMap<String, Object>(
(this.attributes==null)?Collections.<String, Object>emptyMap():
this.attributes);
if (env != null) {
EnvHelp.checkAttributes(env);
usemap.putAll(env);
}
usemap = EnvHelp.filterAttributes(usemap);
final RMIServer stub=(RMIServer)rmiServerImpl.toStub();
return new RMIConnector(stub, usemap);
}
示例2: getAttributes
import com.sun.jmx.remote.util.EnvHelp; //导入方法依赖的package包/类
public Map<String,?> getAttributes() {
Map<String, ?> map = EnvHelp.filterAttributes(attributes);
return Collections.unmodifiableMap(map);
}