I think we should rely on the components that create garbage to clear out
their own garbage without having a central task in the kernel.

On Tue, Jun 7, 2016 at 3:29 PM, Thusitha Thilina Dayaratne <
[email protected]> wrote:

> Hi All,
>
> I'm trying to implement file upload support for msf4j with FormParam. In
> the none streaming mode, we need to create temp files in some location and
> clean them after a particular time period.
>
> For that purpose at the moment I'm using apache commons-io provided
> FileCleaningTracker[1, 2]. There we can give the set of file objects that
> we need to track. This will be running in a separate thread. When those
> objects are eligible for GC, it will delete the those files. In this way we
> can be sure that the temp objects will not get clear before the actual
> service consumes them.
>
> IMHO it would be much easier if we can provide a similar support from the
> kernel level, since products will require similar functionality in the
> future.
>
> AFAIU rather than tracking the file object references, if we run this as a
> periodic task (like in c4) we have to assume that the temp files are been
> consumed after a pre-configured time. Is it safe to assume so?
>
> WDYT?
>
> [1] -
> https://commons.apache.org/proper/commons-io/javadocs/api-2.2/org/apache/commons/io/FileCleaningTracker.html
> [2] -
> https://github.com/apache/commons-io/blob/trunk/src/main/java/org/apache/commons/io/FileCleaningTracker.java
>
> Thanks
> --
> Thusitha Dayaratne
> Software Engineer
> WSO2 Inc. - lean . enterprise . middleware |  wso2.com
>
> Mobile  +94712756809
> Blog      alokayasoya.blogspot.com
> About    http://about.me/thusithathilina
>
>


-- 
*Afkham Azeez*
Director of Architecture; WSO2, Inc.; http://wso2.com
Member; Apache Software Foundation; http://www.apache.org/
* <http://www.apache.org/>*
*email: **[email protected]* <[email protected]>
* cell: +94 77 3320919blog: **http://blog.afkham.org*
<http://blog.afkham.org>
*twitter: **http://twitter.com/afkham_azeez*
<http://twitter.com/afkham_azeez>
*linked-in: **http://lk.linkedin.com/in/afkhamazeez
<http://lk.linkedin.com/in/afkhamazeez>*

*Lean . Enterprise . Middleware*
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to