001/**
002 * Copyright 2010-2014 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.common.util.execute;
017
018import org.slf4j.Logger;
019import org.slf4j.LoggerFactory;
020
021/**
022 * @deprecated
023 */
024@Deprecated
025public class SpringExecutable implements Executable {
026
027        private static final Logger logger = LoggerFactory.getLogger(SpringExecutable.class);
028
029        public static final org.kuali.common.util.service.SpringService DEFAULT_SPRING_SERVICE = new org.kuali.common.util.service.DefaultSpringService();
030
031        org.kuali.common.util.service.SpringService service = DEFAULT_SPRING_SERVICE;
032        org.kuali.common.util.service.SpringContext context;
033        boolean skip;
034
035        public SpringExecutable() {
036                this(null);
037        }
038
039        public SpringExecutable(org.kuali.common.util.service.SpringContext context) {
040                super();
041                this.context = context;
042        }
043
044        @Override
045        public void execute() {
046                if (skip) {
047                        logger.info("Skipping execution");
048                } else {
049                        service.load(context);
050                }
051        }
052
053        public org.kuali.common.util.service.SpringService getService() {
054                return service;
055        }
056
057        public void setService(org.kuali.common.util.service.SpringService service) {
058                this.service = service;
059        }
060
061        public org.kuali.common.util.service.SpringContext getContext() {
062                return context;
063        }
064
065        public void setContext(org.kuali.common.util.service.SpringContext context) {
066                this.context = context;
067        }
068
069        public boolean isSkip() {
070                return skip;
071        }
072
073        public void setSkip(boolean skip) {
074                this.skip = skip;
075        }
076}