protected final Pool _free;
@SuppressWarnings("unchecked")
public final boolean sessionMessage( Who sender, Message msg ) throws Exception
{
Type type = msg.type();
StubHelper<T> helper = (StubHelper<T>) type.getStubHelper();
if (helper == null)
return false;
switch (type.getAsyncMode())
{
case QUEUED:
try
{
_queued.run( new StubPoolRunnable( sender, msg, helper ) );
}
catch ( Exception e )
{
sessionNotify( _obj, e );
}
break;
case FREE:
try
{
_free.run( new StubPoolRunnable( sender, msg, helper ) );
}
catch ( Exception e )
{
sessionNotify( _obj, e );
}
break;
case NONE:
try
{
helper.run( _svc, _obj, sender, msg );
}
catch ( Exception e )
{
sessionNotify( _obj, e );
}
break;
default:
throw new IllegalArgumentException("unknown async mode "+type.getAsyncMode());
}
return true;
}