Re: calling components from java
I think it is org.apache.avalon.framework.component.ComponentManager, but i suggest you to check:-) Phil Peeths wrote: hi i'm having cocoon application and i'm invoking a session bean from cocoon , i want to get the session inside java class , i'm using var factory = cocoon.getComponent(Packages.org.openize.hibernate.PersistenceFactory.ROLE); var hs = factory.createSession(); but i dont which package i should import for using that and also , whih jar file should i add in the libraries Peeths ___ Too much spam in your inbox? Yahoo! Mail gives you the best spam protection for FREE! http://in.mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: calling components from java
hi i checked it , its not that regards peeths --- Philippe Guillard [EMAIL PROTECTED] wrote: I think it is org.apache.avalon.framework.component.ComponentManager, but i suggest you to check:-) Phil Peeths wrote: hi i'm having cocoon application and i'm invoking a session bean from cocoon , i want to get the session inside java class , i'm using var factory = cocoon.getComponent(Packages.org.openize.hibernate.PersistenceFactory.ROLE); var hs = factory.createSession(); but i dont which package i should import for using that and also , whih jar file should i add in the libraries Peeths ___ Too much spam in your inbox? Yahoo! Mail gives you the best spam protection for FREE! http://in.mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Free antispam, antivirus and 1GB to save all your messages Only in Yahoo! Mail: http://in.mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Calling components from java
Ralph, Thanks for the clarification... Robin On 29 Nov 2004, at 17:53, Ralph Goers wrote: Robin Wyles said: Jorg, On 29 Nov 2004, at 12:20, Jorg Heymans wrote: It is my understanding that you can only call / lookup components from other components (i'ld love to be proven wrong on this btw). Write a component that implements the serviceable interface and use that servicemanager to lookup. That is what I suspected :-( Thanks for the info... Robin That is not strictly true. You simply have to have access to the ServiceManager. Implementing Serviceable means you will provide a service() method that will cause the container to call your component to give it the ServiceManager (assuming your component is configured). This is by far the easiest way to do this, but if you have access to some other component that implements Serviceable you can call a method in it to retrieve its ServiceManager reference. Ralph - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Calling components from java
It is my understanding that you can only call / lookup components from other components (i'ld love to be proven wrong on this btw). Write a component that implements the serviceable interface and use that servicemanager to lookup. HTH Jorg Robin Wyles wrote: Hi, I am trying to call a cocoon component from within a Java class - is this possible? From flow I use... var my_component = cocoon.getComponent(Packages.MyComponent.ROLE); ... which works great. I have tried the following in my java class... CocoonComponentManager manager = new CocoonComponentManager(); MyComponent my_component = (MyComponent) manager.lookup(MyComponent.ROLE); - this results in java.lang.NullPointerException ... when I try: DefaultComponentManager = new DefaultComponentManager(); MyComponent my_component = (MyComponent) manager.lookup(MyComponent.ROLE); I get org.apache.avalon.framework.component.ComponentException: Unable to provide implementation. (key [MyComponent]) Can anyone point me to samples of how I can access Cocoon components (declared in cocoon.xconf) in my java classes? Thanks, Robin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Calling components from java
Jorg, On 29 Nov 2004, at 12:20, Jorg Heymans wrote: It is my understanding that you can only call / lookup components from other components (i'ld love to be proven wrong on this btw). Write a component that implements the serviceable interface and use that servicemanager to lookup. That is what I suspected :-( Thanks for the info... Robin HTH Jorg Robin Wyles wrote: Hi, I am trying to call a cocoon component from within a Java class - is this possible? From flow I use... var my_component = cocoon.getComponent(Packages.MyComponent.ROLE); ... which works great. I have tried the following in my java class... CocoonComponentManager manager = new CocoonComponentManager(); MyComponent my_component = (MyComponent) manager.lookup(MyComponent.ROLE); - this results in java.lang.NullPointerException ... when I try: DefaultComponentManager = new DefaultComponentManager(); MyComponent my_component = (MyComponent) manager.lookup(MyComponent.ROLE); I get org.apache.avalon.framework.component.ComponentException: Unable to provide implementation. (key [MyComponent]) Can anyone point me to samples of how I can access Cocoon components (declared in cocoon.xconf) in my java classes? Thanks, Robin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Calling components from java
Robin Wyles said: Jorg, On 29 Nov 2004, at 12:20, Jorg Heymans wrote: It is my understanding that you can only call / lookup components from other components (i'ld love to be proven wrong on this btw). Write a component that implements the serviceable interface and use that servicemanager to lookup. That is what I suspected :-( Thanks for the info... Robin That is not strictly true. You simply have to have access to the ServiceManager. Implementing Serviceable means you will provide a service() method that will cause the container to call your component to give it the ServiceManager (assuming your component is configured). This is by far the easiest way to do this, but if you have access to some other component that implements Serviceable you can call a method in it to retrieve its ServiceManager reference. Ralph - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]