Package com.sun.enterprise.config.serverbeans

Examples of com.sun.enterprise.config.serverbeans.HealthChecker


        return readers;
    }

    @Override
    public HealthCheckerReader getHealthChecker() throws LbReaderException {
        HealthChecker bean = null;
        if(_serverRef != null){
            bean = _serverRef.getHealthChecker();
        }
        if (bean == null) {
            return HealthCheckerReaderImpl.getDefaultHealthChecker();
View Full Code Here


                report.setMessage(msg);
                return;
            }

            if (cRef != null) {
                HealthChecker hc = cRef.getHealthChecker();
                if (hc != null) {
                    removeHealthCheckerFromClusterRef(cRef);
                    String msg = localStrings.getLocalString("http_lb_admin.HealthCheckerDeleted",
                            "Health checker deleted for target {0}", target);
                    logger.info(msg);
                } else {
                   if (ignoreFailure == false) {
                       String msg = localStrings.getLocalString("HealthCheckerDoesNotExist",
                               "Health checker does not exist for target {0} in LB {1}", target, lbConfigName);
                       report.setActionExitCode(ActionReport.ExitCode.FAILURE);
                       report.setMessage(msg);
                       return;
                    }
                }
            }

        // target is a server
        } else if (domain.isServer(target)) {
            ServerRef  sRef   = lbConfig.getRefByRef(ServerRef.class, target);

            // server is not associated to this lb config
            if ((sRef == null) && (ignoreFailure == false)) {
                String msg = localStrings.getLocalString("UnassociatedServer",
                        "Load balancer configuration [{0}] does not have a reference to the given server [{1}].",
                        lbConfigName, target);
                report.setActionExitCode(ActionReport.ExitCode.FAILURE);
                report.setMessage(msg);
                return;
            }

            if (sRef != null) {
                HealthChecker hc  = sRef.getHealthChecker();
                if (hc != null) {
                    removeHealthCheckerFromServerRef(sRef);
                    String msg = localStrings.getLocalString("http_lb_admin.HealthCheckerDeleted",
                            "Health checker deleted for target {0}", target);
                    logger.info(msg);
View Full Code Here

    private void addHealthChecker(final ClusterRef ref)
                                throws TransactionFailure {
        ConfigSupport.apply(new SingleConfigCode<ClusterRef>() {
                @Override
                public Object run(ClusterRef param) throws PropertyVetoException, TransactionFailure {
                    HealthChecker hc = param.createChild(HealthChecker.class);
                    if (url != null)       { hc.setUrl(url);                    }
                    if (interval != null)  { hc.setIntervalInSeconds(interval); }
                    if (timeout != null)   { hc.setTimeoutInSeconds(timeout);   }

                    param.setHealthChecker(hc);
                    return Boolean.TRUE;
                }
        }, ref);
View Full Code Here

    private void addHealthChecker(final ServerRef ref)
                                throws TransactionFailure {
        ConfigSupport.apply(new SingleConfigCode<ServerRef>() {
                @Override
                public Object run(ServerRef param) throws PropertyVetoException, TransactionFailure {
                    HealthChecker hc = param.createChild(HealthChecker.class);
                    if (url != null)       { hc.setUrl(url);                    }
                    if (interval != null)  { hc.setIntervalInSeconds(interval); }
                    if (timeout != null)   { hc.setTimeoutInSeconds(timeout);   }

                    param.setHealthChecker(hc);
                    return Boolean.TRUE;
                }
        }, ref);
View Full Code Here

        if (_clusterRef == null) {
            return HealthCheckerReaderImpl.getDefaultHealthChecker();
        }

        HealthChecker bean = _clusterRef.getHealthChecker();
        if (bean == null) {
            return null;
        } else {
            HealthCheckerReader reader = new HealthCheckerReaderImpl(bean);
            return reader;
View Full Code Here

    private void addHealthChecker(final ClusterRef ref)
                                throws TransactionFailure {
        ConfigSupport.apply(new SingleConfigCode<ClusterRef>() {
                @Override
                public Object run(ClusterRef param) throws PropertyVetoException, TransactionFailure {
                    HealthChecker hc = param.createChild(HealthChecker.class);
                    if (url != null)       { hc.setUrl(url);                    }
                    if (interval != null)  { hc.setIntervalInSeconds(interval); }
                    if (timeout != null)   { hc.setTimeoutInSeconds(timeout);   }

                    param.setHealthChecker(hc);
                    return Boolean.TRUE;
                }
        }, ref);
View Full Code Here

    private void addHealthChecker(final ServerRef ref)
                                throws TransactionFailure {
        ConfigSupport.apply(new SingleConfigCode<ServerRef>() {
                @Override
                public Object run(ServerRef param) throws PropertyVetoException, TransactionFailure {
                    HealthChecker hc = param.createChild(HealthChecker.class);
                    if (url != null)       { hc.setUrl(url);                    }
                    if (interval != null)  { hc.setIntervalInSeconds(interval); }
                    if (timeout != null)   { hc.setTimeoutInSeconds(timeout);   }

                    param.setHealthChecker(hc);
                    return Boolean.TRUE;
                }
        }, ref);
View Full Code Here

                report.setMessage(msg);
                return;
            }

            if (cRef != null) {
                HealthChecker hc = cRef.getHealthChecker();
                if (hc != null) {
                    removeHealthCheckerFromClusterRef(cRef);
                    String msg = localStrings.getLocalString("http_lb_admin.HealthCheckerDeleted",
                            "Health checker deleted for target {0}", target);
                    logger.info(msg);
                } else {
                   if (ignoreFailure == false) {
                       String msg = localStrings.getLocalString("HealthCheckerDoesNotExist",
                               "Health checker does not exist for target {0} in LB {1}", target, lbConfigName);
                       report.setActionExitCode(ActionReport.ExitCode.FAILURE);
                       report.setMessage(msg);
                       return;
                    }
                }
            }

        // target is a server
        } else if (domain.isServer(target)) {
            ServerRef  sRef   = lbConfig.getRefByRef(ServerRef.class, target);

            // server is not associated to this lb config
            if ((sRef == null) && (ignoreFailure == false)) {
                String msg = localStrings.getLocalString("UnassociatedServer",
                        "Load balancer configuration [{0}] does not have a reference to the given server [{1}].",
                        lbConfigName, target);
                report.setActionExitCode(ActionReport.ExitCode.FAILURE);
                report.setMessage(msg);
                return;
            }

            if (sRef != null) {
                HealthChecker hc  = sRef.getHealthChecker();
                if (hc != null) {
                    removeHealthCheckerFromServerRef(sRef);
                    String msg = localStrings.getLocalString("http_lb_admin.HealthCheckerDeleted",
                            "Health checker deleted for target {0}", target);
                    logger.info(msg);
View Full Code Here

        if (_clusterRef == null) {
            return HealthCheckerReaderImpl.getDefaultHealthChecker();
        }

        HealthChecker bean = _clusterRef.getHealthChecker();
        if (bean == null) {
            return null;
        } else {
            HealthCheckerReader reader = new HealthCheckerReaderImpl(bean);
            return reader;
View Full Code Here

TOP

Related Classes of com.sun.enterprise.config.serverbeans.HealthChecker

Copyright © 2018 www.massapicom. 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.