org.apache.fulcrum.intake
Class IntakeServiceFacade

java.lang.Object
  extended by org.apache.fulcrum.intake.IntakeServiceFacade

public class IntakeServiceFacade
extends Object

This is a Facade class for IntakeService. This class provides static methods that call related methods of the implementation of the IntakeService used by the System, according to the settings in your intake.xml file. Note: How should a facade class work? It seems to me that maybe it should only have a hook into the Avalon Component Manager somehow?

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

Constructor Summary
IntakeServiceFacade()
           
 
Method Summary
static Method getFieldGetter(String className, String propName)
          Gets the Method that can be used to get a property value.
static Method getFieldSetter(String className, String propName)
          Gets the Method that can be used to set a property.
static 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.
static String getGroupKey(String groupName)
          Gets the key (usually a short identifier) for a group.
static String getGroupName(String groupKey)
          Gets the group name given its key.
static String[] getGroupNames()
          Names of all the defined groups.
static int getSize(String groupName)
          Gets the current size of the pool for a named group.
static boolean isInitialized()
          Return whether the intake service has been initialized.
static void releaseGroup(Group instance)
          Puts a group back to the pool.
static void setIntakeService(IntakeService service)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntakeServiceFacade

public IntakeServiceFacade()
Method Detail

isInitialized

public static boolean isInitialized()
Return whether the intake service has been initialized.

Returns:
true if the service has been initialzed

getGroup

public static 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.

Parameters:
groupName - the name of the group.
Returns:
a Group instance.
Throws:
IntakeException - if recycling fails.

releaseGroup

public static void releaseGroup(Group instance)
                         throws IntakeException
Puts a group back to the pool.

Parameters:
instance - the object instance to recycle.
Throws:
IntakeException - A non existant group was passed

getSize

public static int getSize(String groupName)
                   throws IntakeException
Gets the current size of the pool for a named group.

Parameters:
groupName - the name of the group.
Returns:
the current pool size
Throws:
IntakeException - A non existant group was passed

getGroupNames

public static String[] getGroupNames()
Names of all the defined groups.

Returns:
array of names.

getGroupKey

public static String getGroupKey(String groupName)
Gets the key (usually a short identifier) for a group.

Parameters:
groupName - the name of the group.
Returns:
the the key.

getGroupName

public static String getGroupName(String groupKey)
Gets the group name given its key.

Parameters:
groupKey - the key.
Returns:
groupName the name of the group.

getFieldSetter

public static Method getFieldSetter(String className,
                                    String propName)
                             throws IntrospectionException,
                                    ClassNotFoundException
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.
Throws:
ClassNotFoundException
IntrospectionException

getFieldGetter

public static Method getFieldGetter(String className,
                                    String propName)
                             throws IntrospectionException,
                                    ClassNotFoundException
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.
Throws:
ClassNotFoundException
IntrospectionException

setIntakeService

public static void setIntakeService(IntakeService service)


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