directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r582712 [3/3] - in /directory: apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/ apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ apacheds/branches/bigbang...
Date Mon, 08 Oct 2007 05:54:47 GMT
Modified: directory/shared/branches/bigbang/asn1-codec/src/main/java/org/apache/directory/shared/asn1/codec/Asn1CodecEncoder.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/asn1-codec/src/main/java/org/apache/directory/shared/asn1/codec/Asn1CodecEncoder.java?rev=582712&r1=582711&r2=582712&view=diff
==============================================================================
--- directory/shared/branches/bigbang/asn1-codec/src/main/java/org/apache/directory/shared/asn1/codec/Asn1CodecEncoder.java
(original)
+++ directory/shared/branches/bigbang/asn1-codec/src/main/java/org/apache/directory/shared/asn1/codec/Asn1CodecEncoder.java
Sun Oct  7 22:54:38 2007
@@ -19,11 +19,11 @@
  */
 package org.apache.directory.shared.asn1.codec;
 
+
 import java.util.Collection;
 import java.util.Enumeration;
 import java.util.Iterator;
 
-import org.apache.directory.shared.asn1.codec.EncoderException;
 import org.apache.directory.shared.asn1.codec.stateful.EncoderCallback;
 import org.apache.directory.shared.asn1.codec.stateful.StatefulEncoder;
 import org.apache.mina.common.ByteBuffer;
@@ -31,6 +31,7 @@
 import org.apache.mina.filter.codec.ProtocolEncoder;
 import org.apache.mina.filter.codec.ProtocolEncoderOutput;
 
+
 /**
  * Adapts {@link StatefulEncoder} to MINA <tt>ProtocolEncoder</tt>
  * 
@@ -40,30 +41,33 @@
 public class Asn1CodecEncoder implements ProtocolEncoder
 {
     private final StatefulEncoder encoder;
-
     private final EncoderCallbackImpl callback = new EncoderCallbackImpl();
 
+
     public Asn1CodecEncoder( StatefulEncoder encoder )
     {
         encoder.setCallback( callback );
         this.encoder = encoder;
     }
 
-    public void encode( IoSession session, Object message,
-                        ProtocolEncoderOutput out ) throws EncoderException
+
+    public void encode( IoSession session, Object message, ProtocolEncoderOutput out ) throws
EncoderException
     {
         callback.encOut = out;
         encoder.encode( message );
     }
 
+
     public void dispose( IoSession session ) throws Exception
     {
     }
 
+
     private class EncoderCallbackImpl implements EncoderCallback
     {
         private ProtocolEncoderOutput encOut;
 
+
         public void encodeOccurred( StatefulEncoder codec, Object encoded )
         {
             if( encoded instanceof java.nio.ByteBuffer )
@@ -76,9 +80,9 @@
             else if( encoded instanceof Object[] )
             {
                 Object[] bufArray = ( Object[] ) encoded;
-                for( int i = 0; i < bufArray.length; i ++ )
+                for ( Object buf : bufArray )
                 {
-                    this.encodeOccurred( codec, bufArray[ i ] );
+                    this.encodeOccurred( codec, buf );
                 }
 
                 encOut.mergeAll();
@@ -95,10 +99,9 @@
             }
             else if( encoded instanceof Collection )
             {
-                Iterator it = ( ( Collection ) encoded ).iterator();
-                while( it.hasNext() )
+                for ( Object o : ( ( Collection ) encoded ) )
                 {
-                    this.encodeOccurred( codec, it.next() );
+                    this.encodeOccurred( codec, o );
                 }
                 
                 encOut.mergeAll();

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java?rev=582712&r1=582711&r2=582712&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java
(original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java
Sun Oct  7 22:54:38 2007
@@ -20,12 +20,9 @@
 package org.apache.directory.shared.ldap.codec;
 
 
-import java.util.HashSet;
-import java.util.Set;
-
 import org.apache.directory.shared.asn1.ber.AbstractContainer;
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.ldap.message.spi.BinaryAttributeDetector;
 
 
 /**
@@ -43,9 +40,9 @@
     /** The ldap message */
     private LdapMessage ldapMessage;
 
-    /** A HashSet which contaons the binary attributes */
-    private Set binaries;
-    
+    /** checks if attribute is binary */
+    private final BinaryAttributeDetector binaryAttributeDetector;
+
     /** The message ID */
     private int messageId;
     
@@ -61,22 +58,29 @@
      */
     public LdapMessageContainer()
     {
-        this( new HashSet() );
+        this( new BinaryAttributeDetector()
+        {
+            public boolean isBinary( String attributeId ) 
+            {
+                return false;
+            }
+        });
     }
 
 
     /**
      * Creates a new LdapMessageContainer object. We will store ten grammars,
      * it's enough ...
+     *
+     * @param binaryAttributeDetector checks if an attribute is binary
      */
-    public LdapMessageContainer( Set binaries )
+    public LdapMessageContainer( BinaryAttributeDetector binaryAttributeDetector )
     {
         super();
-        stateStack = new int[10];
-        grammar = LdapMessageGrammar.getInstance();
-        states = LdapStatesEnum.getInstance();
-
-        this.binaries = binaries;
+        this.stateStack = new int[10];
+        this.grammar = LdapMessageGrammar.getInstance();
+        this.states = LdapStatesEnum.getInstance();
+        this.binaryAttributeDetector = binaryAttributeDetector;
     }
 
 
@@ -115,10 +119,11 @@
 
     /**
      * @return Returns true if the attribute is binary.
+     * @param id checks if an attribute id is binary
      */
     public boolean isBinary( String id )
     {
-        return binaries.contains( StringTools.lowerCaseAscii( StringTools.trim( id ) ) );
+        return binaryAttributeDetector.isBinary( id );
     }
 
     /**
@@ -131,6 +136,7 @@
 
     /**
      * Set the message ID
+     * @param messageId the id of the message
      */
     public void setMessageId( int messageId )
     {

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixDecoder.java?rev=582712&r1=582711&r2=582712&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixDecoder.java
(original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixDecoder.java
Sun Oct  7 22:54:38 2007
@@ -20,23 +20,23 @@
 package org.apache.directory.shared.ldap.codec;
 
 
-import java.io.InputStream;
-import java.nio.ByteBuffer;
-import java.util.Set;
-
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.tlv.TLVStateEnum;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.codec.stateful.DecoderCallback;
 import org.apache.directory.shared.asn1.codec.stateful.DecoderMonitor;
+import org.apache.directory.shared.ldap.message.spi.BinaryAttributeDetector;
 import org.apache.directory.shared.ldap.message.spi.Provider;
 import org.apache.directory.shared.ldap.message.spi.ProviderDecoder;
 import org.apache.directory.shared.ldap.message.spi.ProviderException;
 import org.apache.directory.shared.ldap.util.StringTools;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.InputStream;
+import java.nio.ByteBuffer;
+
+
 /**
  * The TwixDecoder decodes ASN.1 BER encoded PDUs.
  * 
@@ -44,10 +44,6 @@
  */
 public class TwixDecoder implements ProviderDecoder
 {
-    //TM private static long cumul = 0L;
-    //TM private static long count = 0L;
-    //TM private Object lock = new Object();
-
     /** The logger */
     private static Logger log = LoggerFactory.getLogger( TwixDecoder.class );
 
@@ -71,13 +67,13 @@
      * Creates an instance of a Twix Decoder implementation.
      * 
      * @param provider the owning provider.
-     * @param binaries The binary attributes set
+     * @param binaryAttributeDetector checks for binary attributes 
      */
-    public TwixDecoder(Provider provider, Set binaries)
+    public TwixDecoder( Provider provider, BinaryAttributeDetector binaryAttributeDetector
)
     {
         this.provider = provider;
-        ldapMessageContainer = new LdapMessageContainer( binaries );
-        ldapDecoder = new LdapDecoder();
+        this.ldapMessageContainer = new LdapMessageContainer( binaryAttributeDetector );
+        this.ldapDecoder = new LdapDecoder();
     }
 
 
@@ -85,11 +81,10 @@
      * Decodes a PDU
      * 
      * @param encoded The PDU containing the LdapMessage to decode
-     * @throws DecoderExceptionIf anything went wrong
+     * @throws DecoderException if anything goes wrong
      */
     public void decode( Object encoded ) throws DecoderException
     {
-        //TM long t0 = System.nanoTime();
         ByteBuffer buf;
         int position = 0;
 
@@ -141,30 +136,7 @@
                     }
     
                     decoderCallback.decodeOccurred( null, ldapMessageContainer.getLdapMessage()
);
-
                     ldapMessageContainer.clean();
-                    //TM long t1 = System.nanoTime();
-                    //TM
-                    //TM synchronized (lock)
-                    //TM {
-                    //TM     cumul += (t1 - t0);
-                    //TM     count++;
-                    //TM    
-                    //TM
-                    //TM     if ( count % 1000L == 0)
-                    //TM     {
-                    //TM         System.out.println( "Decode cost : " + (cumul/count) );
-                    //TM         cumul = 0L;
-                    //TM     }
-                    //TM }
-                    
-                }
-                else
-                {
-                	if ( IS_DEBUG )
-                	{
-                		
-                	}
                 }
             }
             catch ( DecoderException de )
@@ -241,6 +213,7 @@
             {
                 log.error( "Twix decoder failure, PDU does not contain enough data" );
                 ProviderException pe = new ProviderException( provider, "Twix decoder failure!"
);
+                //noinspection ThrowableInstanceNeverThrown
                 pe.addThrowable( new DecoderException( "The input stream does not contain
a full PDU" ) );
                 throw pe;
             }
@@ -280,6 +253,7 @@
             {
                 log.error( "Twix decoder failure : The input stream does not contain a full
PDU" );
                 ProviderException pe = new ProviderException( provider, "Twix decoder failure!"
);
+                //noinspection ThrowableInstanceNeverThrown
                 pe.addThrowable( new DecoderException( "The input stream does not contain
a full PDU" ) );
                 throw pe;
             }

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixProvider.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixProvider.java?rev=582712&r1=582711&r2=582712&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixProvider.java
(original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixProvider.java
Sun Oct  7 22:54:38 2007
@@ -20,15 +20,7 @@
 package org.apache.directory.shared.ldap.codec;
 
 
-import java.util.Set;
-
-import org.apache.directory.shared.ldap.codec.TwixDecoder;
-import org.apache.directory.shared.ldap.codec.TwixEncoder;
-import org.apache.directory.shared.ldap.message.spi.Provider;
-import org.apache.directory.shared.ldap.message.spi.ProviderDecoder;
-import org.apache.directory.shared.ldap.message.spi.ProviderEncoder;
-import org.apache.directory.shared.ldap.message.spi.ProviderException;
-import org.apache.directory.shared.ldap.message.spi.TransformerSpi;
+import org.apache.directory.shared.ldap.message.spi.*;
 
 
 /**
@@ -62,7 +54,7 @@
      * 
      * @return the singleton SnaccProvider instance
      */
-    public synchronized static Provider getProvider()
+    public static synchronized Provider getProvider()
     {
         if ( singleton == null )
         {
@@ -93,9 +85,9 @@
      * @throws org.apache.directory.shared.ldap.message.spi.ProviderException
      *             if the provider or its decoder cannot be found
      */
-    public ProviderDecoder getDecoder( Set binaries ) throws ProviderException
+    public ProviderDecoder getDecoder( BinaryAttributeDetector binaryAttributeDetector )
throws ProviderException
     {
-        return new TwixDecoder( this, binaries );
+        return new TwixDecoder( this, binaryAttributeDetector );
     }
 
 

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageDecoder.java?rev=582712&r1=582711&r2=582712&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageDecoder.java
(original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageDecoder.java
Sun Oct  7 22:54:38 2007
@@ -20,25 +20,19 @@
 package org.apache.directory.shared.ldap.message;
 
 
-import java.io.InputStream;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Set;
-
 import org.apache.directory.shared.asn1.Asn1Object;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.codec.stateful.DecoderCallback;
 import org.apache.directory.shared.asn1.codec.stateful.DecoderMonitor;
 import org.apache.directory.shared.asn1.codec.stateful.StatefulDecoder;
 import org.apache.directory.shared.ldap.codec.ResponseCarryingException;
-import org.apache.directory.shared.ldap.constants.JndiPropertyConstants;
+import org.apache.directory.shared.ldap.message.spi.BinaryAttributeDetector;
 import org.apache.directory.shared.ldap.message.spi.Provider;
 import org.apache.directory.shared.ldap.message.spi.ProviderDecoder;
 import org.apache.directory.shared.ldap.message.spi.TransformerSpi;
-import org.apache.directory.shared.ldap.util.StringTools;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+
+import java.io.InputStream;
+import java.util.Hashtable;
 
 
 /**
@@ -50,15 +44,6 @@
  */
 public final class MessageDecoder implements ProviderDecoder
 {
-    private static final Logger log = LoggerFactory.getLogger( MessageDecoder.class );
-
-    private static final String BINARY_KEY = JndiPropertyConstants.JNDI_LDAP_ATTRIBUTES_BINARY;
-    
-    private final static Set<String> EMPTY_SET_STRING = new HashSet<String>();
-
-    /** Environment parameters stored here */
-    private final Hashtable<String, Object> env;
-
     /** the ASN.1 provider */
     private final Provider provider;
 
@@ -76,79 +61,16 @@
      * Creates a MessageDecoder using default properties for enabling a BER
      * library provider.
      * 
-     * @param env
-     *            The Map of environment parameters.
-     * @throws MessageException
-     *             if there is a problem creating this decoder.
+     * @param binaryAttributeDetector detects whether or not an attribute is binary
+     * @throws MessageException if there is a problem creating this decoder.
      */
-    public MessageDecoder(final Hashtable<String, Object> env) throws MessageException
+    public MessageDecoder( BinaryAttributeDetector binaryAttributeDetector ) throws MessageException
     {
-        this.env = ( Hashtable<String, Object> ) env.clone();
-        
         // We need to get the encoder class name
         Hashtable providerEnv = Provider.getEnvironment();
         
-        this.env.put( Provider.BERLIB_PROVIDER, providerEnv.get( Provider.BERLIB_PROVIDER
) );
         this.provider = Provider.getProvider( providerEnv );
-
-        Set<String> binaries;
-
-        if ( env.containsKey( BINARY_KEY ) )
-        {
-            Object val = env.get( BINARY_KEY );
-
-            if ( val == null )
-            {
-                if ( log.isWarnEnabled() )
-                {
-                    log.warn( "Null value for " + BINARY_KEY + " key in environment.  Using
empty set for binaries." );
-                }
-                
-                binaries = EMPTY_SET_STRING;
-            }
-            else if ( val instanceof String )
-            {
-                // parse out all words based on expected JNDI format of this
-                // attribute
-                String binaryIds = ( String ) val;
-                binaries = new HashSet<String>();
-
-                if ( !StringTools.isEmpty( binaryIds ) )
-                {
-                    String[] binaryArray = binaryIds.split( " " );
-
-                    for ( String binary:binaryArray )
-                    {
-                        binaries.add( StringTools.lowerCaseAscii( StringTools.trim( binary
) ) );
-                    }
-                }
-            } // if already parsed and set as a collection use it
-            else if ( val instanceof Collection )
-            {
-                binaries = new HashSet<String>();
-                binaries.addAll( ( Set<String> ) val );
-            } // complain if it's something else
-            else
-            {
-                if ( log.isWarnEnabled() )
-                {
-                    log.warn( "Unrecognized value for " + BINARY_KEY
-                        + " key in environment.  Using empty set for binaries." );
-                }
-                
-                binaries = EMPTY_SET_STRING;
-            }
-        }
-        else
-        {
-            if ( log.isWarnEnabled() )
-            {
-                log.warn( "Could not find " + BINARY_KEY + " key in environment.  Using empty
set for binaries." );
-            }
-            binaries = EMPTY_SET_STRING;
-        }
-
-        this.decoder = this.provider.getDecoder( binaries );
+        this.decoder = this.provider.getDecoder( binaryAttributeDetector );
         this.transformer = this.provider.getTransformer();
         this.decoder.setCallback( new DecoderCallback()
         {
@@ -202,14 +124,13 @@
                 }
             }
         }
-        catch (Exception e) 
+        catch ( Exception e )
         {
-            throw (MessageException)e;
+            throw ( MessageException ) e;
         }
 
         // Call on transformer to convert stub based PDU into Message based PDU
-        Message message = transformer.transform( providerEnvelope );
-        return message;
+        return transformer.transform( providerEnvelope );
     }
 
 

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageEncoder.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageEncoder.java?rev=582712&r1=582711&r2=582712&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageEncoder.java
(original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/MessageEncoder.java
Sun Oct  7 22:54:38 2007
@@ -22,7 +22,6 @@
 
 import java.io.OutputStream;
 import java.nio.ByteBuffer;
-import java.util.Hashtable;
 
 import org.apache.directory.shared.asn1.codec.EncoderException;
 import org.apache.directory.shared.asn1.codec.stateful.EncoderCallback;
@@ -56,12 +55,9 @@
      * Creates a MessageEncoder using default properties for enabling a BER
      * library provider.
      * 
-     * @param env
-     *            The Map of environment parameters.
-     * @throws MessageException
-     *             if the encoder cannot be created.
+     * @throws MessageException if the encoder cannot be created.
      */
-    public MessageEncoder(final Hashtable env) throws MessageException
+    public MessageEncoder() throws MessageException
     {
         this.provider = Provider.getProvider( Provider.getEnvironment() );
         this.encoder = provider.getEncoder();

Added: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/spi/BinaryAttributeDetector.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/spi/BinaryAttributeDetector.java?rev=582712&view=auto
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/spi/BinaryAttributeDetector.java
(added)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/spi/BinaryAttributeDetector.java
Sun Oct  7 22:54:38 2007
@@ -0,0 +1,38 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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 implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.directory.shared.ldap.message.spi;
+
+import javax.naming.NamingException;
+
+
+/**
+ * An interface used to abstract the means to detect whether or not an attribute
+ * identifier/descriptor represents a binary attributeType.
+ */
+public interface BinaryAttributeDetector
+{
+    /**
+     * Returns true if the attribute specified is not human readible.
+     *
+     * @param attributeId the identifier/descriptor for the attribute to be checked.
+     * @return true if the attribute specified is not human readible, false otherwise
+     */
+    boolean isBinary( String attributeId );
+}

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/spi/Provider.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/spi/Provider.java?rev=582712&r1=582711&r2=582712&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/spi/Provider.java
(original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/spi/Provider.java
Sun Oct  7 22:54:38 2007
@@ -25,7 +25,6 @@
 
 import java.util.Properties;
 import java.util.Hashtable;
-import java.util.Set;
 
 
 /**
@@ -55,7 +54,7 @@
         + System.getProperty( "java.home" ) + "\n\tjava.class.path = " + System.getProperty(
"java.class.path" );
 
     /** Use the no-op monitor by default unless we find something else */
-    private static ProviderMonitor monitor = null;
+    private static ProviderMonitor monitor;
 
     static
     {
@@ -127,7 +126,7 @@
      * @param vendor
      *            the berlib vendor used by the provider
      */
-    protected Provider(String name, String vendor)
+    protected Provider( String name, String vendor )
     {
         this.name = name;
         this.vendor = vendor;
@@ -175,10 +174,11 @@
      * Gets the decoder associated with this provider.
      * 
      * @return the provider's decoder.
-     * @throws ProviderException
-     *             if the provider or its decoder cannot be found
+     * @throws ProviderException if the provider or its decoder cannot be found
+     * @param binaryAttributeDetector detects whether or not attributes are binary
      */
-    public abstract ProviderDecoder getDecoder( Set binaries ) throws ProviderException;
+    public abstract ProviderDecoder getDecoder( BinaryAttributeDetector binaryAttributeDetector
)
+            throws ProviderException;
 
 
     /**
@@ -195,6 +195,7 @@
     // Factory/Environment Methods
     // ------------------------------------------------------------------------
 
+    
     /**
      * Gets an instance of the configured Provider. The configured provider is
      * the classname specified by the <code>asn.1.berlib.provider</code>
@@ -219,16 +220,16 @@
      * property value. The property is searched for within properties object
      * passed in as a parameter for this method only.
      * 
-     * @param a_env
+     * @param env
      *            the environment used to locate the provider
      * @return a singleton instance of the ASN.1 BER Library Provider
      * @throws ProviderException
      *             if the provider cannot be found
      */
-    public static Provider getProvider( Hashtable a_env ) throws ProviderException
+    public static Provider getProvider( Hashtable env ) throws ProviderException
     {
         Provider provider;
-        String className = ( String ) a_env.get( BERLIB_PROVIDER );
+        String className = ( String ) env.get( BERLIB_PROVIDER );
 
         // --------------------------------------------------------------------
         // Check for a valid property value
@@ -296,7 +297,6 @@
         Properties env = new Properties();
         env.setProperty( BERLIB_PROVIDER, DEFAULT_PROVIDER );
         monitor.usingDefaults( USING_DEFAULTS_MSG, env );
-
         return env;
     }
 }



Mime
View raw message