public class

DefaultComponentRegistrar

extends Object
implements ComponentRegistrar
java.lang.Object
   ↳ com.atlassian.plugin.osgi.hostcomponents.impl.DefaultComponentRegistrar

Class Overview

Default component registrar that also can write registered host components into the OSGi service registry.

Summary

[Expand]
Inherited Constants
From interface com.atlassian.plugin.osgi.hostcomponents.ComponentRegistrar
Public Constructors
DefaultComponentRegistrar()
Public Methods
List<HostComponentRegistration> getRegistry()
InstanceBuilder register(Class...<?> mainInterfaces)
Starts the single host component registration by declaring it as implementing one or more interfaces
List<ServiceRegistration> writeRegistry(BundleContext ctx)
Protected Methods
Object wrapService(Class[]<?> interfaces, Object service)
Wraps the service in a dynamic proxy that ensures all methods are executed with the object class's class loader as the context class loader
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.plugin.osgi.hostcomponents.ComponentRegistrar

Public Constructors

public DefaultComponentRegistrar ()

Public Methods

public List<HostComponentRegistration> getRegistry ()

public InstanceBuilder register (Class...<?> mainInterfaces)

Starts the single host component registration by declaring it as implementing one or more interfaces

Parameters
mainInterfaces The list of interfaces this host component implements
Returns
  • The instance builder that will tie these interfaces with a host component instance

public List<ServiceRegistration> writeRegistry (BundleContext ctx)

Protected Methods

protected Object wrapService (Class[]<?> interfaces, Object service)

Wraps the service in a dynamic proxy that ensures all methods are executed with the object class's class loader as the context class loader

Parameters
interfaces The interfaces to proxy
service The instance to proxy
Returns
  • A proxy that wraps the service