public class org.apache.activemq.console.command.StopGracefullyCommand extends org.apache.activemq.console.command.ShutdownCommand
{
protected java.lang.String connectorName;
protected java.lang.String queueName;
protected long timeout;
protected long pollInterval;
public java.lang.String getName()
{
org.apache.activemq.console.command.StopGracefullyCommand v;
v := @this: org.apache.activemq.console.command.StopGracefullyCommand;
return "stop-gracefully";
}
public java.lang.String getOneLineDescription()
{
org.apache.activemq.console.command.StopGracefullyCommand v;
v := @this: org.apache.activemq.console.command.StopGracefullyCommand;
return "Stops a running broker gracefully.";
}
public void <init>()
{
org.apache.activemq.console.command.StopGracefullyCommand v;
java.lang.String[] v;
v := @this: org.apache.activemq.console.command.StopGracefullyCommand;
specialinvoke v.<org.apache.activemq.console.command.ShutdownCommand: void <init>()>();
v = newarray (java.lang.String)[22];
v[0] = "Task Usage: Main stopGracefully [stop-options] [broker-name] [broker-name] ...";
v[1] = "Description: Stops a running broker if there is no pending messages in the queues. It first stops the connector for client connection, then check queuesize until it becomes 0 before stop the broker.";
v[2] = "";
v[3] = "Stop Options:";
v[4] = "    --connectorName <connectorName> connectorName to stop";
v[5] = "    --queueName <queueName>         check the queuesize of the queueName for pending message";
v[6] = "    --timeout <timeout>             periodically check the queuesize before the timeout expires";
v[7] = "    --pollInterval <pollInterval>   the time interval it checks the queuesize";
v[8] = "    --jmxurl <url>             Set the JMX URL to connect to.";
v[9] = "    --jmxuser <user>           Set the JMX user used for authenticating.";
v[10] = "    --jmxpassword <password>   Set the JMX password used for authenticating.";
v[11] = "    --jmxlocal                 Use the local JMX server instead of a remote one.";
v[12] = "    --localProcessId           Use the local process id to connect( ignore jmxurl, jmxuser, jmxpassword), need to be root to use this option";
v[13] = "    --all                      Stop all brokers.";
v[14] = "    --version                  Display the version information.";
v[15] = "    -h,-?,--help               Display the stop broker help information.";
v[16] = "";
v[17] = "Broker Names:";
v[18] = "    Name of the brokers that will be stopped.";
v[19] = "    If omitted, it is assumed that there is only one broker running, and it will be stopped.";
v[20] = "    Use -all to stop all running brokers.";
v[21] = "";
v.<org.apache.activemq.console.command.StopGracefullyCommand: java.lang.String[] helpFile> = v;
return;
}
protected void stopBrokers(javax.management.MBeanServerConnection, java.util.Collection) throws java.lang.Exception
{
java.lang.Object[] v;
java.lang.String[] v;
long v, v;
java.lang.Long v, v;
java.lang.String v, v, v, v, v, v, v, v;
boolean v, v;
javax.management.MBeanServerConnection v;
java.util.Iterator v;
org.apache.activemq.console.CommandContext v, v, v;
java.util.Collection v;
javax.management.ObjectName v;
java.lang.Exception v;
org.apache.activemq.console.command.StopGracefullyCommand v;
java.lang.Object v;
v := @this: org.apache.activemq.console.command.StopGracefullyCommand;
v := @parameter: javax.management.MBeanServerConnection;
v := @parameter: java.util.Collection;
v = interfaceinvoke v.<java.util.Collection: java.util.Iterator iterator()>();
label:
v = interfaceinvoke v.<java.util.Iterator: boolean hasNext()>();
if v == 0 goto label;
v = interfaceinvoke v.<java.util.Iterator: java.lang.Object next()>();
v = virtualinvoke v.<javax.management.ObjectInstance: javax.management.ObjectName getObjectName()>();
v = virtualinvoke v.<javax.management.ObjectName: java.lang.String getKeyProperty(java.lang.String)>("BrokerName");
v = v.<org.apache.activemq.console.command.StopGracefullyCommand: org.apache.activemq.console.CommandContext context>;
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("Stopping broker: \u0001");
virtualinvoke v.<org.apache.activemq.console.CommandContext: void print(java.lang.String)>(v);
label:
v = newarray (java.lang.Object)[4];
v = v.<org.apache.activemq.console.command.StopGracefullyCommand: java.lang.String connectorName>;
v[0] = v;
v = v.<org.apache.activemq.console.command.StopGracefullyCommand: java.lang.String queueName>;
v[1] = v;
v = v.<org.apache.activemq.console.command.StopGracefullyCommand: long timeout>;
v = staticinvoke <java.lang.Long: java.lang.Long valueOf(long)>(v);
v[2] = v;
v = v.<org.apache.activemq.console.command.StopGracefullyCommand: long pollInterval>;
v = staticinvoke <java.lang.Long: java.lang.Long valueOf(long)>(v);
v[3] = v;
v = newarray (java.lang.String)[4];
v[0] = "java.lang.String";
v[1] = "java.lang.String";
v[2] = "long";
v[3] = "long";
interfaceinvoke v.<javax.management.MBeanServerConnection: java.lang.Object invoke(javax.management.ObjectName,java.lang.String,java.lang.Object[],java.lang.String[])>(v, "stopGracefully", v, v);
v = v.<org.apache.activemq.console.command.StopGracefullyCommand: org.apache.activemq.console.CommandContext context>;
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("Succesfully stopped broker: \u0001");
virtualinvoke v.<org.apache.activemq.console.CommandContext: void print(java.lang.String)>(v);
label:
goto label;
label:
v := @caughtexception;
v = virtualinvoke v.<java.lang.Exception: java.lang.String getMessage()>();
v = virtualinvoke v.<java.lang.String: boolean startsWith(java.lang.String)>("Error unmarshaling return header");
if v != 0 goto label;
v = v.<org.apache.activemq.console.command.StopGracefullyCommand: org.apache.activemq.console.CommandContext context>;
v = virtualinvoke v.<java.lang.Exception: java.lang.String getMessage()>();
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("Exception:\u0001");
virtualinvoke v.<org.apache.activemq.console.CommandContext: void print(java.lang.String)>(v);
goto label;
label:
virtualinvoke v.<org.apache.activemq.console.command.StopGracefullyCommand: void closeJmxConnection()>();
return;
catch java.lang.Exception from label to label with label;
}
protected void handleOption(java.lang.String, java.util.List) throws java.lang.Exception
{
boolean v, v, v, v, v, v, v, v, v, v, v, v;
org.apache.activemq.console.CommandContext v, v, v, v;
java.util.List v;
org.apache.activemq.console.command.StopGracefullyCommand v;
long v, v;
java.lang.String v;
java.lang.IllegalArgumentException v, v, v, v;
java.lang.Object v, v, v, v, v, v, v, v;
v := @this: org.apache.activemq.console.command.StopGracefullyCommand;
v := @parameter: java.lang.String;
v := @parameter: java.util.List;
v = virtualinvoke v.<java.lang.String: boolean equals(java.lang.Object)>("--connectorName");
if v == 0 goto label;
v = interfaceinvoke v.<java.util.List: boolean isEmpty()>();
if v != 0 goto label;
v = interfaceinvoke v.<java.util.List: java.lang.Object get(int)>(0);
v = virtualinvoke v.<java.lang.String: boolean startsWith(java.lang.String)>("-");
if v == 0 goto label;
label:
v = v.<org.apache.activemq.console.command.StopGracefullyCommand: org.apache.activemq.console.CommandContext context>;
v = new java.lang.IllegalArgumentException;
specialinvoke v.<java.lang.IllegalArgumentException: void <init>(java.lang.String)>("connectorName not specified");
virtualinvoke v.<org.apache.activemq.console.CommandContext: void printException(java.lang.Exception)>(v);
return;
label:
v = interfaceinvoke v.<java.util.List: java.lang.Object remove(int)>(0);
v.<org.apache.activemq.console.command.StopGracefullyCommand: java.lang.String connectorName> = v;
goto label;
label:
v = virtualinvoke v.<java.lang.String: boolean equals(java.lang.Object)>("--timeout");
if v == 0 goto label;
v = interfaceinvoke v.<java.util.List: boolean isEmpty()>();
if v != 0 goto label;
v = interfaceinvoke v.<java.util.List: java.lang.Object get(int)>(0);
v = virtualinvoke v.<java.lang.String: boolean startsWith(java.lang.String)>("-");
if v == 0 goto label;
label:
v = v.<org.apache.activemq.console.command.StopGracefullyCommand: org.apache.activemq.console.CommandContext context>;
v = new java.lang.IllegalArgumentException;
specialinvoke v.<java.lang.IllegalArgumentException: void <init>(java.lang.String)>("timeout not specified");
virtualinvoke v.<org.apache.activemq.console.CommandContext: void printException(java.lang.Exception)>(v);
return;
label:
v = interfaceinvoke v.<java.util.List: java.lang.Object remove(int)>(0);
v = staticinvoke <java.lang.Long: long parseLong(java.lang.String)>(v);
v.<org.apache.activemq.console.command.StopGracefullyCommand: long timeout> = v;
goto label;
label:
v = virtualinvoke v.<java.lang.String: boolean equals(java.lang.Object)>("--pollInterval");
if v == 0 goto label;
v = interfaceinvoke v.<java.util.List: boolean isEmpty()>();
if v != 0 goto label;
v = interfaceinvoke v.<java.util.List: java.lang.Object get(int)>(0);
v = virtualinvoke v.<java.lang.String: boolean startsWith(java.lang.String)>("-");
if v == 0 goto label;
label:
v = v.<org.apache.activemq.console.command.StopGracefullyCommand: org.apache.activemq.console.CommandContext context>;
v = new java.lang.IllegalArgumentException;
specialinvoke v.<java.lang.IllegalArgumentException: void <init>(java.lang.String)>("pollInterval not specified");
virtualinvoke v.<org.apache.activemq.console.CommandContext: void printException(java.lang.Exception)>(v);
return;
label:
v = interfaceinvoke v.<java.util.List: java.lang.Object remove(int)>(0);
v = staticinvoke <java.lang.Long: long parseLong(java.lang.String)>(v);
v.<org.apache.activemq.console.command.StopGracefullyCommand: long pollInterval> = v;
goto label;
label:
v = virtualinvoke v.<java.lang.String: boolean equals(java.lang.Object)>("--queueName");
if v == 0 goto label;
v = interfaceinvoke v.<java.util.List: boolean isEmpty()>();
if v != 0 goto label;
v = interfaceinvoke v.<java.util.List: java.lang.Object get(int)>(0);
v = virtualinvoke v.<java.lang.String: boolean startsWith(java.lang.String)>("-");
if v == 0 goto label;
label:
v = v.<org.apache.activemq.console.command.StopGracefullyCommand: org.apache.activemq.console.CommandContext context>;
v = new java.lang.IllegalArgumentException;
specialinvoke v.<java.lang.IllegalArgumentException: void <init>(java.lang.String)>("queueName not specified");
virtualinvoke v.<org.apache.activemq.console.CommandContext: void printException(java.lang.Exception)>(v);
return;
label:
v = interfaceinvoke v.<java.util.List: java.lang.Object remove(int)>(0);
v.<org.apache.activemq.console.command.StopGracefullyCommand: java.lang.String queueName> = v;
goto label;
label:
specialinvoke v.<org.apache.activemq.console.command.ShutdownCommand: void handleOption(java.lang.String,java.util.List)>(v, v);
label:
return;
}
}