org.curjent.example.agent.ftpxfer
Class FTPTransferTasks

java.lang.Object
  extended by org.curjent.agent.FixedTasks
      extended by org.curjent.example.agent.ftpxfer.FTPTransferTasks
All Implemented Interfaces:
AgentTasks

 class FTPTransferTasks
extends FixedTasks

Source for FTP transfer tasks.

FTPTransferTasks is an example of how to manage the lifecycle of agent tasks. Nothing special is required when a task is acquired. Connections are dynamically established as needed since a connection is not needed for all calls. The release method is overridden, however, in order to disconnect a potentially live connection when a task is released.


Constructor Summary
FTPTransferTasks(String remote, String local, int count)
           
 
Method Summary
private static FTPTransferTask[] newTasks(String remote, String local, int count)
           
 void release(Object task)
          Adds the given task to our list of available tasks.
 
Methods inherited from class org.curjent.agent.FixedTasks
acquire
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FTPTransferTasks

FTPTransferTasks(String remote,
                 String local,
                 int count)
Method Detail

release

public void release(Object task)
             throws Throwable
Description copied from class: FixedTasks
Adds the given task to our list of available tasks.

Specified by:
release in interface AgentTasks
Overrides:
release in class FixedTasks
Throws:
Throwable - An unexpected error.

newTasks

private static FTPTransferTask[] newTasks(String remote,
                                          String local,
                                          int count)


Copyright 2009-2011 Tom Landon
Apache License 2.0