[JBoss JIRA] Created: (JBOSGI-144) Framework does not cache ServiceFactory provided service instances
by Thomas Diesler (JIRA)
Framework does not cache ServiceFactory provided service instances
------------------------------------------------------------------
Key: JBOSGI-144
URL: https://jira.jboss.org/jira/browse/JBOSGI-144
Project: JBoss OSGi
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Core
Reporter: Thomas Diesler
Assignee: Thomas Diesler
Fix For: Framework 1.0.0 Alpha1
http://www.osgi.org/javadoc/r4v41/org/osgi/framework/BundleContext.html#g...
A bundle's use of a service is tracked by the bundle's use count of that service. Each time a service's service object is returned by getService(ServiceReference) the context bundle's use count for that service is incremented by one. Each time the service is released by ungetService(ServiceReference) the context bundle's use count for that service is decremented by one.
When a bundle's use count for a service drops to zero, the bundle should no longer use that service.
This method will always return null when the service associated with this reference has been unregistered.
The following steps are required to get the service object:
1. If the service has been unregistered, null is returned.
2. The context bundle's use count for this service is incremented by one.
3. If the context bundle's use count for the service is currently one and the service was registered with an object implementing the ServiceFactory interface, the ServiceFactory.getService(Bundle, ServiceRegistration) method is called to create a service object for the context bundle. This service object is cached by the Framework. While the context bundle's use count for the service is greater than zero, subsequent calls to get the services's service object for the context bundle will return the cached service object. If the service object returned by the ServiceFactory object is not an instanceof all the classes named when the service was registered or the ServiceFactory object throws an exception, null is returned and a Framework event of type FrameworkEvent.ERROR is fired.
4. The service object for the service is returned.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 8 months
[JBoss JIRA] Created: (JBOSGI-140) Invalid delivery of framework events
by Thomas Diesler (JIRA)
Invalid delivery of framework events
------------------------------------
Key: JBOSGI-140
URL: https://jira.jboss.org/jira/browse/JBOSGI-140
Project: JBoss OSGi
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Core
Reporter: Thomas Diesler
Assignee: Thomas Diesler
Fix For: Framework 1.0.0 Alpha1
Although a listener is associated with a bundle context (i.e. must get removed when the bundle gets uninstalled) the events must get delivered to the listeners that are associated with the framework.
sysContext.addBundleListener(listenerA);
Bundle bndA = sysContext.install("bundleA.jar");
bndA.getBundleContext()..addBundleListener(listenerB);
Bundle bndB = sysContext.install("bundleB.jar");
bndB.uninstall();
Both listenerA and listenerB must see the BundleEvents for bundleB
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 8 months