Changes for page Release Notes for XWiki Enterprise 3.3 Milestone 2
Last modified by Thomas Mortagne on 2017/03/24
Change comment:
Adding notes about Disposable interface, Component registration events and Entity reference immutability
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. Sergiu1 +XWiki.dgervalle - Content
-
... ... @@ -35,6 +35,19 @@ 35 35 * You wish to lazily get a component instance (instead of it getting injected when your Component is looked up the first time) 36 36 * You wish to control how you return the instance you're providing for. For example you may wish to read the Component Hint from a configuration file and return the instance of the Component matching that Hint dynamically 37 37 38 +== Component registration and unregistration event are now properly paired == 39 + 40 +The registration and unregistration event triggered by a component manager is now perfectly paired. Registering an existing component role and hint now trigger the unregistration event before registering the new component. 41 + 42 +== New Disposable interface for singleton components == 43 + 44 +To prepare the future uninstallation feature of the Extension Manager, singleton components could now implements the Disposable interface. This interface require a single dispose() methods that will be call when a singleton component is unregistered from its component manager. When a singleton component has been created, this could happen in three cases: 45 + * the component role and hints is explicitly unregistered 46 + * another component role with same hints is registered and therefore replace the existing component 47 + * the component instance is explicitly released calling the release function in the manager 48 + 49 +Components that require a singleton component should be aware that the instance provided is now subject release and should prevent from accessing a component that have been released. This could be done by observing the registration events of the component manager. The Unregister Event is always triggered when a component is released. 50 + 38 38 == Upgrades == 39 39 40 40 The following dependencies have been upgraded: ... ... @@ -98,6 +98,15 @@ 98 98 Always make sure you compare your ##xwiki.cfg## and ##xwiki.properties## files with the newest version since some configuration parameters were added. Note that you should add ##xwiki.store.migration=1## so that XWiki will attempt to automatically migrate your current database to the new schema. Make sure you backup your Database before doing anything. 99 99 {{/warning}} 100 100 114 +== Entity references are now immutable == 115 + 116 +EntityReference (and derived classes, DocumentReference...) has been refactored and are now immutable. This change has been introduced to prevent dangerous issues where a reference hold by an object could be changed by another one. This have a lot of consequences on the reference API and this break the backward compatibility. The following change should be noticed: 117 + * all setters on EntityReference is now protected and could not be used anymore by any public code. Deriving a reference to render it mutable is hardly discouraged. 118 + * EntityReference#getChild() has been removed, since a single entity may have more than one child. A EntityReference#getReversedParentChain() method has been added to allow easy iteration from the root entity to their children in a given parent chain. 119 + * EntityReference#clone() has been removed, a copy-construtor is still available, but is useless since an entity is immutable, there is no need to clone it 120 + * EntityReference#replaceParent(oldParent,newParent) allow creating a new entity with one of the parent in the parent chain replaced 121 + * EntityReference#appendParent() allow creating a new entity with an appended root parent, this one is useless on any derived class since the parent chain could not appended in them. 122 + 101 101 == Issues specific to <projet> <version> == 102 102 103 103 <issues specific to the project>