|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.jas.util.ExecutableChannels
public class ExecutableChannels
ExecutableChannels used to receive and execute classes.
Field Summary | |
---|---|
protected ChannelFactory |
cf
|
protected SocketChannel[] |
channels
|
protected static java.lang.String |
DEFAULT_MFILE
default machine file. |
protected static int |
DEFAULT_PORT
default port. |
protected int[] |
ports
|
protected java.lang.String[] |
servers
|
Constructor Summary | |
---|---|
protected |
ExecutableChannels()
Internal constructor. |
|
ExecutableChannels(java.lang.String mfile)
Constructor from machine file. |
|
ExecutableChannels(java.lang.String[] srvs)
Constructor from array of server:port strings. |
Method Summary | |
---|---|
void |
close()
close all channels and ChannelFactory. |
SocketChannel |
getChannel(int i)
getChannel. |
java.lang.String |
getMasterHost()
get master host. |
int |
getMasterPort()
get master port. |
int |
numChannels()
number of channels. |
int |
numServers()
number of servers. |
void |
open()
open, setup of SocketChannels. |
void |
open(int nc)
open, setup of SocketChannels. |
java.lang.Object |
receive(int i)
recieve on channel i. |
void |
send(int i,
java.lang.Object o)
send on channel i. |
protected void |
setServerPort(int i,
java.lang.String srv)
|
java.lang.String |
toString()
String representation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final int DEFAULT_PORT
protected static final java.lang.String DEFAULT_MFILE
protected final ChannelFactory cf
protected SocketChannel[] channels
protected java.lang.String[] servers
protected int[] ports
Constructor Detail |
---|
protected ExecutableChannels()
public ExecutableChannels(java.lang.String[] srvs)
srvs
- A String array.public ExecutableChannels(java.lang.String mfile) throws java.io.FileNotFoundException
mfile
-
FileNotFoundException.
java.io.FileNotFoundException
Method Detail |
---|
protected void setServerPort(int i, java.lang.String srv)
public java.lang.String toString()
toString
in class java.lang.Object
public int numServers()
public java.lang.String getMasterHost()
public int getMasterPort()
public int numChannels()
public void open() throws java.io.IOException
IOException.
java.io.IOException
public void open(int nc) throws java.io.IOException
nc
- number of channels to open.
IOException.
java.io.IOException
public void close()
public SocketChannel getChannel(int i)
i
- channel number.public void send(int i, java.lang.Object o) throws java.io.IOException
i
- channel number.o
- object to send.
java.io.IOException
public java.lang.Object receive(int i) throws java.io.IOException, java.lang.ClassNotFoundException
i
- channel number.
java.io.IOException
java.lang.ClassNotFoundException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |