directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1675736 - in /directory/shared/trunk/ldap/codec: core/src/main/java/org/apache/directory/api/ldap/codec/osgi/DefaultLdapCodecService.java standalone/src/main/java/org/apache/directory/api/ldap/codec/standalone/StandaloneLdapApiService.java
Date Fri, 24 Apr 2015 00:24:49 GMT
Author: elecharny
Date: Fri Apr 24 00:24:49 2015
New Revision: 1675736

URL: http://svn.apache.org/r1675736
Log:
Made the protected fields private, and added getters/setters to solve some classloading issues

Modified:
    directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/osgi/DefaultLdapCodecService.java
    directory/shared/trunk/ldap/codec/standalone/src/main/java/org/apache/directory/api/ldap/codec/standalone/StandaloneLdapApiService.java

Modified: directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/osgi/DefaultLdapCodecService.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/osgi/DefaultLdapCodecService.java?rev=1675736&r1=1675735&r2=1675736&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/osgi/DefaultLdapCodecService.java
(original)
+++ directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/osgi/DefaultLdapCodecService.java
Fri Apr 24 00:24:49 2015
@@ -81,13 +81,13 @@ public class DefaultLdapCodecService imp
     private static final Logger LOG = LoggerFactory.getLogger( DefaultLdapCodecService.class
);
 
     /** The map of registered {@link org.apache.directory.api.ldap.codec.api.ControlFactory}'s
*/
-    protected Map<String, ControlFactory<? extends Control>> controlFactories
= new HashMap<String, ControlFactory<? extends Control>>();
+    private Map<String, ControlFactory<? extends Control>> controlFactories =
new HashMap<String, ControlFactory<? extends Control>>();
 
     /** The map of registered {@link org.apache.directory.api.ldap.codec.api.ExtendedOperationFactory}'s
by request OID */
-    protected Map<String, ExtendedOperationFactory> extendedOperationsFactories = new
HashMap<String, ExtendedOperationFactory>();
+    private Map<String, ExtendedOperationFactory> extendedOperationsFactories = new
HashMap<String, ExtendedOperationFactory>();
 
     /** The registered ProtocolCodecFactory */
-    protected ProtocolCodecFactory protocolCodecFactory;
+    private ProtocolCodecFactory protocolCodecFactory;
 
 
     /**
@@ -539,4 +539,49 @@ public class DefaultLdapCodecService imp
     {
         return extendedOperationsFactories.containsKey( oid );
     }
+
+
+    /**
+     * @return the controlFactories
+     */
+    public Map<String, ControlFactory<? extends Control>> getControlFactories()
+    {
+        return controlFactories;
+    }
+
+
+    /**
+     * @param controlFactories the controlFactories to set
+     */
+    public void setControlFactories( Map<String, ControlFactory<? extends Control>>
controlFactories )
+    {
+        this.controlFactories = controlFactories;
+    }
+
+
+    /**
+     * @return the extendedOperationsFactories
+     */
+    public Map<String, ExtendedOperationFactory> getExtendedOperationsFactories()
+    {
+        return extendedOperationsFactories;
+    }
+
+
+    /**
+     * @param extendedOperationsFactories the extendedOperationsFactories to set
+     */
+    public void setExtendedOperationsFactories( Map<String, ExtendedOperationFactory>
extendedOperationsFactories )
+    {
+        this.extendedOperationsFactories = extendedOperationsFactories;
+    }
+
+
+    /**
+     * @param protocolCodecFactory the protocolCodecFactory to set
+     */
+    public void setProtocolCodecFactory( ProtocolCodecFactory protocolCodecFactory )
+    {
+        this.protocolCodecFactory = protocolCodecFactory;
+    }
 }

Modified: directory/shared/trunk/ldap/codec/standalone/src/main/java/org/apache/directory/api/ldap/codec/standalone/StandaloneLdapApiService.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/standalone/src/main/java/org/apache/directory/api/ldap/codec/standalone/StandaloneLdapApiService.java?rev=1675736&r1=1675735&r2=1675736&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/standalone/src/main/java/org/apache/directory/api/ldap/codec/standalone/StandaloneLdapApiService.java
(original)
+++ directory/shared/trunk/ldap/codec/standalone/src/main/java/org/apache/directory/api/ldap/codec/standalone/StandaloneLdapApiService.java
Fri Apr 24 00:24:49 2015
@@ -145,9 +145,9 @@ public class StandaloneLdapApiService ex
 
     public StandaloneLdapApiService( List<String> controls, List<String> extendedOperations
) throws Exception
     {
-        CodecFactoryUtil.loadStockControls( controlFactories, this );
+        CodecFactoryUtil.loadStockControls( getControlFactories(), this );
 
-        CodecFactoryUtil.loadStockExtendedOperations( extendedOperationsFactories, this );
+        CodecFactoryUtil.loadStockExtendedOperations( getExtendedOperationsFactories(), this
);
 
         // Load the controls
         loadControls( controls );
@@ -155,7 +155,7 @@ public class StandaloneLdapApiService ex
         // Load the extended operations
         loadExtendedOperations( extendedOperations );
 
-        if ( protocolCodecFactory == null )
+        if ( getProtocolCodecFactory() == null )
         {
             try
             {
@@ -166,11 +166,11 @@ public class StandaloneLdapApiService ex
                     clazz.getConstructor( LdapApiService.class );
                 if ( constructor != null )
                 {
-                    protocolCodecFactory = constructor.newInstance( this );
+                    setProtocolCodecFactory( constructor.newInstance( this ) );
                 }
                 else
                 {
-                    protocolCodecFactory = clazz.newInstance();
+                    setProtocolCodecFactory( clazz.newInstance() );
                 }
             }
             catch ( Exception cause )
@@ -276,7 +276,7 @@ public class StandaloneLdapApiService ex
      */
     private void loadControl( String controlFQCN ) throws Exception
     {
-        if ( controlFactories.containsKey( controlFQCN ) )
+        if ( getControlFactories().containsKey( controlFQCN ) )
         {
             LOG.debug( "Factory for control {} was already loaded", controlFQCN );
             return;
@@ -293,7 +293,7 @@ public class StandaloneLdapApiService ex
 
         ControlFactory<?> factory = ( ControlFactory<?> ) constructor.newInstance(
new Object[]
             { this } );
-        controlFactories.put( factory.getOid(), factory );
+        getControlFactories().put( factory.getOid(), factory );
 
         LOG.info( "Registered control factory: {}", factory.getOid() );
     }
@@ -320,7 +320,7 @@ public class StandaloneLdapApiService ex
      */
     private void loadExtendedOperation( String extendedOperationFQCN ) throws Exception
     {
-        if ( extendedOperationsFactories.containsKey( extendedOperationFQCN ) )
+        if ( getExtendedOperationsFactories().containsKey( extendedOperationFQCN ) )
         {
             LOG.debug( "Factory for extended operation {} was already loaded", extendedOperationFQCN
);
             return;
@@ -339,7 +339,7 @@ public class StandaloneLdapApiService ex
         ExtendedOperationFactory factory = ( ExtendedOperationFactory ) constructor
             .newInstance( new Object[]
                 { this } );
-        extendedOperationsFactories.put( factory.getOid(), factory );
+        getExtendedOperationsFactories().put( factory.getOid(), factory );
 
         LOG.info( "Registered pre-bundled extended operation factory: {}", factory.getOid()
);
     }



Mime
View raw message