|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
net.sweetohm.ant.server.ServerTask
public class ServerTask
This task runs a server to handle build requests send by sockets.
Field Summary | |
---|---|
(package private) java.util.List |
ips
List of allowed IPs for connection |
(package private) int |
port
The port the server is listening to |
(package private) org.apache.tools.ant.Project |
project
The project to build |
(package private) java.net.ServerSocket |
server
The server socket to listen port |
(package private) java.lang.Thread |
thread
The thread that is running |
Fields inherited from class org.apache.tools.ant.Task |
---|
target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
---|
description, location |
Constructor Summary | |
---|---|
ServerTask()
Empty constructor. |
Method Summary | |
---|---|
(package private) boolean |
checkAccess(java.net.Socket socket)
Check that the access is granted by searching the IP of the client in the list of granted IPs. |
void |
execute()
Lauch the server for Ant management, ant wait for shutdown. |
void |
run()
The main loop of the server. |
void |
setIps(java.lang.String ips)
Set the list of granted IPs for connection. |
void |
setPort(int port)
Set the port the server is listening. |
void |
start()
Start the server. |
void |
stop()
Stop the server. |
Methods inherited from class org.apache.tools.ant.Task |
---|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
---|
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
java.lang.Thread thread
int port
java.util.List ips
org.apache.tools.ant.Project project
java.net.ServerSocket server
Constructor Detail |
---|
public ServerTask()
Method Detail |
---|
public void setPort(int port)
port
- The port the server is listening.public void setIps(java.lang.String ips)
ips
- The coma separated list of IPs.public void execute()
execute
in class org.apache.tools.ant.Task
public void run()
run
in interface java.lang.Runnable
public void start()
public void stop()
boolean checkAccess(java.net.Socket socket) throws java.lang.SecurityException
true
if access is granted
and false
if it is not.
socket
- The Socket
for the connection.
java.lang.SecurityException
- if access is not granted for this IP.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |