directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Seelmann <seelm...@apache.org>
Subject Re: svn commit: r1063987 - in /directory: apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ apacheds/trunk/core/src/main/java/org/
Date Sat, 29 Jan 2011 22:13:03 GMT
On Thu, Jan 27, 2011 at 5:50 AM,  <akarasulu@apache.org> wrote:
> Author: akarasulu
> Date: Thu Jan 27 04:50:03 2011
> New Revision: 1063987
>
> URL: http://svn.apache.org/viewvc?rev=1063987&view=rev
> Log:
> cleaned up control codec classes after changes in ManageDsaIT control classes
...
> -public class ManageDsaIT extends BasicControlImpl
> +public interface ManageDsaIT extends Control
>  {
>     /** This control OID */
> -    public static final String OID = "2.16.840.1.113730.3.4.2";
> +    String OID = "2.16.840.1.113730.3.4.2";
>
>     /** An instance of this constant control which never changes */
> -    public static final ManageDsaIT INSTANCE = new ManageDsaIT();
> -
> -
> -    /**
> -     * Default constructor
> -     */
> -    private ManageDsaIT()
> -    {
> -        super( OID );
> -    }
> -
> -
> -    public void setValue( byte [] value )
> -    {
> -    }
> +    ManageDsaIT INSTANCE = new SimpleManageDsaIT();
>
>
> -    public boolean hasValue()
> +    class SimpleManageDsaIT extends BasicControlImpl implements ManageDsaIT
>     {
> -        return false;
> +        /**
> +         * Default constructor.
> +         */
> +        public SimpleManageDsaIT()
> +        {
> +            super( OID );
> +        }
> +
> +
> +        public void setValue( byte [] value )
> +        {
> +        }
> +
> +
> +        public boolean hasValue()
> +        {
> +            return false;
> +        }

It doesn't make sense - and it's also dangerous - to have a static
instance of a control. It is possible to alter the criticality of a
control which may cause issues when using the singleton in a
multi-threaded environment.

Kind Regards,
Stefan

Mime
View raw message