Service provider interface
Service provider interface (SPI) is an API intended to be implemented or extended by a third party. It can be used to enable framework extension and replaceable components.[1][2][3]
Details
From Java documentation:
A service is a well-known set of interfaces and (usually abstract) classes. A service provider is a specific implementation of a service. The classes in a provider typically implement the interfaces and subclass the classes defined in the service itself. Service providers can be installed in an implementation of the Java platform in the form of extensions, that is, jar files placed into any of the usual extension directories. Providers can also be made available by adding them to the application's class path or by some other platform-specific means.[4]
The concept can be extended to other platforms using the corresponding tools. In the Java Runtime Environment, SPIs are used in:[1][2]
- Java Database Connectivity
- Java Cryptography Extension
- Java Naming and Directory Interface
- Java API for XML Processing
- Java Business Integration
- Java Sound
- Java Image I/O
- Java File Systems
See also
References
- ^ a b "Introduction to the Service Provider Interfaces". Oracle Java Documentation.
Services are units of sound-handling functionality that are automatically available when an application program makes use of an implementation of the Java Sound API
- ^ a b Thribhuvan Thakur (November 18, 2009). "Service Provider Interface: Creating Extensible Java Applications". Developer.com. Archived from the original on November 22, 2009. Retrieved August 20, 2010.
A service provider interface (SPI) is the set of public interfaces and abstract classes that a service defines. A SPI may be represented by a single interface (type) or abstract class or a set of interfaces or abstract classes that define the service contract.
- ^ Seacord, C. Robert & Wrage, Lutz (July 2002). "Replaceable Components and the Service Provider Interface". Software Engineering Institute (CMU).
- ^ "ServiceLoader".
External links
- Replaceable Components and the Service Provider Interface (.pdf at The Software Engineering Institute CMU)
- Official Java API documentation: java.util.class and [http://com/javase/4/docs/api/java/util/spi/package-estary.html java.util.spi package
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.