* @return RemoteAEDeploymentMetaData
*/
static public RemoteAEDeploymentMetaData createRemoteAEDeploymentMetaData(
AEDeploymentMetaData metaData) {
ResourceSpecifierFactory factory = UIMAFramework.getResourceSpecifierFactory();
RemoteAEDeploymentMetaData remoteMetaData = (RemoteAEDeploymentMetaData) factory
.createObject(RemoteAEDeploymentMetaData.class);
remoteMetaData.setParent(metaData.getParent());
remoteMetaData.setKey(metaData.getKey());
remoteMetaData.setCasMultiplierPoolSize(metaData.getCasMultiplierPoolSize());
remoteMetaData.setRemoteReplyQueueScaleout(-1);
try {
remoteMetaData.setResourceSpecifier(metaData.getResourceSpecifier(), null, false);
} catch (InvalidXMLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// Clone OR Create a new AsyncAggregateErrorConfiguration
AsyncAEErrorConfiguration aggErrorConfig = null;
AsyncAEErrorConfiguration errorConfig = metaData.getAsyncAEErrorConfiguration();
if (errorConfig instanceof AsyncAggregateErrorConfiguration_Impl) {
// Clone
aggErrorConfig = errorConfig.clone();
} else {
// Create a new AsyncAggregateErrorConfiguration
aggErrorConfig = new AsyncAggregateErrorConfiguration_Impl();
aggErrorConfig.setGetMetadataErrors(new GetMetadataErrors_Impl(errorConfig));
aggErrorConfig.setProcessCasErrors(errorConfig.getProcessCasErrors().clone(aggErrorConfig));
aggErrorConfig.setCollectionProcessCompleteErrors(errorConfig
.getCollectionProcessCompleteErrors().clone(aggErrorConfig));
}
remoteMetaData.setErrorConfiguration(aggErrorConfig);
errorConfig.sParentObject((DeploymentMetaData_Impl)remoteMetaData);
// Set TimeOut for Remote
aggErrorConfig.getGetMetadataErrors().setTimeout(AEDeploymentConstants.DEFAULT_GETMETADATA_TIMEOUT);
return remoteMetaData;
}