View Javadoc
1   package org.kuali.common.util.log4j;
2   
3   import org.kuali.common.util.Assert;
4   import org.kuali.common.util.execute.Executable;
5   
6   /**
7    * @deprecated
8    */
9   @Deprecated
10  public class Log4JExecutable implements Executable {
11  
12  	boolean skip;
13  	org.kuali.common.util.log4j.model.Log4JContext context;
14  	Log4JService service;
15  
16  	public Log4JExecutable() {
17  		this(null, null);
18  	}
19  
20  	public Log4JExecutable(Log4JService service, org.kuali.common.util.log4j.model.Log4JContext context) {
21  		this(service, context, false);
22  	}
23  
24  	public Log4JExecutable(Log4JService service, org.kuali.common.util.log4j.model.Log4JContext context, boolean skip) {
25  		super();
26  		this.service = service;
27  		this.context = context;
28  		this.skip = skip;
29  	}
30  
31  	@Override
32  	public void execute() {
33  
34  		// Might have nothing to do
35  		if (skip) {
36  			return;
37  		}
38  
39  		// Make sure we are configured correctly
40  		Assert.notNull(service, "service is null");
41  		Assert.notNull(context, "context is null");
42  
43  		// Configure log4j as indicated by the context
44  		service.configure(context);
45  	}
46  
47  	public boolean isSkip() {
48  		return skip;
49  	}
50  
51  	public void setSkip(boolean skip) {
52  		this.skip = skip;
53  	}
54  
55  	public Log4JService getService() {
56  		return service;
57  	}
58  
59  	public void setService(Log4JService service) {
60  		this.service = service;
61  	}
62  
63  	public org.kuali.common.util.log4j.model.Log4JContext getContext() {
64  		return context;
65  	}
66  
67  	public void setContext(org.kuali.common.util.log4j.model.Log4JContext context) {
68  		this.context = context;
69  	}
70  
71  }