~elambert/gearmanij/gearman_java_library

« back to all changes in this revision

Viewing changes to src/org/gearman/PacketConnection.java

  • Committer: Eric Lambert
  • Date: 2009-07-07 05:45:30 UTC
  • Revision ID: eric.d.lambert@gmail.com-20090707054530-2963dq28telt30yj
I fubar-ed rev142, so undoing it

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
 * Use and distribution licensed under the 
 
5
 * GNU Lesser General Public License (LGPL) version 2.1.
 
6
 * See the COPYING file in the parent directory for full text.
 
7
 */
 
8
package org.gearman;
 
9
 
 
10
import org.gearman.common.GearmanPacket;
 
11
import org.gearman.util.IORuntimeException;
 
12
 
 
13
/**
 
14
 * Objects that implement this interface manage a connection to a Gearman job
 
15
 * server.
 
16
 */
 
17
public interface PacketConnection extends Cloneable {
 
18
 
 
19
    /**
 
20
     * Open a new connection to a job server.
 
21
     */
 
22
    void open();
 
23
 
 
24
    /**
 
25
     * Close the current connection, if any, to a job server.
 
26
     */
 
27
    void close();
 
28
 
 
29
    /**
 
30
     * Writes a {@link Packet} to a job server.
 
31
     * 
 
32
     * @param request
 
33
     *            Packet to send to job server
 
34
     */
 
35
    void write(GearmanPacket request);
 
36
 
 
37
    /**
 
38
     * Reads a Packet from a job server.
 
39
     * 
 
40
     * @return the Packet
 
41
     * @throws IORuntimeException
 
42
     */
 
43
    GearmanPacket read();
 
44
 
 
45
}