~elambert/gearmanij/gearman_java_library

« back to all changes in this revision

Viewing changes to src/org/gearman/worker/InstanceJobFunctionFactory.java

  • Committer: Eric Lambert
  • Date: 2009-07-07 02:18:15 UTC
  • mfrom: (57.1.65 gearmanij-trunk)
  • Revision ID: eric.d.lambert@gmail.com-20090707021815-0xbupi72ubyoa62a
merge from trunk. ReverseWorkerTest has been ignored, it was failing claiming that certain ops were not supported, since there is duplication in the worker code, for the time being will just ignore this issue, will resolve once the worker code has been straightened out

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
package gearmanij;
 
1
/*
 
2
 * Copyright (C) 2009 by Eric Herman <eric@freesa.org>
 
3
 * Use and distribution licensed under the 
 
4
 * GNU Lesser General Public License (LGPL) version 2.1.
 
5
 * See the COPYING file in the parent directory for full text.
 
6
 */
 
7
package org.gearman.worker;
 
8
 
 
9
import org.gearman.JobFunction;
 
10
import org.gearman.JobFunctionFactory;
2
11
 
3
12
public class InstanceJobFunctionFactory implements JobFunctionFactory {
4
 
  private final JobFunction jobFunction;
5
 
 
6
 
  public InstanceJobFunctionFactory(JobFunction jobFunction) {
7
 
    if (jobFunction == null) {
8
 
      throw new IllegalArgumentException();
9
 
    }
10
 
    this.jobFunction = jobFunction;
11
 
  }
12
 
 
13
 
  public String getFunctionName() {
14
 
    return jobFunction.getName();
15
 
  }
16
 
 
17
 
  public JobFunction getJobFunction() {
18
 
    return jobFunction;
19
 
  }
 
13
    private final JobFunction jobFunction;
 
14
 
 
15
    public InstanceJobFunctionFactory(JobFunction jobFunction) {
 
16
        if (jobFunction == null) {
 
17
            throw new IllegalArgumentException();
 
18
        }
 
19
        this.jobFunction = jobFunction;
 
20
    }
 
21
 
 
22
    public String getFunctionName() {
 
23
        return jobFunction.getName();
 
24
    }
 
25
 
 
26
    public JobFunction getJobFunction() {
 
27
        return jobFunction;
 
28
    }
20
29
 
21
30
}