Examples of ExceptionPackage


Examples of org.rhq.core.util.exception.ExceptionPackage

        this.invalidValue = invalidValue;
        this.error = error;
    }

    public ValidationError(String propertyName, String invalidValue, String errorMessage) {
        this(propertyName, invalidValue, new ExceptionPackage(new Exception(errorMessage)));
    }
View Full Code Here

Examples of org.rhq.core.util.exception.ExceptionPackage

    private void assertFailureResult(String jobId) {
        Object results = opResults.get(jobId);
        assert results != null : "assertFailureResult1: " + opResults;
        assert results instanceof ExceptionPackage : "assertFailureResult2: " + opResults;
        ExceptionPackage error = ((ExceptionPackage) results);
        assert error.getExceptionName().equals(IllegalStateException.class.getName()) : "assertFailureResult3: "
            + opResults;
        assert error.getMessage().equals("Simulates an operation failure") : "assertFailureResult4: " + opResults;
        assert error.getStackTraceString() != null : "assertFailureResult5: " + opResults;
    }
View Full Code Here

Examples of org.rhq.core.util.exception.ExceptionPackage

                    } catch (Throwable t) {
                        log.error("Failed to send operation succeeded message to server. resource=[" + resourceId
                            + "], operation=[" + operationName + "], jobId=[" + jobId + "]", t);
                    }
                } else {
                    ExceptionPackage errorResults = new ExceptionPackage(Severity.Severe, new Exception(errorMessage));
                    try {
                        operationServerService.operationFailed(jobId, result, errorResults, invocationTime,
                            finishedTime);
                    } catch (Throwable t) {
                        log.error("Failed to send operation failed message to server. resource=[" + resourceId
                            + "], operation=[" + operationName + "], jobId=[" + jobId + "]", t);
                    }
                }
            } else {
                if (status.contains(Status.TIMED_OUT)) {
                    try {
                        operationServerService.operationTimedOut(jobId, invocationTime, finishedTime);
                    } catch (Throwable t) {
                        log.error("Failed to send operation timed out message to server. resource=[" + resourceId
                            + "], operation=[" + operationName + "], jobId=[" + jobId + "]", t);
                    }
                } else {
                    ExceptionPackage errorResults;

                    if (status.contains(Status.CANCELED)) {
                        errorResults = new ExceptionPackage(Severity.Info, new Exception("Canceled", failure));
                    } else {
                        errorResults = new ExceptionPackage(Severity.Severe, failure);
                    }

                    try {
                        if (status.contains(Status.CANCELED)) {
                            operationServerService.operationCanceled(jobId, null, errorResults, invocationTime,
                                finishedTime);
                        } else {
                            operationServerService.operationFailed(jobId, null, errorResults, invocationTime,
                                finishedTime);
                        }
                    } catch (Throwable t) {
                        log.error("Failed to send operation failed message to server. resource=[" + resourceId
                            + "], operation=[" + operationName + "], jobId=[" + jobId + "], operation-error=["
                            + errorResults.toString() + "]", t);
                    }
                }
            }
        }
View Full Code Here

Examples of org.rhq.core.util.exception.ExceptionPackage

            } else {
                log.info("Not sending inventory report because no new descendent resources were discovered.");
            }
        } catch (Exception e) {
            log.warn("Exception caught while executing runtime discovery scan rooted at [" + target + "].", e);
            report.addError(new ExceptionPackage(Severity.Warning, e));
        }

        return report;
    }
View Full Code Here

Examples of org.rhq.core.util.exception.ExceptionPackage

            }

        } catch (InterruptedException e) {
            throw e; // if we're interrupted then exit out
        } catch (Throwable t) {
            report.getErrors().add(new ExceptionPackage(Severity.Severe, t));
            log.error("Error in runtime discovery", t);
        }

        return;
    }
View Full Code Here

Examples of org.rhq.core.util.exception.ExceptionPackage

            }

            inventoryManager.handleReport(report);
        } catch (Exception e) {
            log.warn("Exception caught while executing server discovery scan.", e);
            report.addError(new ExceptionPackage(Severity.Warning, e));
        }

        return report;
    }
View Full Code Here

Examples of org.rhq.core.util.exception.ExceptionPackage

                    }
                }
            } catch (ResourceTypeNotEnabledException rtne) {
                // skipping all ignored resources
            } catch (Throwable e) {
                report.getErrors().add(new ExceptionPackage(Severity.Severe, e));
                log.error("Error in auto discovery", e);
            }
        }

        // if we have nothing, our plugins didn't discovery anything, but we want to at least report the platform
View Full Code Here

Examples of org.rhq.core.util.exception.ExceptionPackage

                        }

                        long end = System.currentTimeMillis();

                        if (simulatedOperation_Error != null) {
                            ExceptionPackage error = new ExceptionPackage(new Exception(simulatedOperation_Error));
                            if (operationServerService != null) {
                                operationServerService.operationFailed(jobId, null, error, start, end);
                            }
                        } else if (simulatedOperation_Timeout) {
                            if (operationServerService != null) {
View Full Code Here

Examples of org.rhq.core.util.exception.ExceptionPackage

        DeployPackageStep step = new DeployPackageStep(Integer.toString(stepCounter), description);
        step.setStepResult(result);

        if (throwable != null) {
            String errorMessage = new ExceptionPackage(throwable).getStackTraceString();            
            step.setStepErrorMessage(errorMessage);
        }

        log.setStep(step);
View Full Code Here

Examples of org.rhq.core.util.exception.ExceptionPackage

            EnvironmentScriptFileUpdate updater = EnvironmentScriptFileUpdate.create(script.getAbsolutePath());
            updater.update(newSettings, true);

            request.setStatus(ConfigurationUpdateStatus.SUCCESS);
        } catch (Exception e) {
            request.setErrorMessage(new ExceptionPackage(Severity.Severe, e).toString());
        }

        return;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.