EclipseCon 2011-Gemini Naming

2,099 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,099
On SlideShare
0
From Embeds
0
Number of Embeds
1,227
Actions
Shares
0
Downloads
12
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

EclipseCon 2011-Gemini Naming

  1. 1. <ul>Gemini Naming </ul>
  2. 2. OSGi JNDI Services Specification <ul><li>Specifies a service-based approach to provding JNDI services </li></ul><ul><ul><li>Handles services coming up and down </li></ul></ul><ul><li>Supports legacy services </li></ul><ul><ul><li>e.g. Existing LDAP, COS, RMI, DNS services are supported
  3. 3. Singletons for ObjectFactoryBuilder and InitialContextFactoryBuilder to allow overriding </li></ul></ul><ul><li>Allows use of standard JNDI API </li></ul><ul><ul><li>Careful: “Lifecycle mismatch” </li></ul></ul><ul><li>Special handling of URLs </li></ul><ul><ul><li>URL-based way of looking up OSGi services </li></ul></ul>
  4. 4. JNDIContextManager <ul><li>org.osgi.service.jndi.JNDIContextManager service </li></ul><ul><ul><li>newInitialContext()/newInitialContext(Map)
  5. 5. newDirectoryContext()/newDirectoryContext(Map) </li><ul><li>Search for matching InitialContextFactory services and return a wrapped version of them
  6. 6. If no appropriate InitialContextFactory found, search for appropriate InitialContextFactoryFactoryBuilder services. </li></ul></ul></ul>
  7. 7. JNDIProviderAdmin <ul><li>Conversion between references and objects
  8. 8. org.osgi.service.jndi.JNDIProviderAdmin service </li></ul><ul><ul><li>getObjectInstance() methods </li><ul><li>Search for ObjectFactory services the are appropriate
  9. 9. If no appropriate ObjectFactory, search for appropriate ObjectFactoryBuilder services </li></ul></ul></ul>
  10. 10. Demo <ul><li>Create and register custom ContextFactory
  11. 11. Use JNDIContextManager to get an initial context
  12. 12. Look-up database login information through JNDI
  13. 13. Use retrieved information to login and run JDBC Populator </li></ul>
  14. 14. Gemini JDBC
  15. 15. OSGi JDBC Services Specification <ul><li>org.osgi.service.jdbc.DataSourceFactory service </li><ul><li>Properties: </li><ul><li>OSGI_JDBC_DRIVER_CLASS (required)
  16. 16. OSGI_JDBC_DRIVER_NAME
  17. 17. OSGI_JDBC_VERSION </li></ul><li>Methods: </li><ul><li>createDataSource(Properties)
  18. 18. createConnectionPoolDataSource(Properties)
  19. 19. CreateDriver(Properties)
  20. 20. createXADataSource(Properties) </li></ul></ul></ul>
  21. 21. Derby Support <ul><li>org.apache.derby bundle </li><ul><li>Lightweight OSGi wrapper around derby JDBC driver </li></ul><li>org.eclipse.gemini.dbaccess.derby </li><ul><li>`Published DataSourceFactory service for derby
  22. 22. Depends on org.apache.derby bundle </li></ul></ul>

×