{
if ( report && stopAfter == 0 )
{
throw new IllegalArgumentException( "When --report is sepcified, --stopafter(-s) must be specificed" );
}
Session session = getSession();
String domain = DomainCommand.getDomainName( null, session );
if ( domain == null )
{
throw new IllegalStateException( "Please specify a domain using domain command first." );
}
String beanName = BeanCommand.getBeanName( null, domain, session );
if ( beanName == null )
{
throw new IllegalStateException( "Please specify a bean using bean command first." );
}
final ObjectName name = new ObjectName( beanName );
final MBeanServerConnection con = session.getConnection().getServerConnection();
final Output output;
if ( report )
{
output = new ReportOutput( session );
}