flex.messaging.factories
Class JavaFactory

java.lang.Object
  extended by flex.messaging.factories.JavaFactory
All Implemented Interfaces:
FlexConfigurable, FlexFactory

public class JavaFactory
extends Object
implements FlexFactory

This class implements the FlexFactory interface to constructs Flex messaging components. The JavaFactory uses the class name, specified as the source attribute to determine the class for instances. The scope attribute can be one of session, application or request to determine its lifecycle. If you use application or session, you can specify the optional attribute-id parameter to control the name of the key for storing the component. Two destinations using the same attribute-id will use the same component. The component is stored in the ServletContext (for application scoped components) and in the session (for session scoped components) so you can use these components in your JSP as well.


Field Summary
 
Fields inherited from interface flex.messaging.FlexFactory
SCOPE, SCOPE_APPLICATION, SCOPE_REQUEST, SCOPE_SESSION, SOURCE
 
Method Summary
 FactoryInstance createFactoryInstance(String id, ConfigMap properties)
          This method is called when we initialize the definition of an instance which will be looked up by this factory.
 void initialize(String id, ConfigMap configMap)
          This method can be used to provide additional configuration parameters for the initializing this factory instance itself.
 Object lookup(FactoryInstance inst)
          Returns the instance specified by the source and properties arguments.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

initialize

public void initialize(String id,
                       ConfigMap configMap)
This method can be used to provide additional configuration parameters for the initializing this factory instance itself.

Specified by:
initialize in interface FlexConfigurable

createFactoryInstance

public FactoryInstance createFactoryInstance(String id,
                                             ConfigMap properties)
This method is called when we initialize the definition of an instance which will be looked up by this factory. It should validate that the properties supplied are valid to define an instance. Any valid properties used for this configuration must be accessed to avoid warnings about unused configuration elements. If your factory is only used for application scoped components, you do not need to implement this method as the lookup method itself can be used to validate its configuration.

Specified by:
createFactoryInstance in interface FlexFactory

lookup

public Object lookup(FactoryInstance inst)
Returns the instance specified by the source and properties arguments. For the factory, this may mean constructing a new instance, optionally registering it in some other name space such as the session or JNDI, and then returning it or it may mean creating a new instance and returning it. This method is called for each request to operate on the given item by the system so it should be relatively efficient.

If your factory does not support the scope property, it report an error if scope is supplied in the properties for this instance.

Specified by:
lookup in interface FlexFactory
Parameters:
inst - the FactoryInstance to lookup.
Returns:
the constructed and initialized component for this factory instance.


Copyright © 2007 Adobe Systems Inc. All Rights Reserved.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/lcdsjavadoc/flex/messaging/factories/JavaFactory.html