Ownership Helper

I am trying to programmatically restart an application by retrieving the owner of its shared interface and calling stop (as recommended by Alga), but it appears that the ownership helper is not behaving as described by the Javadoc.

In the following example, the output on System.out is the owner of the shared interface, not of the referenced object:

OwnershipHelper ownershipHelper = ServiceFactory.getRequiredService(OwnershipHelper.class);
Application app = ownershipHelper.getOwner(myInterface);
System.out.println("App Identifier: " + app.getIdentifier());

From the Javadoc:

/**
 * Returns the application that owns the given object.
 * <p>
 * If the object belongs to the kernel or the application is not found, the method returns {@code null}.
 * <p>
 * If the object is a proxy object, the implementation should return the application that owns the referenced
 * object.
 *
 * @param object
 *            the object.
 * @return the owner of the object.
 */
 @Nullable
 Application getOwner(Object object);

Hi stephen,
Can you send me the ivy-fixed.xml file of your Kernel.
You’ld found it in the target~/artifacts folder of your kernel project.
We already encounter this issue with an old version of the wadapps-multisandbox library.
It’ld be fixed with later version of this library.
I want to check that you use a recent version.

Hi Alga,

You should be receiving the file by email shortly. We do not want to upload it to the public internet.

The dependency for wadapps-multisandbox however, is:

<dependency org="ej.library.wadapps" name="wadapps-multisandbox" rev="1.1.0" transitive="false" conf="default->default;provided->provided;default-vd->default;default-fw->default"/>