[jboss-osgi-issues] [JBoss JIRA] Commented: (JBOSGI-305) Clarify ServiceReference.getUsingBundles() in ServiceFactory.ungetService()

Thomas Diesler (JIRA) jira-events at lists.jboss.org
Sun Mar 21 10:22:37 EDT 2010


    [ https://jira.jboss.org/jira/browse/JBOSGI-305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12521023#action_12521023 ] 

Thomas Diesler commented on JBOSGI-305:
---------------------------------------

OSGi cross reference
https://www.osgi.org/members/bugzilla/show_bug.cgi?id=1621

> Clarify ServiceReference.getUsingBundles() in ServiceFactory.ungetService()
> ---------------------------------------------------------------------------
>
>                 Key: JBOSGI-305
>                 URL: https://jira.jboss.org/jira/browse/JBOSGI-305
>             Project: JBoss OSGi
>          Issue Type: Task
>      Security Level: Public(Everyone can see) 
>          Components: Core Framework
>            Reporter: Thomas Diesler
>            Assignee: Thomas Diesler
>
> Consider
>       final boolean[] allGood = new boolean[2];
>       ServiceFactory factory = new ServiceFactory()
>       {
>          @Override
>          public Object getService(Bundle bundle, ServiceRegistration sreg)
>          {
>             ServiceReference sref = sreg.getReference();
>             Bundle[] users = sref.getUsingBundles();
>             assertNotNull("Users not null", users);
>             assertEquals(1, users.length);
>             assertEquals(bundle, users[0]);
>             allGood[0] = true;
>             return new Runnable()
>             {
>                public void run()
>                {
>                }
>             };
>          }
>          @Override
>          public void ungetService(Bundle bundle, ServiceRegistration sreg, Object service)
>          {
>             ServiceReference sref = sreg.getReference();
>             Bundle[] users = sref.getUsingBundles();
>             assertNotNull("Users not null", users);
>             assertEquals(1, users.length);
>             assertEquals(bundle, users[0]);
>             allGood[1] = true;
>          }
>       };
> Here we expect the service user to be the same in getService() and ungetService().
> This works in Felix-2.0.4 but not in Equinox-3.5.2. In Equinox getUsingBundles() returns null in ungetService()
> The Core TCK 4.2 expects the Felix behaviour in ServiceHookTests.testListenerHook03, AFAICS.

-- 
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

        


More information about the jboss-osgi-issues mailing list