org.openwms.core.service.spring.aop
Class CoreServiceAdvice

java.lang.Object
  extended by org.openwms.core.service.spring.aop.CoreServiceAdvice

@Component(value="coreServiceAdvice")
public class CoreServiceAdvice
extends Object

A CoreServiceAdvice is in conjunction with an AOP aspect for Core services.

So far it is used to translate all exceptions into a ServiceRuntimeException and tracing of methods time consumption. Activation is done in XML instead of using Springs AOP annotations.

The advice can be referenced by name "coreServiceAdvice".

Since:
0.1
Version:
$Revision: $
Author:
Heiko Scherrer
See Also:
ServiceRuntimeException

Field Summary
static String COMPONENT_NAME
          Springs component name.
 
Constructor Summary
CoreServiceAdvice()
           
 
Method Summary
 void afterThrowing(Throwable ex)
          Called after an exception is thrown by classes of the Core service layer.
 Object around(org.aspectj.lang.ProceedingJoinPoint pjp)
          Called around any service method invocation to log time consumption of each method call.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPONENT_NAME

public static final String COMPONENT_NAME
Springs component name.

See Also:
Constant Field Values
Constructor Detail

CoreServiceAdvice

public CoreServiceAdvice()
Method Detail

around

public Object around(org.aspectj.lang.ProceedingJoinPoint pjp)
              throws Throwable
Called around any service method invocation to log time consumption of each method call.

Parameters:
pjp - the ProceedingJoinPoint object
Returns:
the return value of the service method invocation
Throws:
Throwable - any exception thrown by the method invocation

afterThrowing

public void afterThrowing(Throwable ex)
Called after an exception is thrown by classes of the Core service layer. If the exception is not of type ServiceRuntimeException it is wrapped by a new ServiceRuntimeException.

Turn tracing to level WARN to log the root cause.

Parameters:
ex - The root exception that is thrown


Copyright © 2005-2011 openwms.org. All Rights Reserved.