Skip to content

Cannot Export Multiple Interfaces #1

@set321go

Description

@set321go

When I wish to export multiple services

@ServiceExport(interfaces = {SystemReadyState.class, ManagedService.class})
public class MyClass implements SystemReadyState, ManagedService {}

The generated code is incorrect and only contains one interface

@Named
@EagerSingleton
public class SystemReadyStatePeaberryServiceExport {

@Inject
Export<SystemReadyState> service;

}

@Named
public class SystemReadyStatePeaberryExportModule extends AbstractModule {

    @Override
    protected void configure() {
            install(Peaberry.osgiModule());

        Map<String, Object> attributes = new HashMap<>();
            attributes.put("service.pid", SystemReadyVetoRegistry.class.getName());

        bind(export(SystemReadyState.class)).toProvider(service(SystemReadyVetoRegistry.class)
            .attributes(attributes)
            .export());
    }
}

Attempts to fix this have failed so far because the implementation relies on an exception being throw and thus we can never proceed past the first annotation to be processed. https://github.com/elasticpath/peaberry-code-generator/blob/master/src/main/java/org/eclipse/sisu/contrib/peaberry/ServiceExportAnnotationProcessor.java L80

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions