org.apache.mina.filter.codec.ProtocolCodecFactory Java Examples

The following examples show how to use org.apache.mina.filter.codec.ProtocolCodecFactory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HackedProtocolCodecFilter.java    From sailfish-core with Apache License 2.0 5 votes vote down vote up
/**
 *
 * Creates a new instance of ProtocolCodecFilter, associating a factory
 * for the creation of the encoder and decoder.
 *
 * @param factory The associated factory
 */
public HackedProtocolCodecFilter(ProtocolCodecFactory factory) {
    if (factory == null) {
        throw new IllegalArgumentException("factory");
    }

    this.factory = factory;
}
 
Example #2
Source File: DefaultLdapCodecService.java    From directory-ldap-api with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public ProtocolCodecFactory registerProtocolCodecFactory( ProtocolCodecFactory protocolCodecFactory )
{
    ProtocolCodecFactory oldFactory = this.protocolCodecFactory;
    this.protocolCodecFactory = protocolCodecFactory;
    return oldFactory;
}
 
Example #3
Source File: StandaloneLdapApiService.java    From directory-ldap-api with Apache License 2.0 4 votes vote down vote up
/**
 * Creates a new instance of StandaloneLdapApiService.
 *
 * @param requestControls The list of request controls to store
 * @param responseControls The list of response controls to store
 * @param extendedOperations The list of extended operations to store
 * @param intermediateResponses The list of intermediate responsess to store
 * @throws Exception If we had an issue with one of the two lists
 */
public StandaloneLdapApiService( List<String> requestControls, 
    List<String> responseControls, List<String> extendedOperations,
    List<String> intermediateResponses ) throws Exception
{
    StockCodecFactoryUtil.loadStockControls( this );
    ExtrasCodecFactoryUtil.loadExtrasControls( this );
    ExtrasCodecFactoryUtil.loadExtrasExtendedOperations( this );
    ExtrasCodecFactoryUtil.loadExtrasIntermediateResponses( this );

    // Load the controls
    loadControls( requestControls, getRequestControlFactories() );
    loadControls( responseControls, getResponseControlFactories() );

    // Load the extended operations
    loadExtendedOperations( extendedOperations );

    // Load the extended operations
    loadIntermediateResponse( intermediateResponses );

    if ( getProtocolCodecFactory() == null )
    {
        try
        {
            @SuppressWarnings("unchecked")
            Class<? extends ProtocolCodecFactory> clazz = ( Class<? extends ProtocolCodecFactory> )
                Class.forName( DEFAULT_PROTOCOL_CODEC_FACTORY );
            Constructor<? extends ProtocolCodecFactory> constructor =
                clazz.getConstructor( LdapApiService.class );

            if ( constructor != null )
            {
                setProtocolCodecFactory( constructor.newInstance( this ) );
            }
            else
            {
                setProtocolCodecFactory( clazz.newInstance() );
            }
        }
        catch ( Exception cause )
        {
            throw new RuntimeException( I18n.err( I18n.ERR_06000_FAILED_TO_LOAD_DEFAULT_CODEC_FACTORY ), cause );
        }
    }
}
 
Example #4
Source File: DefaultLdapCodecService.java    From directory-ldap-api with Apache License 2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public ProtocolCodecFactory getProtocolCodecFactory()
{
    return protocolCodecFactory;
}
 
Example #5
Source File: DefaultLdapCodecService.java    From directory-ldap-api with Apache License 2.0 4 votes vote down vote up
/**
 * @param protocolCodecFactory the protocolCodecFactory to set
 */
public void setProtocolCodecFactory( ProtocolCodecFactory protocolCodecFactory )
{
    this.protocolCodecFactory = protocolCodecFactory;
}
 
Example #6
Source File: LdapServer.java    From MyVirtualDirectory with Apache License 2.0 4 votes vote down vote up
public ProtocolCodecFactory getProtocolCodecFactory()
{
    return codecFactory;
}
 
Example #7
Source File: LdapServer.java    From MyVirtualDirectory with Apache License 2.0 4 votes vote down vote up
public ProtocolCodecFactory getProtocolCodecFactory()
{
    return codecFactory;
}
 
Example #8
Source File: TcpServer.java    From game-server with MIT License 2 votes vote down vote up
/**
 * <p>Constructor for TcpServer.</p>
 *
 * @param minaServerConfig a {@link com.jzy.game.engine.mina.config.MinaServerConfig} object.
 * @param ioHandler a {@link org.apache.mina.core.service.IoHandler} object.
 * @param factory a {@link org.apache.mina.filter.codec.ProtocolCodecFactory} object.
 */
public TcpServer(MinaServerConfig minaServerConfig, IoHandler ioHandler, ProtocolCodecFactory factory) {
    this(minaServerConfig, ioHandler);
    this.factory = factory;
}
 
Example #9
Source File: TcpServer.java    From game-server with MIT License 2 votes vote down vote up
/**
 * <p>Constructor for TcpServer.</p>
 *
 * @param minaServerConfig a {@link com.jzy.game.engine.mina.config.MinaServerConfig} object.
 * @param ioHandler a {@link org.apache.mina.core.service.IoHandler} object.
 * @param factory a {@link org.apache.mina.filter.codec.ProtocolCodecFactory} object.
 * @param filters 不要包含消息解码、线程池过滤器,已默认添加
 */
public TcpServer(MinaServerConfig minaServerConfig, IoHandler ioHandler, ProtocolCodecFactory factory,
                 Map<String, IoFilter> filters) {
    this(minaServerConfig, ioHandler, factory);
    this.filters = filters;
}
 
Example #10
Source File: LdapApiService.java    From directory-ldap-api with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a new LDAP {@link ProtocolCodecFactory}.
 *
 * @return the {@link ProtocolCodecFactory}
 */
ProtocolCodecFactory getProtocolCodecFactory();
 
Example #11
Source File: LdapApiService.java    From directory-ldap-api with Apache License 2.0 2 votes vote down vote up
/**
 * Registers a ProtocolCodecFactory with this LdapCodecService.
 *
 * @param factory The factory being registered.
 * @return The previously set {@link ProtocolCodecFactory}, or null if
 * none had been set earlier.
 */
ProtocolCodecFactory registerProtocolCodecFactory( ProtocolCodecFactory factory );