Hi Dirk, The FlexFactory lookup() method is called for every method invocation. Support for scopes (app/session/request) is optional and this is why lookup() is always called on FlexFactory and FlexFactoryInstance. The instance you're looking up could be stored in a way that doesn't use J2EE scopes at all (Spring/JNDI/etc.).
Take a look at the SpringFactory on the Adobe exchange; the scope attribute is not supported by this factory implementation because it isn't needed. This factory also illustrates the use of a nested FlexFactoryInstance class that does the actual lookup() for the target instance to return. http://www.adobe.com/cfusion/exchange/#view=sn611&viewName=Flex%20Extension&extid=1035406 You have complete flexibility in your FlexFactoryInstance.lookup() implementation to find and return an instance that is stored anywhere or constructed dynamically every time. Destinations that are configured to use a FlexFactory create a single factory instance and reuse it. In turn, FlexFactory implementations generally create and use a single FlexFactoryInstance instance, and your FlexFactoryInstance implementation can use J2EE scopes to cache instances of the source class (in this case you can just use the existing JavaFactory), retrieve instances from some other framework or registry, or do their own custom instance caching/lookup. Best, Seth ________________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Dirk Eismann Sent: Thursday, October 26, 2006 7:21 AM To: [email protected] Subject: [flexcoders] Question concerning flex.messaging.FlexFactory Short question: when implementing the FlexFactory interface in a custom factory class, how does the lookup() work at runtime? Most importantly: how often does it gets called by FDS? Only once (depending on the scope setting) or for every method invocation on e.g. the RemoteObject instance? I guess only once but I'm not sure. Thanks, Dirk. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

