You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Thiago Souza <tc...@gmail.com> on 2015/01/25 16:40:18 UTC

[ipojo] Help wih @Stereotype and custom handler

Hi all,

I'm trying to create a custom handler with a @Stereotype annotation (named
@Namespace) with the following use case:

@Namespace("a-namespace")
public class ANamespaceComponent {
}

The ANamespaceComponent would also inherit @Component(name="a-namespace")
and @Instantiate with additional processing.

Unfortunatelly I'm not being able to understand, from the documentation,
what artifacts (and how) should be created.

Any help appreciated!

Thanks!





--
View this message in context: http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

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


Re: [ipojo] Help wih @Stereotype and custom handler

Posted by Thiago Souza <tc...@gmail.com>.
Thanks for the tip! :)



--
View this message in context: http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011273.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

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


Re: [ipojo] Help wih @Stereotype and custom handler

Posted by Thiago Souza <tc...@gmail.com>.
Hi!

So the only way is by polling these services? Won't this lead to race
condition problems?

Cheers

On Thu Jan 29 2015 at 5:05:42 PM clement escoffier [via Apache Felix] <
ml-node+s18485n5011309h60@n6.nabble.com> wrote:

>
> On 29 janvier 2015 at 19:23:16, Thiago Souza ([hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5011309&i=0>) wrote:
>
> Hi clement!
>
> Well, so maybe you could give me a hint.
>
> Is there any way to know when all the components of a custom handler of a
> specific bundle has been instantiated and activated? For example, a
> bundle
> X defines components A and B wit a custom handler NS:H. Components A and
> B
> are all immediate annotated with @Instantiate. So, how can I know when
> iPojo finishes processing bundle X?
>
> I tried listening to Bundle.STARTED event, but it seems that ipojo
> processing is happening after this event (or it's async, I don't know).
> Yes, it’s async by default. What you need to know is to listen the 2 queue
> service provided by iPOJO.
>
> Check
> https://github.com/wisdom-framework/wisdom/blob/master/core/wisdom-test/src/main/java/org/wisdom/test/parents/Stability.java#L78.
> This function waits for all queues to be empty.
>
> Cheers,
>
> Clement
>
>
>
>
>
> Any help apreciated!
>
> Thanks
>
>
>
> On Thu Jan 29 2015 at 4:08:06 PM clement escoffier [via Apache Felix] <
> [hidden email] <http:///user/SendEmail.jtp?type=node&node=5011309&i=1>>
> wrote:
>
> > Hi,
> >
> >
> > On 29 janvier 2015 at 15:21:00, Thiago Souza ([hidden email]
> > <http:///user/SendEmail.jtp?type=node&node=5011306&i=0>) wrote:
> >
> > Hi!
> >
> > Thanks for the tips! I ended up creating a custom handler for this.
> >
> > Now, what I need to do is to generate some metadata to bundle's
> manifest.
> > Is it possible using the visitor? If not, I'll have to solve this in
> > runtime.
> > No the visitor does not let you do such kind of enhancement.The visitor
> > lets you write the iPOJO metadata you want (well, they are stored in
> the
> > manifest, so maybe it’s enough for you).
> >
> >
> >
> > Cheers,
> >
> >
> >
> > Clement
> >
> >
> >
> >
> >
> > Thanks!
> >
> > On Mon Jan 26 2015 at 3:40:06 AM clement escoffier [via Apache Felix] <
> > [hidden email] <http:///user/SendEmail.jtp?type=node&node=5011306&i=1>>
>
> > wrote:
> >
> > > Hi,
> > >
> > > On 25 janvier 2015 at 22:45:46, Thiago Souza ([hidden email]
> > > <http:///user/SendEmail.jtp?type=node&node=5011275&i=0>) wrote:
> > > Hi!
> > >
> > > I could implement a prototype that generates metadata in the
> component
> > > descriptor.
> > >
> > > Now I can create an iPojo that requires component factories with
> these
> > > metadata. But I'm not being able to find a way to access the pojo
> > > instance
> > > itself given a factory, is it possible?
> > > You use the Factory to create a ComponentInstance, then you have two
> > ways:
> > >
> > > 1) The best way is to retrieve a service exposed by the freshly
> created
> > > instance. You can use the ‘instance.name’ property to select the
> > service.
> > > That way, you manager ‘invalid’ instance (instances that depends on
> > > unavailable services), as the service won’t be exposed in this case.
> > >
> > > try {
> > > ServiceReference[] refs =
> > >
> > > context.getServiceReferences(YourServiceInterface.class.getName(),
> > > "(instance.name=" + instance.getInstanceName() +")");
> > > if (refs != null) {
> > > Foo your_object = (Foo) context.getService(refs[0]);
> > > }
> > > } catch (InvalidSyntaxException e) {
> > > // Should not happen
> > > }
> > > 2) You can use the following snippet:
> > >
> > > if (instance.getState() == ComponentInstance.VALID) {
> > > ImplementationClass object =
> > > (ImplementationClass) ((InstanceManager) instance).getPojoObject();
> > > } else {
> > > System.out.println("Cannot get an implementation object from an
> invalid
> > > instance");
> > > }
> > >
> > > First it requires a cast to InstanceManager. InstanceManager is the
> > > implementation class behind @Component. As iPOJO supports her type of
> > > entities, you need to be sure you are using @Component before casting
> > > (others are Handler, Composite…). Once you have the instance manager
> > you
> > > can call the ‘getPojoObject’ to retrieve the pojo instance. If none
> > exist,
> > > one is created.
> > >
> > >
> > > Cheers,
> > >
> > > Clement
> > >
> > >
> > >
> > >
> > > Regards
> > >
> > > On Sun, Jan 25, 2015, 14:15 clement escoffier [via Apache Felix] <
> > > [hidden email] <http:///user/SendEmail.jtp?type=node&node=5011275&i=1>>
>
> >
> > > wrote:
> > >
> > > > Hi,
> > > >
> > > > Unfortunately stereotypes do not support ‘parameter’ right now, but
> > you
> > > > can use ‘visitors’ which are small classes rewriting the
> annotation.
> > > > Here is something similar to what you try to do:
> > > >
> > >
> >
> https://github.com/wisdom-framework/wisdom/blob/master/core/wisdom-ipojo-module/src/main/java/org/wisdom/ipojo/module/WisdomServiceVisitor.java
>
> >
> > >
> > > >
> > > > Cheers,
> > > >
> > > > Clement
> > > > On 25 janvier 2015 at 16:42:50, Thiago Souza ([hidden email]
> > > > <http:///user/SendEmail.jtp?type=node&node=5011272&i=0>) wrote:
> > > >
> > > > Hi all,
> > > >
> > > > I'm trying to create a custom handler with a @Stereotype annotation
> > > (named
> > > >
> > > > @Namespace) with the following use case:
> > > >
> > > > @Namespace("a-namespace")
> > > > public class ANamespaceComponent {
> > > > }
> > > >
> > > > The ANamespaceComponent would also inherit
> > > @Component(name="a-namespace")
> > > >
> > > > and @Instantiate with additional processing.
> > > >
> > > > Unfortunatelly I'm not being able to understand, from the
> > > documentation,
> > > > what artifacts (and how) should be created.
> > > >
> > > > Any help appreciated!
> > > >
> > > > Thanks!
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > View this message in context:
> > > >
> > >
> >
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271.html
>
> >
> > >
> > > >
> > > > Sent from the Apache Felix - Users mailing list archive at
> > Nabble.com.
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [hidden email]
> > > > <http:///user/SendEmail.jtp?type=node&node=5011272&i=1>
> > > > For additional commands, e-mail: [hidden email]
> > > > <http:///user/SendEmail.jtp?type=node&node=5011272&i=2>
> > > >
> > > >
> > > >
> > > > ------------------------------
> > > > If you reply to this email, your message will be added to the
> > > discussion
> > > > below:
> > > >
> > > >
> > >
> >
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011272.html
>
> >
> > >
> > > > To unsubscribe from [ipojo] Help wih @Stereotype and custom
> handler,
> > > click
> > > > here
> > > > <
> > >
> > > > .
> > > > NAML
> > > > <
> > >
> >
> http://apache-felix.18485.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> >
> > >
> > > >
> > >
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011274.html
>
> >
> > >
> > > Sent from the Apache Felix - Users mailing list archive at
> Nabble.com.
> > >
> > > If you reply to this email, your message will be added to the
> > discussion
> > > below:
> > >
> > >
> >
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011275.html
>
> >
> > > To unsubscribe from [ipojo] Help wih @Stereotype and custom handler,
> > click
> > > here
> > > <
> > > .
> > > NAML
> > > <
> >
> http://apache-felix.18485.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> >
> > >
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011303.html
>
> >
> > Sent from the Apache Felix - Users mailing list archive at Nabble.com.
> >
> > If you reply to this email, your message will be added to the
> discussion
> > below:
> >
> >
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011306.html
>
> > To unsubscribe from [ipojo] Help wih @Stereotype and custom handler,
> click
> > here
> > <
> > .
> > NAML
> > <
> http://apache-felix.18485.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> >
>
>
>
>
> --
> View this message in context:
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011308.html
>
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011309.html
>  To unsubscribe from [ipojo] Help wih @Stereotype and custom handler, click
> here
> <http://apache-felix.18485.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5011271&code=dGNvc3Rhc291emFAZ21haWwuY29tfDUwMTEyNzF8LTEyNzI0NjQ3MjU=>
> .
> NAML
> <http://apache-felix.18485.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011310.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

Re: [ipojo] Help wih @Stereotype and custom handler

Posted by Clement Escoffier <cl...@gmail.com>.
On 29 janvier 2015 at 19:23:16, Thiago Souza (tcostasouza@gmail.com) wrote:

Hi clement! 

Well, so maybe you could give me a hint. 

Is there any way to know when all the components of a custom handler of a 
specific bundle has been instantiated and activated? For example, a bundle 
X defines components A and B wit a custom handler NS:H. Components A and B 
are all immediate annotated with @Instantiate. So, how can I know when 
iPojo finishes processing bundle X? 

I tried listening to Bundle.STARTED event, but it seems that ipojo 
processing is happening after this event (or it's async, I don't know). 
Yes, it’s async by default. What you need to know is to listen the 2 queue service provided by iPOJO.

Check https://github.com/wisdom-framework/wisdom/blob/master/core/wisdom-test/src/main/java/org/wisdom/test/parents/Stability.java#L78. This function waits for all queues to be empty.

Cheers,

Clement





Any help apreciated! 

Thanks 



On Thu Jan 29 2015 at 4:08:06 PM clement escoffier [via Apache Felix] < 
ml-node+s18485n5011306h67@n6.nabble.com> wrote: 

> Hi, 
> 
> 
> On 29 janvier 2015 at 15:21:00, Thiago Souza ([hidden email] 
> <http:///user/SendEmail.jtp?type=node&node=5011306&i=0>) wrote: 
> 
> Hi! 
> 
> Thanks for the tips! I ended up creating a custom handler for this. 
> 
> Now, what I need to do is to generate some metadata to bundle's manifest. 
> Is it possible using the visitor? If not, I'll have to solve this in 
> runtime. 
> No the visitor does not let you do such kind of enhancement.The visitor 
> lets you write the iPOJO metadata you want (well, they are stored in the 
> manifest, so maybe it’s enough for you). 
> 
> 
> 
> Cheers, 
> 
> 
> 
> Clement 
> 
> 
> 
> 
> 
> Thanks! 
> 
> On Mon Jan 26 2015 at 3:40:06 AM clement escoffier [via Apache Felix] < 
> [hidden email] <http:///user/SendEmail.jtp?type=node&node=5011306&i=1>> 
> wrote: 
> 
> > Hi, 
> > 
> > On 25 janvier 2015 at 22:45:46, Thiago Souza ([hidden email] 
> > <http:///user/SendEmail.jtp?type=node&node=5011275&i=0>) wrote: 
> > Hi! 
> > 
> > I could implement a prototype that generates metadata in the component 
> > descriptor. 
> > 
> > Now I can create an iPojo that requires component factories with these 
> > metadata. But I'm not being able to find a way to access the pojo 
> > instance 
> > itself given a factory, is it possible? 
> > You use the Factory to create a ComponentInstance, then you have two 
> ways: 
> > 
> > 1) The best way is to retrieve a service exposed by the freshly created 
> > instance. You can use the ‘instance.name’ property to select the 
> service. 
> > That way, you manager ‘invalid’ instance (instances that depends on 
> > unavailable services), as the service won’t be exposed in this case. 
> > 
> > try { 
> > ServiceReference[] refs = 
> > 
> > context.getServiceReferences(YourServiceInterface.class.getName(), 
> > "(instance.name=" + instance.getInstanceName() +")"); 
> > if (refs != null) { 
> > Foo your_object = (Foo) context.getService(refs[0]); 
> > } 
> > } catch (InvalidSyntaxException e) { 
> > // Should not happen 
> > } 
> > 2) You can use the following snippet: 
> > 
> > if (instance.getState() == ComponentInstance.VALID) { 
> > ImplementationClass object = 
> > (ImplementationClass) ((InstanceManager) instance).getPojoObject(); 
> > } else { 
> > System.out.println("Cannot get an implementation object from an invalid 
> > instance"); 
> > } 
> > 
> > First it requires a cast to InstanceManager. InstanceManager is the 
> > implementation class behind @Component. As iPOJO supports her type of 
> > entities, you need to be sure you are using @Component before casting 
> > (others are Handler, Composite…). Once you have the instance manager 
> you 
> > can call the ‘getPojoObject’ to retrieve the pojo instance. If none 
> exist, 
> > one is created. 
> > 
> > 
> > Cheers, 
> > 
> > Clement 
> > 
> > 
> > 
> > 
> > Regards 
> > 
> > On Sun, Jan 25, 2015, 14:15 clement escoffier [via Apache Felix] < 
> > [hidden email] <http:///user/SendEmail.jtp?type=node&node=5011275&i=1>> 
> 
> > wrote: 
> > 
> > > Hi, 
> > > 
> > > Unfortunately stereotypes do not support ‘parameter’ right now, but 
> you 
> > > can use ‘visitors’ which are small classes rewriting the annotation. 
> > > Here is something similar to what you try to do: 
> > > 
> > 
> https://github.com/wisdom-framework/wisdom/blob/master/core/wisdom-ipojo-module/src/main/java/org/wisdom/ipojo/module/WisdomServiceVisitor.java 
> 
> > 
> > > 
> > > Cheers, 
> > > 
> > > Clement 
> > > On 25 janvier 2015 at 16:42:50, Thiago Souza ([hidden email] 
> > > <http:///user/SendEmail.jtp?type=node&node=5011272&i=0>) wrote: 
> > > 
> > > Hi all, 
> > > 
> > > I'm trying to create a custom handler with a @Stereotype annotation 
> > (named 
> > > 
> > > @Namespace) with the following use case: 
> > > 
> > > @Namespace("a-namespace") 
> > > public class ANamespaceComponent { 
> > > } 
> > > 
> > > The ANamespaceComponent would also inherit 
> > @Component(name="a-namespace") 
> > > 
> > > and @Instantiate with additional processing. 
> > > 
> > > Unfortunatelly I'm not being able to understand, from the 
> > documentation, 
> > > what artifacts (and how) should be created. 
> > > 
> > > Any help appreciated! 
> > > 
> > > Thanks! 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > -- 
> > > View this message in context: 
> > > 
> > 
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271.html 
> 
> > 
> > > 
> > > Sent from the Apache Felix - Users mailing list archive at 
> Nabble.com. 
> > > 
> > > --------------------------------------------------------------------- 
> > > To unsubscribe, e-mail: [hidden email] 
> > > <http:///user/SendEmail.jtp?type=node&node=5011272&i=1> 
> > > For additional commands, e-mail: [hidden email] 
> > > <http:///user/SendEmail.jtp?type=node&node=5011272&i=2> 
> > > 
> > > 
> > > 
> > > ------------------------------ 
> > > If you reply to this email, your message will be added to the 
> > discussion 
> > > below: 
> > > 
> > > 
> > 
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011272.html 
> 
> > 
> > > To unsubscribe from [ipojo] Help wih @Stereotype and custom handler, 
> > click 
> > > here 
> > > < 
> > 
> > > . 
> > > NAML 
> > > < 
> > 
> http://apache-felix.18485.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> 
> 
> > 
> > > 
> > 
> > 
> > 
> > 
> > -- 
> > View this message in context: 
> > 
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011274.html 
> 
> > 
> > Sent from the Apache Felix - Users mailing list archive at Nabble.com. 
> > 
> > If you reply to this email, your message will be added to the 
> discussion 
> > below: 
> > 
> > 
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011275.html 
> 
> > To unsubscribe from [ipojo] Help wih @Stereotype and custom handler, 
> click 
> > here 
> > < 
> > . 
> > NAML 
> > < 
> http://apache-felix.18485.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> 
> 
> > 
> 
> 
> 
> 
> -- 
> View this message in context: 
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011303.html 
> 
> Sent from the Apache Felix - Users mailing list archive at Nabble.com. 
> 
> If you reply to this email, your message will be added to the discussion 
> below: 
> 
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011306.html 
> To unsubscribe from [ipojo] Help wih @Stereotype and custom handler, click 
> here 
> <http://apache-felix.18485.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5011271&code=dGNvc3Rhc291emFAZ21haWwuY29tfDUwMTEyNzF8LTEyNzI0NjQ3MjU=> 
> . 
> NAML 
> <http://apache-felix.18485.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> 
> 




-- 
View this message in context: http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011308.html 
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

Re: [ipojo] Help wih @Stereotype and custom handler

Posted by Thiago Souza <tc...@gmail.com>.
Hi clement!

Well, so maybe you could give me a hint.

Is there any way to know when all the components of a custom handler of a
specific bundle has been instantiated and activated? For example, a bundle
X defines components A and B wit a custom handler NS:H. Components A and B
are all immediate annotated with @Instantiate. So, how can I know when
iPojo finishes processing bundle X?

I tried listening to Bundle.STARTED event, but it seems that ipojo
processing is happening after this event (or it's async, I don't know).

Any help apreciated!

Thanks



On Thu Jan 29 2015 at 4:08:06 PM clement escoffier [via Apache Felix] <
ml-node+s18485n5011306h67@n6.nabble.com> wrote:

> Hi,
>
>
> On 29 janvier 2015 at 15:21:00, Thiago Souza ([hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5011306&i=0>) wrote:
>
> Hi!
>
> Thanks for the tips! I ended up creating a custom handler for this.
>
> Now, what I need to do is to generate some metadata to bundle's manifest.
> Is it possible using the visitor? If not, I'll have to solve this in
> runtime.
> No the visitor does not let you do such kind of enhancement.The visitor
> lets you write the iPOJO metadata you want (well, they are stored in the
> manifest, so maybe it’s enough for you).
>
>
>
> Cheers,
>
>
>
> Clement
>
>
>
>
>
> Thanks!
>
> On Mon Jan 26 2015 at 3:40:06 AM clement escoffier [via Apache Felix] <
> [hidden email] <http:///user/SendEmail.jtp?type=node&node=5011306&i=1>>
> wrote:
>
> > Hi,
> >
> > On 25 janvier 2015 at 22:45:46, Thiago Souza ([hidden email]
> > <http:///user/SendEmail.jtp?type=node&node=5011275&i=0>) wrote:
> > Hi!
> >
> > I could implement a prototype that generates metadata in the component
> > descriptor.
> >
> > Now I can create an iPojo that requires component factories with these
> > metadata. But I'm not being able to find a way to access the pojo
> > instance
> > itself given a factory, is it possible?
> > You use the Factory to create a ComponentInstance, then you have two
> ways:
> >
> > 1) The best way is to retrieve a service exposed by the freshly created
> > instance. You can use the ‘instance.name’ property to select the
> service.
> > That way, you manager ‘invalid’ instance (instances that depends on
> > unavailable services), as the service won’t be exposed in this case.
> >
> > try {
> > ServiceReference[] refs =
> >
> > context.getServiceReferences(YourServiceInterface.class.getName(),
> > "(instance.name=" + instance.getInstanceName() +")");
> > if (refs != null) {
> > Foo your_object = (Foo) context.getService(refs[0]);
> > }
> > } catch (InvalidSyntaxException e) {
> > // Should not happen
> > }
> > 2) You can use the following snippet:
> >
> > if (instance.getState() == ComponentInstance.VALID) {
> > ImplementationClass object =
> > (ImplementationClass) ((InstanceManager) instance).getPojoObject();
> > } else {
> > System.out.println("Cannot get an implementation object from an invalid
> > instance");
> > }
> >
> > First it requires a cast to InstanceManager. InstanceManager is the
> > implementation class behind @Component. As iPOJO supports her type of
> > entities, you need to be sure you are using @Component before casting
> > (others are Handler, Composite…). Once you have the instance manager
> you
> > can call the ‘getPojoObject’ to retrieve the pojo instance. If none
> exist,
> > one is created.
> >
> >
> > Cheers,
> >
> > Clement
> >
> >
> >
> >
> > Regards
> >
> > On Sun, Jan 25, 2015, 14:15 clement escoffier [via Apache Felix] <
> > [hidden email] <http:///user/SendEmail.jtp?type=node&node=5011275&i=1>>
>
> > wrote:
> >
> > > Hi,
> > >
> > > Unfortunately stereotypes do not support ‘parameter’ right now, but
> you
> > > can use ‘visitors’ which are small classes rewriting the annotation.
> > > Here is something similar to what you try to do:
> > >
> >
> https://github.com/wisdom-framework/wisdom/blob/master/core/wisdom-ipojo-module/src/main/java/org/wisdom/ipojo/module/WisdomServiceVisitor.java
>
> >
> > >
> > > Cheers,
> > >
> > > Clement
> > > On 25 janvier 2015 at 16:42:50, Thiago Souza ([hidden email]
> > > <http:///user/SendEmail.jtp?type=node&node=5011272&i=0>) wrote:
> > >
> > > Hi all,
> > >
> > > I'm trying to create a custom handler with a @Stereotype annotation
> > (named
> > >
> > > @Namespace) with the following use case:
> > >
> > > @Namespace("a-namespace")
> > > public class ANamespaceComponent {
> > > }
> > >
> > > The ANamespaceComponent would also inherit
> > @Component(name="a-namespace")
> > >
> > > and @Instantiate with additional processing.
> > >
> > > Unfortunatelly I'm not being able to understand, from the
> > documentation,
> > > what artifacts (and how) should be created.
> > >
> > > Any help appreciated!
> > >
> > > Thanks!
> > >
> > >
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271.html
>
> >
> > >
> > > Sent from the Apache Felix - Users mailing list archive at
> Nabble.com.
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [hidden email]
> > > <http:///user/SendEmail.jtp?type=node&node=5011272&i=1>
> > > For additional commands, e-mail: [hidden email]
> > > <http:///user/SendEmail.jtp?type=node&node=5011272&i=2>
> > >
> > >
> > >
> > > ------------------------------
> > > If you reply to this email, your message will be added to the
> > discussion
> > > below:
> > >
> > >
> >
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011272.html
>
> >
> > > To unsubscribe from [ipojo] Help wih @Stereotype and custom handler,
> > click
> > > here
> > > <
> >
> > > .
> > > NAML
> > > <
> >
> http://apache-felix.18485.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> >
> > >
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011274.html
>
> >
> > Sent from the Apache Felix - Users mailing list archive at Nabble.com.
> >
> > If you reply to this email, your message will be added to the
> discussion
> > below:
> >
> >
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011275.html
>
> > To unsubscribe from [ipojo] Help wih @Stereotype and custom handler,
> click
> > here
> > <
> > .
> > NAML
> > <
> http://apache-felix.18485.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> >
>
>
>
>
> --
> View this message in context:
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011303.html
>
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011306.html
>  To unsubscribe from [ipojo] Help wih @Stereotype and custom handler, click
> here
> <http://apache-felix.18485.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5011271&code=dGNvc3Rhc291emFAZ21haWwuY29tfDUwMTEyNzF8LTEyNzI0NjQ3MjU=>
> .
> NAML
> <http://apache-felix.18485.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011308.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

Re: [ipojo] Help wih @Stereotype and custom handler

Posted by Clement Escoffier <cl...@gmail.com>.
Hi,


On 29 janvier 2015 at 15:21:00, Thiago Souza (tcostasouza@gmail.com) wrote:

Hi! 

Thanks for the tips! I ended up creating a custom handler for this. 

Now, what I need to do is to generate some metadata to bundle's manifest. 
Is it possible using the visitor? If not, I'll have to solve this in 
runtime. 
No the visitor does not let you do such kind of enhancement.The visitor lets you write the iPOJO metadata you want (well, they are stored in the manifest, so maybe it’s enough for you).



Cheers,



Clement





Thanks! 

On Mon Jan 26 2015 at 3:40:06 AM clement escoffier [via Apache Felix] < 
ml-node+s18485n5011275h6@n6.nabble.com> wrote: 

> Hi, 
> 
> On 25 janvier 2015 at 22:45:46, Thiago Souza ([hidden email] 
> <http:///user/SendEmail.jtp?type=node&node=5011275&i=0>) wrote: 
> Hi! 
> 
> I could implement a prototype that generates metadata in the component 
> descriptor. 
> 
> Now I can create an iPojo that requires component factories with these 
> metadata. But I'm not being able to find a way to access the pojo 
> instance 
> itself given a factory, is it possible? 
> You use the Factory to create a ComponentInstance, then you have two ways: 
> 
> 1) The best way is to retrieve a service exposed by the freshly created 
> instance. You can use the ‘instance.name’ property to select the service. 
> That way, you manager ‘invalid’ instance (instances that depends on 
> unavailable services), as the service won’t be exposed in this case. 
> 
> try { 
> ServiceReference[] refs = 
> 
> context.getServiceReferences(YourServiceInterface.class.getName(), 
> "(instance.name=" + instance.getInstanceName() +")"); 
> if (refs != null) { 
> Foo your_object = (Foo) context.getService(refs[0]); 
> } 
> } catch (InvalidSyntaxException e) { 
> // Should not happen 
> } 
> 2) You can use the following snippet: 
> 
> if (instance.getState() == ComponentInstance.VALID) { 
> ImplementationClass object = 
> (ImplementationClass) ((InstanceManager) instance).getPojoObject(); 
> } else { 
> System.out.println("Cannot get an implementation object from an invalid 
> instance"); 
> } 
> 
> First it requires a cast to InstanceManager. InstanceManager is the 
> implementation class behind @Component. As iPOJO supports her type of 
> entities, you need to be sure you are using @Component before casting 
> (others are Handler, Composite…). Once you have the instance manager you 
> can call the ‘getPojoObject’ to retrieve the pojo instance. If none exist, 
> one is created. 
> 
> 
> Cheers, 
> 
> Clement 
> 
> 
> 
> 
> Regards 
> 
> On Sun, Jan 25, 2015, 14:15 clement escoffier [via Apache Felix] < 
> [hidden email] <http:///user/SendEmail.jtp?type=node&node=5011275&i=1>> 
> wrote: 
> 
> > Hi, 
> > 
> > Unfortunately stereotypes do not support ‘parameter’ right now, but you 
> > can use ‘visitors’ which are small classes rewriting the annotation. 
> > Here is something similar to what you try to do: 
> > 
> https://github.com/wisdom-framework/wisdom/blob/master/core/wisdom-ipojo-module/src/main/java/org/wisdom/ipojo/module/WisdomServiceVisitor.java 
> 
> > 
> > Cheers, 
> > 
> > Clement 
> > On 25 janvier 2015 at 16:42:50, Thiago Souza ([hidden email] 
> > <http:///user/SendEmail.jtp?type=node&node=5011272&i=0>) wrote: 
> > 
> > Hi all, 
> > 
> > I'm trying to create a custom handler with a @Stereotype annotation 
> (named 
> > 
> > @Namespace) with the following use case: 
> > 
> > @Namespace("a-namespace") 
> > public class ANamespaceComponent { 
> > } 
> > 
> > The ANamespaceComponent would also inherit 
> @Component(name="a-namespace") 
> > 
> > and @Instantiate with additional processing. 
> > 
> > Unfortunatelly I'm not being able to understand, from the 
> documentation, 
> > what artifacts (and how) should be created. 
> > 
> > Any help appreciated! 
> > 
> > Thanks! 
> > 
> > 
> > 
> > 
> > 
> > -- 
> > View this message in context: 
> > 
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271.html 
> 
> > 
> > Sent from the Apache Felix - Users mailing list archive at Nabble.com. 
> > 
> > --------------------------------------------------------------------- 
> > To unsubscribe, e-mail: [hidden email] 
> > <http:///user/SendEmail.jtp?type=node&node=5011272&i=1> 
> > For additional commands, e-mail: [hidden email] 
> > <http:///user/SendEmail.jtp?type=node&node=5011272&i=2> 
> > 
> > 
> > 
> > ------------------------------ 
> > If you reply to this email, your message will be added to the 
> discussion 
> > below: 
> > 
> > 
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011272.html 
> 
> > To unsubscribe from [ipojo] Help wih @Stereotype and custom handler, 
> click 
> > here 
> > < 
> 
> > . 
> > NAML 
> > < 
> http://apache-felix.18485.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> 
> 
> > 
> 
> 
> 
> 
> -- 
> View this message in context: 
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011274.html 
> 
> Sent from the Apache Felix - Users mailing list archive at Nabble.com. 
> 
> If you reply to this email, your message will be added to the discussion 
> below: 
> 
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011275.html 
> To unsubscribe from [ipojo] Help wih @Stereotype and custom handler, click 
> here 
> <http://apache-felix.18485.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5011271&code=dGNvc3Rhc291emFAZ21haWwuY29tfDUwMTEyNzF8LTEyNzI0NjQ3MjU=> 
> . 
> NAML 
> <http://apache-felix.18485.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> 
> 




-- 
View this message in context: http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011303.html 
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

Re: [ipojo] Help wih @Stereotype and custom handler

Posted by Thiago Souza <tc...@gmail.com>.
Hi!

Thanks for the tips! I ended up creating a custom handler for this.

Now, what I need to do is to generate some metadata to bundle's manifest.
Is it possible using the visitor?  If not, I'll have to solve this in
runtime.

Thanks!

On Mon Jan 26 2015 at 3:40:06 AM clement escoffier [via Apache Felix] <
ml-node+s18485n5011275h6@n6.nabble.com> wrote:

> Hi,
>
> On 25 janvier 2015 at 22:45:46, Thiago Souza ([hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5011275&i=0>) wrote:
> Hi!
>
> I could implement a prototype that generates metadata in the component
> descriptor.
>
> Now I can create an iPojo that requires component factories with these
> metadata. But I'm not being able to find a way to access the pojo
> instance
> itself given a factory, is it possible?
> You use the Factory to create a ComponentInstance, then you have two ways:
>
> 1) The best way is to retrieve a service exposed by the freshly created
> instance. You can use the ‘instance.name’ property to select the service.
> That way, you manager ‘invalid’ instance (instances that depends on
> unavailable services), as the service won’t be exposed in this case.
>
> try {
>     ServiceReference[] refs =
>
> context.getServiceReferences(YourServiceInterface.class.getName(),
>           "(instance.name=" + instance.getInstanceName() +")");
>     if (refs != null) {
>         Foo your_object = (Foo) context.getService(refs[0]);
>     }
> } catch (InvalidSyntaxException e) {
>     // Should not happen
> }
> 2) You can use the following snippet:
>
> if (instance.getState() == ComponentInstance.VALID) {
>    ImplementationClass object =
>       (ImplementationClass) ((InstanceManager) instance).getPojoObject();
> } else {
>    System.out.println("Cannot get an implementation object from an invalid
> instance");
> }
>
> First it requires a cast to InstanceManager. InstanceManager is the
> implementation class behind @Component. As iPOJO supports her type of
> entities, you need to be sure you are using @Component before casting
> (others are Handler, Composite…). Once you have the instance manager you
> can call the ‘getPojoObject’ to retrieve the pojo instance. If none exist,
> one is created.
>
>
> Cheers,
>
> Clement
>
>
>
>
> Regards
>
> On Sun, Jan 25, 2015, 14:15 clement escoffier [via Apache Felix] <
> [hidden email] <http:///user/SendEmail.jtp?type=node&node=5011275&i=1>>
> wrote:
>
> > Hi,
> >
> > Unfortunately stereotypes do not support ‘parameter’ right now, but you
> > can use ‘visitors’ which are small classes rewriting the annotation.
> > Here is something similar to what you try to do:
> >
> https://github.com/wisdom-framework/wisdom/blob/master/core/wisdom-ipojo-module/src/main/java/org/wisdom/ipojo/module/WisdomServiceVisitor.java
>
> >
> > Cheers,
> >
> > Clement
> > On 25 janvier 2015 at 16:42:50, Thiago Souza ([hidden email]
> > <http:///user/SendEmail.jtp?type=node&node=5011272&i=0>) wrote:
> >
> > Hi all,
> >
> > I'm trying to create a custom handler with a @Stereotype annotation
> (named
> >
> > @Namespace) with the following use case:
> >
> > @Namespace("a-namespace")
> > public class ANamespaceComponent {
> > }
> >
> > The ANamespaceComponent would also inherit
> @Component(name="a-namespace")
> >
> > and @Instantiate with additional processing.
> >
> > Unfortunatelly I'm not being able to understand, from the
> documentation,
> > what artifacts (and how) should be created.
> >
> > Any help appreciated!
> >
> > Thanks!
> >
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271.html
>
> >
> > Sent from the Apache Felix - Users mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > <http:///user/SendEmail.jtp?type=node&node=5011272&i=1>
> > For additional commands, e-mail: [hidden email]
> > <http:///user/SendEmail.jtp?type=node&node=5011272&i=2>
> >
> >
> >
> > ------------------------------
> > If you reply to this email, your message will be added to the
> discussion
> > below:
> >
> >
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011272.html
>
> > To unsubscribe from [ipojo] Help wih @Stereotype and custom handler,
> click
> > here
> > <
>
> > .
> > NAML
> > <
> http://apache-felix.18485.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> >
>
>
>
>
> --
> View this message in context:
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011274.html
>
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011275.html
>  To unsubscribe from [ipojo] Help wih @Stereotype and custom handler, click
> here
> <http://apache-felix.18485.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5011271&code=dGNvc3Rhc291emFAZ21haWwuY29tfDUwMTEyNzF8LTEyNzI0NjQ3MjU=>
> .
> NAML
> <http://apache-felix.18485.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011303.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

Re: [ipojo] Help wih @Stereotype and custom handler

Posted by Clement Escoffier <cl...@gmail.com>.
Hi,

On 25 janvier 2015 at 22:45:46, Thiago Souza (tcostasouza@gmail.com) wrote:
Hi! 

I could implement a prototype that generates metadata in the component 
descriptor. 

Now I can create an iPojo that requires component factories with these 
metadata. But I'm not being able to find a way to access the pojo instance 
itself given a factory, is it possible? 
You use the Factory to create a ComponentInstance, then you have two ways:

1) The best way is to retrieve a service exposed by the freshly created instance. You can use the ‘instance.name’ property to select the service. That way, you manager ‘invalid’ instance (instances that depends on unavailable services), as the service won’t be exposed in this case.

try {
    ServiceReference[] refs =  
          context.getServiceReferences(YourServiceInterface.class.getName(),  
          "(instance.name=" + instance.getInstanceName() +")");
    if (refs != null) {
        Foo your_object = (Foo) context.getService(refs[0]);
    }
} catch (InvalidSyntaxException e) {
    // Should not happen
}
2) You can use the following snippet:

if (instance.getState() == ComponentInstance.VALID) {
   ImplementationClass object =  
      (ImplementationClass) ((InstanceManager) instance).getPojoObject();
} else {
   System.out.println("Cannot get an implementation object from an invalid instance");
}

First it requires a cast to InstanceManager. InstanceManager is the implementation class behind @Component. As iPOJO supports her type of entities, you need to be sure you are using @Component before casting (others are Handler, Composite…). Once you have the instance manager you can call the ‘getPojoObject’ to retrieve the pojo instance. If none exist, one is created.


Cheers,

Clement




Regards 

On Sun, Jan 25, 2015, 14:15 clement escoffier [via Apache Felix] < 
ml-node+s18485n5011272h13@n6.nabble.com> wrote: 

> Hi, 
> 
> Unfortunately stereotypes do not support ‘parameter’ right now, but you 
> can use ‘visitors’ which are small classes rewriting the annotation. 
> Here is something similar to what you try to do: 
> https://github.com/wisdom-framework/wisdom/blob/master/core/wisdom-ipojo-module/src/main/java/org/wisdom/ipojo/module/WisdomServiceVisitor.java 
> 
> Cheers, 
> 
> Clement 
> On 25 janvier 2015 at 16:42:50, Thiago Souza ([hidden email] 
> <http:///user/SendEmail.jtp?type=node&node=5011272&i=0>) wrote: 
> 
> Hi all, 
> 
> I'm trying to create a custom handler with a @Stereotype annotation (named 
> 
> @Namespace) with the following use case: 
> 
> @Namespace("a-namespace") 
> public class ANamespaceComponent { 
> } 
> 
> The ANamespaceComponent would also inherit @Component(name="a-namespace") 
> 
> and @Instantiate with additional processing. 
> 
> Unfortunatelly I'm not being able to understand, from the documentation, 
> what artifacts (and how) should be created. 
> 
> Any help appreciated! 
> 
> Thanks! 
> 
> 
> 
> 
> 
> -- 
> View this message in context: 
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271.html 
> 
> Sent from the Apache Felix - Users mailing list archive at Nabble.com. 
> 
> --------------------------------------------------------------------- 
> To unsubscribe, e-mail: [hidden email] 
> <http:///user/SendEmail.jtp?type=node&node=5011272&i=1> 
> For additional commands, e-mail: [hidden email] 
> <http:///user/SendEmail.jtp?type=node&node=5011272&i=2> 
> 
> 
> 
> ------------------------------ 
> If you reply to this email, your message will be added to the discussion 
> below: 
> 
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011272.html 
> To unsubscribe from [ipojo] Help wih @Stereotype and custom handler, click 
> here 
> <http://apache-felix.18485.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5011271&code=dGNvc3Rhc291emFAZ21haWwuY29tfDUwMTEyNzF8LTEyNzI0NjQ3MjU=> 
> . 
> NAML 
> <http://apache-felix.18485.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> 
> 




-- 
View this message in context: http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011274.html 
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

Re: [ipojo] Help wih @Stereotype and custom handler

Posted by Thiago Souza <tc...@gmail.com>.
Hi!

I could implement a prototype that generates metadata in the component
descriptor.

Now I can create an iPojo that requires component factories with these
metadata. But I'm not being able to find a way to access the pojo instance
itself given a factory, is it possible?

Regards

On Sun, Jan 25, 2015, 14:15 clement escoffier [via Apache Felix] <
ml-node+s18485n5011272h13@n6.nabble.com> wrote:

> Hi,
>
> Unfortunately stereotypes do not support ‘parameter’ right now, but you
> can use ‘visitors’ which are small classes rewriting the annotation.
> Here is something similar to what you try to do:
> https://github.com/wisdom-framework/wisdom/blob/master/core/wisdom-ipojo-module/src/main/java/org/wisdom/ipojo/module/WisdomServiceVisitor.java
>
> Cheers,
>
> Clement
> On 25 janvier 2015 at 16:42:50, Thiago Souza ([hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5011272&i=0>) wrote:
>
> Hi all,
>
> I'm trying to create a custom handler with a @Stereotype annotation (named
>
> @Namespace) with the following use case:
>
> @Namespace("a-namespace")
> public class ANamespaceComponent {
> }
>
> The ANamespaceComponent would also inherit @Component(name="a-namespace")
>
> and @Instantiate with additional processing.
>
> Unfortunatelly I'm not being able to understand, from the documentation,
> what artifacts (and how) should be created.
>
> Any help appreciated!
>
> Thanks!
>
>
>
>
>
> --
> View this message in context:
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271.html
>
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5011272&i=1>
> For additional commands, e-mail: [hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5011272&i=2>
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011272.html
>  To unsubscribe from [ipojo] Help wih @Stereotype and custom handler, click
> here
> <http://apache-felix.18485.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5011271&code=dGNvc3Rhc291emFAZ21haWwuY29tfDUwMTEyNzF8LTEyNzI0NjQ3MjU=>
> .
> NAML
> <http://apache-felix.18485.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271p5011274.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

Re: [ipojo] Help wih @Stereotype and custom handler

Posted by Clement Escoffier <cl...@gmail.com>.
Hi,

Unfortunately stereotypes do not support ‘parameter’ right now, but you can use ‘visitors’ which are small classes rewriting the annotation.
Here is something similar to what you try to do: https://github.com/wisdom-framework/wisdom/blob/master/core/wisdom-ipojo-module/src/main/java/org/wisdom/ipojo/module/WisdomServiceVisitor.java

Cheers,

Clement
On 25 janvier 2015 at 16:42:50, Thiago Souza (tcostasouza@gmail.com) wrote:

Hi all,  

I'm trying to create a custom handler with a @Stereotype annotation (named  
@Namespace) with the following use case:  

@Namespace("a-namespace")  
public class ANamespaceComponent {  
}  

The ANamespaceComponent would also inherit @Component(name="a-namespace")  
and @Instantiate with additional processing.  

Unfortunatelly I'm not being able to understand, from the documentation,  
what artifacts (and how) should be created.  

Any help appreciated!  

Thanks!  





--  
View this message in context: http://apache-felix.18485.x6.nabble.com/ipojo-Help-wih-Stereotype-and-custom-handler-tp5011271.html  
Sent from the Apache Felix - Users mailing list archive at Nabble.com.  

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