@Override public void handle(DataInput input, int correlationId) throws IOException { log.trace("UnregisterMBean"); byte paramType = input.readByte(); if (paramType != OBJECT_NAME) { throw new IOException("Unexpected paramType"); } Unmarshaller unmarshaller = prepareForUnMarshalling(input); ObjectName objectName; try { objectName = unmarshaller.readObject(ObjectName.class); } catch (ClassNotFoundException cnfe) { throw new IOException(cnfe); } try { server.getMBeanServerConnection().unregisterMBean(objectName); writeResponse(UNREGISTER_MBEAN, correlationId); log.tracef("[%d] UnregisterMBean - Success Response Sent", correlationId); } catch (MBeanRegistrationException e) { writeResponse(e, UNREGISTER_MBEAN, correlationId); log.tracef("[%d] UnregisterMBean - Failure Response Sent", correlationId); } catch (InstanceNotFoundException e) { writeResponse(e, UNREGISTER_MBEAN, correlationId); log.tracef("[%d] UnregisterMBean - Failure Response Sent", correlationId); } }
mbsc.unregisterMBean(instance.getObjectName()); return null; } else if (subCommand.startsWith(CREATE_CMD_PREFIX)) {
@Override public void handle(DataInput input, int correlationId) throws IOException { log.trace("UnregisterMBean"); byte paramType = input.readByte(); if (paramType != OBJECT_NAME) { throw new IOException("Unexpected paramType"); } Unmarshaller unmarshaller = prepareForUnMarshalling(input); ObjectName objectName; try { objectName = unmarshaller.readObject(ObjectName.class); } catch (ClassNotFoundException cnfe) { throw new IOException(cnfe); } try { server.getMBeanServerConnection().unregisterMBean(objectName); writeResponse(UNREGISTER_MBEAN, correlationId); log.tracef("[%d] UnregisterMBean - Success Response Sent", correlationId); } catch (MBeanRegistrationException e) { writeResponse(e, UNREGISTER_MBEAN, correlationId); log.tracef("[%d] UnregisterMBean - Failure Response Sent", correlationId); } catch (InstanceNotFoundException e) { writeResponse(e, UNREGISTER_MBEAN, correlationId); log.tracef("[%d] UnregisterMBean - Failure Response Sent", correlationId); } }
public static void unregisterAll(final MBeanServerConnection conn, final Set<ObjectName> allNames) throws IOException, MalformedObjectNameException, MBeanRegistrationException { for (final ObjectName name : allNames) { try { conn.unregisterMBean(name); } catch (Exception e) { // OK, gone, it objects, etc } } }
public void unregisterMBean(ObjectName name) throws InstanceNotFoundException, MBeanRegistrationException, IOException { server.unregisterMBean(name); } }
public void unregisterMBean(ObjectName name) throws InstanceNotFoundException,MBeanRegistrationException,IOException{ connection.unregisterMBean(name); }
public static void unregisterAll(final MBeanServerConnection conn, final Set<ObjectName> allNames) throws IOException, MalformedObjectNameException, MBeanRegistrationException { for (final ObjectName name : allNames) { try { conn.unregisterMBean(name); } catch (Exception e) { // OK, gone, it objects, etc } } }
private void unregisterBeanForName(String name) { try { JMXServiceURL jmxServiceURL = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://127.0.0.1:9999/jmxrmi"); JMXConnector cc = JMXConnectorFactory.connect(jmxServiceURL); MBeanServerConnection mbsc = cc.getMBeanServerConnection(); //This information is available in jconsole ObjectName serviceConfigName = new ObjectName("YourObjectName"); mbsc.unregisterMBean(serviceConfigName); // Close JMX connector cc.close(); } catch (Exception e) { System.out.println("Exception occurred: " + e.toString()); e.printStackTrace(); } }
@Override public void unregisterMBean(ObjectName name) throws InstanceNotFoundException, MBeanRegistrationException, IOException { checkConnection(); connection.unregisterMBean(name); }
@Override public void unregisterMBean(ObjectName name) throws InstanceNotFoundException, MBeanRegistrationException, IOException { checkConnection(); connection.unregisterMBean(name); }
@Override public void unregisterMBean(ObjectName name) throws InstanceNotFoundException, MBeanRegistrationException, IOException { checkConnection(); connection.unregisterMBean(name); }
@Override public void unregisterMBean(ObjectName name) throws InstanceNotFoundException, MBeanRegistrationException, IOException { checkConnection(); connection.unregisterMBean(name); }
public void unregisterMBean(ObjectName name, Subject delegate) throws InstanceNotFoundException, MBeanRegistrationException, IOException { getServer().unregisterMBean(name); }
/** * Unregisters the MBean given as a command line argument. */ private void mbeanUnregister() { MBeanServerConnection cnx; try { cnx = this.jmxap.getMBeanServerConnection(); cnx.unregisterMBean(this.on); } catch (Exception e) { e.printStackTrace(System.err); } finally { this.jmxap.releaseMBeanServerConnection(); } }
/** * Unregister Mbean * @param jmxServerConnection * @param name * @return The value of the given named attribute * @throws Exception */ protected String jmxUuregister(MBeanServerConnection jmxServerConnection,String name) throws Exception { String error = null; if(isEcho()) { handleOutput("Unregister MBean " + name ); } jmxServerConnection.unregisterMBean( new ObjectName(name)); return error; }
private void unregisterNonCompliantMBean( final ObjectName objectName) { if ( mUnregisterNonCompliant ) { try { mMBeanServer.unregisterMBean(objectName); logWarning( "Unregistered non-compliant MBean " + objectName, null); } catch( final Exception ignore ) { logWarning( "Unable to unregister non-compliant MBean " + objectName, null); } } }
private void unregisterNonCompliantMBean( final ObjectName objectName) { if ( mUnregisterNonCompliant ) { try { mMBeanServer.unregisterMBean(objectName); logWarning( "Unregistered non-compliant MBean " + objectName, null); } catch( final Exception ignore ) { logWarning( "Unable to unregister non-compliant MBean " + objectName, null); } } }
public void execute(String[] args) throws Exception { processArguments(args); log.debug("object names: " + names); if (names.size() == 0) throw new CommandException("At least one object name is required"); MBeanServerConnection server = getMBeanServer(); Iterator iter = names.iterator(); while (iter.hasNext()) { ObjectName name = (ObjectName)iter.next(); server.unregisterMBean(name); } closeServer(); } }
/** * Deletes the MLet given as command argument. * * @throws InstanceNotFoundException MBean instance not found. * @throws MBeanRegistrationException MLet registration failed. * @throws MalformedObjectNameException Object name invalid. * @throws IOException Connection problem. */ private void deleteMLet() throws InstanceNotFoundException, MBeanRegistrationException, MalformedObjectNameException, IOException { try { this.mbscnx = this.jmxap.getMBeanServerConnection(); this.mbscnx.unregisterMBean(ObjectName.getInstance(this.getDomain() + ":" + MLET_OBJECTNAME_RADIX + ",name=" + (this.mletName != null ? this.mletName : this.server))); } finally { this.jmxap.releaseMBeanServerConnection(); } }
public void unRegisterTimerService(){ mTargetCheckTimer.stop(); unHookFromTimerService(); try{ if ( mMBeanServer.isRegistered(mTargetCheckTimerObjectName) ) { mMBeanServer.unregisterMBean(mTargetCheckTimerObjectName); } }catch(Exception e){ String bundleKey = "caps.management.server.alert.instance.check.timer.shutdown.error.log.msg"; String message = AlertUtil.constructLogMessage(bundleKey); mLogger.log(Level.WARNING, message, e); } }