Project JXTA

net.jxta.impl.endpoint
Class WireFormatMessageBinary.Instantiator

java.lang.Object
  extended by net.jxta.impl.endpoint.WireFormatMessageBinary.Instantiator
All Implemented Interfaces:
WireFormatMessageFactory.Instantiator
Enclosing class:
WireFormatMessageBinary

static class WireFormatMessageBinary.Instantiator
extends Object
implements WireFormatMessageFactory.Instantiator

Our instantiator.


Constructor Summary
WireFormatMessageBinary.Instantiator()
          Creates new WireFormatMessageBinary Instantiator
 
Method Summary
 Message fromWire(InputStream is, MimeMediaType type, MimeMediaType contentEncoding)
          Create an abstract message from a serialization.
 MimeMediaType[] getSupportedContentEncodings()
          Returns a list of the content encodings supported by this serialization.
 MimeMediaType[] getSupportedMimeTypes()
          Returns the list of mime types supported by this serialization.
 WireFormatMessage toWire(Message msg, MimeMediaType type, MimeMediaType[] preferedContentEncoding)
          Create a WireFormatMessage from an abstract message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WireFormatMessageBinary.Instantiator

public WireFormatMessageBinary.Instantiator()
Creates new WireFormatMessageBinary Instantiator

Method Detail

getSupportedMimeTypes

public MimeMediaType[] getSupportedMimeTypes()
Returns the list of mime types supported by this serialization. All of mimetypes in this list should have no mime type parameters.

Specified by:
getSupportedMimeTypes in interface WireFormatMessageFactory.Instantiator

getSupportedContentEncodings

public MimeMediaType[] getSupportedContentEncodings()
Returns a list of the content encodings supported by this serialization. These content encodings apply to both the overall coding of the message and to the encodig of individual elements.

Specified by:
getSupportedContentEncodings in interface WireFormatMessageFactory.Instantiator

fromWire

public Message fromWire(InputStream is,
                        MimeMediaType type,
                        MimeMediaType contentEncoding)
                 throws IOException
Create an abstract message from a serialization.

Specified by:
fromWire in interface WireFormatMessageFactory.Instantiator
Parameters:
is - The message stream. Message serializations must either use internal data or EOF to determine the length of the stream.
type - Declared message type of the stream including any optional configuration parameters.
contentEncoding - Content encoding (including optional parameters) which has been applied to the message. May be null for unencoded messages.
Returns:
a proxy object for the abstract message which is a representation of the message in its serialized form.
Throws:
IOException

toWire

public WireFormatMessage toWire(Message msg,
                                MimeMediaType type,
                                MimeMediaType[] preferedContentEncoding)
Create a WireFormatMessage from an abstract message. It is an error (though lazily enforced) tomodify the abstract message during the lifetime of the WireFormatMessage.

Specified by:
toWire in interface WireFormatMessageFactory.Instantiator
Parameters:
msg - the message for which a serialization is desired.
type - the the serialization form desired. This can include mime parameters to control options.
preferedContentEncoding - An array of acceptable message encodings in descending order of preference. any or none of these encoding options may be used. May be null for unencoded messages.
Returns:
a proxy object for the abstract message which is a representation of the message in its serialized form.

JXTA J2SE