org.apache.turbine.services.intake
Interface IntakeService

All Known Implementing Classes:
TurbineIntakeService

public interface IntakeService

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

Version:
$Id: IntakeService.java,v 1.3 2002/07/11 16:53:28 mpoeschl Exp $
Author:
John McNally

Field Summary
static int DEFAULT_POOL_CAPACITY
          The default pool capacity.
static java.lang.String SERVICE_NAME
          The key under which this service is stored in TurbineServices.
static java.lang.String XML_PATH
          The property specifying the location of the xml specification.
 
Method Summary
 void clearPool()
          Clears all instances from the pool.
 void clearPool(java.lang.String groupName)
          Clears instances of a named group from the pool.
 int getCapacity(java.lang.String groupName)
          Gets the capacity of the pool for a named group.
 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 named group.
 boolean releaseGroup(Group instance)
          Puts a group back to the pool.
 void setCapacity(java.lang.String groupName, int capacity)
          Sets the capacity of the pool for a named group.
 

Field Detail

SERVICE_NAME

public static final java.lang.String SERVICE_NAME
The key under which this service is stored in TurbineServices.

XML_PATH

public static final java.lang.String XML_PATH
The property specifying the location of the xml specification.

DEFAULT_POOL_CAPACITY

public static final int DEFAULT_POOL_CAPACITY
The default pool capacity.
Method Detail

getGroup

public Group getGroup(java.lang.String groupName)
               throws TurbineException
Gets an instance of a named group either from the pool or by calling the Factory Service if the pool is empty.
Parameters:
groupName - the name of the group.
Returns:
a Group instance.
Throws:
TurbineException - if recycling fails.

releaseGroup

public boolean releaseGroup(Group instance)
Puts a group back to the pool.
Parameters:
instance - the object instance to recycle.
Returns:
true if the instance was accepted.

getCapacity

public int getCapacity(java.lang.String groupName)
Gets the capacity of the pool for a named group.
Parameters:
groupName - the name of the group.

setCapacity

public void setCapacity(java.lang.String groupName,
                        int capacity)
Sets the capacity of the pool for a named group. Note that the pool will be cleared after the change.
Parameters:
groupName - the name of the group.
capacity - the new capacity.

getSize

public int getSize(java.lang.String groupName)
Gets the current size of the pool for a named group.
Parameters:
groupName - the name of the group.

clearPool

public void clearPool(java.lang.String groupName)
Clears instances of a named group from the pool.
Parameters:
groupName - the name of the group.

clearPool

public void clearPool()
Clears all instances from the pool.

getGroupNames

public java.lang.String[] getGroupNames()
Names of all the defined groups.
Returns:
array of names.

getGroupKey

public java.lang.String getGroupKey(java.lang.String groupName)
Gets the key (usually a short identifier) for a group.
Parameters:
groupName - the name of the group.
Returns:
the key.

getGroupName

public java.lang.String getGroupName(java.lang.String groupKey)
Gets the group name given its key.
Parameters:
the - the key.
Returns:
groupName the name of the group.

getFieldSetter

public java.lang.reflect.Method getFieldSetter(java.lang.String className,
                                               java.lang.String propName)
Gets the Method that can be used to set a property.
Parameters:
className - the name of the object.
propName - the name of the property.
Returns:
the setter.

getFieldGetter

public 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.
Parameters:
className - the name of the object.
propName - the name of the property.
Returns:
the getter.


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