/** * Whether context is responsible for incomplete deployment. * * @param contextName context's name * @return true when context is responsible */ public boolean isInvalidContext(String contextName) { if (isIncomplete() == false) return false; if (matchComponentName(contextName, getContextsInError().keySet())) return true; if (matchComponentName(contextName, getContextsMissingDependencies().keySet())) return true; return false; }
/** * Get the contexts in error info. * * @return string info */ public String getContextsInErrorInfo() { if (contextsInErrorInfo == null) calculateContextsError(); return contextsInErrorInfo; }
@Override public String getMessage() { StringBuilder buffer = new StringBuilder(); buffer.append("Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):\n"); // Display all the missing deployers buffer.append(incompleteDeployments.getDeploymentsMissingDeployerInfo()); // Display all the incomplete deployments buffer.append(incompleteDeployments.getDeploymentsInErrorInfo()); // Display all the missing dependencies buffer.append(incompleteDeployments.getContextsMissingDependenciesInfo()); // Display all contexts in error buffer.append(incompleteDeployments.getContextsInErrorInfo()); // buffer to string return buffer.toString(); } }
/** * Whether deployment unit is responsible for incomplete deployment. * * @param deploymentName deployment unit name * @return true when deployment unit is responsible */ public boolean isInvalidDeployment(String deploymentName) { if (isIncomplete() == false) return false; if (matchComponentName(deploymentName, getDeploymentsInError().keySet())) return true; if (matchComponentName(deploymentName, getDeploymentsMissingDeployer())) return true; return false; }
@Override public Throwable transform(Throwable exception) { IncompleteDeploymentException incompleteDeploymentException = findIncompleteDeploymentException(exception); if(incompleteDeploymentException != null) { for (Entry<String, Throwable> entry : incompleteDeploymentException.getIncompleteDeployments().getContextsInError().entrySet()) { return entry.getValue(); } } return null; }
Map<String, Set<MissingDependency>> contextsMissingDependencies = getContextsMissingDependencies(); if (contextsMissingDependencies.isEmpty() == false) mergeRootCauses(rootCauses, dependency.getDependency(), dependency.getActualState()); Map<String, Throwable> contextsInError = getContextsInError(); if (contextsInError.isEmpty() == false) mergeRootCauses(rootCauses, entry.getKey(), "** UNKNOWN ERROR **"); else mergeRootCauses(rootCauses, entry.getKey(), t.toString());
contextsMissingDependencies = null; IncompleteDeployments incomplete = new IncompleteDeployments(deploymentsInError, deploymentsMissingDeployer, contextsInError, contextsMissingDependencies); if (incomplete.isIncomplete()) throw new IncompleteDeploymentException(incomplete);
@Override public Throwable transform(Throwable exception) { IncompleteDeploymentException incompleteDeploymentException = findIncompleteDeploymentException(exception); if(incompleteDeploymentException != null) { for (Entry<String, Throwable> entry : incompleteDeploymentException.getIncompleteDeployments().getContextsInError().entrySet()) { return entry.getValue(); } } return null; }
IncompleteDeployments incomplete = new IncompleteDeployments(deploymentsInError, deploymentsMissingDeployer, contextsInError, contextsMissingDependencies); if (incomplete.isIncomplete()) throw new IncompleteDeploymentException(incomplete);
@Override public Throwable transform(Throwable exception) { IncompleteDeploymentException incompleteDeploymentException = findIncompleteDeploymentException(exception); if(incompleteDeploymentException != null) { for (Entry<String, Throwable> entry : incompleteDeploymentException.getIncompleteDeployments().getContextsInError().entrySet()) { return entry.getValue(); } } return null; }
/** * Get the contexts missing dependecies info * * @return the contexts missing dependency */ public String getContextsMissingDependenciesInfo() { if (contextsMissingDependenciesInfo == null) calculateContextsError(); return contextsMissingDependenciesInfo; }
@Override public Throwable transform(Throwable exception) { IncompleteDeploymentException incompleteDeploymentException = findIncompleteDeploymentException(exception); if(incompleteDeploymentException != null) { for (Entry<String, Throwable> entry : incompleteDeploymentException.getIncompleteDeployments().getContextsInError().entrySet()) { return entry.getValue(); } } return null; }