|
||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||
See:
Description
| Interface Summary | |
|---|---|
| RemotingExceptionFactory | Interface for optional exception handling service to SpringBeanAdapter. |
| Class Summary | |
|---|---|
| ExampleExceptionFactory | An example implementation of RemotingExceptionFactory |
| SpringBeanAdapter | An adapter for locating Flash Remoting services in a Spring application context. |
SpringBeanAdapter is an adapter for locating Flash Remoting services in a Spring application context.
SpringBeanAdapter is supported by Carbon Five.
Configure Flash Remoting to use SpringBeanAdapter by editing your Flex Flash Remoting configuration file located in WEB-INF/flex/gateway-config.xml.
<service-adapters>
<adapter type="stateless-class">com.carbonfive.flash.spring.SpringBeanAdapter</adapter>
</service-adapters>
<remote-objects>
<named>
<object name="LocalServiceName">
<source>spring://RemoteServiceName</source>
<type>stateless-class</type>
<allow-unnamed-access>false</allow-unnamed-access>
</object>
</named>
</remote-objects>
With this configuration, you can then use remote object services from your Flex application with:
<mx:RemoteObject id="serviceName" named="LocalServiceName"/>
public class ExampleExceptionFactory
implements java.io.Serializable, RemotingExceptionFactory
{
public static String CUSTOM_CODE = "Server.Custom";
public void throwException(Throwable t) throws Exception
{
if (t instanceof SecurityException)
{
GatewayException e = new GatewayException(t.getMessage());
e.setRootCause(t);
e.setCode(GatewayException.SERVER_AUTHORIZATION);
throw e;
}
else if (t instanceof IndexOutOfBoundsException)
{
GatewayException e = new GatewayException(t.getMessage());
e.setRootCause(t);
e.setCode(CUSTOM_CODE);
throw e;
}
if (t instanceof Exception) throw (Exception) t;
else if (t instanceof Error) throw (Error) t;
}
}
If you do not convert the exception to a GatewayException in your implementation of RemotingExceptionFactory, it will be handled by the standard Flash Remoting exception handling process.
|
||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||