org.apache.directory.shared.ldap.message.spi
Interface ProviderEncoder

All Superinterfaces:
ProviderObject, org.apache.directory.shared.asn1.codec.stateful.StatefulEncoder
All Known Implementing Classes:
MessageEncoder, TwixEncoder

public interface ProviderEncoder
extends ProviderObject, org.apache.directory.shared.asn1.codec.stateful.StatefulEncoder

Standard encoder service provider interface. BER encoders of ASN.1 compiler stubs are expected to implement this interface.

Version:
$Rev: 379008 $
Author:
Apache Directory Project

Method Summary
 java.nio.ByteBuffer encodeBlocking(java.lang.Object obj)
          Encodes a compiler stub specific ASN.1 message envelope containment tree into byte array.
 void encodeBlocking(java.lang.Object lock, java.io.OutputStream out, java.lang.Object obj)
          Encodes a compiler stub specific ASN.1 message envelope containment tree onto an output stream.
 
Methods inherited from interface org.apache.directory.shared.ldap.message.spi.ProviderObject
getProvider
 
Methods inherited from interface org.apache.directory.shared.asn1.codec.stateful.StatefulEncoder
encode, setCallback, setEncoderMonitor
 

Method Detail

encodeBlocking

public void encodeBlocking(java.lang.Object lock,
                           java.io.OutputStream out,
                           java.lang.Object obj)
                    throws ProviderException
Encodes a compiler stub specific ASN.1 message envelope containment tree onto an output stream.

Parameters:
lock - lock object used to exclusively write to the output stream
out - the OutputStream to encode the message envelope onto.
obj - the top-level message envelope stub instance, i.e. for the Snacc4J service provider this would be an instance of the LDAPMessage compiler generated stub class.
Throws:
ProviderException - to indicate an error while attempting to encode the message envelope onto the output stream. Provider specific exceptions encountered while encoding can be held within this subclass of MultiException.

encodeBlocking

public java.nio.ByteBuffer encodeBlocking(java.lang.Object obj)
                                   throws ProviderException
Encodes a compiler stub specific ASN.1 message envelope containment tree into byte array.

Parameters:
obj - the top-level message envelope stub instance, i.e. for the Snacc4J service provider this would be an instance of the LDAPMessage compiler generated stub class.
Returns:
the encoded object in a byte buffer
Throws:
ProviderException - to indicate an error while attempting to encode the message envelope into a byte buffer. Provider specific exceptions encountered while encoding can be held within this subclass of MultiException.


Copyright © 2003-2006 . All Rights Reserved.