Class AdviceServiceImpl

java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    advice(Object object)
    Advice the object with a the list of default AvalonInterceptorServices.
    advice(String[] interceptorList, Object object)
    Advice the object with a list of AvalonInterceptorServices.
    advice(String name, Object object)
    Advice the object with a the list of default AvalonInterceptorServices.
    advice(String name, String[] interceptorList, 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 Object
    doAdvice(String name, String[] interceptorList, Object object)
    Does the actual work of advising the object.
    boolean
    isAdviced(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 Details

    • AdviceServiceImpl

      public AdviceServiceImpl()
  • Method Details

    • 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 Object advice(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:
    • advice

      public Object advice(String name, 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
    • advice

      public Object advice(String[] interceptorList, 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
    • advice

      public Object advice(String name, String[] interceptorList, 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
    • isAdviced

      public boolean isAdviced(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
    • doAdvice

      protected Object doAdvice(String name, String[] interceptorList, 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.