This content has been marked as final.
Show 4 replies
-
1. Re: In callback
adrian.brock Jun 29, 2007 6:25 AM (in response to adrian.brock)Ales replied.
"adrian@jboss.org" wrote:
It is the parameter type of the methods.
incallback is a HORRIBLE name for this. Please define something that is easier to understand. Thanks.
I agree. But I don't really care what it is called, I care what does.
Ales, maybe you can come up with a better name, e.g.
installCallback and uninstallCallback?
Just writing response myself. :-)
Yup I was thinking of something better, but everything looked too long.
Bill, any (short) suggestions? -
2. Re: In callback
bill.burke Jul 2, 2007 11:26 AM (in response to adrian.brock)"adrian@jboss.org" wrote:
Ales replied."adrian@jboss.org" wrote:
It is the parameter type of the methods.
incallback is a HORRIBLE name for this. Please define something that is easier to understand. Thanks.
I agree. But I don't really care what it is called, I care what does.
Ales, maybe you can come up with a better name, e.g.
installCallback and uninstallCallback?
Just writing response myself. :-)
Yup I was thinking of something better, but everything looked too long.
Bill, any (short) suggestions?
BTW, I hate this approach. The install/uninstall syntax was better because it was more readable. At least you knew what was going on. Now you have to guess/read dig deep into the documentation to figure out what is going on. -
3. Re: In callback
alesj Jul 2, 2007 11:35 AM (in response to adrian.brock)"bill.burke@jboss.com" wrote:
Now you have to guess/read dig deep into the documentation to figure out what is going on.
It's a simple callback.
I don't think it can get more 'natural' than this.
You don't need any sophisticated documentation.
It's the same thing as if you are aware that install exists, you can also be aware that a callback will be issued. :-) -
4. Re: In callback
adrian.brock Jul 2, 2007 12:12 PM (in response to adrian.brock)This callback is just an IOC version of something you can do with OSGi
(or even the old JMX notifications).
In OSGi/JMX you can listen to services appearing and disappearing
and do work on them, e.g.public void [un]registerNotification(Event event) { if (event.getTarget() instanceof Deployer) [un]register(); }
All the [un]installCallback is doing is removing the need to write the notification
handling and wiring yourself.
Actually, it is slightly more complicated, because you can choose the event
to be a true dependency (i.e. there must be at least N deployers -most likely 1)
or optional (I don't care if there are no deployers, deploy me anyway)
through the cardinality.
Its probably easier to understand in its alternate form, i.e. as an injection
of a collection of all implementations of a specific type.
e.g. intead of, give me a DataSource@Inject public void setDataSource(DataSource ds);
it is give me all DataSources@Inject public void setDataSources(Collection<DataSource> all);