You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2016/07/14 20:08:41 UTC
svn commit: r1752741 -
/uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/impl/UimaContext_ImplBase.java
Author: schor
Date: Thu Jul 14 20:08:41 2016
New Revision: 1752741
URL: http://svn.apache.org/viewvc?rev=1752741&view=rev
Log:
[UIMA-4769] sofa mappings for flow controllers fixed - copy of v2 change set
Modified:
uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/impl/UimaContext_ImplBase.java
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/impl/UimaContext_ImplBase.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/impl/UimaContext_ImplBase.java?rev=1752741&r1=1752740&r2=1752741&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/impl/UimaContext_ImplBase.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/impl/UimaContext_ImplBase.java Thu Jul 14 20:08:41 2016
@@ -219,6 +219,22 @@ public abstract class UimaContext_ImplBa
* @see org.apache.uima.UimaContextAdmin#createChild(java.lang.String)
*/
public UimaContextAdmin createChild(String aContextName, Map<String, String> aSofaMappings) {
+
+ // create child context with the absolute mappings
+ ChildUimaContext_impl child = new ChildUimaContext_impl(this, aContextName, combineSofaMappings(aSofaMappings));
+
+ // build a tree of MBeans that parallels the tree of UimaContexts
+ mMBean.addComponent(aContextName, child.mMBean);
+
+ return child;
+ }
+
+ /**
+ * Create the child sofa map by combining existing mapping from the current context with
+ * any mappings specific for this child, passed in as aSofaMappings
+ * @return the combined absolute sofamappings
+ */
+ public Map<String, String> combineSofaMappings(Map<String, String> aSofaMappings) {
// The aSofaMappings parameter, if present, defines the mapping between the child
// context's sofa names and this context's sofa names. This context's sofa names
// may again be remapped (according to the mSofaMappings field). We need to
@@ -241,14 +257,7 @@ public abstract class UimaContext_ImplBa
childSofaMap.put(childSofaName, absoluteSofaName);
}
}
-
- // create child context with the absolute mappings
- ChildUimaContext_impl child = new ChildUimaContext_impl(this, aContextName, childSofaMap);
-
- // build a tree of MBeans that parallels the tree of UimaContexts
- mMBean.addComponent(aContextName, child.mMBean);
-
- return child;
+ return childSofaMap;
}
/**