Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EclipseLink/DesignDocs/305401"

(New page: <br>Getting the Local Helper Context == The following API on SDOHelperContext will allow you to obtain a local HelperContext. Local helperContexts will be isolated at the same level that ...)
 
 
Line 1: Line 1:
<br>Getting the Local Helper Context ==
+
= Enhancement 305401 - SDO Serialization using local HelperContext =
  
The following API on SDOHelperContext will allow you to obtain a local HelperContext. Local helperContexts will be isolated at the same level that global helpers are today.
+
== Getting the Local Helper Context  ==
  
/**<br> * Return the local helper context with the given identifier, or create<br> * one if it does not already exist. This method must be thread safe.<br> * The identifiers must be unique in the same scope as the global HelperContexts.<br> */<br> public static SDOHelperContext getHelperContext(String identifier);<br> i.e. <br> SDOHelperContext.getHelperContext("servicename").getDataFactory();
+
The following API on SDOHelperContext will allow you to obtain a local HelperContext. Local helperContexts will be isolated at the same level that global helpers are today.  
  
== <br>Redefining the Metadata ==
+
/**<br> * Return the local helper context with the given identifier, or create<br> * one if it does not already exist. This method must be thread safe.<br> * The identifiers must be unique in the same scope as the global HelperContexts.<br> */<br> public static SDOHelperContext getHelperContext(String identifier);<br> i.e. <br> SDOHelperContext.getHelperContext("servicename").getDataFactory();
  
The following API on SDOHelperContext is relevant to redefining the metadata. Essentially you create a new HelperContext, define the new metadata, and replace the old one.
+
== <br>Redefining the Metadata  ==
  
/**<br> * Create a HelperContext with the given identifier.<br> */<br> public SDOHelperContext(String identifier);
+
The following API on SDOHelperContext is relevant to redefining the metadata. Essentially you create a new HelperContext, define the new metadata, and replace the old one.  
  
/**<br> * Replace the HelperContext associated with this identifer.<br> */<br> public static void putHelperContext(SDOHelperContext helperContext);
+
/**<br> * Create a HelperContext with the given identifier.<br> */<br> public SDOHelperContext(String identifier);  
  
i.e.<br> // "servicename" is the identifier for the HelperContext being replaced<br> SDOHelperContext newHelperContext = new SDOHelperContext("servicename");<br> newHelperContext.getXSDHelper().define(...);<br> SDOHelperContext.putHelperContext(newHelperContext);
+
/**<br> * Replace the HelperContext associated with this identifer.<br> */<br> public static void putHelperContext(SDOHelperContext helperContext);  
  
== <br>DataObjects created with Old Metadata ==
+
i.e.<br> // "servicename" is the identifier for the HelperContext being replaced<br> SDOHelperContext newHelperContext = new SDOHelperContext("servicename");<br> newHelperContext.getXSDHelper().define(...);<br> SDOHelperContext.putHelperContext(newHelperContext);
 +
 
 +
== <br>DataObjects created with Old Metadata ==
  
 
When the HelperContext is replaced you may have DataObjects created with an older version of the HelperContext that you still need to work with (they would still point to the old types &amp; properties). If required, we could add the following method to DataHelper (from SDO 3.0) that would enable "compatible" DataObjects to be moved from the old HelperContext to the new one.  
 
When the HelperContext is replaced you may have DataObjects created with an older version of the HelperContext that you still need to work with (they would still point to the old types &amp; properties). If required, we could add the following method to DataHelper (from SDO 3.0) that would enable "compatible" DataObjects to be moved from the old HelperContext to the new one.  
  
DataObject project(DataObject originalObject);
+
DataObject project(DataObject originalObject);  
  
Essentially "compatible" means that I could marshal the DataObjects to XML using the old HelperContext and then unmarshal them using the new HelperContext. Note there are no restrictions on the types of "redefine" that can be made, only a restriction on migrating old DataObjects to the new Types and Properties.
+
Essentially "compatible" means that I could marshal the DataObjects to XML using the old HelperContext and then unmarshal them using the new HelperContext. Note there are no restrictions on the types of "redefine" that can be made, only a restriction on migrating old DataObjects to the new Types and Properties.  
  
== <br>RMI Serialization ==
+
== <br>RMI Serialization ==
  
On the source and target there must be a local HelperContext with the same identifier (uri/name) with matching metadata. With this contract in place RMI serialization will happen transparently.<br>
+
On the source and target there must be a local HelperContext with the same identifier (uri/name) with matching metadata. With this contract in place RMI serialization will happen transparently.<br> <br>  
<br>
+
  
 
<br>
 
<br>

Latest revision as of 17:35, 10 March 2010

Enhancement 305401 - SDO Serialization using local HelperContext

Getting the Local Helper Context

The following API on SDOHelperContext will allow you to obtain a local HelperContext. Local helperContexts will be isolated at the same level that global helpers are today.

/**
* Return the local helper context with the given identifier, or create
* one if it does not already exist. This method must be thread safe.
* The identifiers must be unique in the same scope as the global HelperContexts.
*/
public static SDOHelperContext getHelperContext(String identifier);
i.e.
SDOHelperContext.getHelperContext("servicename").getDataFactory();


Redefining the Metadata

The following API on SDOHelperContext is relevant to redefining the metadata. Essentially you create a new HelperContext, define the new metadata, and replace the old one.

/**
* Create a HelperContext with the given identifier.
*/
public SDOHelperContext(String identifier);

/**
* Replace the HelperContext associated with this identifer.
*/
public static void putHelperContext(SDOHelperContext helperContext);

i.e.
// "servicename" is the identifier for the HelperContext being replaced
SDOHelperContext newHelperContext = new SDOHelperContext("servicename");
newHelperContext.getXSDHelper().define(...);
SDOHelperContext.putHelperContext(newHelperContext);


DataObjects created with Old Metadata

When the HelperContext is replaced you may have DataObjects created with an older version of the HelperContext that you still need to work with (they would still point to the old types & properties). If required, we could add the following method to DataHelper (from SDO 3.0) that would enable "compatible" DataObjects to be moved from the old HelperContext to the new one.

DataObject project(DataObject originalObject);

Essentially "compatible" means that I could marshal the DataObjects to XML using the old HelperContext and then unmarshal them using the new HelperContext. Note there are no restrictions on the types of "redefine" that can be made, only a restriction on migrating old DataObjects to the new Types and Properties.


RMI Serialization

On the source and target there must be a local HelperContext with the same identifier (uri/name) with matching metadata. With this contract in place RMI serialization will happen transparently.


Back to the top