public class BureauRegistry extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
BureauRegistry.CommandGenerator
Defines how to generate a command to launch a bureau in a local process.
|
static interface |
BureauRegistry.Launcher
Defines how a bureau is launched.
|
| Constructor and Description |
|---|
BureauRegistry(InvocationManager invmgr,
PresentsConnectionManager conmgr,
ClientManager clmgr)
Creates an uninitialized registry.
|
| Modifier and Type | Method and Description |
|---|---|
String |
checkToken(BureauCredentials creds)
Check the credentials to make sure this is one of our bureaus.
|
void |
destroyAgent(AgentObject agent)
Destroys a previously started agent using the data in the given object.
|
Exception |
getLaunchError(AgentObject agentObj)
If this agent's bureau encountered an error on launch, return it.
|
PresentsSession |
lookupClient(String bureauId)
Returns the active session for a bureau of the given id.
|
void |
setCommandGenerator(String bureauType,
BureauRegistry.CommandGenerator cmdGenerator)
Registers a command generator for a given type.
|
void |
setCommandGenerator(String bureauType,
BureauRegistry.CommandGenerator cmdGenerator,
int timeout)
Registers a command generator for a given type.
|
void |
setLauncher(String bureauType,
BureauRegistry.Launcher launcher)
Registers a launcher for a given type.
|
void |
setLauncher(String bureauType,
BureauRegistry.Launcher launcher,
int timeout)
Registers a launcher for a given type.
|
void |
startAgent(AgentObject agent)
Starts a new agent using the data in the given object, creating a new bureau if necessary.
|
@Inject public BureauRegistry(InvocationManager invmgr, PresentsConnectionManager conmgr, ClientManager clmgr)
public String checkToken(BureauCredentials creds)
public void setCommandGenerator(String bureauType, BureauRegistry.CommandGenerator cmdGenerator)
bureauType is used to determine the CommandGenerator
instance to call. The registry will wait indefinitely for the bureau to connect back.bureauType - the type of bureau that will be launchedcmdGenerator - the generator to be used for bureaus of bureauTypepublic void setCommandGenerator(String bureauType, BureauRegistry.CommandGenerator cmdGenerator, int timeout)
bureauType is used to determine the CommandGenerator
instance to call. If the launched bureau does not connect within the given number of
milliseconds, it will be logged as an error and future attempts to launch the bureau
will try launching the command again.bureauType - the type of bureau that will be launchedcmdGenerator - the generator to be used for bureaus of bureauTypetimeout - milliseconds to wait for the bureau or 0 to wait foreverpublic void setLauncher(String bureauType, BureauRegistry.Launcher launcher)
bureauType is used to determine the Launcher
instance to call. The registry will wait indefinitely for the launched bureau
to connect back.bureauType - the type of bureau that will be launchedlauncher - the launcher to be used for bureaus of bureauTypepublic void setLauncher(String bureauType, BureauRegistry.Launcher launcher, int timeout)
bureauType is used to determine the Launcher
instance to call. If the launched bureau does not connect within the given number of
milliseconds, it will be logged as an error and future attempts to launch the bureau
will invoke the launch method again.bureauType - the type of bureau that will be launchedlauncher - the launcher to be used for bureaus of bureauTypetimeout - milliseconds to wait for the bureau or 0 to wait foreverpublic void startAgent(AgentObject agent)
public void destroyAgent(AgentObject agent)
public PresentsSession lookupClient(String bureauId)
public Exception getLaunchError(AgentObject agentObj)
Copyright © 2015. All rights reserved.