@Override public void handle(DataInput input, final int correlationId) throws IOException { log.trace("GetDefaultDomain"); final String defaultDomain = server.getMBeanServerConnection().getDefaultDomain(); writeResponse(defaultDomain, GET_DEFAULT_DOMAIN, correlationId); log.tracef("[%d] CreateMBean - Success Response Sent", correlationId); } }
@Override public void handle(DataInput input, int correlationId) throws IOException { log.trace("GetMBeanInfo"); 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 { MBeanInfo info = server.getMBeanServerConnection().getMBeanInfo(objectName); writeResponse(info, MBEAN_INFO, GET_MBEAN_INFO, correlationId); log.tracef("[%d] GetMBeanInfo - Success Response Sent", correlationId); } catch (IntrospectionException e) { writeResponse(e, MBEAN_INFO, correlationId); log.tracef("[%d] GetMBeanInfo - Failure Response Sent", correlationId); } catch (InstanceNotFoundException e) { writeResponse(e, MBEAN_INFO, correlationId); log.tracef("[%d] GetMBeanInfo - Failure Response Sent", correlationId); } catch (ReflectionException e) { writeResponse(e, MBEAN_INFO, correlationId); log.tracef("[%d] GetMBeanInfo - Failure Response Sent", correlationId); } }
@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); } }
final Object attributeValue = server.getMBeanServerConnection().getAttribute(objectName, attribute); writeResponse(attributeValue, OBJECT, GET_ATTRIBUTE, correlationId); writeResponse(e, GET_ATTRIBUTE, correlationId); log.tracef("[%d] GetAttribute - Failure Response Sent", correlationId); } catch (InstanceNotFoundException e) { writeResponse(e, GET_ATTRIBUTE, correlationId); log.tracef("[%d] GetAttribute - Failure Response Sent", correlationId); } catch (MBeanException e) { writeResponse(e, GET_ATTRIBUTE, correlationId); log.tracef("[%d] GetAttribute - Failure Response Sent", correlationId); } catch (ReflectionException e) { writeResponse(e, GET_ATTRIBUTE, correlationId); log.tracef("[%d] GetAttribute - Failure Response Sent", correlationId);
@Override public void handle(DataInput input, int correlationId) throws IOException { log.trace("GetObjectInstance"); 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 { ObjectInstance objectInstance = server.getMBeanServerConnection().getObjectInstance(objectName); writeResponse(objectInstance, OBJECT_INSTANCE, GET_OBJECT_INSTANCE, correlationId); log.tracef("[%d] GetObjectInstance - Success Response Sent", correlationId); } catch (InstanceNotFoundException e) { writeResponse(e, GET_OBJECT_INSTANCE, correlationId); log.tracef("[%d] GetObjectInstance - Failure Response Sent", correlationId); } }
server.getMBeanServerConnection().setAttribute(objectName, attr); writeResponse(SET_ATTRIBUTE, correlationId); writeResponse(e, SET_ATTRIBUTE, correlationId); log.tracef("[%d] SetAttribute - Failure Response Sent", correlationId); } catch (InvalidAttributeValueException e) { writeResponse(e, SET_ATTRIBUTE, correlationId); log.tracef("[%d] SetAttribute - Failure Response Sent", correlationId); } catch (AttributeNotFoundException e) { writeResponse(e, SET_ATTRIBUTE, correlationId); log.tracef("[%d] SetAttribute - Failure Response Sent", correlationId); } catch (ReflectionException e) { writeResponse(e, SET_ATTRIBUTE, correlationId); log.tracef("[%d] SetAttribute - Failure Response Sent", correlationId); } catch (MBeanException e) { writeResponse(e, SET_ATTRIBUTE, correlationId); log.tracef("[%d] SetAttribute - Failure Response Sent", correlationId);
@Override public void handle(DataInput input, int correlationId) throws IOException { log.trace("IsInstanceOf"); 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); } paramType = unmarshaller.readByte(); if (paramType != STRING) { throw new IOException("Unexpected paramType"); } String className = unmarshaller.readUTF(); try { boolean instanceOf = server.getMBeanServerConnection().isInstanceOf(objectName, className); writeResponse(instanceOf, INSTANCE_OF, correlationId); log.tracef("[%d] IsInstanceOf - Success Response Sent", correlationId); } catch (InstanceNotFoundException e) { writeResponse(e, INSTANCE_OF, correlationId); log.tracef("[%d] IsInstanceOf - Failure Response Sent", correlationId); } }
AttributeList attributeValues = server.getMBeanServerConnection().setAttributes(objectName, attributes); writeResponse(attributeValues, ATTRIBUTE_LIST, SET_ATTRIBUTES, correlationId); writeResponse(e, SET_ATTRIBUTES, correlationId); log.tracef("[%d] SetAttributes - Failure Response Sent", correlationId); } catch (ReflectionException e) { writeResponse(e, SET_ATTRIBUTES, correlationId); log.tracef("[%d] SetAttributes - Failure Response Sent", correlationId);
AttributeList attributeValues = server.getMBeanServerConnection().getAttributes(objectName, attributes); writeResponse(attributeValues, ATTRIBUTE_LIST, GET_ATTRIBUTES, correlationId); writeResponse(e, GET_ATTRIBUTES, correlationId); log.tracef("[%d] GetAttributes - Failure Response Sent", correlationId); } catch (ReflectionException e) { writeResponse(e, GET_ATTRIBUTES, correlationId); log.tracef("[%d] GetAttributes - Failure Response Sent", correlationId);
writeResponse(REMOVE_NOTIFICATION_LISTENER, correlationId); writeResponse(e, REMOVE_NOTIFICATION_LISTENER, correlationId); log.tracef("[%d] RemoveNotificationListener - Failure Response Sent", correlationId); } catch (ListenerNotFoundException e) { writeResponse(e, REMOVE_NOTIFICATION_LISTENER, correlationId); log.tracef("[%d] RemoveNotificationListener - Failure Response Sent", correlationId);
Object result = server.getMBeanServerConnection().invoke(objectName, operationName, params, signature); writeResponse(result, OBJECT, INVOKE, correlationId); writeResponse(e, INVOKE, correlationId); log.tracef("[%d] Invoke - Failure Response Sent", correlationId); } catch (ReflectionException e) { writeResponse(e, INVOKE, correlationId); log.tracef("[%d] Invoke - Failure Response Sent", correlationId); } catch (MBeanException e) { writeResponse(e, INVOKE, correlationId); log.tracef("[%d] Invoke - Failure Response Sent", correlationId);
writeResponse(ADD_NOTIFICATION_LISTENER, correlationId); writeResponse(e, ADD_NOTIFICATION_LISTENER, correlationId); log.tracef("[%d] AddNotificationListener - Failure Response Sent", correlationId);
writeResponse(instance, OBJECT_INSTANCE, CREATE_MBEAN, correlationId); writeResponse(e, CREATE_MBEAN, correlationId); log.tracef("[%d] CreateMBean - Failure Response Sent", correlationId); } catch (NotCompliantMBeanException e) { writeResponse(e, CREATE_MBEAN, correlationId); log.tracef("[%d] CreateMBean - Failure Response Sent", correlationId); } catch (MBeanException e) { writeResponse(e, CREATE_MBEAN, correlationId); log.tracef("[%d] CreateMBean - Failure Response Sent", correlationId); } catch (ReflectionException e) { writeResponse(e, CREATE_MBEAN, correlationId); log.tracef("[%d] CreateMBean - Failure Response Sent", correlationId); } catch (InstanceNotFoundException e) { writeResponse(e, CREATE_MBEAN, correlationId); log.tracef("[%d] CreateMBean - Failure Response Sent", correlationId);
@Override public void handle(DataInput input, final int correlationId) throws IOException { log.trace("GetDefaultDomain"); final String defaultDomain = server.getMBeanServerConnection().getDefaultDomain(); writeResponse(defaultDomain, GET_DEFAULT_DOMAIN, correlationId); log.tracef("[%d] CreateMBean - Success Response Sent", correlationId); } }
@Override public void handle(DataInput input, final int correlationId) throws IOException { log.trace("GetDefaultDomain"); final String defaultDomain = server.getMBeanServerConnection().getDefaultDomain(); writeResponse(defaultDomain, GET_DEFAULT_DOMAIN, correlationId); log.tracef("[%d] CreateMBean - Success Response Sent", correlationId); } }
@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); } }
@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); } }
@Override public void handle(DataInput input, int correlationId) throws IOException { log.trace("GetObjectInstance"); 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 { ObjectInstance objectInstance = server.getMBeanServerConnection().getObjectInstance(objectName); writeResponse(objectInstance, OBJECT_INSTANCE, GET_OBJECT_INSTANCE, correlationId); log.tracef("[%d] GetObjectInstance - Success Response Sent", correlationId); } catch (InstanceNotFoundException e) { writeResponse(e, GET_OBJECT_INSTANCE, correlationId); log.tracef("[%d] GetObjectInstance - Failure Response Sent", correlationId); } }
@Override public void handle(DataInput input, int correlationId) throws IOException { log.trace("GetObjectInstance"); 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 { ObjectInstance objectInstance = server.getMBeanServerConnection().getObjectInstance(objectName); writeResponse(objectInstance, OBJECT_INSTANCE, GET_OBJECT_INSTANCE, correlationId); log.tracef("[%d] GetObjectInstance - Success Response Sent", correlationId); } catch (InstanceNotFoundException e) { writeResponse(e, GET_OBJECT_INSTANCE, correlationId); log.tracef("[%d] GetObjectInstance - Failure Response Sent", correlationId); } }
@Override public void handle(DataInput input, int correlationId) throws IOException { log.trace("IsInstanceOf"); 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); } paramType = unmarshaller.readByte(); if (paramType != STRING) { throw new IOException("Unexpected paramType"); } String className = unmarshaller.readUTF(); try { boolean instanceOf = server.getMBeanServerConnection().isInstanceOf(objectName, className); writeResponse(instanceOf, INSTANCE_OF, correlationId); log.tracef("[%d] IsInstanceOf - Success Response Sent", correlationId); } catch (InstanceNotFoundException e) { writeResponse(e, INSTANCE_OF, correlationId); log.tracef("[%d] IsInstanceOf - Failure Response Sent", correlationId); } }