Class IntakeServiceImpl

java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.fulcrum.intake.IntakeServiceImpl
All Implemented Interfaces:
org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, IntakeService

public class IntakeServiceImpl extends org.apache.avalon.framework.logger.AbstractLogEnabled implements IntakeService, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.service.Serviceable
This service provides access to input processing objects based on an XML specification. avalon.component name="intake" avalon.service type="org.apache.fulcrum.intake.IntakeService"
Version:
$Id$
Author:
John McNally, Henning P. Schmiedehausen, Quinton McCombs
  • Constructor Details

    • IntakeServiceImpl

      public IntakeServiceImpl()
  • Method Details

    • getGroup

      public Group getGroup(String groupName) throws IntakeException
      Gets an instance of a named group either from the pool or by calling the Factory Service if the pool is empty.
      Specified by:
      getGroup in interface IntakeService
      Parameters:
      groupName - the name of the group.
      Returns:
      a Group instance.
      Throws:
      IntakeException - if recycling fails.
    • releaseGroup

      public void releaseGroup(Group instance) throws IntakeException
      Puts a Group back to the pool.
      Specified by:
      releaseGroup in interface IntakeService
      Parameters:
      instance - the object instance to recycle.
      Throws:
      IntakeException - The passed group name does not exist.
    • getSize

      public int getSize(String groupName) throws IntakeException
      Gets the current size of the pool for a group.
      Specified by:
      getSize in interface IntakeService
      Parameters:
      groupName - the name of the group.
      Returns:
      the size of the group pool
      Throws:
      IntakeException - The passed group name does not exist.
    • getGroupNames

      public String[] getGroupNames()
      Names of all the defined groups.
      Specified by:
      getGroupNames in interface IntakeService
      Returns:
      array of names.
    • getGroupKey

      public String getGroupKey(String groupName)
      Gets the key (usually a short identifier) for a group.
      Specified by:
      getGroupKey in interface IntakeService
      Parameters:
      groupName - the name of the group.
      Returns:
      the the key.
    • getGroupName

      public String getGroupName(String groupKey)
      Gets the group name given its key.
      Specified by:
      getGroupName in interface IntakeService
      Parameters:
      groupKey - the key.
      Returns:
      groupName the name of the group.
    • getFieldSetter

      public Method getFieldSetter(String className, String propName) throws ClassNotFoundException, IntrospectionException
      Gets the Method that can be used to set a property.
      Specified by:
      getFieldSetter in interface IntakeService
      Parameters:
      className - the name of the object.
      propName - the name of the property.
      Returns:
      the setter.
      Throws:
      ClassNotFoundException - if the class specified could not be loaded
      IntrospectionException - if the property setter could not be called
    • getFieldGetter

      public Method getFieldGetter(String className, String propName) throws ClassNotFoundException, IntrospectionException
      Gets the Method that can be used to get a property value.
      Specified by:
      getFieldGetter in interface IntakeService
      Parameters:
      className - the name of the object.
      propName - the name of the property.
      Returns:
      the getter.
      Throws:
      ClassNotFoundException - if the class specified could not be loaded
      IntrospectionException - if the property getter could not be called
    • configure

      public void configure(org.apache.avalon.framework.configuration.Configuration conf) throws org.apache.avalon.framework.configuration.ConfigurationException
      Avalon component lifecycle method
      Specified by:
      configure in interface org.apache.avalon.framework.configuration.Configurable
      Throws:
      org.apache.avalon.framework.configuration.ConfigurationException
    • initialize

      public void initialize() throws Exception
      Avalon component lifecycle method Initializes the service by loading xml rule files and creating the Intake groups.
      Specified by:
      initialize in interface org.apache.avalon.framework.activity.Initializable
      Throws:
      Exception - if initialization fails.
    • contextualize

      public void contextualize(org.apache.avalon.framework.context.Context context) throws org.apache.avalon.framework.context.ContextException
      Note that the avalon.entry key="urn:avalon:home" and the type is File
      Specified by:
      contextualize in interface org.apache.avalon.framework.context.Contextualizable
      Parameters:
      context - the Context to use
      Throws:
      org.apache.avalon.framework.context.ContextException - if the context is not found
      See Also:
      • Contextualizable.contextualize(org.apache.avalon.framework.context.Context)
    • service

      public void service(org.apache.avalon.framework.service.ServiceManager manager) throws org.apache.avalon.framework.service.ServiceException
      Avalon component lifecycle method avalon.dependency type="org.apache.fulcrum.localization.LocalizationService"
      Specified by:
      service in interface org.apache.avalon.framework.service.Serviceable
      Parameters:
      manager - the service manager
      Throws:
      org.apache.avalon.framework.service.ServiceException - generic exception
      See Also:
      • Serviceable.service(org.apache.avalon.framework.service.ServiceManager)