}
public void run()
{
log.log( Level.INFO, System.currentTimeMillis() + " -- ClientThread" + number + " started" );
EJClient ejclient = null;
if ( !useSingleClient )
{
ejclient = new EJClient( "127.0.0.1", port, adapter );
ejclient.enableCompression( compression );
ejclient.enablePersistentConnection( persistent );
ejclient.setConnectionTimeout( 60000 );
if ( inJvm ) ejclient.setInJVM( true );
}
else
{
ejclient = client;
}
Map result = null;
Map input = new HashMap();
input.put( "KEY1", "Hello" );
input.put( "KEY2", Integer.valueOf( 101 ) );
input.put( "KEY3", BigDecimal.valueOf( 102 ) );
if ( useCustomTypes )
{
input.put( "KEY4", new ObjectBean() );
}
try
{
result = (Map) ejclient.execute( input );
assertNotNull( result );
if ( useCustomTypes )
{
assertNotNull( result.get( "KEY4" ) );
Object objBean = result.get( "KEY4" );
assertTrue( objBean instanceof ObjectBean );
}
log.log( Level.INFO, System.currentTimeMillis() + " -- ClientThread" + number + " return map contains "
+ result.size() + " entries." );
}
catch ( Exception e )
{
log.log( Level.SEVERE, "Test failed!", e );
}
finally
{
if ( result != null )
{
successCount.getAndIncrement();
}
activeCount.getAndDecrement();
if ( !useSingleClient ) ejclient.close();
}
log.log( Level.INFO, System.currentTimeMillis() + " -- ClientThread" + number + " finished" );
}