本文整理汇总了Java中javax.management.remote.MBeanServerForwarder类的典型用法代码示例。如果您正苦于以下问题:Java MBeanServerForwarder类的具体用法?Java MBeanServerForwarder怎么用?Java MBeanServerForwarder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MBeanServerForwarder类属于javax.management.remote包,在下文中一共展示了MBeanServerForwarder类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setMBeanServer
import javax.management.remote.MBeanServerForwarder; //导入依赖的package包/类
/**
* Set the <code>MBeanServer</code> object to which incoming
* requests are sent. This must be either the MBean server in
* which this connector is registered, or an
* <code>MBeanServerForwarder</code> leading to that server. An
* <code>MBeanServerForwarder</code> <code>mbsf</code> leads to an
* MBean server <code>mbs</code> if
* <code>mbsf.getMBeanServer()</code> is either <code>mbs</code>
* or an <code>MBeanServerForwarder</code> leading to
* <code>mbs</code>.
*
* @exception IllegalArgumentException if <code>newMBS</code> is neither
* the MBean server in which this connector is registered nor an
* <code>MBeanServerForwarder</code> leading to that server.
*
* @exception IllegalStateException This method has been invoked
* while the communicator was ONLINE or STARTING.
*/
public synchronized void setMBeanServer(MBeanServer newMBS)
throws IllegalArgumentException, IllegalStateException {
synchronized (stateLock) {
if (state == ONLINE || state == STARTING)
throw new IllegalStateException("Stop server before " +
"carrying out this operation");
}
final String error =
"MBeanServer argument must be MBean server where this " +
"server is registered, or an MBeanServerForwarder " +
"leading to that server";
Vector<MBeanServer> seenMBS = new Vector<>();
for (MBeanServer mbs = newMBS;
mbs != bottomMBS;
mbs = ((MBeanServerForwarder) mbs).getMBeanServer()) {
if (!(mbs instanceof MBeanServerForwarder))
throw new IllegalArgumentException(error);
if (seenMBS.contains(mbs))
throw new IllegalArgumentException("MBeanServerForwarder " +
"loop");
seenMBS.addElement(mbs);
}
topMBS = newMBS;
}
示例2: setMBeanServer
import javax.management.remote.MBeanServerForwarder; //导入依赖的package包/类
/**
* Set the <code>MBeanServer</code> object to which incoming
* requests are sent. This must be either the MBean server in
* which this connector is registered, or an
* <code>MBeanServerForwarder</code> leading to that server. An
* <code>MBeanServerForwarder</code> <code>mbsf</code> leads to an
* MBean server <code>mbs</code> if
* <code>mbsf.getMBeanServer()</code> is either <code>mbs</code>
* or an <code>MBeanServerForwarder</code> leading to
* <code>mbs</code>.
*
* @exception IllegalArgumentException if <code>newMBS</code> is neither
* the MBean server in which this connector is registered nor an
* <code>MBeanServerForwarder</code> leading to that server.
*
* @exception IllegalStateException This method has been invoked
* while the communicator was ONLINE or STARTING.
*/
public synchronized void setMBeanServer(MBeanServer newMBS)
throws IllegalArgumentException, IllegalStateException {
synchronized (stateLock) {
if (state == ONLINE || state == STARTING)
throw new IllegalStateException("Stop server before " +
"carrying out this operation");
}
final String error =
"MBeanServer argument must be MBean server where this " +
"server is registered, or an MBeanServerForwarder " +
"leading to that server";
Vector<MBeanServer> seenMBS = new Vector<MBeanServer>();
for (MBeanServer mbs = newMBS;
mbs != bottomMBS;
mbs = ((MBeanServerForwarder) mbs).getMBeanServer()) {
if (!(mbs instanceof MBeanServerForwarder))
throw new IllegalArgumentException(error);
if (seenMBS.contains(mbs))
throw new IllegalArgumentException("MBeanServerForwarder " +
"loop");
seenMBS.addElement(mbs);
}
topMBS = newMBS;
}
示例3: setMBeanServerForwarder
import javax.management.remote.MBeanServerForwarder; //导入依赖的package包/类
@Override
public synchronized
void setMBeanServerForwarder(MBeanServerForwarder mbsf) {
super.setMBeanServerForwarder(mbsf);
if (rmiServerImpl != null)
rmiServerImpl.setMBeanServer(getMBeanServer());
}
示例4: newMBeanServer
import javax.management.remote.MBeanServerForwarder; //导入依赖的package包/类
public MBeanServer newMBeanServer(
String defaultDomain,
MBeanServer outer,
MBeanServerDelegate delegate) {
final MBeanServerForwarder mbsf =
MBeanServerForwarderInvocationHandler.newProxyInstance();
final MBeanServer innerMBeanServer =
inner.newMBeanServer(defaultDomain,
(outer == null ? mbsf : outer),
delegate);
mbsf.setMBeanServer(innerMBeanServer);
return mbsf;
}
示例5: newProxyInstance
import javax.management.remote.MBeanServerForwarder; //导入依赖的package包/类
public static MBeanServerForwarder newProxyInstance() {
final InvocationHandler handler =
new MBeanServerForwarderInvocationHandler();
final Class[] interfaces =
new Class[] {MBeanServerForwarder.class};
Object proxy = Proxy.newProxyInstance(
MBeanServerForwarder.class.getClassLoader(),
interfaces,
handler);
return MBeanServerForwarder.class.cast(proxy);
}
示例6: newProxyInstance
import javax.management.remote.MBeanServerForwarder; //导入依赖的package包/类
public static MBeanServerForwarder newProxyInstance() {
final InvocationHandler handler = new MBSFInvocationHandler();
final Class[] interfaces =
new Class[] {MBeanServerForwarder.class};
Object proxy = Proxy.newProxyInstance(
MBeanServerForwarder.class.getClassLoader(),
interfaces,
handler);
return MBeanServerForwarder.class.cast(proxy);
}
示例7: newProxyInstance
import javax.management.remote.MBeanServerForwarder; //导入依赖的package包/类
public static MBeanServerForwarder newProxyInstance() {
final InvocationHandler handler =
new MBeanServerForwarderInvocationHandler();
final Class[] interfaces =
new Class[] {MBeanServerForwarder.class};
Object proxy = Proxy.newProxyInstance(
MBeanServerForwarder.class.getClassLoader(),
interfaces,
handler);
return MBeanServerForwarder.class.cast(proxy);
}
示例8: newMBeanServer
import javax.management.remote.MBeanServerForwarder; //导入依赖的package包/类
public MBeanServer newMBeanServer(String defaultDomain,
MBeanServer outer,
MBeanServerDelegate delegate) {
final MBeanServerForwarder mbsf =
MBeanServerForwarderInvocationHandler.newProxyInstance();
final MBeanServer innerMBeanServer =
inner.newMBeanServer(defaultDomain,
(outer == null ? mbsf : outer),
delegate);
mbsf.setMBeanServer(innerMBeanServer);
return mbsf;
}