|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectow.tool.util.toolframework.AbstractDHTBasedTool<java.lang.String>
ow.tool.dhtshell.Main
uk.ac.ic.doc.automed.p2p.apps.MainApp
public class MainApp
Nested Class Summary | |
---|---|
protected static class |
MainApp.SimpleWorkflow
A workflow for stand-alone testing, it starts all the peers needed to run the test |
Field Summary | |
---|---|
private static java.lang.Class[] |
COMMANDS
|
static java.lang.String |
TYPE_BIBTEX
simple |
static java.lang.String |
TYPE_DSP
a dsp peer |
static java.lang.String |
TYPE_SIMPLE
simple |
static java.lang.String |
TYPE_SQL
|
static java.lang.String |
TYPE_USER
|
static java.lang.String |
TYPE_XML
|
private P2PWorkflow |
wf
|
Fields inherited from class ow.tool.dhtshell.Main |
---|
COMMAND, ENCODING, mainThread, SHELL_PORT, XMLRPC_PORT_DIFF, XMLRPC_PORT_RANGE |
Constructor Summary | |
---|---|
MainApp()
|
Method Summary | |
---|---|
org.apache.commons.cli.Options |
getCmdOptions()
AutoMed P2P options |
org.apache.commons.cli.CommandLine |
getCommandLine()
|
ow.dht.DHT |
getDHT()
|
protected org.apache.commons.cli.Options |
getDHTOptions()
The default dht options required by OverlayWeaver's DHT implementation. |
static P2PWorkflow |
getWorkflowInstance(org.apache.commons.cli.CommandLine cmd,
boolean execute)
Define an instance of the workflow (subclasses can customise this method to define their own AutoMed workflow) |
P2PWorkflow |
getWorkflowInstance(Peer p,
AutoMedDHTImpl odht,
java.lang.String dsType,
java.lang.String... args)
Create a workflow instance to run from a remote session. |
protected static P2PWorkflow |
getWorkflowInstance(Peer peer,
org.apache.commons.cli.CommandLine cmd,
boolean execute)
|
P2PWorkflow |
getWorkflowInstance(Peer peer,
java.lang.String[] args,
boolean execute)
|
static P2PWorkflow |
getWorkflowInstance(Peer peer,
java.lang.String dsType,
org.apache.commons.cli.CommandLine cmd,
boolean execute)
|
P2PWorkflow |
getWorkflowInstanceByID(java.lang.String pid,
boolean execute)
Create a new workflow instance from the command line arguments |
protected ow.tool.util.shellframework.Shell |
init(java.lang.String[] args,
java.io.BufferedReader in,
java.io.PrintStream out,
boolean interactive)
Extends the init() method of the super-class Main to start a shell using an existing DHT protocol instance. This is invoked by the start() method of Main, which is in turn invoked by the startShell() method of this class. |
static void |
main(java.lang.String[] args)
|
private static P2PWorkflow |
newWorkflowInstance(java.lang.String dsType,
Peer peer,
org.apache.commons.cli.CommandLine cmd)
|
org.apache.commons.cli.CommandLine[] |
parseArgs(org.apache.commons.cli.Option[] existingOpts,
org.apache.commons.cli.Options opts,
int start,
int end,
java.io.InputStream fin)
Read a set of peers from the source file |
org.apache.commons.cli.CommandLine |
parseArgs(org.apache.commons.cli.Options opts,
java.lang.String[] args)
Parse an array of arguments into a command line object |
protected void |
printHelp()
|
org.apache.commons.cli.CommandLine |
readP2POptions(org.apache.commons.cli.Options existingOpts,
java.lang.String pid)
|
protected org.apache.commons.cli.CommandLine |
readP2POptions(org.apache.commons.cli.Options existingOpts,
java.lang.String pid,
java.io.InputStream fin)
|
void |
startApp(java.lang.String pid)
|
void |
startShell()
A method to start a remote exection shell. |
Methods inherited from class ow.tool.dhtshell.Main |
---|
interrupt, invoke, start, usage |
Methods inherited from class ow.tool.util.toolframework.AbstractDHTBasedTool |
---|
getInitialOptions, initialize, initialize, usage |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private P2PWorkflow wf
private static final java.lang.Class[] COMMANDS
public static final java.lang.String TYPE_DSP
public static final java.lang.String TYPE_SIMPLE
public static final java.lang.String TYPE_BIBTEX
public static final java.lang.String TYPE_SQL
public static final java.lang.String TYPE_XML
public static final java.lang.String TYPE_USER
Constructor Detail |
---|
public MainApp()
Method Detail |
---|
protected org.apache.commons.cli.Options getDHTOptions()
public org.apache.commons.cli.Options getCmdOptions()
protected void printHelp()
public void startApp(java.lang.String pid) throws java.lang.Exception
java.lang.Exception
public P2PWorkflow getWorkflowInstanceByID(java.lang.String pid, boolean execute) throws AutoMedException
args
- execute
-
AutoMedException
public static P2PWorkflow getWorkflowInstance(org.apache.commons.cli.CommandLine cmd, boolean execute) throws AutoMedException
AutoMedException
public P2PWorkflow getWorkflowInstance(Peer p, AutoMedDHTImpl odht, java.lang.String dsType, java.lang.String... args) throws IllegalOperationException
p
- dht
- args
-
IllegalOperationException
public P2PWorkflow getWorkflowInstance(Peer peer, java.lang.String[] args, boolean execute)
protected static P2PWorkflow getWorkflowInstance(Peer peer, org.apache.commons.cli.CommandLine cmd, boolean execute) throws AutoMedException
AutoMedException
public static P2PWorkflow getWorkflowInstance(Peer peer, java.lang.String dsType, org.apache.commons.cli.CommandLine cmd, boolean execute) throws AutoMedException
AutoMedException
private static P2PWorkflow newWorkflowInstance(java.lang.String dsType, Peer peer, org.apache.commons.cli.CommandLine cmd)
public void startShell()
protected ow.tool.util.shellframework.Shell init(java.lang.String[] args, java.io.BufferedReader in, java.io.PrintStream out, boolean interactive)
init
in class ow.tool.dhtshell.Main
public ow.dht.DHT getDHT()
public org.apache.commons.cli.CommandLine getCommandLine()
public org.apache.commons.cli.CommandLine parseArgs(org.apache.commons.cli.Options opts, java.lang.String[] args) throws java.lang.Exception
args
-
java.lang.Exception
public org.apache.commons.cli.CommandLine[] parseArgs(org.apache.commons.cli.Option[] existingOpts, org.apache.commons.cli.Options opts, int start, int end, java.io.InputStream fin) throws AutoMedException
existingOpts
- pid
- fin
-
AutoMedException
public org.apache.commons.cli.CommandLine readP2POptions(org.apache.commons.cli.Options existingOpts, java.lang.String pid) throws AutoMedException
AutoMedException
protected org.apache.commons.cli.CommandLine readP2POptions(org.apache.commons.cli.Options existingOpts, java.lang.String pid, java.io.InputStream fin) throws AutoMedException
AutoMedException
public static void main(java.lang.String[] args)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |