org.apache.fulcrum.intake
Class IntakeServiceImpl

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

Version:
$Id: IntakeServiceImpl.java 832048 2009-11-02 18:55:08Z tv $
Author:
John McNally, Henning P. Schmiedehausen, Quinton McCombs

Field Summary
 
Fields inherited from interface org.apache.fulcrum.intake.IntakeService
DEFAULT_POOL_CAPACITY, ROLE, SERIAL_XML, SERIAL_XML_DEFAULT, XML_PATH_DEFAULT, XML_PATHS
 
Constructor Summary
IntakeServiceImpl()
           
 
Method Summary
 void configure(org.apache.avalon.framework.configuration.Configuration conf)
          Avalon component lifecycle method
 void contextualize(org.apache.avalon.framework.context.Context context)
           
 Method getFieldGetter(String className, String propName)
          Gets the Method that can be used to get a property value.
 Method getFieldSetter(String className, String propName)
          Gets the Method that can be used to set a property.
 Group getGroup(String groupName)
          Gets an instance of a named group either from the pool or by calling the Factory Service if the pool is empty.
 String getGroupKey(String groupName)
          Gets the key (usually a short identifier) for a group.
 String getGroupName(String groupKey)
          Gets the group name given its key.
 String[] getGroupNames()
          Names of all the defined groups.
 int getSize(String groupName)
          Gets the current size of the pool for a group.
 void initialize()
          Avalon component lifecycle method Initializes the service by loading default class loaders and customized object factories.
 void releaseGroup(Group instance)
          Puts a Group back to the pool.
 void service(org.apache.avalon.framework.service.ServiceManager manager)
          Avalon component lifecycle method
 
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

IntakeServiceImpl

public IntakeServiceImpl()
Method Detail

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.
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
IntrospectionException

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
IntrospectionException

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 default class loaders and customized object factories.

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
Specified by:
contextualize in interface org.apache.avalon.framework.context.Contextualizable
Throws:
org.apache.avalon.framework.context.ContextException
See Also:
Contextualizable

service

public void service(org.apache.avalon.framework.service.ServiceManager manager)
             throws org.apache.avalon.framework.service.ServiceException
Avalon component lifecycle method

Specified by:
service in interface org.apache.avalon.framework.service.Serviceable
Throws:
org.apache.avalon.framework.service.ServiceException


Copyright © 2005-2009 The Apache Software Foundation. All Rights Reserved.