| java.lang.Object org.romaframework.core.flow.ObjectContext
ObjectContext | public class ObjectContext implements SessionListener(Code) | | Manager of forms, user objects and their relationships. Track all changes in objects. It's used to update changed properties of
objects after user's code execution.
author: Luca Garulli (luca.garulli@assetdata.it) |
Method Summary | |
public void | close(Object iUserObject) | public void | createObjectFormAssociation(Object iUserObject, String iArea, ContentComponent iForm) Create an association between a User Object and a ContentForm. | public boolean | existComponent(Class<? extends Object> iClass) Check if a component was configured in the IoC system. | public boolean | existComponent(String iComponentName) Check if a component was configured in the IoC system. | public DynaBean | getActionFeatures(Object iUserObject, String iAspectName, String iActionName) Return the features of the requested action. | public DynaBean | getClassFeatures(Object iUserObject, String iAspectName) Return the features of the entity. | public T | getComponent(Class<T> iClass) Get a component configured in the IoC system. | public T | getComponent(String iName) Get a component configured in the IoC system. | public T | getContextComponent(Class<T> iClass) Get the component from the current thread's context.
Parameters: iClass - Class of the component to get. | public T | getContextComponent(String iComponent) Get the component from the current thread's context.
Parameters: iComponent - Component name to get. | public DynaBean | getFieldFeatures(Object iUserObject, String iAspectName, String iFieldName) Return the features of the requested field. | public ContentComponent | getFormByClass(Object iSession, Class> iClassOfObject) Return the first form of the declaring Class iClassOfObject. | public ContentComponent | getFormByObject(Object iUserObject) Return the form associated to a User Object. | public ContentComponent | getFormByObject(Object iSession, Object iUserObject) Return the form associated to a User Object. | public Map<SessionInfo, ContentComponent> | getFormsByClass(Class> iClass) Return all the forms for all the active session that render POJOs of class iClass. | public static ObjectContext | getInstance() Get the singleton instance. | public Object | getObject(String iEntityName) Get the instance of user class iEntityClassName. | public Object | getObject(String iEntityName, Object iEntityInstance) Get the instance of user class iEntityClassName. | public T | getObject(Class<T> iEntityClass) Get the instance of user class iNextClass. | public T | getObject(Class<T> iEntityClass, Object iEntityInstance) Get the instance of user class iNextClass. | public Object | getProperty(String iKey) Get a session context attribute value. | public SchemaObject | getSchemaObject(Object iUserObject) Get the schema object associated to the current POJO. | public Screen | getScreen() Return the desktop for the current user. | public Screen | getScreen(Object iUserSession) Return the screen for the user. | public void | logout() | public void | onSessionCreating(SessionInfo iSession) | public void | onSessionDestroying(SessionInfo iSession) | public void | refresh(SessionInfo iSession, ContentComponent iForm) | public void | refresh(Object iUserObject, String iPropertyName) Refresh a property feature and/or value. | public void | refresh(SessionInfo iUserSession, Object iUserObject, String iPropertyName) Refresh a property feature and/or value of iUserSession session. | public void | removeObjectFormAssociation(Object iUserObject) | public boolean | setActionFeature(Object iUserObject, String iAspectName, String iActionName, String iFeatureName, Object iFeatureValue) | public boolean | setClassFeature(Object iUserObject, String iAspectName, String iFeatureName, Object iFeatureValue) | public void | setContextComponent(Class<? extends Object> iClass, Object iValue) Set a component in the thread's context. | public void | setContextComponent(String iComponentName, Object iValue) Set a component in the thread's context. | public boolean | setFieldFeature(Object iUserObject, String iAspectName, String iFieldName, String iFeatureName, Object iFeatureValue) | public void | setProperty(String iKey, Object iValue) Set a session context attribute giving a name and a value. | public void | setScreen(Screen iScreen) Set the current screen. | public void | show(Object iContent) Display the form reading information from POJO received in the current desktop, in default position. | public void | show(Object iContent, String iPosition) Display the form reading information from POJO received following the layout rules. | public void | show(Object iContent, String iPosition, Screen iScreen, SessionInfo iSession) | public void | show(Object iContent, String iPosition, Screen iScreen, SessionInfo iSession, SchemaObject iSchema) Display the form reading information from POJO received following the layout rules. | public void | showComponent(Object iComponent, String iArea) | public void | shutdown() | public void | validate(Object iPOJO) Validate the POJO applying the validation rules found on it. |
ObjectContext | protected ObjectContext()(Code) | | |
createObjectFormAssociation | public void createObjectFormAssociation(Object iUserObject, String iArea, ContentComponent iForm)(Code) | | Create an association between a User Object and a ContentForm. This association is useful to gather custom form information.
Parameters: iUserObject - Parameters: iArea - Parameters: iForm - |
existComponent | public boolean existComponent(Class<? extends Object> iClass)(Code) | | Check if a component was configured in the IoC system.
Parameters: iClass - Interface of component implementation true if was configured, otherwise null |
existComponent | public boolean existComponent(String iComponentName)(Code) | | Check if a component was configured in the IoC system.
Parameters: iComponentName - Name of component to search true if was configured, otherwise null |
getActionFeatures | public DynaBean getActionFeatures(Object iUserObject, String iAspectName, String iActionName) throws ConfigurationNotFoundException(Code) | | Return the features of the requested action. The first time the features are requested, their are cloned by the original
features. This allow to customize features at a User Object level without consuming memory if not necessary.
Parameters: iUserObject - User Object Parameters: iActionName - The name of the action DynaBean instance |
getClassFeatures | public DynaBean getClassFeatures(Object iUserObject, String iAspectName) throws ConfigurationNotFoundException(Code) | | Return the features of the entity. The first time the features are requested, their are cloned by the original features. This
allow to customize features at a User Object level without consuming memory if not necessary.
Parameters: iUserObject - User Object DynaBean instance |
getComponent | public T getComponent(Class<T> iClass)(Code) | | Get a component configured in the IoC system.
Parameters: iClass - Interface of component implementation the component if any or null if not found |
getComponent | public T getComponent(String iName)(Code) | | Get a component configured in the IoC system.
Parameters: iName - Component name the component if any or null if not found |
getContextComponent | public T getContextComponent(Class<T> iClass)(Code) | | Get the component from the current thread's context.
Parameters: iClass - Class of the component to get. Component if found, otherwise null |
getContextComponent | public T getContextComponent(String iComponent)(Code) | | Get the component from the current thread's context.
Parameters: iComponent - Component name to get. Component if found, otherwise null |
getFormByClass | public ContentComponent getFormByClass(Object iSession, Class> iClassOfObject)(Code) | | Return the first form of the declaring Class iClassOfObject.
Parameters: iSession - User session, null to get the current active Parameters: iClassOfObject - The Class of the object ContentComponent instance if any, otherwise null |
getFormByObject | public ContentComponent getFormByObject(Object iUserObject)(Code) | | Return the form associated to a User Object.
Parameters: iUserObject - ContentComponent instance if any, otherwise null |
getFormByObject | public ContentComponent getFormByObject(Object iSession, Object iUserObject)(Code) | | Return the form associated to a User Object.
Parameters: iSession - User session, null to get the current active Parameters: iUserObject - ContentComponent instance if any, otherwise null |
getFormsByClass | public Map<SessionInfo, ContentComponent> getFormsByClass(Class> iClass)(Code) | | Return all the forms for all the active session that render POJOs of class iClass.
Parameters: iClass - Class to search Map with all entries that are handling POJOs of class iClass |
getInstance | public static ObjectContext getInstance()(Code) | | Get the singleton instance.
The singleton instance. |
getObject | public Object getObject(String iEntityName)(Code) | | Get the instance of user class iEntityClassName. If the instance is in the user session's pool then recycle it, otherwise
create a new one and insert in to the user session's pool.
Parameters: iEntityClassName - User Class name of requested object instance of class requested |
getObject | public Object getObject(String iEntityName, Object iEntityInstance)(Code) | | Get the instance of user class iEntityClassName. If the instance is in the user session's pool then recycle it, otherwise
create a new one and insert in to the user session's pool.
Parameters: iEntityClassName - User Class name of requested object Parameters: iEntityInstance - Entity instance to assign to the object requested if is instance of ComposedEntity instance of class requested |
getObject | public T getObject(Class<T> iEntityClass)(Code) | | Get the instance of user class iNextClass. If the instance is in the user session's pool then recycle it, otherwise create a
new one and insert in to the user session's pool. Use this method instead of getObject(String) when you know class type at
compile time to benefits of static checks and future refactoring.
See Also: ObjectContext.getObject(String) Parameters: iEntityClass - instance of class requested |
getObject | public T getObject(Class<T> iEntityClass, Object iEntityInstance)(Code) | | Get the instance of user class iNextClass. If the instance is in the user session's pool then recycle it, otherwise create a
new one and insert in to the user session's pool. Use this method instead of getObject(String) when you know class type at
compile time to benefits of static checks and future refactoring.
See Also: ObjectContext.getObject(String) Parameters: iEntityClass - Parameters: iEntityInstance - Entity instance to assign to the object requested if is instance of ComposedEntity instance of class requested |
getProperty | public Object getProperty(String iKey)(Code) | | Get a session context attribute value.
Parameters: iKey - attribute name Attribute value |
getScreen | public Screen getScreen()(Code) | | Return the desktop for the current user.
Desktop instance |
getScreen | public Screen getScreen(Object iUserSession)(Code) | | Return the screen for the user.
Parameters: iUserSession - User session Desktop instance |
logout | public void logout()(Code) | | |
refresh | public void refresh(Object iUserObject, String iPropertyName)(Code) | | Refresh a property feature and/or value.
Parameters: iUserObject - The User Object of changed property Parameters: iPropertyName - The property name |
refresh | public void refresh(SessionInfo iUserSession, Object iUserObject, String iPropertyName)(Code) | | Refresh a property feature and/or value of iUserSession session.
Parameters: iUserSession - The User Session Parameters: iUserObject - The User Object of changed property Parameters: iPropertyName - The property name |
removeObjectFormAssociation | public void removeObjectFormAssociation(Object iUserObject)(Code) | | |
setContextComponent | public void setContextComponent(Class<? extends Object> iClass, Object iValue)(Code) | | Set a component in the thread's context.
Parameters: iClass - Class of the component to set. Parameters: iValue - Component instance |
setContextComponent | public void setContextComponent(String iComponentName, Object iValue)(Code) | | Set a component in the thread's context.
Parameters: iComponentName - Component name to set. Parameters: iValue - Component instance |
setProperty | public void setProperty(String iKey, Object iValue)(Code) | | Set a session context attribute giving a name and a value.
Parameters: iKey - attribute name Parameters: iValue - attribute value |
setScreen | public void setScreen(Screen iScreen)(Code) | | Set the current screen.
Parameters: iScreen - |
show | public void show(Object iContent) throws ViewException(Code) | | Display the form reading information from POJO received in the current desktop, in default position.
Parameters: iContent - Object instance to display |
show | public void show(Object iContent, String iPosition) throws ViewException(Code) | | Display the form reading information from POJO received following the layout rules. Display the object on iWhere position in
the current desktop.
Parameters: iContent - Parameters: iPosition - throws: ViewException - |
show | public void show(Object iContent, String iPosition, Screen iScreen, SessionInfo iSession, SchemaObject iSchema) throws ViewException(Code) | | Display the form reading information from POJO received following the layout rules. Display the object on iWhere position in
the desktop received as the argument iDesktop.
Parameters: iContent - Object instance to display Parameters: iPosition - Desktop position where render the object Parameters: iScreen - Desktop instance to use throws: Exception - |
shutdown | public void shutdown()(Code) | | |
validate | public void validate(Object iPOJO)(Code) | | Validate the POJO applying the validation rules found on it.
Parameters: iPOJO - The object to validate |
|
|