boolean collocatedAggregate = false;
if ( endpoint.getServiceInfo() != null ) {
endpoint.getServiceInfo().setState(ServiceState.RUNNING.name());
}
ResourceMetaData resource = null;
ServiceInfo remoteDelegateServiceInfo = null;
if (aTypeSystem.trim().length() > 0) {
if (endpoint.isRemote()) {
System.out.println("Remote Service:" + key
+ " Initialized. Ready To Process Messages From Queue:"
+ endpoint.getEndpoint());
if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.CONFIG)) {
UIMAFramework.getLogger(CLASS_NAME).logrb(Level.CONFIG, CLASS_NAME.getName(),
"mergeTypeSystem", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
"UIMAEE_remote_delegate_ready__CONFIG",
new Object[] { getComponentName(), fromDestination });
}
}
if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.CONFIG)) {
UIMAFramework.getLogger(CLASS_NAME).logrb(Level.CONFIG, CLASS_NAME.getName(),
"mergeTypeSystem", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
"UIMAEE_merge_ts_from_delegate__CONFIG", new Object[] { fromDestination });
}
ByteArrayInputStream bis = new ByteArrayInputStream(aTypeSystem.getBytes());
XMLInputSource in1 = new XMLInputSource(bis, null);
resource = UIMAFramework.getXMLParser().parseResourceMetaData(in1);
if (isStopped()) {
return;
}
getCasManagerWrapper().addMetadata((ProcessingResourceMetaData) resource);
analysisEngineMetaDataMap.put(key, (ProcessingResourceMetaData) resource);
if (((ProcessingResourceMetaData) resource).getOperationalProperties()
.getOutputsNewCASes()) {
endpoint.setIsCasMultiplier(true);
remoteCasMultiplierList.add(key);
}
if (endpoint.isRemote()) {
Object o = null;
remoteDelegateServiceInfo = getDelegateServiceInfo(key);
if (remoteDelegateServiceInfo != null
&& (o = ((ProcessingResourceMetaData) resource)
.getConfigurationParameterSettings().getParameterValue(
AnalysisEngineController.AEInstanceCount)) != null) {
((PrimitiveServiceInfo) remoteDelegateServiceInfo)
.setAnalysisEngineInstanceCount(((Integer) o).intValue());
}
}
} else {
collocatedAggregate = true;
}
endpoint.setInitialized(true);
// If getMeta request not yet sent, send meta request to all remote delegate
// Special case when all delegates are remote is handled in the setInputChannel
synchronized (unregisteredDelegateList) {
// TODO can't find where this list is checked. Is it still used???
if (requestForMetaSentToRemotes == false && !allDelegatesAreRemote) {
String unregisteredDelegateKey = null;
for (int i = 0; i < unregisteredDelegateList.size(); i++) {
unregisteredDelegateKey = (String) unregisteredDelegateList.get(i);
if (unregisteredDelegateKey.equals(key)) {
unregisteredDelegateList.remove(i);
}
}
}
}
//
if (collocatedAggregate || resource instanceof ProcessingResourceMetaData) {
if (allTypeSystemsMerged()) {
for (int i = 0; i < remoteCasMultiplierList.size(); i++) {
Endpoint endpt = (Endpoint) destinationMap.get((String) remoteCasMultiplierList
.get(i));
if (endpt != null && endpt.isCasMultiplier() && endpt.isRemote()) {
System.out.println("Setting Shadow Pool of Size:" + endpt.getShadowPoolSize()
+ " For Cas Multiplier:" + (String) remoteCasMultiplierList.get(i));
getCasManagerWrapper().initialize(endpt.getShadowPoolSize(),
(String) remoteCasMultiplierList.get(i));
if (remoteDelegateServiceInfo != null) {
remoteDelegateServiceInfo.setCASMultiplier();
}
}
}
if (!isStopped()) {
try {