|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.turbine.services.BaseInitable | +--org.apache.turbine.services.BaseService | +--org.apache.turbine.services.TurbineBaseService | +--org.apache.turbine.services.intake.TurbineIntakeService
This service provides access to input processing objects based on an XML specification.
Inner Class Summary | |
private class |
TurbineIntakeService.PoolBuffer
An inner class for group specific pools. |
Field Summary | |
private AppData |
appData
The top element of the object tree |
private static int |
GETTER
|
private java.util.Map |
getterMap
The cache of property getters. |
private java.util.Map |
groupKeyMap
The cache of group keys. |
private java.util.Map |
groupNameMap
The cache of group names. |
private java.lang.String[] |
groupNames
Array of group names. |
private OMTool |
omTool
Keep a OMTool to be able to retrieve objects |
private java.util.HashMap |
poolRepository
The pool repository, one pool for each class. |
private static int |
SETTER
|
private java.util.Map |
setterMap
The cache of property setters. |
Fields inherited from class org.apache.turbine.services.BaseService |
configuration, name, properties, 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, SERVICE_NAME, XML_PATH |
Fields inherited from interface org.apache.turbine.services.Service |
SERVICE_NAME |
Constructor Summary | |
TurbineIntakeService()
Constructor. |
Method Summary | |
void |
clearPool()
Clears all instances from the pool. |
void |
clearPool(java.lang.String name)
Clears instances of a group from the pool. |
int |
getCapacity(java.lang.String name)
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 name)
Gets the current size of the pool for a group. |
void |
init(javax.servlet.ServletConfig config)
Called the first time the Service is used. |
private java.lang.Object |
pollInstance(java.lang.String groupName)
Polls and recycles an object of the named group from the pool. |
boolean |
releaseGroup(Group instance)
Puts a Group back to the pool. |
void |
setCapacity(java.lang.String name,
int capacity)
Sets the capacity of the pool for a group. |
private void |
writeAppData(java.lang.String xmlPath,
java.lang.String appDataPath,
java.io.File serialAppData)
This method writes the appData file into Objects and stores the information into this classes appData property |
Methods inherited from class org.apache.turbine.services.TurbineBaseService |
init, 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 |
|
Methods inherited from interface org.apache.turbine.services.Initable |
getInit, setInitableBroker |
Field Detail |
private java.lang.String[] groupNames
private java.util.Map groupNameMap
private java.util.Map groupKeyMap
private java.util.Map getterMap
private java.util.Map setterMap
private OMTool omTool
private AppData appData
private java.util.HashMap poolRepository
private static final int GETTER
private static final int SETTER
Constructor Detail |
public TurbineIntakeService()
Method Detail |
public void init(javax.servlet.ServletConfig config) throws InitializationException
init
in class TurbineBaseService
config
- A ServletConfig.private void writeAppData(java.lang.String xmlPath, java.lang.String appDataPath, java.io.File serialAppData) throws java.lang.Exception
public Group getGroup(java.lang.String groupName) throws TurbineException
getGroup
in interface IntakeService
groupName
- the name of the group.TurbineException
- if recycling fails.public boolean releaseGroup(Group instance)
releaseGroup
in interface IntakeService
instance
- the object instance to recycle.public int getCapacity(java.lang.String name)
getCapacity
in interface IntakeService
name
- the name of the class.public void setCapacity(java.lang.String name, int capacity)
setCapacity
in interface IntakeService
name
- the name of the group.capacity
- the new capacity.public int getSize(java.lang.String name)
getSize
in interface IntakeService
name
- the name of the group.public void clearPool(java.lang.String name)
clearPool
in interface IntakeService
name
- the name of the group.public void clearPool()
clearPool
in interface IntakeService
private java.lang.Object pollInstance(java.lang.String groupName) throws TurbineException
groupName
- the name of the group.TurbineException
- if recycling fails.public java.lang.String[] getGroupNames()
getGroupNames
in interface IntakeService
public java.lang.String getGroupKey(java.lang.String groupName)
getGroupKey
in interface IntakeService
groupName
- the name of the group.public java.lang.String getGroupName(java.lang.String groupKey)
getGroupName
in interface IntakeService
the
- the key.public java.lang.reflect.Method getFieldSetter(java.lang.String className, java.lang.String propName)
getFieldSetter
in interface IntakeService
className
- the name of the object.propName
- the name of the property.public java.lang.reflect.Method getFieldGetter(java.lang.String className, java.lang.String propName)
getFieldGetter
in interface IntakeService
className
- the name of the object.propName
- the name of the property.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |