|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectexpectj.ExpectJ
public class ExpectJ
This class is the starting point of the ExpectJ Utility. This class
acts as factory for all Spawn
s.
Constructor Summary | |
---|---|
ExpectJ()
Create a new ExpectJ with an infinite timeout. |
|
ExpectJ(long defaultTimeoutSeconds)
Create a new ExpectJ with specified timeout setting. |
Method Summary | |
---|---|
Spawn |
spawn(com.jcraft.jsch.Channel channel)
This method creates a spawn that controls an SSH connection. |
Spawn |
spawn(Executor executor)
This method spawns a new process. |
Spawn |
spawn(Spawnable spawnable)
This method launches a Spawnable . |
Spawn |
spawn(String command)
This method spawns a new process. |
Spawn |
spawn(String hostName,
int port)
This method spawns a telnet connection to the given host and port number. |
Spawn |
spawn(String remoteHostName,
int remotePort,
String userName,
String password)
This method creates a spawn that controls an SSH connection. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExpectJ(long defaultTimeoutSeconds)
defaultTimeoutSeconds
- default time out in seconds for the expect
commands on the spawned process. -1 default time out indicates
indefinite timeout.public ExpectJ()
Method Detail |
---|
public Spawn spawn(Spawnable spawnable) throws IOException
Spawnable
. Further expect commands can be
invoked on the returned Spawn
object.
spawnable
- spawnable to be executed
IOException
- if the spawning failspublic Spawn spawn(String command) throws IOException
Spawn
object.
command
- command to be executed
IOException
- if the process spawning failsRuntime.exec(String)
public Spawn spawn(Executor executor) throws IOException
Spawn
object.
executor
- Will be called upon to start the new process
IOException
- if the process spawning failsRuntime.exec(String[])
public Spawn spawn(String hostName, int port) throws IOException
Spawn
object.
hostName
- The name of the host to connect to.port
- The remote port to connect to.
IOException
- if the telnet spawning fails
UnknownHostException
- if you specify a bogus host nameTelnetSpawn
,
spawn(String, int, String, String)
,
spawn(Channel)
public Spawn spawn(com.jcraft.jsch.Channel channel) throws IOException
channel
- The SSH channel to control.
IOException
- If taking control over the SSH channel fails.spawn(String, int, String, String)
,
SshSpawn.SshSpawn(Channel)
public Spawn spawn(String remoteHostName, int remotePort, String userName, String password) throws IOException
remoteHostName
- The remote host to connect to.remotePort
- The remote port to connect to.userName
- The user name with which to authenticatepassword
- The password with which to authenticate
IOException
- If taking control over the SSH channel fails.spawn(Channel)
,
SshSpawn.SshSpawn(String, int, String, String)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |