|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.talika.tarsis.service.AbstractService org.talika.tarsis.command.factory.CommandFactoryService org.talika.tarsis.command.factory.xml.XmlCommandsFactory
public final class XmlCommandsFactory
XML based implementation of CommandFactory
interface.
It reads command definitions from an XML file that defaults to
/WEB-INF/commands.xml
.
Definitions are loaded when factory is initialized.
XmlCommandFactory
Field Summary | |
---|---|
static java.lang.String |
COMMANDS_FILE
Command definitions file. |
Constructor Summary | |
---|---|
XmlCommandsFactory()
Creates a new XmlCommandsFactory object. |
Method Summary | |
---|---|
java.lang.String |
getCommandsFile()
Returns command definitions file. |
java.lang.String |
getName()
Service name. |
void |
init(Context context)
Called by the framework to indicate that is being placed into service. |
protected void |
loadCommand(java.lang.String commandName)
Tries to load command definition from repository for a given name. |
protected void |
loadCommands()
Load commands from command definitions file. |
protected void |
loadPackage(java.lang.String packageName)
Tries to load all command definitions from repository for a given package. |
protected java.util.Map |
loadXmlCommands(org.xml.sax.InputSource input)
Loads command definitions from an XML source. |
void |
setCommandsFile(java.lang.String commandsFile)
Sets command definitions file. |
Methods inherited from class org.talika.tarsis.command.factory.CommandFactoryService |
---|
addCommand, addCommands, findCommand |
Methods inherited from class org.talika.tarsis.service.AbstractService |
---|
destroy, getContext, getLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String COMMANDS_FILE
Constructor Detail |
---|
public XmlCommandsFactory()
XmlCommandsFactory
object.
Method Detail |
---|
public void init(Context context) throws ServiceException
init
method.commandsFile
is set if not sets its value to
COMMANDS_FILE
.Logger
instance from context.commandsFile
.
init
in interface Service
init
in class AbstractService
context
- Context context that initialized service.
ServiceException
- if an exception has occurred that interferes with the
services's normal operationService.init(Context)
public java.lang.String getName()
getName
in interface Service
getName
in class AbstractService
Service.getName()
protected void loadCommand(java.lang.String commandName)
loadCommand
in class CommandFactoryService
commandName
- String name of command to load.protected void loadPackage(java.lang.String packageName)
loadPackage
in class CommandFactoryService
packageName
- String name for package to load.protected void loadCommands()
protected java.util.Map loadXmlCommands(org.xml.sax.InputSource input)
input
- InputSource XML source.
null
if something
wrong happens parsing XML source.public java.lang.String getCommandsFile()
public void setCommandsFile(java.lang.String commandsFile)
commandsFile
- String command definitions file.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |