System.out.print( "Number of messages: " );
Integer messageCount = Integer.valueOf( System.console().readLine() );
System.out.print( "Delay in Milliseconds: " );
Long processingDelay = Long.valueOf( System.console().readLine() );
StatelessSession slsb = getStatelessSessionBean();
slsb.sendMessage( message, messageCount, processingDelay );
}
private StatelessSession getStatelessSessionBean() throws NamingException {
return (StatelessSession)context.lookup(SLSB_JNDI);
}