directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Karasulu <akaras...@apache.org>
Subject Re: svn commit: r1205037 - in /directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component: hub/ hub/client/user/ instance/
Date Wed, 23 Nov 2011 06:59:49 GMT
Please try to avoid committing with empty log messages Gokturk. I saw
this a few times already and did not want to say anything but this
make it hard to search or follow our vcs history.

Thanks,
Alex

On Tue, Nov 22, 2011 at 5:30 PM,  <gokturk@apache.org> wrote:
> Author: gokturk
> Date: Tue Nov 22 15:30:30 2011
> New Revision: 1205037
>
> URL: http://svn.apache.org/viewvc?rev=1205037&view=rev
> Log: (empty)
>
> Added:
>    directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ConfigurationManager.java
> Modified:
>    directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentHub.java
>    directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentManager.java
>    directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/client/user/UserComponentInstanceGenerator.java
>    directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/instance/ADSComponentInstance.java
>
> Modified: directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentHub.java
> URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentHub.java?rev=1205037&r1=1205036&r2=1205037&view=diff
> ==============================================================================
> --- directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentHub.java
(original)
> +++ directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentHub.java
Tue Nov 22 15:30:30 2011
> @@ -99,9 +99,14 @@ public class ComponentHub
>     private ComponentCacheManager cacheManager = new ComponentCacheManager();
>
>     /*
> +     * Used to manage instances' DIT hooks.
> +     */
> +    private ConfigurationManager configManager = new ConfigurationManager();
> +
> +    /*
>      * Used to manage components
>      */
> -    private ComponentManager componentManager = new ComponentManager( cacheManager
);
> +    private ComponentManager componentManager = new ComponentManager( cacheManager,
configManager );
>
>     /*
>      * OSGI Logger
>
> Modified: directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentManager.java
> URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentManager.java?rev=1205037&r1=1205036&r2=1205037&view=diff
> ==============================================================================
> --- directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentManager.java
(original)
> +++ directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentManager.java
Tue Nov 22 15:30:30 2011
> @@ -70,6 +70,11 @@ public class ComponentManager
>     private ComponentCacheManager cacheManager;
>
>     /*
> +     * Configuration Manager
> +     */
> +    private ConfigurationManager configManager;
> +
> +    /*
>      * Ldif deferred writing queue.
>      */
>     private Queue<LdifEntry> ldifQueue = new LinkedBlockingQueue<LdifEntry>();
> @@ -80,11 +85,13 @@ public class ComponentManager
>     private LdapCoreSessionConnection ldapConn;
>
>
> -    public ComponentManager( ComponentCacheManager cacheManager )
> +    public ComponentManager( ComponentCacheManager cacheManager, ConfigurationManager
configManager )
>     {
>         schemaGenerators = new Hashtable<String, ComponentSchemaGenerator>();
>         instanceGenerators = new Hashtable<String, ADSComponentInstanceGenerator>();
> +
>         this.cacheManager = cacheManager;
> +        this.configManager = configManager;
>     }
>
>
> @@ -94,7 +101,7 @@ public class ComponentManager
>      *
>      * @param conn LdapCoreSessionConnection reference to set.
>      */
> -    public synchronized void setConnectionReady( LdapCoreSessionConnection conn )
> +    public synchronized void setConnection( LdapCoreSessionConnection conn )
>     {
>         ldapConn = conn;
>
> @@ -148,6 +155,8 @@ public class ComponentManager
>         {
>             ADSComponentInstance instance = generator.createInstance( component,
properties );
>
> +            instance.setConfigManager( configManager );
> +
>             if ( instance != null )
>             {
>                 component.addInstance( instance );
> @@ -325,4 +334,46 @@ public class ComponentManager
>         }
>     }
>
> +
> +    /**
> +     * Caches the component manually
> +     *
> +     * @param component ADSComponent to initiate caching
> +     */
> +    public void cacheComponent( ADSComponent component )
> +    {
> +        cacheManager.cacheComponent( component );
> +    }
> +
> +
> +    /**
> +     * Loads the cached instance configurations for component, and use
> +     * them to create cached instances.
> +     *
> +     * @param component ADSComponent reference to load its cached instances.
> +     * @return loaded instances.
> +     */
> +    public List<ADSComponentInstance> loadCachedInstances( ADSComponent component
)
> +    {
> +        List<ADSComponentInstance> cachedInstances = new ArrayList<ADSComponentInstance>();
> +
> +        List<Properties> cachedConfigurations = cacheManager.getCachedInstanceConfigurations(
component );
> +
> +        if ( cachedConfigurations == null )
> +        {
> +            return null;
> +        }
> +
> +        for ( Properties props : cachedConfigurations )
> +        {
> +            ADSComponentInstance ins = createInstance( component, props );
> +            if ( ins != null )
> +            {
> +                cachedInstances.add( ins );
> +            }
> +        }
> +
> +        return cachedInstances;
> +    }
> +
>  }
>
> Added: directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ConfigurationManager.java
> URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ConfigurationManager.java?rev=1205037&view=auto
> ==============================================================================
> --- directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ConfigurationManager.java
(added)
> +++ directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ConfigurationManager.java
Tue Nov 22 15:30:30 2011
> @@ -0,0 +1,25 @@
> +/*
> + *  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.server.component.hub;
> +
> +public class ConfigurationManager
> +{
> +
> +}
>
> Modified: directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/client/user/UserComponentInstanceGenerator.java
> URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/client/user/UserComponentInstanceGenerator.java?rev=1205037&r1=1205036&r2=1205037&view=diff
> ==============================================================================
> --- directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/client/user/UserComponentInstanceGenerator.java
(original)
> +++ directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/client/user/UserComponentInstanceGenerator.java
Tue Nov 22 15:30:30 2011
> @@ -56,6 +56,8 @@ public class UserComponentInstanceGenera
>         }
>
>         // TODO Auto-generated method stub
> +
> +        //Remember to set configuration of the instance here...
>         return null;
>     }
>
>
> Modified: directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/instance/ADSComponentInstance.java
> URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/instance/ADSComponentInstance.java?rev=1205037&r1=1205036&r2=1205037&view=diff
> ==============================================================================
> --- directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/instance/ADSComponentInstance.java
(original)
> +++ directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/instance/ADSComponentInstance.java
Tue Nov 22 15:30:30 2011
> @@ -23,6 +23,7 @@ package org.apache.directory.server.comp
>  import java.util.Properties;
>
>  import org.apache.directory.server.component.ADSComponent;
> +import org.apache.directory.server.component.hub.ConfigurationManager;
>
>
>  /**
> @@ -52,6 +53,11 @@ public class ADSComponentInstance
>      */
>     private String configHookDn;
>
> +    /*
> +     * ConfigurationManager to manage instance's DIT hooks.
> +     */
> +    private ConfigurationManager configManager;
> +
>
>     /**
>      * @return the instance
> @@ -124,4 +130,13 @@ public class ADSComponentInstance
>         this.configHookDn = configHookDn;
>     }
>
> +
> +    /**
> +     * @param configManager the configManager to set
> +     */
> +    public void setConfigManager( ConfigurationManager configManager )
> +    {
> +        this.configManager = configManager;
> +    }
> +
>  }
>
>
>



-- 
Best Regards,
-- Alex

Mime
View raw message