|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
server.Server
public class Server
Field Summary |
---|
Fields inherited from class java.rmi.server.RemoteObject |
---|
ref |
Fields inherited from interface api.Client2Server |
---|
NAME |
Fields inherited from interface api.Computer2Server |
---|
NAME |
Constructor Summary | |
---|---|
Server(boolean animate)
|
Method Summary | |
---|---|
LoginContainer |
login(Server2Computer computer)
Logs a computer in to a server. |
static void |
main(java.lang.String[] args)
|
void |
putResult(Server2Computer computer,
Result result)
puts a result on the server |
void |
putTask(Task task)
Remote method for submitting a task to the server. |
void |
registerListener(RemoteListener remoteListener)
Registers an event listener on a server |
void |
startThreads()
|
void |
stop()
Stops the server and all of its connected computers. |
java.lang.Object |
takeResult()
Gets a result from the server. |
Task |
takeTask(Server2Computer computer)
Blocking call to take a task from the server |
Task[] |
takeTasks(Server2Computer computer,
int count)
Non-blocking request for multiple tasks |
void |
updateShared(Server2Computer computer,
Shared shared)
send a shared update to the server |
Methods inherited from class java.rmi.server.UnicastRemoteObject |
---|
clone, exportObject, exportObject, exportObject, unexportObject |
Methods inherited from class java.rmi.server.RemoteServer |
---|
getClientHost, getLog, setLog |
Methods inherited from class java.rmi.server.RemoteObject |
---|
equals, getRef, hashCode, toString, toStub |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Server(boolean animate) throws java.rmi.RemoteException
java.rmi.RemoteException
Method Detail |
---|
public void stop() throws java.rmi.RemoteException
Client2Server
stop
in interface Client2Server
java.rmi.RemoteException
- RMI Exceptionpublic void startThreads()
public LoginContainer login(Server2Computer computer) throws java.rmi.RemoteException
Computer2Server
login
in interface Computer2Server
computer
- A reference to the remote computer object that is logging in. This allows the
server to make calls to the computer.
java.rmi.RemoteException
- RMI Exceptionpublic void putResult(Server2Computer computer, Result result) throws java.rmi.RemoteException
Computer2Server
putResult
in interface Computer2Server
computer
- the computer issuing the resultresult
- the result object
java.rmi.RemoteException
- RMI Exceptionpublic void putTask(Task task) throws java.rmi.RemoteException
Client2Server
putTask
in interface Client2Server
task
- The task to be executed on a client's behalf
java.rmi.RemoteException
- RMI exceptionpublic void registerListener(RemoteListener remoteListener) throws java.rmi.RemoteException
Client2Server
registerListener
in interface Client2Server
remoteListener
- the listener to register
java.rmi.RemoteException
- RMI Exceptionpublic java.lang.Object takeResult() throws java.rmi.RemoteException
Client2Server
takeResult
in interface Client2Server
java.rmi.RemoteException
- RMI exceptionpublic Task takeTask(Server2Computer computer) throws java.rmi.RemoteException
Computer2Server
takeTask
in interface Computer2Server
computer
- the computer requesting the task
java.rmi.RemoteException
- RMI Exceptionpublic Task[] takeTasks(Server2Computer computer, int count) throws java.rmi.RemoteException
Computer2Server
takeTasks
in interface Computer2Server
computer
- The requesting computercount
- The number of desired tasks
java.rmi.RemoteException
- RMI Exceptionpublic void updateShared(Server2Computer computer, Shared shared) throws java.rmi.RemoteException
Computer2Server
updateShared
in interface Computer2Server
computer
- the computer issuing the updateshared
- the new shared object
java.rmi.RemoteException
- RMI Exceptionpublic static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |