org.apache.fulcrum.yaafi.service.advice
Class AdviceServiceImpl

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.fulcrum.yaafi.service.advice.AdviceServiceImpl
All Implemented Interfaces:
org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.configuration.Reconfigurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, AdviceService

public class AdviceServiceImpl
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements AdviceService, org.apache.avalon.framework.service.Serviceable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.configuration.Reconfigurable

Simple service providing interceptor advices for ordinary POJOs. Since the implementation uses Dynamic Proxies only methods invoked by an interface can be advised.

Author:
Siegfried Goeschl

Constructor Summary
AdviceServiceImpl()
           
 
Method Summary
 java.lang.Object advice(java.lang.Object object)
          Advice the object with a the list of default AvalonInterceptorServices.
 java.lang.Object advice(java.lang.String[] interceptorList, java.lang.Object object)
          Advice the object with a list of AvalonInterceptorServices.
 java.lang.Object advice(java.lang.String name, java.lang.Object object)
          Advice the object with a the list of default AvalonInterceptorServices.
 java.lang.Object advice(java.lang.String name, java.lang.String[] interceptorList, java.lang.Object object)
          Advice the object with a list of AvalonInterceptorServices.
 void configure(org.apache.avalon.framework.configuration.Configuration configuration)
           
 void contextualize(org.apache.avalon.framework.context.Context context)
           
protected  java.lang.Object doAdvice(java.lang.String name, java.lang.String[] interceptorList, java.lang.Object object)
          Does the actual work of advising the object.
 boolean isAdviced(java.lang.Object object)
          Is the given object already adviced?
 void reconfigure(org.apache.avalon.framework.configuration.Configuration configuration)
           
 void service(org.apache.avalon.framework.service.ServiceManager serviceManager)
           
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdviceServiceImpl

public AdviceServiceImpl()
Method Detail

service

public void service(org.apache.avalon.framework.service.ServiceManager serviceManager)
             throws org.apache.avalon.framework.service.ServiceException
Specified by:
service in interface org.apache.avalon.framework.service.Serviceable
Throws:
org.apache.avalon.framework.service.ServiceException
See Also:
Serviceable.service(org.apache.avalon.framework.service.ServiceManager)

contextualize

public void contextualize(org.apache.avalon.framework.context.Context context)
                   throws org.apache.avalon.framework.context.ContextException
Specified by:
contextualize in interface org.apache.avalon.framework.context.Contextualizable
Throws:
org.apache.avalon.framework.context.ContextException
See Also:
Contextualizable.contextualize(org.apache.avalon.framework.context.Context)

configure

public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Throws:
org.apache.avalon.framework.configuration.ConfigurationException
See Also:
Configurable.configure(org.apache.avalon.framework.configuration.Configuration)

reconfigure

public void reconfigure(org.apache.avalon.framework.configuration.Configuration configuration)
                 throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
reconfigure in interface org.apache.avalon.framework.configuration.Reconfigurable
Throws:
org.apache.avalon.framework.configuration.ConfigurationException
See Also:
Reconfigurable.reconfigure(org.apache.avalon.framework.configuration.Configuration)

advice

public java.lang.Object advice(java.lang.Object object)
Description copied from interface: AdviceService
Advice the object with a the list of default AvalonInterceptorServices.

Specified by:
advice in interface AdviceService
Parameters:
object - the object to be advised
Returns:
the advised object
See Also:
AdviceService.advice(java.lang.Object)

advice

public java.lang.Object advice(java.lang.String name,
                               java.lang.Object object)
Description copied from interface: AdviceService
Advice the object with a the list of default AvalonInterceptorServices.

Specified by:
advice in interface AdviceService
Parameters:
name - the name of the object
object - the object to be advised
Returns:
the advised object
See Also:
AdviceService.advice(java.lang.String, java.lang.Object)

advice

public java.lang.Object advice(java.lang.String[] interceptorList,
                               java.lang.Object object)
Description copied from interface: AdviceService
Advice the object with a list of AvalonInterceptorServices.

Specified by:
advice in interface AdviceService
Parameters:
interceptorList - the list of service names
object - the object to be advised
Returns:
the advised object
See Also:
AdviceService.advice(java.lang.String[], java.lang.Object)

advice

public java.lang.Object advice(java.lang.String name,
                               java.lang.String[] interceptorList,
                               java.lang.Object object)
Description copied from interface: AdviceService
Advice the object with a list of AvalonInterceptorServices.

Specified by:
advice in interface AdviceService
Parameters:
name - the associated name of the object
interceptorList - the list of service names
object - the object to be advised
Returns:
the advised object
See Also:
AdviceService.advice(java.lang.String, java.lang.String[], java.lang.Object)

isAdviced

public boolean isAdviced(java.lang.Object object)
Description copied from interface: AdviceService
Is the given object already adviced?

Specified by:
isAdviced in interface AdviceService
Parameters:
object - the object to check
Returns:
true if the object is an dynamic proxy
See Also:
AdviceService.isAdviced(java.lang.Object)

doAdvice

protected java.lang.Object doAdvice(java.lang.String name,
                                    java.lang.String[] interceptorList,
                                    java.lang.Object object)
Does the actual work of advising the object.

Parameters:
name - the name of the object to be advised
interceptorList - the list of interceptor services to advise the object
object - the object to be advised
Returns:
the advised object.


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.