This should work. I am trying to understand the code example you
gave. In the code snippet you have a call to setCallback() that
passes a ServiceReference<WorkpoolService> as the callback for a
service of type WorkpoolService. However, your sample service is
of type AComponent and its callback service is of type
AComponentCallback. Somewhere you need to call setCallback() on
a service reference of type AComponent, passing a callback service
reference of type AComponentCallback. Is there any code that
does this?
Simon
Giorgio Zoppi wrote:
Hi,
i've a problem with callbacks in this situation.
I create a component, call it.. AComponent
@Remotable
@Callback(AComponentCallback.class)
public interface AComponent {
@OneWay
void someMethod();
}
public interface AComponentCallback
{
void receiveResult()
}
I'd like to set callback to AComponent dynamically and i's wiring
target dynamically to a component, is it feasible?
I.e something like:
ServiceReferenceImpl<WorkerService> myworker =
(ServiceReferenceImpl<WorkerService>)workerQueue.get();
ServiceReference<WorkpoolService> workpoolServiceReference =
workpoolContext.createSelfReference(WorkpoolService.class);
myworker.setCallback(workpoolServiceReference);
WorkerService ws = myworker.getService();
ws.compute(new TestJob(10));
I tried, but when it computes I got
http://petrus:49233/WorkerComponent527fe31a93f9f21b5378257c5e343047c99445dc
[java] 27-nov-2007 15.22.50 workpool.WorkerServiceImpl compute
[java] INFO:
WorkerComponent527fe31a93f9f21b5378257c5e343047c99445dc is computing a
new job
[java] RuntimeException invoking receiveResult:
org.osoa.sca.ServiceRuntimeException: No callback wire found for /
[java] org.osoa.sca.ServiceRuntimeException: No callback wire found for /
[java] at
org.apache.tuscany.sca.core.invocation.JDKCallbackInvocationHandler.invoke(JDKCallbackInvocationHandler.java:63)
The question is then how are callbacks attached to a component? And
when callbacks are wired?
BTW I saw Apache Tribes for group memebership and it's ok for small groups.
Cheers,
Giorgio.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Simon C Nash IBM Distinguished Engineer
Hursley Park, Winchester, UK [EMAIL PROTECTED]
Tel. +44-1962-815156 Fax +44-1962-818999
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]