Issue 70 in peaberry: Bind concrete service classes

16 views
Skip to first unread message

peab...@googlecode.com

unread,
Dec 22, 2011, 3:34:55 AM12/22/11
to guice...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 70 by dennie...@gmail.com: Bind concrete service classes
http://code.google.com/p/peaberry/issues/detail?id=70

Using Peaberry 1.2:
When I want to bind a concrete service (without an interface) I am
receiving an Exception:

The array of service names is empty
at jpa.example1.GuiceModule.configure(GuiceModule.java:24)
while locating org.ops4j.peaberry.Export<jpa.example1.ConcreteService>

I am using this code:
public class GuiceModule extends PeaberryActivationModule{

@Override
protected void configure() {
// 1. Does not work
bind(export(ConcreteService.class))
.toProvider(service(ConcreteService.class).export());
// 2. Does not work
bindService(ConcreteService.class).export();
}

peab...@googlecode.com

unread,
Dec 23, 2011, 5:55:11 AM12/23/11
to guice...@googlegroups.com

Comment #1 on issue 70 by mccu...@gmail.com: Bind concrete service classes
http://code.google.com/p/peaberry/issues/detail?id=70

The current getInterfaceNames implementation (in OSGiServiceExport.java)
finds interfaces implemented by the service class - if the implementation
has no interfaces then this will be empty, and perhaps in that case it
should also include the implementation class itself as a service interface.

A workaround is to set the OBJECTCLASS property yourself:

bind(export(ConcreteService.class)).toProvider(

service(ConcreteService.class).attributes(objectClass(ConcreteService.class)).export());

Where objectClass is a static utility method from Attributes.java


peab...@googlecode.com

unread,
Aug 4, 2012, 5:34:57 PM8/4/12
to guice...@googlegroups.com
Updates:
Status: Accepted
Owner: mccu...@gmail.com

Comment #2 on issue 70 by mccu...@gmail.com: Bind concrete service classes
http://code.google.com/p/peaberry/issues/detail?id=70

Will see if this can be made easier

peab...@googlecode.com

unread,
Jun 21, 2015, 9:50:43 PM6/21/15
to guice...@googlegroups.com
Updates:
Status: Duplicate

Comment #4 on issue 70 by mccu...@gmail.com: Bind concrete service classes
https://code.google.com/p/peaberry/issues/detail?id=70

Moved to https://github.com/ops4j/peaberry/issues/73

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
Reply all
Reply to author
Forward
0 new messages