Hi Harris,
You really should be able to just add code which looks into the
properties map in your FlexFactory implementation's
"createFactoryInstance" method. This should be called at startup time
when the system is parsing the configuration. It is important to
access the configuration variables here even if you don't use them until
the lookup method because FDS will complain if there are any config
variables defined which are not accessed at startup. (As an aside, the
ConfigMap interface has an "allowProperty" method you can use to mark a
config entry as being expected even if you don't need it until later).
As a sample, I modified the createFactoryInstance method for the spring
factory as follows and was able to see the config variable printed on
startup:
public FactoryInstance createFactoryInstance(String id, ConfigMap
properties)
{
SpringFactoryInstance instance = new SpringFactoryInstance(this,
id, properties);
System.out.println("myvar=" +
properties.getPropertyAsString("myvar", null));
instance.setSource(properties.getPropertyAsString(SOURCE,
instance.getId()));
return instance;
}
I was using the 2.5 beta but this should work also in 2.0 and 2.0.1.
Also make sure you take a look at the EJB Factory which is up on the
adobe component exchange if you haven't already.
Regards,
Jeff
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Harris Reynolds
Sent: Friday, March 16, 2007 11:03 AM
To: [email protected]
Subject: [flexcoders] FlexFactory/FDS Inconsistencies
Hi there. I am working on a FlexFactory implementation that is capable
of creating objects that act as remote services. In the documentation
it states that, "Each factory instance can add configuration attributes
that are used when that factory instance is defined, as the following
example shows:
<destination id="myDestination">
<properties>
<source>mypackage.MyRemoteClass</source>
<factory>myFactoryId</factory>
<myfactoryinstanceattribute>
myfoobar2value
</myfactoryinstanceattribute>
</properties>
</destination>
However, adding an extra element to the properties element within
remoting-config.xml causes Flex to chock in the initialization process
when starting the server.
Is is possible to get additional information into a FlexFactory to
customize its implementation? I've looked in detail at the example
that does this with Spring, but it doesn't take advantage of passing a
custom value to the FlexFactory. I am trying to deploy this to
Weblogic and create a FlexFactory that is capable of creating EJBs based
on their JNDI name.
thanks,
~harris