You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2005/05/24 08:33:17 UTC
svn commit: r178094 - in
/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars:
BindRequestGrammar.java BindResponseGrammar.java LdapResultGrammar.java
Author: elecharny
Date: Mon May 23 23:33:16 2005
New Revision: 178094
URL: http://svn.apache.org/viewcvs?rev=178094&view=rev
Log:
Suppressed the pooling mechanism
Modified:
directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindRequestGrammar.java
directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindResponseGrammar.java
directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapResultGrammar.java
Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindRequestGrammar.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindRequestGrammar.java?rev=178094&r1=178093&r2=178094&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindRequestGrammar.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindRequestGrammar.java Mon May 23 23:33:16 2005
@@ -25,7 +25,6 @@
import org.apache.asn1.ber.tlv.TLV;
import org.apache.asn1.ber.tlv.Value;
import org.apache.asn1.ldap.codec.LdapMessageContainer;
-import org.apache.asn1.ldap.codec.LdapPoolEnum;
import org.apache.asn1.ldap.codec.primitives.LdapDN;
import org.apache.asn1.ldap.codec.primitives.LdapString;
import org.apache.asn1.ldap.codec.utils.IntegerDecoder;
@@ -34,7 +33,6 @@
import org.apache.asn1.ldap.pojo.SaslAuthenticationPOJO;
import org.apache.asn1.ldap.pojo.SimpleAuthenticationPOJO;
import org.apache.asn1.util.MutableString;
-import org.apache.asn1.util.pools.PoolException;
import org.apache.log4j.Logger;
@@ -110,31 +108,19 @@
checkLength( ldapMessage, ldapMessageContainer.getCurrentTLV() );
- try
- {
-
- // Now, we can allocate the BindRequest POJO
- BindRequestPOJO bindRequest = ( BindRequestPOJO )
- ldapMessageContainer.getPoolManager().allocate(
- LdapPoolEnum.BIND_REQUEST_POJO_POOL );
-
- // As this is a new Constructed object, we have to init its length
- TLV tlv = ldapMessageContainer.getCurrentTLV();
- int expectedLength = tlv.getLength().getLength();
-
- bindRequest.setExpectedLength( expectedLength );
- bindRequest.setCurrentLength( 0 );
- bindRequest.setFather( ldapMessage );
+ // Now, we can allocate the BindRequest POJO
+ BindRequestPOJO bindRequest = new BindRequestPOJO();
- // And we associate it to the ldapMessage POJO
- ldapMessage.setProtocolOP( bindRequest );
+ // As this is a new Constructed object, we have to init its length
+ TLV tlv = ldapMessageContainer.getCurrentTLV();
+ int expectedLength = tlv.getLength().getLength();
+
+ bindRequest.setExpectedLength( expectedLength );
+ bindRequest.setCurrentLength( 0 );
+ bindRequest.setFather( ldapMessage );
- }
- catch ( PoolException pe )
- {
- throw new DecoderException(
- "Cannot allocate a BindRequest Pojo : " + pe.getMessage() );
- }
+ // And we associate it to the ldapMessage POJO
+ ldapMessage.setProtocolOP( bindRequest );
}
} );
@@ -249,8 +235,7 @@
TLV tlv = ldapMessageContainer.getCurrentTLV();
- bindRequestMessage.setName( LdapDN.parseDN(
- ldapMessageContainer.getPoolManager(), tlv.getValue().getData() ) );
+ bindRequestMessage.setName( LdapDN.parseDN(tlv.getValue().getData() ) );
return;
}
} );
@@ -289,22 +274,11 @@
// Allocate the Authentication POJO
SimpleAuthenticationPOJO authentication = null;
- try
- {
-
- authentication = ( SimpleAuthenticationPOJO )
- ldapMessageContainer.getPoolManager().allocate(
- LdapPoolEnum.SIMPLE_AUTH_POJO_POOL );
+ authentication = new SimpleAuthenticationPOJO();
- authentication.setFather( bindRequestMessage );
+ authentication.setFather( bindRequestMessage );
- bindRequestMessage.setAuthentication( authentication );
- }
- catch ( PoolException pe )
- {
- throw new DecoderException(
- "Cannot allocate a SimpleAuthentication Pojo : " + pe.getMessage() );
- }
+ bindRequestMessage.setAuthentication( authentication );
// We have to handle the special case of a 0 length simple
if (tlv.getLength().getLength() == 0)
@@ -388,21 +362,11 @@
// Create the SaslAuthentication POJO
SaslAuthenticationPOJO authentication = null;
- try
- {
- authentication = ( SaslAuthenticationPOJO )
- ldapMessageContainer.getPoolManager().allocate(
- LdapPoolEnum.SASL_AUTH_POJO_POOL );
+ authentication = new SaslAuthenticationPOJO();
- authentication.setFather( bindRequestMessage );
+ authentication.setFather( bindRequestMessage );
- bindRequestMessage.setAuthentication( authentication );
- }
- catch ( PoolException pe )
- {
- throw new DecoderException(
- "Cannot allocate a SaslAuthentication Pojo : " + pe.getMessage() );
- }
+ bindRequestMessage.setAuthentication( authentication );
// We have to handle the special case of a 0 length mechanism
if (tlv.getLength().getLength() == 0)
@@ -438,7 +402,6 @@
SaslAuthenticationPOJO saslAuthentication = bindRequestMessage.getSaslAuthentication();
MutableString mechanism = LdapString.parse(
- ldapMessageContainer.getPoolManager(),
ldapMessageContainer.getCurrentTLV().getValue().getData() );
saslAuthentication.setMechanism( mechanism );
Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindResponseGrammar.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindResponseGrammar.java?rev=178094&r1=178093&r2=178094&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindResponseGrammar.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindResponseGrammar.java Mon May 23 23:33:16 2005
@@ -24,10 +24,8 @@
import org.apache.asn1.ber.grammar.IGrammar;
import org.apache.asn1.ber.tlv.TLV;
import org.apache.asn1.ldap.codec.LdapMessageContainer;
-import org.apache.asn1.ldap.codec.LdapPoolEnum;
import org.apache.asn1.ldap.pojo.BindResponsePOJO;
import org.apache.asn1.ldap.pojo.LdapMessagePOJO;
-import org.apache.asn1.util.pools.PoolException;
import org.apache.log4j.Logger;
@@ -94,30 +92,18 @@
checkLength( ldapMessageContainer.getLdapMessage(),
ldapMessageContainer.getCurrentTLV() );
- try
- {
+ // Now, we can allocate the BindRequest POJO
+ BindResponsePOJO bindResponse = new BindResponsePOJO();
- // Now, we can allocate the BindRequest POJO
- BindResponsePOJO bindResponse = ( BindResponsePOJO )
- ldapMessageContainer.getPoolManager().allocate(
- LdapPoolEnum.BIND_RESPONSE_POJO_POOL );
-
- // As this is a new Constructed object, we have to init its length
- TLV tlv = ldapMessageContainer.getCurrentTLV();
- int expectedLength = tlv.getLength().getLength();
- bindResponse.setExpectedLength( expectedLength );
- bindResponse.setCurrentLength( 0 );
- bindResponse.setFather( ldapMessage );
-
- // And we associate it to the ldapMessage POJO
- ldapMessage.setProtocolOP( bindResponse );
-
- }
- catch ( PoolException pe )
- {
- throw new DecoderException(
- "Cannot allocate a BindResponse Pojo : " + pe.getMessage() );
- }
+ // As this is a new Constructed object, we have to init its length
+ TLV tlv = ldapMessageContainer.getCurrentTLV();
+ int expectedLength = tlv.getLength().getLength();
+ bindResponse.setExpectedLength( expectedLength );
+ bindResponse.setCurrentLength( 0 );
+ bindResponse.setFather( ldapMessage );
+
+ // And we associate it to the ldapMessage POJO
+ ldapMessage.setProtocolOP( bindResponse );
}
} );
Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapResultGrammar.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapResultGrammar.java?rev=178094&r1=178093&r2=178094&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapResultGrammar.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapResultGrammar.java Mon May 23 23:33:16 2005
@@ -25,7 +25,6 @@
import org.apache.asn1.ber.tlv.TLV;
import org.apache.asn1.ber.tlv.Value;
import org.apache.asn1.ldap.codec.LdapMessageContainer;
-import org.apache.asn1.ldap.codec.LdapPoolEnum;
import org.apache.asn1.ldap.codec.primitives.LdapDN;
import org.apache.asn1.ldap.codec.primitives.LdapString;
import org.apache.asn1.ldap.codec.utils.IntegerDecoder;
@@ -34,7 +33,6 @@
import org.apache.asn1.ldap.pojo.LdapMessagePOJO;
import org.apache.asn1.ldap.pojo.LdapResultPOJO;
import org.apache.asn1.util.MutableString;
-import org.apache.asn1.util.pools.PoolException;
import org.apache.log4j.Logger;
@@ -102,17 +100,8 @@
// We have to allocate a LdapResultPOJO now
LdapResultPOJO ldapResult = null;
- try
- {
- ldapResult = ( LdapResultPOJO ) ( ldapMessageContainer.getPoolManager()
- .allocate( LdapPoolEnum.LDAP_RESULT_POJO_POOL ) );
- bindResponse.setLdapResult( ldapResult );
- }
- catch ( PoolException pe )
- {
- throw new DecoderException(
- "Cannot allocate a LdapResult Pojo : " + pe.getMessage() );
- }
+ ldapResult = new LdapResultPOJO();
+ bindResponse.setLdapResult( ldapResult );
TLV tlv = ldapMessageContainer.getCurrentTLV();
@@ -314,7 +303,7 @@
TLV tlv = ldapMessageContainer.getCurrentTLV();
MutableString matchedDN = LdapDN.parseDN(
- ldapMessageContainer.getPoolManager(), tlv.getValue().getData() );
+ tlv.getValue().getData() );
ldapResult.setMatchedDN( matchedDN );
return;
}
@@ -383,7 +372,7 @@
TLV tlv = ldapMessageContainer.getCurrentTLV();
MutableString errorMessage = LdapString.parse(
- ldapMessageContainer.getPoolManager(), tlv.getValue().getData() );
+ tlv.getValue().getData() );
ldapResult.setErrorMessage( errorMessage );
return;
}
@@ -518,7 +507,7 @@
ldapMessageContainer.getCurrentTLV();
MutableString referral = LdapString.parse(
- ldapMessageContainer.getPoolManager(), tlv.getValue().getData() );
+ tlv.getValue().getData() );
ldapResult.addReferral( referral );
}
} );