org.jgroups.protocols

Class COMPRESS

public class COMPRESS extends Protocol

Compresses the payload of a message. Goal is to reduce the number of messages sent across the wire. Should ideally be layered somewhere above a fragmentation protocol (e.g. FRAG).

Version: $Id: COMPRESS.java,v 1.10 2005/11/03 11:42:59 belaban Exp $

Author: Bela Ban

Nested Class Summary
static classCOMPRESS.CompressHeader
Method Summary
voiddestroy()
voiddown(Event evt)
We compress the payload if it is larger than min_size.
StringgetName()
voidinit()
booleansetProperties(Properties props)
voidup(Event evt)
If there is no header, we pass the message up.

Method Detail

destroy

public void destroy()

down

public void down(Event evt)
We compress the payload if it is larger than min_size. In this case we add a header containing the original size before compression. Otherwise we add no header.
Note that we compress either the entire buffer (if offset/length are not used), or a subset (if offset/length are used)

Parameters: evt

getName

public String getName()

init

public void init()

setProperties

public boolean setProperties(Properties props)

up

public void up(Event evt)
If there is no header, we pass the message up. Otherwise we uncompress the payload to its original size.

Parameters: evt

Copyright ? 1998-2005 Bela Ban. All Rights Reserved.