[SAGA-RG] minutes from the OGF21 session on the Java language binding

Daniel Templeton Dan.Templeton at Sun.COM
Fri Oct 19 11:51:38 CDT 2007


I put together an example of the Generics syntax I mentioned:

import java.util.Date;

public class Main {
    public static void main(String[] args) {
        Date d = new Date();
        String s = "test";

        // Type is inferred from d2
        Date d2 = cast(d);
        // Because we're chaining, type must be provided explicitly
        String[] ts = Main.<String>cast(s).split("es");
    }

    // We suppress warnings generated by the unchecked cast
    @SuppressWarnings("unchecked")
    public static <T> T cast(Object o) {
        T t = (T)o;

        return t;
    }
}


Hopefully that's clear enough.

Daniel


Andre Merzky wrote:
> Some comments below
>
> Quoting [Thilo Kielmann] (Oct 18 2007):
>   
>> timeout values:
>> --------------
>> numeric constants such as "nowait" and "waitforever" shall be used instead
>> of 0 and -1
>>     
>
> A side comment in the session was that this would be useful
> for C++ as well - I agree.
>
>
>   
>> tasks:
>> -----
>>
>> this interface (group) seemingly needs more attention
>>
>> it is suggested to check whether future objects from the concurrency library
>> could be used.
>> the RVTask looks very much like a future
>>
>> the asymmetry between run() and waittask() should be resolved
>>     
>
> An comment here was, too, that this might not be easy, as
> wait() is reserved, and runtask() would be unconventional
> (as run() is usually used in Java for runnables).
>
> Another comment from Dan was that method templates/generics
> should work in Java 5, e.g.:
>
>   saga::file f = ...;
>   saga::task t = f.get_size    <Async>   ();
>   ssize_t    s = t.get_result  <ssize_t> ();
>
> okok, that is C++, but the point is that something similar
> is supposedly working in Java as well.
>
>
>   
>> CPI, adaptor interface:
>> ----------------------
>>
>> The audience suggests to add an SPI (service provider interface) as part
>> of the Java language binding (currently called CPI in the JavaGAT)
>> This could allow for a standardized adaptor interface, and thus adaptor
>> reuse.
>> Good examples for such an API/SPI combinations are: JAXP, LDAP, DRMAA
>>     
>
> To simplify the documents, and to allow for implementations
> which do not use the SPI, we could split that in two
> documents?
>
> Same holds for C++, where we wee encouraged to formally nail
> down the CPI, to allow for exchangable adaptors.
>
> Cheers, Andre.
>
>   


More information about the saga-rg mailing list