001package org.kuali.common.util.log4j;
002
003import org.kuali.common.util.Assert;
004import org.kuali.common.util.execute.Executable;
005
006/**
007 * @deprecated
008 */
009@Deprecated
010public class Log4JExecutable implements Executable {
011
012        boolean skip;
013        org.kuali.common.util.log4j.model.Log4JContext context;
014        Log4JService service;
015
016        public Log4JExecutable() {
017                this(null, null);
018        }
019
020        public Log4JExecutable(Log4JService service, org.kuali.common.util.log4j.model.Log4JContext context) {
021                this(service, context, false);
022        }
023
024        public Log4JExecutable(Log4JService service, org.kuali.common.util.log4j.model.Log4JContext context, boolean skip) {
025                super();
026                this.service = service;
027                this.context = context;
028                this.skip = skip;
029        }
030
031        @Override
032        public void execute() {
033
034                // Might have nothing to do
035                if (skip) {
036                        return;
037                }
038
039                // Make sure we are configured correctly
040                Assert.notNull(service, "service is null");
041                Assert.notNull(context, "context is null");
042
043                // Configure log4j as indicated by the context
044                service.configure(context);
045        }
046
047        public boolean isSkip() {
048                return skip;
049        }
050
051        public void setSkip(boolean skip) {
052                this.skip = skip;
053        }
054
055        public Log4JService getService() {
056                return service;
057        }
058
059        public void setService(Log4JService service) {
060                this.service = service;
061        }
062
063        public org.kuali.common.util.log4j.model.Log4JContext getContext() {
064                return context;
065        }
066
067        public void setContext(org.kuali.common.util.log4j.model.Log4JContext context) {
068                this.context = context;
069        }
070
071}