~elambert/gearmanij/gearman_java_library

« back to all changes in this revision

Viewing changes to src/org/gearman/GearmanJobServerConnection.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
 
/*
2
 
 * Copyright (C) 2009 by Eric Herman <eric@freesa.org>
3
 
 * Copyright (C) 2009 by Robert Stewart <robert@wombatnation.com>
4
 
 * Copyright (C) 2009 by Eric Lambert <Eric.Lambert@sun.com>
5
 
 * Use and distribution licensed under the
6
 
 * GNU Lesser General Public License (LGPL) version 2.1.
7
 
 * See the COPYING file in the parent directory for full text.
8
 
 */
9
 
package org.gearman;
10
 
 
11
 
import gearmanij.Packet;
12
 
import gearmanij.util.IORuntimeException;
13
 
import java.io.IOException;
14
 
 
15
 
/*
16
 
 * This is essentially a copy of the the gearmanij.Connection interface.
17
 
 */
18
 
 
19
 
/**
20
 
 * This interface exposes the API that classes representing connections to a
21
 
 * Gearman Job Server must implement.
22
 
 */
23
 
public interface GearmanJobServerConnection {
24
 
 
25
 
    /**
26
 
     * Opens a connection to the Gearman Job Server
27
 
     */
28
 
    void open() throws IOException;
29
 
 
30
 
    /**
31
 
     * Closes a connection to the Gearman Job Server
32
 
     */
33
 
    void close();
34
 
 
35
 
    /**
36
 
     * Writes a {@link GearmanPacket} into the connection with the Gearman Job Server.
37
 
     *
38
 
     * @param request The request to be written.
39
 
     */
40
 
    void write(GearmanPacket request) throws IOException;
41
 
 
42
 
    /**
43
 
     * Reads a {@link GearmanPacket} from the connection with the Gearman Job Server.
44
 
     * @return the GearmanPacket read from the connection.
45
 
     * @throws IORuntimeException if an I/O exception was encountered.
46
 
     */
47
 
    GearmanPacket read() throws IOException;
48
 
}