private String getBusinessInstanceState(XMLDispatcherRequest request)
{
XMLDispatcherContext xdCtx = request.getXdCtx();
Object instance = xdCtx.getBusinessInstance(request.getClassName(),request.getInstanceId());
XMLDispatcherStateReadOnly xdsr = null;
try
{
// local XMLDispatcherState interface
xdsr = (XMLDispatcherStateReadOnly)instance;
}
catch (ClassCastException e1)
{
XMLDispatcherStateReadOnlyRemote xdsrr = null;
try
{
// remote XMLDispatcherState interface
xdsrr = (XMLDispatcherStateReadOnlyRemote)instance;
}
catch (ClassCastException e2)
{
// no fsm
return null;
}
// with fsm (remote interface)
try
{
return xdsrr.getState(xdCtx);
}
catch(RemoteException e)
{
throw new XMLDispatcherRuntimeException(e);
}
}
// with fsm (local interface)
return xdsr.getState(xdCtx);
}