commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 38912] New: - Add Service class to locate SPI implementations
Date Thu, 09 Mar 2006 22:04:00 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38912>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38912

           Summary: Add Service class to locate SPI implementations
           Product: Commons
           Version: unspecified
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Lang
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: skitching@apache.org


The "service locator" pattern was first defined/documented in java 1.3.

This pattern allows code to locate a concrete implementation of some specific
interface, eg locate implementations of the cryptograpy API. This is of use to
any code that supports "plugin" implementations. 

The pattern is quite simple; a jarfile provides a concrete implementation of an
interface (or abstract base class), and includes a file
  META-INF/services/fully.qualified.interface.name
where the file contains the name of the concrete implementation.

Java 1.6 finally introduces a standard API which implements service lookup using
this pattern, java.util.Service. It would be nice to have an implementation in
Lang for code that wants to use this standard pattern but cannot depend on java 1.6.
   http://download.java.net/jdk6/docs/api/java/util/Service.html

An implementation of this pattern currently exists here, though it was written
without knowing that java.util.Service exists so the interface may change:

http://svn.apache.org/repos/asf/jakarta/commons/proper/logging/contrib/simon/jcl2/core/java/org/apache/commons/logging/Utils.java
http://svn.apache.org/repos/asf/jakarta/commons/proper/logging/contrib/simon/jcl2/core/

The commons-discovery project may also have an implementation of this pattern.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message