directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r178104 - /directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/spnego/codec/grammars/SpnegoGrammar.java
Date Tue, 24 May 2005 06:37:45 GMT
Author: elecharny
Date: Mon May 23 23:37:45 2005
New Revision: 178104

URL: http://svn.apache.org/viewcvs?rev=178104&view=rev
Log:
Suppressed the pooling mechanism

Modified:
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/spnego/codec/grammars/SpnegoGrammar.java

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/spnego/codec/grammars/SpnegoGrammar.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/spnego/codec/grammars/SpnegoGrammar.java?rev=178104&r1=178103&r2=178104&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/spnego/codec/grammars/SpnegoGrammar.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/spnego/codec/grammars/SpnegoGrammar.java
Mon May 23 23:37:45 2005
@@ -28,12 +28,9 @@
 import org.apache.asn1.primitives.OctetString;
 import org.apache.asn1.spnego.SpnegoConstants;
 import org.apache.asn1.spnego.codec.SpnegoContainer;
-import org.apache.asn1.spnego.codec.SpnegoPoolEnum;
 import org.apache.asn1.spnego.pojo.SpnegoNegTokenInitPOJO;
 import org.apache.asn1.spnego.pojo.SpnegoNegTokenTargPOJO;
 import org.apache.asn1.spnego.pojo.SpnegoPOJO;
-import org.apache.asn1.util.pools.PoolEnum;
-import org.apache.asn1.util.pools.PoolException;
 
 import org.apache.log4j.Logger;
 
@@ -90,27 +87,15 @@
                 {
                     public void action( IAsn1Container container ) throws DecoderException
                     {
+                        SpnegoContainer spnegoContainer = ( SpnegoContainer ) container;
 
-                        try
-                        {
-
-                            SpnegoContainer spnegoContainer = ( SpnegoContainer ) container;
-
-                            // First, create a empty Spnego POJO
-                            SpnegoPOJO spnegoPOJO = ( SpnegoPOJO )
-                                spnegoContainer.getPoolManager().allocate(
-                                    SpnegoPoolEnum.SPNEGO_NEG_TOKEN_INIT_POJO_POOL );
+                        // First, create a empty Spnego POJO
+                        SpnegoPOJO spnegoPOJO = new SpnegoNegTokenInitPOJO();
 
-                            // Then stores it into the container
-                            spnegoContainer.setSpnego( spnegoPOJO );
+                        // Then stores it into the container
+                        spnegoContainer.setSpnego( spnegoPOJO );
 
-                            return;
-                        }
-                        catch ( PoolException pe )
-                        {
-                            throw new DecoderException(
-                                "Cannot allocate a spnego Pojo : " + pe.getMessage() );
-                        }
+                        return;
                     }
                 } );
 
@@ -357,19 +342,10 @@
                         TLV                    tlv             = spnegoContainer.getCurrentTLV();
 
                         // Creates a new OID, and add it to the mech type list
-                        try
-                        {
-
-                            OID oid = ( OID ) ( spnegoContainer.getPoolManager().allocate(
-                                        PoolEnum.OID_POOL ) );
+                        OID oid = new OID();
 
-                            oid.setOID( tlv.getValue().getData() );
-                            spnego.addMechTypeList( oid );
-                        }
-                        catch ( PoolException pe )
-                        {
-                            throw new DecoderException( "Cannot allocate an OID" );
-                        }
+                        oid.setOID( tlv.getValue().getData() );
+                        spnego.addMechTypeList( oid );
 
                         return;
                     }
@@ -532,29 +508,17 @@
                         TLV                    tlv             = spnegoContainer.getCurrentTLV();
 
                         // Get the req flags and set the flag
-                        try
-                        {
-
-                            BitString bitString = ( BitString ) ( spnegoContainer.getPoolManager()
-                                    .allocate( PoolEnum.BIT_STRING_POOL ) );
-                            bitString.setData( tlv.getValue().getData() );
+                        BitString bitString = new BitString();
+                        bitString.setData( tlv.getValue().getData() );
 
-                            spnego.setReqFlags(bitString.getData()[0]);
-                            spnego.setAnonFlag( bitString.getBit( 0 ) );
-                            spnego.setConfFlag( bitString.getBit( 1 ) );
-                            spnego.setDelegFlag( bitString.getBit( 2 ) );
-                            spnego.setIntegFlag( bitString.getBit( 3 ) );
-                            spnego.setMutualFlag( bitString.getBit( 4 ) );
-                            spnego.setReplayFlag( bitString.getBit( 5 ) );
-                            spnego.setSequenceFlag( bitString.getBit( 6 ) );
-
-                            bitString.free();
-                        }
-                        catch ( PoolException pe )
-                        {
-                            throw new DecoderException( "Cannot allocate a BitString : "
+
-                                pe.getMessage() );
-                        }
+                        spnego.setReqFlags(bitString.getData()[0]);
+                        spnego.setAnonFlag( bitString.getBit( 0 ) );
+                        spnego.setConfFlag( bitString.getBit( 1 ) );
+                        spnego.setDelegFlag( bitString.getBit( 2 ) );
+                        spnego.setIntegFlag( bitString.getBit( 3 ) );
+                        spnego.setMutualFlag( bitString.getBit( 4 ) );
+                        spnego.setReplayFlag( bitString.getBit( 5 ) );
+                        spnego.setSequenceFlag( bitString.getBit( 6 ) );
 
                         return;
                     }
@@ -671,19 +635,9 @@
                         {
 
                             // Creates a new mechToken
-                            try
-                            {
+                            OctetString mechToken = new OctetString();
 
-                                OctetString mechToken = ( OctetString )
-                                    ( spnegoContainer.getPoolManager().allocate(
-                                            PoolEnum.OCTET_STRING_POOL ) );
-
-                                spnego.setMechToken( mechToken );
-                            }
-                            catch ( PoolException pe )
-                            {
-                                throw new DecoderException( "Cannot allocate a MechToken"
);
-                            }
+                            spnego.setMechToken( mechToken );
                         }
 
                         return;
@@ -827,19 +781,9 @@
                         {
 
                             // Creates a new mechListMIC
-                            try
-                            {
+                            OctetString mechListMIC = new OctetString();
 
-                                OctetString mechListMIC = ( OctetString )
-                                    ( spnegoContainer.getPoolManager().allocate(
-                                            PoolEnum.OCTET_STRING_POOL ) );
-
-                                spnego.setMechListMIC( mechListMIC );
-                            }
-                            catch ( PoolException pe )
-                            {
-                                throw new DecoderException( "Cannot allocate a MechListMIC"
);
-                            }
+                            spnego.setMechListMIC( mechListMIC );
                         }
 
                         return;
@@ -885,26 +829,15 @@
                     public void action( IAsn1Container container ) throws DecoderException
                     {
 
-                        try
-                        {
-
-                            SpnegoContainer spnegoContainer = ( SpnegoContainer ) container;
+                        SpnegoContainer spnegoContainer = ( SpnegoContainer ) container;
 
-                            // First, create a empty Spnego POJO
-                            SpnegoPOJO spnegoPOJO = ( SpnegoPOJO )
-                                spnegoContainer.getPoolManager().allocate(
-                                    SpnegoPoolEnum.SPNEGO_NEG_TOKEN_TARG_POJO_POOL );
+                        // First, create a empty Spnego POJO
+                        SpnegoPOJO spnegoPOJO = new SpnegoNegTokenTargPOJO();
 
-                            // Then stores it into the container
-                            spnegoContainer.setSpnego( spnegoPOJO );
+                        // Then stores it into the container
+                        spnegoContainer.setSpnego( spnegoPOJO );
 
-                            return;
-                        }
-                        catch ( PoolException pe )
-                        {
-                            throw new DecoderException(
-                                "Cannot allocate a spnego Pojo : " + pe.getMessage() );
-                        }
+                        return;
                     }
                 } );
 
@@ -1285,19 +1218,10 @@
                         TLV                    tlv             = spnegoContainer.getCurrentTLV();
 
                         // Creates a new OID, and add it to the supported meth
-                        try
-                        {
+                        OID oid = new OID();
 
-                            OID oid = ( OID ) ( spnegoContainer.getPoolManager().allocate(
-                                        PoolEnum.OID_POOL ) );
-
-                            oid.setOID( tlv.getValue().getData() );
-                            spnego.setSupportedMech( oid );
-                        }
-                        catch ( PoolException pe )
-                        {
-                            throw new DecoderException( "Cannot allocate an OID" );
-                        }
+                        oid.setOID( tlv.getValue().getData() );
+                        spnego.setSupportedMech( oid );
 
                         return;
                     }
@@ -1410,18 +1334,9 @@
                             // Create a responseToken
                             // TODO: use the length to allocate the best
                             // OctetString possible.
-                            try
-                            {
-                                OctetString responseToken = ( OctetString )
-                                    ( spnegoContainer.getPoolManager().allocate(
-                                            PoolEnum.OCTET_STRING_POOL ) );
-
-                                spnego.setResponseToken( responseToken );
-                            }
-                            catch ( PoolException pe )
-                            {
-                                throw new DecoderException( "Cannot allocate a responseToken"
);
-                            }
+                            OctetString responseToken = new OctetString();
+
+                            spnego.setResponseToken( responseToken );
                         }
 
                         return;
@@ -1568,18 +1483,9 @@
                             // Create a responseToken
                             // TODO: use the length to allocate the best
                             // OctetString possible.
-                            try
-                            {
-                                OctetString mechListMIC = ( OctetString )
-                                    ( spnegoContainer.getPoolManager().allocate(
-                                            PoolEnum.OCTET_STRING_POOL ) );
-
-                                spnego.setMechListMIC( mechListMIC );
-                            }
-                            catch ( PoolException pe )
-                            {
-                                throw new DecoderException( "Cannot allocate a mechListMIC"
);
-                            }
+                            OctetString mechListMIC = new OctetString();
+
+                            spnego.setMechListMIC( mechListMIC );
                         }
 
                         return;



Mime
View raw message