Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 29899 invoked from network); 25 Apr 2005 20:32:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 25 Apr 2005 20:32:58 -0000 Received: (qmail 2380 invoked by uid 500); 25 Apr 2005 20:33:31 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 2334 invoked by uid 500); 25 Apr 2005 20:33:30 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 2320 invoked by uid 99); 25 Apr 2005 20:33:30 -0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Mon, 25 Apr 2005 13:33:30 -0700 Received: (qmail 29860 invoked by uid 65534); 25 Apr 2005 20:32:56 -0000 Message-ID: <20050425203256.29857.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: svn commit: r164640 - /directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/LdapDecoder.java Date: Mon, 25 Apr 2005 20:32:55 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.0-dev X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: elecharny Date: Mon Apr 25 13:32:55 2005 New Revision: 164640 URL: http://svn.apache.org/viewcvs?rev=3D164640&view=3Drev Log: Added this class to do the Ldap pools initialization Added: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/co= dec/LdapDecoder.java Added: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap= /codec/LdapDecoder.java URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/s= rc/java/org/apache/asn1/ldap/codec/LdapDecoder.java?rev=3D164640&view=3Dauto =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/co= dec/LdapDecoder.java (added) +++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/co= dec/LdapDecoder.java Mon Apr 25 13:32:55 2005 @@ -0,0 +1,89 @@ +/* + * Copyright 2005 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or impli= ed. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.asn1.ldap.codec; + +import org.apache.asn1.ber.Asn1Decoder; +import org.apache.asn1.ber.tlv.TLVFactory; +import org.apache.asn1.ber.tlv.TLVPoolEnum; +import org.apache.asn1.ldap.pojo.factories.BindRequestPOJOFactory; +import org.apache.asn1.ldap.pojo.factories.BindResponsePOJOFactory; +import org.apache.asn1.ldap.pojo.factories.LdapMessagePOJOFactory; +import org.apache.asn1.ldap.pojo.factories.LdapResultPOJOFactory; +import org.apache.asn1.ldap.pojo.factories.SaslAuthenticationPOJOFactory; +import org.apache.asn1.ldap.pojo.factories.SimpleAuthenticationPOJOFactory; +import org.apache.asn1.util.MutableString1024Factory; +import org.apache.asn1.util.MutableString128Factory; +import org.apache.asn1.util.MutableString16Factory; +import org.apache.asn1.util.MutableString256Factory; +import org.apache.asn1.util.MutableString32Factory; +import org.apache.asn1.util.MutableString512Factory; +import org.apache.asn1.util.MutableString64Factory; +import org.apache.asn1.util.MutableStringFactory; +import org.apache.asn1.util.pools.LocalPoolManager; +import org.apache.asn1.util.pools.PoolEnum; + +/** + * The Ldap decoder. This class does the initialisation of the object's po= ols. + * @author Apache Directory Pr= oject + */ +public class LdapDecoder extends Asn1Decoder { + =20 + /** + * Standard LdapDecoder constructor. The decoder will + * be pooled. + * + */ + public LdapDecoder() + { + this(true); + } + =20 + /** + * LdapDecoder constructor. + *=20 + * @param isPooled Tells if the objects are allocated or pooled.=20 + */ + public LdapDecoder(boolean isPooled) + { + // We have to create the pools, which are MutableString + // pools. We will initialize 60 pools, because we will + // use TLV pools, String pools and Ldap pools + poolMgr =3D new LocalPoolManager( 60, true ); + + // Standard ASN.1 pools + poolMgr.initPool(TLVPoolEnum.TLV_POOL, new TLVFactory(), 1024, 102= 40); + =20 + // String pools + poolMgr.initPool(PoolEnum.STRING_POOL_16, new MutableString16Facto= ry(), 1024, 1024); + poolMgr.initPool(PoolEnum.STRING_POOL_32, new MutableString32Facto= ry(), 1024, 1024); + poolMgr.initPool(PoolEnum.STRING_POOL_64, new MutableString64Facto= ry(), 1024, 1024); + poolMgr.initPool(PoolEnum.STRING_POOL_128, new MutableString128Fac= tory(), 1024, 1024); + poolMgr.initPool(PoolEnum.STRING_POOL_256, new MutableString256Fac= tory(), 1024, 1024); + poolMgr.initPool(PoolEnum.STRING_POOL_512, new MutableString512Fac= tory(), 1024, 1024); + poolMgr.initPool(PoolEnum.STRING_POOL_1024, new MutableString1024F= actory(), 1024, 1024); + poolMgr.initPool(PoolEnum.STREAMED_STRING_POOL, new MutableStringF= actory(), 1024, 1024); + =20 + // Ldap pools + poolMgr.initPool(LdapPoolEnum.SIMPLE_AUTH_POJO_POOL, new SimpleAut= henticationPOJOFactory(), 1024, 1024); + poolMgr.initPool(LdapPoolEnum.SASL_AUTH_POJO_POOL, new SaslAuthent= icationPOJOFactory(), 1024, 1024); + poolMgr.initPool(LdapPoolEnum.BIND_RESPONSE_POJO_POOL, new BindRes= ponsePOJOFactory(), 1024, 1024); + poolMgr.initPool(LdapPoolEnum.BIND_REQUEST_POJO_POOL, new BindRequ= estPOJOFactory(), 1024, 1024); + poolMgr.initPool(LdapPoolEnum.LDAP_MESSAGE_CONTAINER_POOL, new Lda= pMessageContainerFactory(), 1024, 1024); + poolMgr.initPool(LdapPoolEnum.LDAP_MESSAGE_POJO_POOL, new LdapMess= agePOJOFactory(), 1024, 1024); + poolMgr.initPool(LdapPoolEnum.LDAP_RESULT_POJO_POOL, new LdapResul= tPOJOFactory(), 1024, 1024); + } +}