org.apache.turbine.services.intake
Class TurbineIntakeService

java.lang.Object
  extended byorg.apache.turbine.services.BaseInitable
      extended byorg.apache.turbine.services.BaseService
          extended byorg.apache.turbine.services.TurbineBaseService
              extended byorg.apache.turbine.services.intake.TurbineIntakeService
All Implemented Interfaces:
Initable, IntakeService, Service

public class TurbineIntakeService
extends TurbineBaseService
implements IntakeService

This service provides access to input processing objects based on an XML specification.

Version:
$Id: TurbineIntakeService.java 534527 2007-05-02 16:10:59Z tv $
Author:
John McNally, Henning P. Schmiedehausen, Quinton McCombs

Field Summary
 
Fields inherited from class org.apache.turbine.services.BaseService
configuration, name, serviceBroker
 
Fields inherited from class org.apache.turbine.services.BaseInitable
initableBroker, isInitialized
 
Fields inherited from interface org.apache.turbine.services.intake.IntakeService
DEFAULT_POOL_CAPACITY, SERIAL_XML, SERIAL_XML_DEFAULT, SERVICE_NAME, XML_PATH, XML_PATH_DEFAULT
 
Fields inherited from interface org.apache.turbine.services.Service
SERVICE_NAME
 
Constructor Summary
TurbineIntakeService()
          Constructor.
 
Method Summary
 java.lang.reflect.Method getFieldGetter(java.lang.String className, java.lang.String propName)
          Gets the Method that can be used to get a property value.
 java.lang.reflect.Method getFieldSetter(java.lang.String className, java.lang.String propName)
          Gets the Method that can be used to set a property.
 Group getGroup(java.lang.String groupName)
          Gets an instance of a named group either from the pool or by calling the Factory Service if the pool is empty.
 java.lang.String getGroupKey(java.lang.String groupName)
          Gets the key (usually a short identifier) for a group.
 java.lang.String getGroupName(java.lang.String groupKey)
          Gets the group name given its key.
 java.lang.String[] getGroupNames()
          Names of all the defined groups.
 int getSize(java.lang.String groupName)
          Gets the current size of the pool for a group.
 void init()
          Called the first time the Service is used.
 void init(javax.servlet.ServletConfig config)
          Deprecated. use init() instead.
 void releaseGroup(Group instance)
          Puts a Group back to the pool.
 
Methods inherited from class org.apache.turbine.services.TurbineBaseService
init, init, shutdown
 
Methods inherited from class org.apache.turbine.services.BaseService
getConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker
 
Methods inherited from class org.apache.turbine.services.BaseInitable
getInit, getInitableBroker, setInit, setInitableBroker
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.turbine.services.Initable
getInit, setInitableBroker
 

Constructor Detail

TurbineIntakeService

public TurbineIntakeService()
Constructor. All Components need a public no argument constructor to be a legal Component.

Method Detail

init

public void init()
          throws InitializationException
Called the first time the Service is used.

Specified by:
init in interface Initable
Overrides:
init in class TurbineBaseService
Throws:
InitializationException - Something went wrong in the init stage

init

public void init(javax.servlet.ServletConfig config)
          throws InitializationException
Deprecated. use init() instead.

Called the first time the Service is used.

Overrides:
init in class TurbineBaseService
Parameters:
config - A ServletConfig.
Throws:
InitializationException - if initialization of this class was not successful.

getGroup

public Group getGroup(java.lang.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(java.lang.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 java.lang.String[] getGroupNames()
Names of all the defined groups.

Specified by:
getGroupNames in interface IntakeService
Returns:
array of names.

getGroupKey

public java.lang.String getGroupKey(java.lang.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 java.lang.String getGroupName(java.lang.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 java.lang.reflect.Method getFieldSetter(java.lang.String className,
                                               java.lang.String propName)
                                        throws java.lang.ClassNotFoundException,
                                               java.beans.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:
java.lang.ClassNotFoundException
java.beans.IntrospectionException

getFieldGetter

public java.lang.reflect.Method getFieldGetter(java.lang.String className,
                                               java.lang.String propName)
                                        throws java.lang.ClassNotFoundException,
                                               java.beans.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:
java.lang.ClassNotFoundException
java.beans.IntrospectionException


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