directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gokt...@apache.org
Subject svn commit: r1366375 - in /directory/apacheds/branches/apacheds-osgi/hub: api/src/main/java/org/apache/directory/server/hub/api/ api/src/main/java/org/apache/directory/server/hub/api/meta/ connectors/ipojo/core/src/main/java/org/apache/directory/server...
Date Fri, 27 Jul 2012 13:08:32 GMT
Author: gokturk
Date: Fri Jul 27 13:08:31 2012
New Revision: 1366375

URL: http://svn.apache.org/viewvc?rev=1366375&view=rev
Log:
Couple of changes to make ComponentHub pure OSGI compliant in reconfiguration manner. And
some refinements to decrease DoF on reconfiguration parameters:

* Helper flags on component factories are disabled and use of them removed from the code.(thread-safe,
exclusive)
* Immutable property behaviour is changed. It is now only rejecting reconfigurations on immutable
properties is component is created already.
* Reinstantiation of component on reconfiguration is disabled.

Modified:
    directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/AbstractComponentListener.java
    directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/ComponentListener.java
    directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DcMetadataDescriptor.java
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/DcMetadataBuilder.java
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/DirectoryComponent.java
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/DirectoryInterceptor.java
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/DirectoryPartition.java
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/DirectoryProperty.java
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/DirectoryServer.java
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DcHandlerConstants.java
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryComponentHandler.java
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryInterceptorHandler.java
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryPartitionHandler.java
    directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryServerHandler.java
    directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/ComponentHubImpl.java
    directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/HubClientManager.java
    directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreConfigManager.java

Modified: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/AbstractComponentListener.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/AbstractComponentListener.java?rev=1366375&r1=1366374&r2=1366375&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/AbstractComponentListener.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/AbstractComponentListener.java
Fri Jul 27 13:08:31 2012
@@ -21,7 +21,6 @@
 package org.apache.directory.server.hub.api;
 
 
-import org.apache.directory.server.hub.api.component.DcConfiguration;
 import org.apache.directory.server.hub.api.component.DirectoryComponent;
 import org.apache.directory.server.hub.api.exception.HubAbortException;
 
@@ -62,7 +61,7 @@ public class AbstractComponentListener i
      * @see org.apache.directory.server.hub.api.ComponentListener#componentReconfigured(org.apache.directory.server.hub.api.component.DirectoryComponent,
boolean)
      */
     @Override
-    public void componentReconfigured( DirectoryComponent component, boolean newInstance
)
+    public void componentReconfigured( DirectoryComponent component )
     {
 
     }

Modified: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/ComponentListener.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/ComponentListener.java?rev=1366375&r1=1366374&r2=1366375&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/ComponentListener.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/ComponentListener.java
Fri Jul 27 13:08:31 2012
@@ -36,5 +36,5 @@ public interface ComponentListener
     public abstract void componentDeactivated( DirectoryComponent component );
 
 
-    public abstract void componentReconfigured( DirectoryComponent component, boolean newInstance
);
+    public abstract void componentReconfigured( DirectoryComponent component );
 }
\ No newline at end of file

Modified: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DcMetadataDescriptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DcMetadataDescriptor.java?rev=1366375&r1=1366374&r2=1366375&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DcMetadataDescriptor.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/meta/DcMetadataDescriptor.java
Fri Jul 27 13:08:31 2012
@@ -43,8 +43,6 @@ public class DcMetadataDescriptor
     private Hashtable<String, String> attributes;
 
     private boolean factory;
-    private boolean exclusive;
-    private boolean threadSafe;
 
 
     public DcMetadataDescriptor(
@@ -90,30 +88,6 @@ public class DcMetadataDescriptor
     }
 
 
-    public boolean isExclusive()
-    {
-        return exclusive;
-    }
-
-
-    public void setExclusive( boolean exclusive )
-    {
-        this.exclusive = exclusive;
-    }
-
-
-    public boolean isThreadSafe()
-    {
-        return threadSafe;
-    }
-
-
-    public void setThreadSafe( boolean threadSafe )
-    {
-        this.threadSafe = threadSafe;
-    }
-
-
     public Version getMetaVersion()
     {
         return metaVersion;

Modified: directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/DcMetadataBuilder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/DcMetadataBuilder.java?rev=1366375&r1=1366374&r2=1366375&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/DcMetadataBuilder.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/core/src/main/java/org/apache/directory/server/hub/connector/ipojo/core/DcMetadataBuilder.java
Fri Jul 27 13:08:31 2012
@@ -46,9 +46,6 @@ public class DcMetadataBuilder
         Version metaVersion = factory.getBundleContext().getBundle().getVersion();
         boolean isFactory = true;
 
-        boolean isExclusive = false;
-        boolean isThreadSafe = true;
-
         List<DcPropertyDescription> properties = new ArrayList<DcPropertyDescription>();
 
         Hashtable<String, String> attributes = new Hashtable<String, String>();
@@ -89,14 +86,6 @@ public class DcMetadataBuilder
                 {
                     isFactory = Boolean.parseBoolean( defaultValue );
                 }
-                else if ( name.equals( DcHandlerConstants.META_IS_EXCLUSIVE ) )
-                {
-                    isExclusive = Boolean.parseBoolean( defaultValue );
-                }
-                else if ( name.equals( DcHandlerConstants.META_IS_THREAD_SAFE ) )
-                {
-                    isThreadSafe = Boolean.parseBoolean( defaultValue );
-                }
                 else
                 {
                     attributes.put( name, defaultValue );
@@ -126,9 +115,6 @@ public class DcMetadataBuilder
             className,
             implemented, extended, attributes, properties.toArray( new DcPropertyDescription[0]
) );
 
-        metadata.setExclusive( isExclusive );
-        metadata.setThreadSafe( isThreadSafe );
-
         return metadata;
     }
 

Modified: directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/DirectoryComponent.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/DirectoryComponent.java?rev=1366375&r1=1366374&r2=1366375&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/DirectoryComponent.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/DirectoryComponent.java
Fri Jul 27 13:08:31 2012
@@ -34,10 +34,4 @@ import java.lang.annotation.Target;
 public @interface DirectoryComponent
 {
     boolean factory() default true;
-
-
-    boolean exclusive() default false;
-
-
-    boolean threadsafe() default true;
 }
\ No newline at end of file

Modified: directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/DirectoryInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/DirectoryInterceptor.java?rev=1366375&r1=1366374&r2=1366375&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/DirectoryInterceptor.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/DirectoryInterceptor.java
Fri Jul 27 13:08:31 2012
@@ -36,20 +36,16 @@ import org.apache.directory.server.hub.a
 @Target(ElementType.TYPE)
 public @interface DirectoryInterceptor
 {
-	boolean factory() default true;
+    boolean factory() default true;
 
 
-    boolean exclusive() default false;
-
-
-    boolean threadsafe() default true;
-    
     /*
      * Used to specify interception point for all component instances
      * instantiated from factory.
      */
     InterceptionPoint interceptionPoint() default InterceptionPoint.END;
 
+
     /*
      * Used to specify in which operations this factory's instances
      * will be called.

Modified: directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/DirectoryPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/DirectoryPartition.java?rev=1366375&r1=1366374&r2=1366375&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/DirectoryPartition.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/DirectoryPartition.java
Fri Jul 27 13:08:31 2012
@@ -32,11 +32,6 @@ import java.lang.annotation.Target;
 @Target(ElementType.TYPE)
 public @interface DirectoryPartition
 {
-	boolean factory() default true;
+    boolean factory() default true;
 
-
-    boolean exclusive() default false;
-
-
-    boolean threadsafe() default true;
 }

Modified: directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/DirectoryProperty.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/DirectoryProperty.java?rev=1366375&r1=1366374&r2=1366375&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/DirectoryProperty.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/DirectoryProperty.java
Fri Jul 27 13:08:31 2012
@@ -68,6 +68,7 @@ public @interface DirectoryProperty
 
     /*
      * Whether property will be immutable
+     * Means only assignable at creation time.
      */
     boolean immutable() default false;
 

Modified: directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/DirectoryServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/DirectoryServer.java?rev=1366375&r1=1366374&r2=1366375&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/DirectoryServer.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/DirectoryServer.java
Fri Jul 27 13:08:31 2012
@@ -33,11 +33,5 @@ import java.lang.annotation.Target;
 @Target(ElementType.TYPE)
 public @interface DirectoryServer
 {
-	boolean factory() default true;
-
-
-    boolean exclusive() default false;
-
-
-    boolean threadsafe() default true;
+    boolean factory() default true;
 }

Modified: directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DcHandlerConstants.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DcHandlerConstants.java?rev=1366375&r1=1366374&r2=1366375&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DcHandlerConstants.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DcHandlerConstants.java
Fri Jul 27 13:08:31 2012
@@ -44,15 +44,11 @@ public class DcHandlerConstants
      */
     public static final String DSCOMPONENT_OWNER_PROP_NAME = "dscomponent.owner";
     public static final String DSCOMPONENT_FACTORY_PROP_NAME = "factory";
-    public static final String DSCOMPONENT_EXCLUSIVE_PROP_NAME = "exclusive";
-    public static final String DSCOMPONENT_THREADSAFE_PROP_NAME = "threadsafe";
 
     /*
      * Property names for meta proeprties at connector level 
      */
     public static final String META_IS_FACTORY = "isFactory";
-    public static final String META_IS_EXCLUSIVE = "isImmutable";
-    public static final String META_IS_THREAD_SAFE = "isThreadSafe";
     public static final String INTERCEPTOR_INTERCEPTION_POINT = "interceptionPoint";
     public static final String INTERCEPTOR_INTERCEPTOR_OPERATIONS = "operations";
 

Modified: directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryComponentHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryComponentHandler.java?rev=1366375&r1=1366374&r2=1366375&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryComponentHandler.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryComponentHandler.java
Fri Jul 27 13:08:31 2012
@@ -60,18 +60,6 @@ public class DirectoryComponentHandler e
             constants.put( DcHandlerConstants.META_IS_FACTORY, isFactory );
         }
 
-        String isExclusive = component.getAttribute( DcHandlerConstants.DSCOMPONENT_EXCLUSIVE_PROP_NAME
);
-        if ( isExclusive != null )
-        {
-            constants.put( DcHandlerConstants.META_IS_EXCLUSIVE, isExclusive );
-        }
-        
-        String isThreadSafe = component.getAttribute( DcHandlerConstants.DSCOMPONENT_THREADSAFE_PROP_NAME
);
-        if ( isThreadSafe != null )
-        {
-            constants.put( DcHandlerConstants.META_IS_THREAD_SAFE, isThreadSafe );
-        }
-
         return constants;
 
     }

Modified: directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryInterceptorHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryInterceptorHandler.java?rev=1366375&r1=1366374&r2=1366375&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryInterceptorHandler.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryInterceptorHandler.java
Fri Jul 27 13:08:31 2012
@@ -64,18 +64,6 @@ public class DirectoryInterceptorHandler
             constants.put( DcHandlerConstants.META_IS_FACTORY, isFactory );
         }
 
-        String isExclusive = interceptor.getAttribute( DcHandlerConstants.DSCOMPONENT_EXCLUSIVE_PROP_NAME
);
-        if ( isExclusive != null )
-        {
-            constants.put( DcHandlerConstants.META_IS_EXCLUSIVE, isExclusive );
-        }
-
-        String isThreadSafe = interceptor.getAttribute( DcHandlerConstants.DSCOMPONENT_THREADSAFE_PROP_NAME
);
-        if ( isThreadSafe != null )
-        {
-            constants.put( DcHandlerConstants.META_IS_THREAD_SAFE, isThreadSafe );
-        }
-
         constants.put( DcHandlerConstants.INTERCEPTOR_INTERCEPTION_POINT, interceptionPoint
);
         constants.put( DcHandlerConstants.INTERCEPTOR_INTERCEPTOR_OPERATIONS, interceptorOperations
);
 

Modified: directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryPartitionHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryPartitionHandler.java?rev=1366375&r1=1366374&r2=1366375&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryPartitionHandler.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryPartitionHandler.java
Fri Jul 27 13:08:31 2012
@@ -61,18 +61,6 @@ public class DirectoryPartitionHandler e
             constants.put( DcHandlerConstants.META_IS_FACTORY, isFactory );
         }
 
-        String isExclusive = partition.getAttribute( DcHandlerConstants.DSCOMPONENT_EXCLUSIVE_PROP_NAME
);
-        if ( isExclusive != null )
-        {
-            constants.put( DcHandlerConstants.META_IS_EXCLUSIVE, isExclusive );
-        }
-
-        String isThreadSafe = partition.getAttribute( DcHandlerConstants.DSCOMPONENT_THREADSAFE_PROP_NAME
);
-        if ( isThreadSafe != null )
-        {
-            constants.put( DcHandlerConstants.META_IS_THREAD_SAFE, isThreadSafe );
-        }
-
         return constants;
     }
 

Modified: directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryServerHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryServerHandler.java?rev=1366375&r1=1366374&r2=1366375&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryServerHandler.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/hub/connectors/ipojo/handler/src/main/java/org/apache/directory/server/component/handler/ipojo/DirectoryServerHandler.java
Fri Jul 27 13:08:31 2012
@@ -61,18 +61,6 @@ public class DirectoryServerHandler exte
             constants.put( DcHandlerConstants.META_IS_FACTORY, isFactory );
         }
 
-        String isExclusive = server.getAttribute( DcHandlerConstants.DSCOMPONENT_EXCLUSIVE_PROP_NAME
);
-        if ( isExclusive != null )
-        {
-            constants.put( DcHandlerConstants.META_IS_EXCLUSIVE, isExclusive );
-        }
-
-        String isThreadSafe = server.getAttribute( DcHandlerConstants.DSCOMPONENT_THREADSAFE_PROP_NAME
);
-        if ( isThreadSafe != null )
-        {
-            constants.put( DcHandlerConstants.META_IS_THREAD_SAFE, isThreadSafe );
-        }
-
         return constants;
     }
 

Modified: directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/ComponentHubImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/ComponentHubImpl.java?rev=1366375&r1=1366374&r2=1366375&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/ComponentHubImpl.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/ComponentHubImpl.java
Fri Jul 27 13:08:31 2012
@@ -82,6 +82,7 @@ public class ComponentHubImpl implements
 
     private ConfiguratorInterceptor configurator;
 
+
     public ComponentHubImpl( HubStore store )
     {
         this.store = store;
@@ -258,28 +259,25 @@ public class ComponentHubImpl implements
             }
         }
 
-        boolean isExclusive = metadata.isExclusive();
-        boolean reinstantiate = false;
-
-        // Immutable property change handling
         if ( component.getRuntimeInfo() != null )
         {
-            for ( DcProperty prop : newConfiguration )
+            // Immutable property modification prevention
+            for ( DcProperty newProp : newConfiguration )
             {
-                DcPropertyDescription pd = metadata.getPropertyDescription( prop.getName()
);
-                if ( pd != null && pd.isImmutable() )
+                String propName = newProp.getName();
+                DcPropertyDescription propDesc = metadata.getPropertyDescription( propName
);
+                if ( propDesc.isImmutable() )
                 {
-                    DcProperty oldProp = component.getConfiguration().getProperty( prop.getName()
);
-                    if ( oldProp != null && !( oldProp.getValue().equals( prop.getValue()
) ) )
+                    String oldPropVal = component.getConfiguration().getProperty( propName
).getValue();
+                    if ( newProp.getValue() != oldPropVal )
                     {
-                        reinstantiate = true;
+                        throw new HubAbortException( "Changing a immmutable property of active
instance is forbidden!" );
                     }
                 }
             }
         }
 
         DcConfiguration oldConfiguration = component.getConfiguration();
-        DcRuntime oldRuntime = component.getRuntimeInfo();
 
         DcOperationsManager operations = handlersReg.getPIDHandler( component.getComponentManagerPID()
);
 
@@ -290,6 +288,8 @@ public class ComponentHubImpl implements
         }
         catch ( BadConfigurationException e )
         {
+            component.setConfiguration( oldConfiguration );
+
             throw new HubAbortException( "New configuration is rejected while processing",
e );
         }
 
@@ -297,23 +297,9 @@ public class ComponentHubImpl implements
         {
             try
             {
-                if ( reinstantiate )
-                {
-                    if ( isExclusive )
-                    {
-                        operations.disposeComponent( component );
-                    }
-                    else
-                    {
-                        component.setRuntimeInfo( null );
-                    }
-                }
-                else
-                {
-                    operations.reconfigureComponent( component );
-                }
+                operations.reconfigureComponent( component );
 
-                clientManager.fireDCReconfigured( component, reinstantiate );
+                clientManager.fireDCReconfigured( component );
 
                 List<ParentLink> parents = parentLinksReg.getParentLinks( component
);
                 if ( parents != null )
@@ -332,34 +318,26 @@ public class ComponentHubImpl implements
             }
             catch ( Exception e )
             {
-                if ( reinstantiate && !isExclusive )
+
+                component.setConfiguration( oldConfiguration );
+                try
                 {
-                    component.setRuntimeInfo( oldRuntime );
-                    component.setConfiguration( oldConfiguration );
+                    processConfiguration( component );
+                    operations.reconfigureComponent( component );
 
+                    // We ensured the previous state, now inform the reconfiguration agent
with exception
                     throw new HubAbortException( "Reconfiguration is rejected by target component:"
                         + component.getComponentPID(), e );
                 }
-                else
+                catch ( Exception e2 )
                 {
-                    component.setConfiguration( oldConfiguration );
-                    try
-                    {
-                        processConfiguration( component );
-                        operations.reconfigureComponent( component );
-
-                        throw new HubAbortException( "Reconfiguration is rejected by target
component:"
-                            + component.getComponentPID(), e );
-                    }
-                    catch ( Exception e2 )
-                    {
-                        deactivateComponent( component );
+                    deactivateComponent( component );
 
-                        throw new HubAbortException( "Reconfiguration reverted but component
couldn't be saved:"
-                            + component.getComponentPID(), e );
+                    throw new HubAbortException( "Reconfiguration reverted but component
couldn't be saved:"
+                        + component.getComponentPID(), e );
 
-                    }
                 }
+
             }
         }
         else
@@ -473,18 +451,18 @@ public class ComponentHubImpl implements
                             // TODO log given parent couldn't be reverted from cancelled
removal of its referenced property.
                         }
                     }
-                    
+
                     removed = false;
                     break;
                 }
             }
-            
-            if(removed)
+
+            if ( removed )
             {
                 parentLinksReg.destroyComponentLinks( component );
             }
         }
-        
+
         deactivateComponent( component );
 
         componentsReg.removeDirectoryComponent( component );

Modified: directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/HubClientManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/HubClientManager.java?rev=1366375&r1=1366374&r2=1366375&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/HubClientManager.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/HubClientManager.java
Fri Jul 27 13:08:31 2012
@@ -128,12 +128,12 @@ public class HubClientManager
     }
 
 
-    public void fireDCReconfigured( DirectoryComponent component, boolean newInstance )
+    public void fireDCReconfigured( DirectoryComponent component )
     {
         List<AbstractComponentListener> clients = getRegisteredClients( component );
         for ( ComponentListener client : clients )
         {
-            client.componentReconfigured( component, newInstance );
+            client.componentReconfigured( component );
         }
     }
 

Modified: directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreConfigManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreConfigManager.java?rev=1366375&r1=1366374&r2=1366375&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreConfigManager.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreConfigManager.java
Fri Jul 27 13:08:31 2012
@@ -196,8 +196,6 @@ public class StoreConfigManager
             .getMetaVersion().toString() );
         mdEntry.add( schemaManager.getAttributeType( StoreSchemaConstants.HUB_AT_MD_FACTORY
),
             ( metadata.isFactory() ) ? "TRUE" : "FALSE" );
-        mdEntry.add( schemaManager.getAttributeType( StoreSchemaConstants.HUB_AT_MD_EXCLUSIVE
),
-            ( metadata.isExclusive() ) ? "TRUE" : "FALSE" );
         mdEntry.add( schemaManager.getAttributeType( StoreSchemaConstants.HUB_AT_MD_CLASSNAME
),
             metadata.getClassName() );
 



Mime
View raw message