Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 82 by
bouhie...@gmail.com: Always getting the same instance.
(Does single() mean singleton?).
http://code.google.com/p/peaberry/issues/detail?id=82
When using peaberry, I always get the same instance of an object.
I don't specify the binding as being a Singleton Scope or use the
@Singleton annotation
on the class. The binding is however annotated (with @Server).
How do I get a unique instance? (A non-singleton).
Am I using Peaberry wrongly?
Bundle1:
--------
Module1:
bind(export(IDataProvider.class)).annotatedWith(Server.class)
.toProvider(service(ServerCDODataProvider.class).export());
Activator1:
@Inject
@Server
Export<IDataProvider> dataProvider;
.... start(BundleContext ctx){
createInjector(osgiModule(ctx), new Module1()).injectMembers();
Bundle2:
-------
Module2:
bind(IDataProvider.class).annotatedWith(Server.class).toProvider(
service(IDataProvider.class).single());
ConsumerClass1:
@Inject
@Server
IDataProvider provider1
ConsumerClass2:
@Inject
@Server
IDataProvider provider2
provider1 == provider2 => true
--
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