Hi Clement,

Thanks for the pointers you have provided. I have used the annotation 
@PostRegistration as a callback to confirm the registration of my service. It 
works now.

Regards,
Kiran

-----Original Message-----
From: Raja Bahadur, Kiran (IT/IN) 
Sent: Monday, September 09, 2013 21:54
To: users@felix.apache.org
Subject: RE: Issue with Architecture object

Hi Clement, 

Using our white board patterns such as this I am receiving updates of " 
org.apache.felix.ipojo.architecture.Architecture" object and also all the 
instance updates. (org.osgi.framework.ServiceReference)
Below is the class structure which receives all the updates of Architecture 
object and all ServiceReference updates. 

@Component(publicFactory = false, immediate = true, managedservice = 
"ServiceExporter", architecture = true
        , name = "ServiceExporter")
@Instantiate(name = "ServiceExporter")
@Whiteboards(whiteboards =
        {
                @Wbp(
                        filter = "(monitor=true)",
                        onDeparture = "removeArch",
                        onModification = "modifiedArch",
                        onArrival = "addArch"),
                @Wbp(filter = "(instance.name=*)",
                        onArrival = "onArrival",
                        onDeparture = "onDeparture",
                        onModification = "onModification"
                )
        })

public class ServiceExporter {//start of class

    @Requires
    private Architecture[] arch;


@Bind(aggregate = true, id = "arch", optional = true)
    private void addArch(Architecture arch) { ......
}

@Unbind(aggregate = true, id = "arch", optional = true)
    private void removeArch(Architecture arch) { .....
}

@Modified(aggregate = true, id = "arch", optional = true)
    private void modifiedArch(Architecture arch) { .....
}

private synchronized void onArrival(ServiceReference ref) throws IOException { 
.....
}

private synchronized void onDeparture(ServiceReference ref) throws IOException 
{ .....
}

private synchronized void onModification(ServiceReference ref) throws 
IOException { .....
}

}//end of class





Could you please elaborate about the "ProvidedServicesListener", I am a bit new 
to the iPojo world? I know there are different handlers for @Provides, 
@Requires, etc... but how do I register to get updates related to individual 
handlers?

In my "com.abc.Publisher" (previous example) I have used @PostRegistration as 
well, for which I get an update once the service is registered, but I can' t 
extract an "Architecture" object from ServiceReference object. 

Is there any way to get hold of the latest Architecture object once I get hold 
of the ServiceReference in the updates that I get?

Many thanks,
Kiran

-----Original Message-----
From: Raja Bahadur, Kiran (IT/IN)
Sent: Monday, September 09, 2013 21:22
To: users@felix.apache.org
Subject: RE: Issue with Architecture object

Hi Clement,

Thanks for your response. I will take a quick look at it and get back to you. 
Another thing is that all the other services except this one come as 
"registered" when we get the update via Architecture object.

Regards,
Kiran

-----Original Message-----
From: Clement Escoffier [mailto:clement.escoff...@gmail.com]
Sent: Monday, September 09, 2013 21:14
To: users@felix.apache.org
Subject: Re: Issue with Architecture object

Hi,

When the architecture object is injected the service may be not yet registered. 
Indeed the architecture service is exposed before the registration of the 
(business) services. To be notified of the change, there is a set of listeners 
you can register on the different handlers such as the 
'ProvidedServiceListener'.

Regards,

Clement

On 9 sept. 2013, at 11:01, kiran.rajabaha...@nomura.com wrote:

> Hi,
> 
> I am having an issue where one of my registered service always comes out from 
> via Architecture object as “unregistered”. But when I actually check the 
> karaf (container) for that instance, it shows as “registered”. I am listening 
> to all Architecture events. (Add, Modify, Delete) using White Board Patterns.
> 
> Kindly let me know if there is anything obvious from the below output.
> 
> 
> 
> Debugging the callbacks of @Modified (Arch) method shows it as “unregistered”:
> Example: (the extract of the
> arch.getInstanceDescription().getHandlers()[1].getHandlerInfo() , 
> where arch is org.apache.felix.ipojo.architecture.Architecture)
> 
> 
> handler name="org.apache.felix.ipojo:provides" state="valid"
>      provides specifications="[com.abc.Publisher]" state="unregistered"
>            property name="service.pid" 
> value="EventPub.ba553e85-922c-4344-bed5-ac3c0077b9fd"
>            property name="factory.name" value="EventPub"
>            property name="instance.name" 
> value="EventPub.ba553e85-922c-4344-bed5-ac3c0077b9fd"
> 
> 
> 
> In the karaf console the output shows as registered:
> 
> instance name="EventPub.ba553e85-922c-4344-bed5-ac3c0077b9fd" state="valid" 
> bundle="74" component.type="EventPub"
>        handler name="org.apache.felix.ipojo:callback" state="valid"
>        handler name="org.apache.felix.ipojo:provides" state="valid"
>                provides specifications="[com.abc.Publisher]" 
> state="registered" service.id="382"
>                        property name="service.pid" 
> value="EventPub.ba553e85-922c-4344-bed5-ac3c0077b9fd"
>                        property name="factory.name" value="EventPub"
>                        property name="instance.name" 
> value="EventPub.ba553e85-922c-4344-bed5-ac3c0077b9fd"
>        handler name="com.abc.publisher.handler:endpointPublishes" 
> state="valid"
>        handler name="org.apache.felix.ipojo:architecture" state="valid"
> 
> 
> 
> 
> Regards,
> Kiran
> 
> This e-mail (including any attachments) is confidential, may contain 
> proprietary or privileged information and is intended for the named
> recipient(s) only. Unintended recipients are prohibited from taking 
> action on the basis of information in this e-mail and must delete all 
> copies. Nomura will not accept responsibility or liability for the 
> accuracy or completeness of, or the presence of any virus or disabling 
> code in, this e-mail. If verification is sought please request a hard 
> copy. Any reference to the terms of executed transactions should be 
> treated as preliminary only and subject to formal written confirmation 
> by Nomura. Nomura reserves the right to monitor e-mail communications 
> through its networks (in accordance with applicable laws). No 
> confidentiality or privilege is waived or lost by Nomura by any 
> mistransmission of this e-mail. Any reference to "Nomura" is a 
> reference to any entity in the Nomura Holdings, Inc. group.
> Please read our Electronic Communications Legal Notice which forms 
> part of this e-mail: http://www.Nomura.com/email_disclaimer.htm
> 


This e-mail (including any attachments) is confidential, may contain 
proprietary or privileged information and is intended for the named
recipient(s) only. Unintended recipients are prohibited from taking action on 
the basis of information in this e-mail and must delete all copies. Nomura will 
not accept responsibility or liability for the accuracy or completeness of, or 
the presence of any virus or disabling code in, this e-mail. If verification is 
sought please request a hard copy. Any reference to the terms of executed 
transactions should be treated as preliminary only and subject to formal 
written confirmation by Nomura. Nomura reserves the right to monitor e-mail 
communications through its networks (in accordance with applicable laws). No 
confidentiality or privilege is waived or lost by Nomura by any mistransmission 
of this e-mail. Any reference to "Nomura" is a reference to any entity in the 
Nomura Holdings, Inc. group.
Please read our Electronic Communications Legal Notice which forms part of this 
e-mail: http://www.Nomura.com/email_disclaimer.htm


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org


This e-mail (including any attachments) is confidential, may contain 
proprietary or privileged information and is intended for the named
recipient(s) only. Unintended recipients are prohibited from taking action on 
the basis of information in this e-mail and must delete all copies. Nomura will 
not accept responsibility or liability for the accuracy or completeness of, or 
the presence of any virus or disabling code in, this e-mail. If verification is 
sought please request a hard copy. Any reference to the terms of executed 
transactions should be treated as preliminary only and subject to formal 
written confirmation by Nomura. Nomura reserves the right to monitor e-mail 
communications through its networks (in accordance with applicable laws). No 
confidentiality or privilege is waived or lost by Nomura by any mistransmission 
of this e-mail. Any reference to "Nomura" is a reference to any entity in the 
Nomura Holdings, Inc. group.
Please read our Electronic Communications Legal Notice which forms part of this 
e-mail: http://www.Nomura.com/email_disclaimer.htm


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org


This e-mail (including any attachments) is confidential, may contain
proprietary or privileged information and is intended for the named
recipient(s) only. Unintended recipients are prohibited from taking
action on the basis of information in this e-mail and must delete all
copies. Nomura will not accept responsibility or liability for the
accuracy or completeness of, or the presence of any virus or disabling
code in, this e-mail. If verification is sought please request a hard
copy. Any reference to the terms of executed transactions should be
treated as preliminary only and subject to formal written confirmation
by Nomura. Nomura reserves the right to monitor e-mail communications
through its networks (in accordance with applicable laws). No
confidentiality or privilege is waived or lost by Nomura by any
mistransmission of this e-mail. Any reference to "Nomura" is a
reference to any entity in the Nomura Holdings, Inc. group.
Please read our Electronic Communications Legal Notice which forms
part of this e-mail: http://www.Nomura.com/email_disclaimer.htm


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org

Reply via email to