Hello, i have a felix OSGi system and iPOJO bundles in it, managing
service dependencies for all other bundles.
And i have three types of public services (interfaces) in this system:
- Subscriber -- represents a participant in system's messaging.
- ProtocolInstance -- represents a connection via specific protocol to
a specific server
- ProtocolManager -- (Singletone, Factory?) manages (creates and
pre-configures) ProtocolInstance`s.
And also i have a single instance for whole system of:
- ConnectionManager -- which listens for ProtocolManager`s publications
and asks them for appropriate ProtocolInstance`s when time and
conditions are right.
Public services above are implemented and annotated in the following
way:
--->3---
@Provides
@Instantiate
@Component
ConnectionManager implements Subscriber
@Provides
@Instantiate
@Component
ProtocolManagerImpl implements ProtocolManager
@Provides
@Component
ProtocolInstanceImpl implements ProtocolInstance, Subscriber
--->3---
in that way, i wish the following actions to happen:
- Some authorized bundle asks a ConnectionManager to perform a
connection to server X via protocol Y
- ConnectionManager looks up ProtocolManager service in it's internal
list of published ProtocolManager`s for manager of protocol Y
(ProtocolManagerYImpl instance) and if finds it - asks this manager to
create a connection to server X
- Asked ProtocolManagerYImpl creates a ProtocolInstanceYImpl and
returns it to ConnectionManager, so he can connect() or disconnect()
this instance
The problem i faced is lying on the last step. I could create an
apropriate ProtocolInstance, but it won't be published as OSGi service
despite it's iPOJO annotations upon mere `new
ProtocolInstanceYImpl(argsSpecifyingServerXConnectionData);`.
But it is not like nothing happens and regular ProtocolInstanceYImpl
instance is created - it's, as far as i understood by poking debugger,
gets augmented with bunch of fields with underscores in names.
Also, this fields disappear when i remove iPOJO annotations from this
ProtocolInstanceYImpl class.
So, my question it: how do i integrate into iPOJO-fied system the
object insttance i created by hand?
Or, if it is a wrong question, how do i create a regular
(non-singletone) instance that way it will be integrated (published,
binded, injected, etc) into the system?
Thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]