/** */ public static Object get(ObjectName name, MBeanServer server) throws MBeanProxyCreationException { return get(new Class[] { ProxyContext.class, DynamicMBean.class }, name, server); }
public void startService() throws Exception { mgmt = (SleeManagementMBeanImplMBean)MBeanProxy.get(SleeManagementMBeanImplMBean.class, sleeManagementMBeanName, server); } }
/** * Creates a proxy to an MBean in the given MBean server. * * @param intrface the interface this proxy implements * @param name object name of the MBean this proxy connects to * @param server MBean server this proxy connects to * * @return proxy instance * * @throws MBeanProxyCreationException if the proxy could not be created */ public static Object get(Class intrface, ObjectName name, MBeanServer server) throws MBeanProxyCreationException { return get(new Class[] { intrface, ProxyContext.class, DynamicMBean.class }, name, server); }
/** * Creates a proxy to an MBean in the given MBean server. * * @param intrface the interface this proxy implements * @param name object name of the MBean this proxy connects to * @param agentID agent ID of the MBean server this proxy connects to * * @return proxy instance * * @throws MBeanProxyCreationException if the proxy could not be created */ public static Object get(Class intrface, ObjectName name, String agentID) throws MBeanProxyCreationException { return get(intrface, name, (MBeanServer)MBeanServerFactory.findMBeanServer(agentID).get(0)); }
/** Create the deployer service */ protected void createService() throws Exception { mainDeployer = (MainDeployerMBean)MBeanProxy.get(MainDeployerMBean.class, MainDeployerMBean.OBJECT_NAME, server); super.attach(); }
private MainDeployerMBean getMainDeployer() throws MBeanProxyCreationException { MBeanServer server = MBeanServerLocator.locateJBoss(); MainDeployerMBean mainDeployer = (MainDeployerMBean)MBeanProxy.get(MainDeployerMBean.class, MainDeployerMBean.OBJECT_NAME, server); return mainDeployer; } }
private MainDeployerMBean getMainDeployer() throws MBeanProxyCreationException { MBeanServer server = MBeanServerLocator.locateJBoss(); MainDeployerMBean mainDeployer = (MainDeployerMBean)MBeanProxy.get(MainDeployerMBean.class, MainDeployerMBean.OBJECT_NAME, server); return mainDeployer; } }
public Object run() throws Exception { Object proxy = MBeanProxy.get(iface, name, server); Class[] ifaces = {iface}; InvocationHandler secureHandler = new InvocationHandlerAction(proxy); Object secureProxy = Proxy.newProxyInstance(iface.getClassLoader(), ifaces, secureHandler); return secureProxy; } }
/** Create the deployer service */ protected void createService() throws Exception { mainDeployer = (MainDeployerMBean)MBeanProxy.get(MainDeployerMBean.class, MainDeployerMBean.OBJECT_NAME, server); super.attach(); }
/** Create the deployer service */ protected void createService() throws Exception { mainDeployer = (MainDeployerMBean)MBeanProxy.get(MainDeployerMBean.class, MainDeployerMBean.OBJECT_NAME, server); super.attach(); }
private MainDeployerMBean getMainDeployer() throws MBeanProxyCreationException { MBeanServer server = MBeanServerLocator.locateJBoss(); MainDeployerMBean mainDeployer = (MainDeployerMBean)MBeanProxy.get(MainDeployerMBean.class, MainDeployerMBean.OBJECT_NAME, server); return mainDeployer; } }
private void startRMIServer(NullActivityFactoryImpl naf, SleeInternalEndpoint endpoint, EventLookup eventLookup, ObjectName rmiServerInterfaceMBean) { try { logger.debug("creating RmiServerInterface using MBeanProxy"); rmiServerInterfaceMBeanImpl = (RmiServerInterfaceMBean) MBeanProxy .get(RmiServerInterfaceMBean.class, rmiServerInterfaceMBean, mbeanServer); rmiServerInterfaceMBeanImpl.startRMIServer(naf, endpoint, eventLookup, activityContextFactory); } catch (Exception e) { logger.error( "Failed to start HA RMI server for Remote slee service", e); } }
static Object getMBeanProxy(Class iface, ObjectName name, MBeanServer server) throws Exception { Object proxy; if( System.getSecurityManager() == null ) { proxy = MBeanProxy.get(iface, name, server); } else { MBeanProxyAction action = new MBeanProxyAction(iface, name, server); proxy = AccessController.doPrivileged(action); } return proxy; } static ClassLoader getContextClassLoader()
/** * Return a MBean specified by its class and lookup name using JBoss JMX utilities. * @throws NullPointerException * @throws MBeanProxyCreationException * @throws MalformedObjectNameException * @see org.jboss.mx.util.MBeanProxy * @see org.jboss.mx.util.MBeanServerLocator */ public static <T> T findMBean(Class<T> type, String lookupName) { try { MBeanServer mbeanServer = MBeanServerLocator.locateJBoss(); Object mbean = MBeanProxy.get(type, new ObjectName(lookupName), mbeanServer); return type.cast(mbean); } catch( Exception e){ throw new RuntimeException(e); } }
private Ejb3ModuleMBean getEJB3Module(ObjectName objectName) { Ejb3ModuleMBean ejb3Module; try { MBeanServer server = MBeanServerLocator.locateJBoss(); ejb3Module = (Ejb3ModuleMBean)MBeanProxy.get(Ejb3ModuleMBean.class, objectName, server); if (ejb3Module == null) throw new WSFDeploymentException("Cannot obtain EJB3 module: " + objectName); return ejb3Module; } catch (MBeanProxyCreationException ex) { throw new WSFDeploymentException("Cannot obtain proxy to EJB3 module"); } } }
static Ejb3ModuleMBean getEJB3Module(ObjectName objectName) { Ejb3ModuleMBean ejb3Module; try { MBeanServer server = MBeanServerLocator.locateJBoss(); ejb3Module = (Ejb3ModuleMBean)MBeanProxy.get(Ejb3ModuleMBean.class, objectName, server); if (ejb3Module == null) throw new WSFDeploymentException("Cannot obtain EJB3 module: " + objectName); return ejb3Module; } catch (MBeanProxyCreationException ex) { throw new WSFDeploymentException("Cannot obtain proxy to EJB3 module"); } } }
private Ejb3ModuleMBean getEJB3Module(ObjectName objectName) { Ejb3ModuleMBean ejb3Module; try { MBeanServer server = MBeanServerLocator.locateJBoss(); ejb3Module = (Ejb3ModuleMBean)MBeanProxy.get(Ejb3ModuleMBean.class, objectName, server); if (ejb3Module == null) throw new WSFDeploymentException("Cannot obtain EJB3 module: " + objectName); return ejb3Module; } catch (MBeanProxyCreationException ex) { throw new WSFDeploymentException("Cannot obtain proxy to EJB3 module"); } } }
private Ejb3ModuleMBean getEJB3Module(ObjectName objectName) { Ejb3ModuleMBean ejb3Module; try { MBeanServer server = MBeanServerLocator.locateJBoss(); ejb3Module = (Ejb3ModuleMBean)MBeanProxy.get(Ejb3ModuleMBean.class, objectName, server); if (ejb3Module == null) throw new WSFDeploymentException("Cannot obtain EJB3 module: " + objectName); return ejb3Module; } catch (MBeanProxyCreationException ex) { throw new WSFDeploymentException("Cannot obtain proxy to EJB3 module"); } } }
static Ejb3ModuleMBean getEJB3Module(ObjectName objectName) { Ejb3ModuleMBean ejb3Module; try { MBeanServer server = MBeanServerLocator.locateJBoss(); ejb3Module = (Ejb3ModuleMBean)MBeanProxy.get(Ejb3ModuleMBean.class, objectName, server); if (ejb3Module == null) throw new WSFDeploymentException("Cannot obtain EJB3 module: " + objectName); return ejb3Module; } catch (MBeanProxyCreationException ex) { throw new WSFDeploymentException("Cannot obtain proxy to EJB3 module"); } } }
static Ejb3ModuleMBean getEJB3Module(ObjectName objectName) { Ejb3ModuleMBean ejb3Module; try { MBeanServer server = MBeanServerLocator.locateJBoss(); ejb3Module = (Ejb3ModuleMBean)MBeanProxy.get(Ejb3ModuleMBean.class, objectName, server); if (ejb3Module == null) throw new WSFDeploymentException("Cannot obtain EJB3 module: " + objectName); return ejb3Module; } catch (MBeanProxyCreationException ex) { throw new WSFDeploymentException("Cannot obtain proxy to EJB3 module"); } } }