Date: 2004-06-24T09:23:07
Editor: 200.69.248.193 <>
Wiki: Jakarta HiveMind Wiki
Page: FrequentlyAskedQuestions
URL: http://wiki.apache.org/jakarta-hivemind/FrequentlyAskedQuestions
no comment
Change Log:
------------------------------------------------------------------------------
@@ -4,15 +4,15 @@
----
-'''Question:''' '''InjectingNonServiceFactoryObtainedObjects''' (DanielFeist
21/06/2004)
+'''Question 1):''' '''InjectingNonServiceFactoryObtainedObjects'''
(DanielFeist 21/06/2004)
Is there anyway to inject a service, using the BuilderFactory, with an object
obtained by invoking a method of another service thus allowing non-service
objects to be obtained from a POJOF (plain old java object factory) for
injection?
-'''Question:''' '''["UsingJNDIToObtainHiveMindServices"]''' (DanielFeist
24/06/2004)
+'''Question 2):''' '''["UsingJNDIToObtainHiveMindServices"]''' (DanielFeist
24/06/2004)
I have been experimenting with the use of JNDI as a facade to !HiveMind by
implementing a simple JNDI SPI. The ''lookup'' method of a JNDI ''Context''
takes just a ''Name'', yet to obtain a !HiveMind service i need to be able to
specifiy the interface expected. What i have found is that i can, in place of
the interface expected put {{{Object.class}}} and everything works ok.
''Object'' is not an interface so i'm not quite sure why this works. Is this
intentional? Will !HiveMind continue to support this?
'''Accepted Answer:'''
-HowardLewisShip: Yes, passing {{{Object.class}}} will continue work although
but it is not recommended in ''normal'' cirmcumstaces. The idea of passing in
the expected (assignable) type is to allow HiveMind to do a check that the
service object or proxy returned is assignable. Better a good message from
inside HiveMind than a bad ClassCastException. Using java.lang.Object is
acceptible if you don't care about that test.
+HowardLewisShip: Yes, passing {{{Object.class}}} will continue work but it is
not recommended in ''normal'' cirmcumstaces. The idea of passing in the
expected (assignable) type is to allow HiveMind to do a check that the service
object or proxy returned is assignable. Better a good message from inside
HiveMind than a bad ClassCastException. Using java.lang.Object is acceptible if
you don't care about that test.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]