Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating an SPI.




First off, thanks to all who have responded thus far. Lot's of helpful information from all of you...


On Dec 31, 2005, at 1:44 PM, Elliott Hughes wrote:

On 2005-12-31, at 10:18, email@hidden wrote:
On 12/31/05 00:02, "Rams" <email@hidden> wrote:

Does anyone here have any tips, tutorials, or how-to's on creating your own
service provider interface in Java? Something like the sound or crypto
spi's. Ideally, I'd like to create an application based on my own SPI and
improve functionality with service providers as I go along. An SPI seems like
a good way to do that, but I'm not finding a lot of documentation on creating
one.

wait until Apple has a Java 6 "DP" (or develop on Linux), and use java.util.Service?


  http://download.java.net/jdk6/docs/api/java/util/Service.html

if you're too impatient to wait for Apple, back-port it to Java 5.

Is there any reason I cannot use sun.misc.Service like javax.naming.spi does? After unzipping the src.jar file in java home, that appears to be how the standard java SPI's are locating class names. Once I've got the names, I think I can figure out how to get a classloader to produce an instance for me... I mean, I could read through every jar file in the classpath looking for /META-INF/ Service myself, but it seems like a bit of a waste if all I want to do is find the class names and this thing does the trick. Is using a sun.* class a bad idea for any reason?


Again, TIA

--
Learn how to cryptographically sign your mail with Mac OS X 10.3+
http://www.joar.com/certificates/

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.