OK, I'll try that
Thanks a lot
Benoît
Le 16 juil. 09 à 16:59, Clement Escoffier a écrit :
Hi,
On 16.07.2009, at 15:12, Benoît Thiébault wrote:
Le 16 juil. 09 à 14:47, Clement Escoffier a écrit :
Hi,
There is no instances of MessageImpl declared there. How are they
created ? If you call "new" on the class, it will not be managed
by iPOJO.
yes, the messages are created by the message service on demand by
client applications :
public void createMessage(String messageName) {
// If the message does not exist, create it
if (messageMap.get(messageName) == null) {
messageMap.put(messageName, new MessageImpl(messageName));
} else {
System.out.println("[Create] Message " + messageName + "
already exists");
}
}
I understand now that this can't be managed by iPOJO... How can I
do this ? By using the Message factory ? Do you have any
documentation to point for that ?
So, the client application can use a temporal service dependency
(that's support proxy) injecting your service and gives it to the
MessageImpl (as a constructor argument for example). To achieve
that, add the following metadata to the client's metadata file :
<temporal:requires proxy="true" field="service"/>
Then, the previous code, would become (assuming that the service
field is declared) :
public void createMessage(String messageName) {
// If the message does not exist, create it
if (messageMap.get(messageName) == null) {
messageMap.put(messageName, new MessageImpl(service,
messageName)); // Give the service there.
} else {
System.out.println("[Create] Message " + messageName + "
already exists");
}
}
Regards,
Clement
Can you send the architecture of the MessagingServiceImpl instance
and of the MessageImpl instance ? (arch -instance instance_name).
Here it is :
instance name="MessagingServiceImpl-0"
component.type="MessagingServiceImpl" state="valid" bundle="7"
object name="myapp.messaging.impl.messagingservicei...@1dcc042f"
handler name="org.apache.felix.ipojo:provides" state="valid"
provides service.id="33" state="registered"
specifications="[myapp.messaging.MessagingService]"
property name="factory.name"
value="MessagingServiceImpl"
property name="instance.name"
value="MessagingServiceImpl-0"
handler name="org.apache.felix.ipojo:architecture" state="valid"
Regards,
Clement
Thank you
Benoît Thiébault
---------------------------------------------------------------------
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]
Benoît Thiébault
Société Artenum
24 rue Louis Blanc, 75010 Paris
tel: +33 (0)1 46 94 67 54
Artenum - Science & Groupware - http://www.artenum.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]