directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gokt...@apache.org
Subject svn commit: r1338614 - /directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/ComponentHubImpl.java
Date Tue, 15 May 2012 09:27:08 GMT
Author: gokturk
Date: Tue May 15 09:27:08 2012
New Revision: 1338614

URL: http://svn.apache.org/viewvc?rev=1338614&view=rev
Log:
Added a check to prevent non-factory types to have more than 1 instance

Modified:
    directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/ComponentHubImpl.java

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=1338614&r1=1338613&r2=1338614&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
Tue May 15 09:27:08 2012
@@ -295,6 +295,15 @@ public class ComponentHubImpl implements
                 + component.getComponentPID() );
         }
 
+        if ( componentsReg.getComponents( component.getComponentManagerPID() ) != null )
+        {
+            DCMetadataDescriptor metadata = metadatasReg.getMetadataDescriptor( component.getComponentManagerPID()
);
+            if ( !metadata.isFactory() )
+            {
+                throw new HubAbortException( metadata.getMetadataPID() + "can not have more
than 1 instance" );
+            }
+        }
+
         setInjectionProperties( metadatasReg.getMetadataDescriptor( component.getComponentManagerPID()
),
             component.getConfiguration() );
 



Mime
View raw message