org.apache.jetspeed.service
Class ServiceFactory
java.lang.Object
|
+--org.apache.jetspeed.service.ServiceFactory
- public class ServiceFactory
- extends java.lang.Object
The ServiceFactory class is a singleton that allows to instantiate
Service objects. Each service is identified by its abstract interface.
- See Also:
Service
Method Summary |
static Service |
getService(java.lang.Class aServiceInterface,
org.apache.turbine.util.RunData aRunData)
Returns a service object with the given name. |
static Service |
getService(java.lang.Class aServiceInterface,
org.apache.turbine.util.RunData aRunData,
java.lang.Object[] aParams)
Returns a service object with the given name. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
getService
public static Service getService(java.lang.Class aServiceInterface,
org.apache.turbine.util.RunData aRunData)
throws ServiceException
- Returns a service object with the given name. If no such service exists,
a null object is returned.
- Parameters:
aServiceInterface
- the interface (class) of the serviceaRunData
- the Turbine RunData object- Returns:
- the persistence service
- Throws:
- ServiceException - if the initialization of the service fails
getService
public static Service getService(java.lang.Class aServiceInterface,
org.apache.turbine.util.RunData aRunData,
java.lang.Object[] aParams)
throws ServiceException
- Returns a service object with the given name. The array of parameters
has to contain the parameters that are required by the requested service.
If no such service exists, a null object is returned.
- Parameters:
aName
- the name of the serviceaRunData
- the Turbine RunData objectaParams
- an array of parameters- Returns:
- the persistence service
- Throws:
- ServiceException - if the initialization of the service fails
e.g. because the given parameter list is not correct