Ok, now, I see how to construct my component.
Thanks John and Ron !!!

Didier

----- Original Message ----- From: "John Coleman" <[EMAIL PROTECTED]>
To: "Tapestry users" <[email protected]>
Sent: Thursday, December 01, 2005 8:21 PM
Subject: Re: Using Hivemind in components


Here is the longhand way of doing it, but in this case no interface is used,
instead the class is used directly...

in Home.page xml file:
<page-specification class="Home">
<inject property="userServices" object="service:iomodule.UserServices"/>
</page-specification>

(you can do the above injection directly in your page class, see below)

in Home.java:

import container.services.business.UserServices;

public abstract class Home extends BasePage {

@InjectObject("service:iomodule.UserServices") // option if you use
annotations instead?
public abstract UserServices getUserServices(); // property with interface
of type to inject with service from hivemind

public void dosomething() {
     getUserServices().dosomething();
}

}

in hivemodule:
<module id="iomodule" version="1.0.0">
<service-point id="UserServices"
interface="container.services.business.UserServices" visibility="public"/>
<implementation service-id="UserServices">
<invoke-factory model="threaded">
<construct class="container.services.business.UserServices"/>
</invoke-factory>
</module>


John


----- Original Message ----- From: "Didier LAFFORGUE" <[EMAIL PROTECTED]>
To: "Tapestry users" <[email protected]>
Sent: Thursday, December 01, 2005 9:49 AM
Subject: Using Hivemind in components



Hi guys,

I'm creating a new component for Tapestry 4.0 and I have a big question
about hivemind and its integration in my component.
If my component uses a hivemind service, is it possible to "inject" an
implementation of this service when I declare my component in a page ? In

this case, my component will use only the "interface" of the service and I
should declare the implementation in the hivemind.xml of my application. Is
it right ?
Best regards.

Didier


This message contains information that may be privileged or confidential and
is the property of the Capgemini Group. It is intended only for the person
to whom it is addressed. If you are not the intended recipient, you are not
authorized to read, print, retain, copy, disseminate,  distribute, or use
this message or any part thereof. If you receive this  message in error,
please notify the sender immediately and delete all copies of this message.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to