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

Thomas Diesler (JIRA) jira-events at lists.jboss.org
Tue Jul 26 05:53:25 EDT 2011


     [ https://issues.jboss.org/browse/JBOSGI-305?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Diesler resolved JBOSGI-305.
-----------------------------------

    Resolution: Out of Date


Out of Date

> Clarify ServiceReference.getUsingBundles() in ServiceFactory.ungetService()
> ---------------------------------------------------------------------------
>
>                 Key: JBOSGI-305
>                 URL: https://issues.jboss.org/browse/JBOSGI-305
>             Project: JBoss OSGi
>          Issue Type: Task
>      Security Level: Public(Everyone can see) 
>          Components: Core Framework
>            Reporter: Thomas Diesler
>             Fix For: Approved and Unscheduled
>
>
> 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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-osgi-issues mailing list