On 01/29/2013 04:23 PM, Thorsten Scherler wrote:
> On 01/29/2013 10:50 AM, [email protected] wrote:
>> Modified: 
>> incubator/droids/branches/0.2.x-cleanup/droids-core/src/main/java/org/apache/droids/core/Task.java
>> URL: 
>> http://svn.apache.org/viewvc/incubator/droids/branches/0.2.x-cleanup/droids-core/src/main/java/org/apache/droids/core/Task.java?rev=1439804&r1=1439803&r2=1439804&view=diff
>> ==============================================================================
>> --- 
>> incubator/droids/branches/0.2.x-cleanup/droids-core/src/main/java/org/apache/droids/core/Task.java
>>  (original)
>> +++ 
>> incubator/droids/branches/0.2.x-cleanup/droids-core/src/main/java/org/apache/droids/core/Task.java
>>  Tue Jan 29 09:50:17 2013
>> @@ -59,4 +59,6 @@ public interface Task extends Serializab
>>      public void abort();
>>  
>>      public boolean isAborted();
>> +
>> +    public Task createTask(URI uri);
>>  }
> Why did you added createTask to the interface?
>
> IMO it is not really generic since seeing your implementation and my
> current use case I would rather expected something like
>
> Link task = new LinkTask(link, uri, link.getDepth() + 1);
>
> /**
>      * Creates a new LinkTask.
>      *
>      * @param from Link
>      * @param uri URI
>      * @param depth int
>      */
>
> ...but I as well understand your approach.
>
> However I am doing the creation of tasks in my main CrawlingDroid but I
> am trying to understand why you have done it like that.
>
> salu2
>

Actually I just fixed my custom code for the linkTask with

    @Override
    public Link createTask(URI uri) {
        return new LinkTask(this, uri, this.getDepth() + 1);
    }

salu2

-- 
Thorsten Scherler <scherler.at.gmail.com>
codeBusters S.L. - web based systems
<consulting, training and solutions>

http://www.codebusters.es/

Reply via email to