Class DefaultStreamTransportFactory
- java.lang.Object
-
- com.levigo.jadice.server.streamtransport.DefaultStreamTransportFactory
-
- All Implemented Interfaces:
StreamTransportFactory
public class DefaultStreamTransportFactory extends Object implements StreamTransportFactory
-
-
Constructor Summary
Constructors Constructor Description DefaultStreamTransportFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDigest()
int
getMaximumMessageSize()
Future<?>
initiateTransport(Stream stream, com.levigo.jadice.server.shared.transport.internal.TransportSender transport)
Create a transport for the given InputStream.void
setDigest(String digest)
Set an (optional) digest for integrity of transported streamsvoid
setMaximumMessageSize(int maximumMessageSize)
If the stream must be split in several messages, this value limits the maximum size of the individual messages.void
shutdown()
Shut down the stream transport factory.void
startup()
Initialize the stream transport factory.
-
-
-
Method Detail
-
initiateTransport
public Future<?> initiateTransport(Stream stream, com.levigo.jadice.server.shared.transport.internal.TransportSender transport) throws TransportException
Description copied from interface:StreamTransportFactory
Create a transport for the given InputStream.- Specified by:
initiateTransport
in interfaceStreamTransportFactory
- Parameters:
stream
- theStream
to transporttransport
- a TransportSender which can be used by the transport- Returns:
- a
Future
associated with the transmission of the providedStream
- Throws:
TransportException
- if transport initiation failed
-
startup
public void startup() throws StreamTransportException
Description copied from interface:StreamTransportFactory
Initialize the stream transport factory.- Specified by:
startup
in interfaceStreamTransportFactory
- Throws:
StreamTransportException
- if startup failed
-
shutdown
public void shutdown() throws StreamTransportException
Description copied from interface:StreamTransportFactory
Shut down the stream transport factory.- Specified by:
shutdown
in interfaceStreamTransportFactory
- Throws:
StreamTransportException
- if shutdown failed
-
setDigest
public void setDigest(String digest) throws NoSuchAlgorithmException
Description copied from interface:StreamTransportFactory
Set an (optional) digest for integrity of transported streams- Specified by:
setDigest
in interfaceStreamTransportFactory
- Parameters:
digest
- Name of the digest algorithm (ornull
to disable feature)- Throws:
NoSuchAlgorithmException
- If no digest with the given name was found
-
getDigest
public String getDigest()
- Specified by:
getDigest
in interfaceStreamTransportFactory
- Returns:
- The name of the digest algorithm (or
null
if no checking is enabled)
-
setMaximumMessageSize
public void setMaximumMessageSize(int maximumMessageSize)
Description copied from interface:StreamTransportFactory
If the stream must be split in several messages, this value limits the maximum size of the individual messages.- Specified by:
setMaximumMessageSize
in interfaceStreamTransportFactory
- Parameters:
maximumMessageSize
- max. size of a message (in bytes)
-
getMaximumMessageSize
public int getMaximumMessageSize()
- Specified by:
getMaximumMessageSize
in interfaceStreamTransportFactory
-
-