river-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Firmstone <j...@zeus.net.au>
Subject Example of Generics and Service API.
Date Wed, 29 Dec 2010 10:55:04 GMT
Check out an example of utilising Generics and maintaining runtime type 
safety with Service API.

See:

http://svn.apache.org/viewvc/incubator/river/jtsk/skunk/pepe/src/org/apache/river/api/lookup/

StreamServiceRegistrar and MarshalledServiceItem (extends ServiceItem) 
are part of the Service API.

ResultStream<T>, is an interface using generics.

StreamServiceRegistrar uses ResultStream, but reverts to the default 
type, Object.

ServiceResultStreamFilter and ServiceResultStreamUnmarshaller are client 
utility classes that utilise Generic's, implement ResultStream and are 
used by the client to manipulate the results from StreamServiceRegistrar 
and MarshalledServiceItem.


Cheers,

Peter.


Mime
View raw message