Search in sources :

Example 1 with ProtocolCodecFactory

use of org.apache.mina.filter.codec.ProtocolCodecFactory in project camel by apache.

the class Mina2Producer method configureDataGramCodecFactory.

/**
     * For datagrams the entire message is available as a single IoBuffer so lets just pass those around by default
     * and try converting whatever they payload is into IoBuffer unless some custom converter is specified
     */
protected void configureDataGramCodecFactory(final String type, final IoService service, final Mina2Configuration configuration) {
    ProtocolCodecFactory codecFactory = configuration.getCodec();
    if (codecFactory == null) {
        codecFactory = new Mina2UdpProtocolCodecFactory(this.getEndpoint().getCamelContext());
        if (LOG.isDebugEnabled()) {
            LOG.debug("{}: Using CodecFactory: {}", new Object[] { type, codecFactory });
        }
    }
    addCodecFactory(service, codecFactory);
}
Also used : ProtocolCodecFactory(org.apache.mina.filter.codec.ProtocolCodecFactory)

Example 2 with ProtocolCodecFactory

use of org.apache.mina.filter.codec.ProtocolCodecFactory in project camel by apache.

the class Mina2Consumer method configureDataGramCodecFactory.

/**
     * For datagrams the entire message is available as a single IoBuffer so lets just pass those around by default
     * and try converting whatever they payload is into IoBuffer unless some custom converter is specified
     */
protected void configureDataGramCodecFactory(final String type, final IoService service, final Mina2Configuration configuration) {
    ProtocolCodecFactory codecFactory = configuration.getCodec();
    if (codecFactory == null) {
        codecFactory = new Mina2UdpProtocolCodecFactory(this.getEndpoint().getCamelContext());
        if (LOG.isDebugEnabled()) {
            LOG.debug("{}: Using CodecFactory: {}", new Object[] { type, codecFactory });
        }
    }
    addCodecFactory(service, codecFactory);
}
Also used : ProtocolCodecFactory(org.apache.mina.filter.codec.ProtocolCodecFactory)

Example 3 with ProtocolCodecFactory

use of org.apache.mina.filter.codec.ProtocolCodecFactory in project directory-ldap-api by apache.

the class AbstractCodecServiceTest method setupLdapCodecService.

/**
 * Initialize the codec service
 */
@BeforeClass
public static void setupLdapCodecService() {
    codec = new DefaultLdapCodecService();
    codec.registerProtocolCodecFactory(new ProtocolCodecFactory() {

        public ProtocolEncoder getEncoder(IoSession session) throws Exception {
            return null;
        }

        public ProtocolDecoder getDecoder(IoSession session) throws Exception {
            return null;
        }
    });
    if (LdapApiServiceFactory.isInitialized() == false) {
        LdapApiServiceFactory.initialize(codec);
    }
    encoder = new LdapEncoder(codec);
}
Also used : LdapEncoder(org.apache.directory.api.ldap.codec.api.LdapEncoder) DefaultLdapCodecService(org.apache.directory.api.ldap.codec.osgi.DefaultLdapCodecService) ProtocolCodecFactory(org.apache.mina.filter.codec.ProtocolCodecFactory) ProtocolDecoder(org.apache.mina.filter.codec.ProtocolDecoder) ProtocolEncoder(org.apache.mina.filter.codec.ProtocolEncoder) IoSession(org.apache.mina.core.session.IoSession) BeforeClass(org.junit.BeforeClass)

Example 4 with ProtocolCodecFactory

use of org.apache.mina.filter.codec.ProtocolCodecFactory in project camel by apache.

the class MinaComponent method configureDataGramCodecFactory.

/**
     * For datagrams the entire message is available as a single ByteBuffer so lets just pass those around by default
     * and try converting whatever they payload is into ByteBuffers unless some custom converter is specified
     */
protected void configureDataGramCodecFactory(final String type, final IoServiceConfig config, final MinaConfiguration configuration) {
    ProtocolCodecFactory codecFactory = configuration.getCodec();
    if (codecFactory == null) {
        codecFactory = new MinaUdpProtocolCodecFactory(getCamelContext());
        if (LOG.isDebugEnabled()) {
            LOG.debug("{}: Using CodecFactory: {}", new Object[] { type, codecFactory });
        }
    }
    addCodecFactory(config, codecFactory);
}
Also used : ProtocolCodecFactory(org.apache.mina.filter.codec.ProtocolCodecFactory)

Example 5 with ProtocolCodecFactory

use of org.apache.mina.filter.codec.ProtocolCodecFactory in project directory-ldap-api by apache.

the class DefaultLdapCodecService method registerProtocolCodecFactory.

/**
 * {@inheritDoc}
 */
@Override
public ProtocolCodecFactory registerProtocolCodecFactory(ProtocolCodecFactory protocolCodecFactory) {
    ProtocolCodecFactory oldFactory = this.protocolCodecFactory;
    this.protocolCodecFactory = protocolCodecFactory;
    return oldFactory;
}
Also used : ProtocolCodecFactory(org.apache.mina.filter.codec.ProtocolCodecFactory)

Aggregations

ProtocolCodecFactory (org.apache.mina.filter.codec.ProtocolCodecFactory)5 LdapEncoder (org.apache.directory.api.ldap.codec.api.LdapEncoder)1 DefaultLdapCodecService (org.apache.directory.api.ldap.codec.osgi.DefaultLdapCodecService)1 IoSession (org.apache.mina.core.session.IoSession)1 ProtocolDecoder (org.apache.mina.filter.codec.ProtocolDecoder)1 ProtocolEncoder (org.apache.mina.filter.codec.ProtocolEncoder)1 BeforeClass (org.junit.BeforeClass)1