<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:12pt">How about just using "as" and "using" instead of "asClass" and "usingClassloader"?<br><br>Consider something like the following which kind of looks like a dsl:<br><br>Foo f = cache.getAdvancedCache().as (Foo.class).using (classLoader).get (key);<br><br>T<br><div style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"><br><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Sanne Grinovero &lt;sanne.grinovero@gmail.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> infinispan -Dev List &lt;infinispan-dev@lists.jboss.org&gt;<br><b><span style="font-weight: bold;">Sent:</span></b> Mon, 2 May, 2011 21:08:47<br><b><span style="font-weight: bold;">Subject:</span></b> Re:
 [infinispan-dev] [Pull Request] Modular Classloading Compatibility<br></font><br>2011/5/2 Manik Surtani &lt;<a ymailto="mailto:manik@jboss.org" href="mailto:manik@jboss.org">manik@jboss.org</a>&gt;:<br>&gt;<br>&gt; On 1 May 2011, at 13:38, Pete Muir wrote:<br>&gt;<br>&gt;&gt;&gt;&gt; As in, user API? &nbsp;That's a little intrusive... e.g., put(K, V, cl) ?<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Not for put, since you have the class, just get, and I was thinking<br>&gt;&gt;&gt; something more like:<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Foo foo = getUsing(key, Foo.class)<br>&gt;&gt;<br>&gt;&gt; This would be a pretty useful addition to the API anyway to avoid user casts.<br>&gt;<br>&gt; Maybe as an "advanced" API, so as not to pollute the basic API? &nbsp;A bit like:<br>&gt;<br>&gt; Foo f = cache.getAdvancedCache().asClass(Foo.class).get(key);<br><br>doesn't look much better than a cast, but is more cryptical :)<br><br>getting back to the classloader issue, what
 about:<br><br>Cache c = cacheManager.getCache( cacheName, classLoader );<br><br>or<br>Cache c = cacheManager.getCache( cacheName ).usingClassLoader(classLoader );<br><br>BTW if that's an issue on the API, maybe you should propose it to<br>JSR-107 as well ?<br><br>Sanne<br><br>_______________________________________________<br>infinispan-dev mailing list<br><a ymailto="mailto:infinispan-dev@lists.jboss.org" href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a></div></div>
</div></body></html>