|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectome.util.tasks.Configuration
public class Configuration
Helper for creating any task from String properties, and can even instantiate
ServiceFactory
and Task
objects if given the proper
arguments.
Understands the parameters:
Properties
of the form:
{task=mytask, user=root, group=system, type=Task, pass=SECRET}
Configuration
,
Task
Nested Class Summary | |
---|---|
static class |
Configuration.Keys
Enumeration of the string values which will be used directly by Configuration . |
Field Summary | |
---|---|
static String |
DEFAULTPKG
Default package in which Task lookups will be performed. |
Constructor Summary | |
---|---|
Configuration(Properties props)
Sole constructor. |
Method Summary | |
---|---|
ServiceFactory |
createServiceFactory()
Creates a ServiceFactory instance based on the values of
#getServer() and #getLogin() (such that a subclass could
override these methods to influence the ServiceFactory). |
Task |
createTask()
Creates a new Task based on the values of
getProperties() , getTaskClass() , and
createServiceFactory() . |
Properties |
getProperties()
Returns the Properties instance provided during constuction. |
Class<Task> |
getTaskClass()
Returns the Class found in the Properties |
protected String |
p(Configuration.Keys key)
Returns the property for the Enum.toString() value of the
argument. |
protected Class<Task> |
parseTask(String task,
String pkg)
Adds the package to the task name, and returns the class if found. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULTPKG
Task
lookups will be performed.
Constructor Detail |
---|
public Configuration(Properties props)
Properties
values.
props
- Not null.Method Detail |
---|
public Properties getProperties()
public Class<Task> getTaskClass()
Class
found in the Properties
public ServiceFactory createServiceFactory()
ServiceFactory
instance based on the values of
#getServer()
and #getLogin()
(such that a subclass could
override these methods to influence the ServiceFactory).
ServiceFactory
instance.public Task createTask()
Task
based on the values of
getProperties()
, getTaskClass()
, and
createServiceFactory()
.
Task
instance, ready for execution.
RuntimeException
- if anything happens during the reflection-based creation of
the Task
protected String p(Configuration.Keys key)
Enum.toString()
value of the
argument.
protected Class<Task> parseTask(String task, String pkg)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Version: Beta-4.1.1-r5927-b91
Copyright © 2009 The University of Dundee. All Rights Reserved.