net.sf.sasl.aop.exception.handling
Class ServiceExceptionFirewallAspectConfigBean

java.lang.Object
  extended by net.sf.sasl.aop.exception.handling.ServiceExceptionFirewallAspectConfigBean

public class ServiceExceptionFirewallAspectConfigBean
extends Object

Configuration bean for the ServiceExceptionFirewallAspect. A configuration describes which properties should be set with what kind of values in an object instance that was instantiated by the ServiceExceptionFirewallAspect as a replacement for a throwed exception by a target method.

Suppose the return types of all public methods of a service are derived from a ResponseDTO which has got the following properties: boolean wasSuccessfullyComputed, String resultCode, String resultCodeDetailMessage. A configuration for the ResponseDTO might now look as the following:
className = packagepath.ResponseDTO
propertyNameValueMap = ("wasSuccessfullyComputed", false), ("resultCode", "Internal Server Error")
errorDetailMessagePropertyName = "resultCodeDetailMessage"

Now a service method with return type ComplexResponseDTO (anyway derived from ResponseDTO) throws an exception. The ServiceExceptionFirewallAspect will instantiate a new instance of ComplexResponseDTO and assign the properties of ComplexResponseDTO the above defined values. The errorDetailMessagePropertyName is a special property that gets the string representation of the stack trace of the thrown exception assigned if setted. The ComplexResponseDTO instance is than returned instead of the thrown exception.
If there had been also a configuration for ComplexResponseDTO defined, than it would have been used in the above scenario instead of the configuration for ResponseDTO.

Since:
0.0.1 (sasl-common-aspect-library)
Author:
Philipp Förmer

Constructor Summary
ServiceExceptionFirewallAspectConfigBean()
           
 
Method Summary
 String getClassName()
          Returns the full qualified class name to which this configuration belongs/should be applied.
 String getErrorDetailMessagePropertyName()
          Returns the property name to which the ServiceExceptionFirewallAspect should assign the string representation of the stack trace of a throwed exception.
 Map<String,Object> getPropertyNameValueMap()
          Returns a map of (propertyName, propertyValue) mappings.
 void setClassName(String className)
          Sets the full qualified class name to which this configuration belongs/should be applied.
 void setErrorDetailMessagePropertyName(String errorDetailMessagePropertyName)
          Sets the (optional) property name to which the ServiceExceptionFirewallAspect should assign the string representation of the stack trace of a throwed exception.
 void setPropertyNameValueMap(Map<String,Object> propertyNameValueMap)
          Sets a map of (propertyName, propertyValue) mappings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceExceptionFirewallAspectConfigBean

public ServiceExceptionFirewallAspectConfigBean()
Method Detail

getClassName

public String getClassName()
Returns the full qualified class name to which this configuration belongs/should be applied.

Returns:
null or non null
Since:
0.0.1 (sasl-common-aspect-library)

setClassName

public void setClassName(String className)
Sets the full qualified class name to which this configuration belongs/should be applied.

Parameters:
className - null or non null
Since:
0.0.1 (sasl-common-aspect-library)

getPropertyNameValueMap

public Map<String,Object> getPropertyNameValueMap()
Returns a map of (propertyName, propertyValue) mappings. An instantiated object of type getClassName() will be assigned those property values, if the object instance was instantiated by the ServiceExceptionFirewallAspect class.

Returns:
null or non null
Since:
0.0.1 (sasl-common-aspect-library)

setPropertyNameValueMap

public void setPropertyNameValueMap(Map<String,Object> propertyNameValueMap)
Sets a map of (propertyName, propertyValue) mappings. A null key mapping will be ignored. The mapping will be used to assign an instance of getClassName() special property values, if the object instance was instantiated by the ServiceExceptionFirewallAspect class as replacement for an exception. Such a pair could be for example an executed flag (value=false) or a result code (value=500 Internal Server Error).

Parameters:
propertyNameValueMap - null or non null
Since:
0.0.1 (sasl-common-aspect-library)

getErrorDetailMessagePropertyName

public String getErrorDetailMessagePropertyName()
Returns the property name to which the ServiceExceptionFirewallAspect should assign the string representation of the stack trace of a throwed exception.

Returns:
null or non null
Since:
0.0.1 (sasl-common-aspect-library)

setErrorDetailMessagePropertyName

public void setErrorDetailMessagePropertyName(String errorDetailMessagePropertyName)
Sets the (optional) property name to which the ServiceExceptionFirewallAspect should assign the string representation of the stack trace of a throwed exception.

Parameters:
detailMessagePropertyName - null or non null
Since:
0.0.1 (sasl-common-aspect-library)


Copyright © 2010. All Rights Reserved.