}
public void mgmtClose()
{
MethodRegistry methodRegistry = getMethodRegistry();
ConnectionCloseBody responseBody =
methodRegistry.createConnectionCloseBody(
AMQConstant.REPLY_SUCCESS.getCode(),
new AMQShortString("The connection was closed using the broker's management interface."),
0,0);
// This seems ugly but because we use closeConnection in both normal
// broker operation and as part of the management interface it cannot
// be avoided. The Current Actor will be null when this method is
// called via the QMF management interface. As such we need to set one.
boolean removeActor = false;
if (CurrentActor.get() == null)
{
removeActor = true;
CurrentActor.set(new ManagementActor(_actor.getRootMessageLogger()));
}
try
{
writeFrame(responseBody.generateFrame(0));
try
{
closeSession();