geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r797174 - /geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/Parser.java
Date Thu, 23 Jul 2009 18:05:41 GMT
Author: gawor
Date: Thu Jul 23 18:05:40 2009
New Revision: 797174

URL: http://svn.apache.org/viewvc?rev=797174&view=rev
Log:
support inlined <reference/> element for services

Modified:
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/Parser.java

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/Parser.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/Parser.java?rev=797174&r1=797173&r2=797174&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/Parser.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/Parser.java
Thu Jul 23 18:05:40 2009
@@ -571,25 +571,30 @@
                         service.addRegistrationListener(parseRegistrationListener(e, service));
                     } else if (nodeNameEquals(e, BEAN_ELEMENT)) {
                         if (service.getServiceComponent() != null) {
-                            throw new ComponentDefinitionException("Only one of " + REF_ATTRIBUTE
+ " attribute, " + BEAN_ELEMENT + " element or " + REF_ELEMENT + " element can be set");
+                            throw new ComponentDefinitionException("Only one of " + REF_ATTRIBUTE
+ " attribute, " + BEAN_ELEMENT + " element, " + REFERENCE_ELEMENT + " element or " + REF_ELEMENT
+ " element can be set");
                         }
                         service.setServiceComponent((Target) parseBeanMetadata(e, false));
                     } else if (nodeNameEquals(e, REF_ELEMENT)) {
                         if (service.getServiceComponent() != null) {
-                            throw new ComponentDefinitionException("Only one of " + REF_ATTRIBUTE
+ " attribute, " + BEAN_ELEMENT + " element or " + REF_ELEMENT + " element can be set");
+                            throw new ComponentDefinitionException("Only one of " + REF_ATTRIBUTE
+ " attribute, " + BEAN_ELEMENT + " element, " + REFERENCE_ELEMENT + " element or " + REF_ELEMENT
+ " element can be set");
                         }
                         String component = e.getAttribute(COMPONENT_ID_ATTRIBUTE);
                         if (component == null || component.length() == 0) {
                             throw new ComponentDefinitionException("Element " + REF_ELEMENT
+ " must have a valid " + COMPONENT_ID_ATTRIBUTE + " attribute");
                         }
-                        service.setServiceComponent(new RefMetadataImpl(component));
+                        service.setServiceComponent(new RefMetadataImpl(component));    
              
+                    } else if (nodeNameEquals(e, REFERENCE_ELEMENT)) {
+                        if (service.getServiceComponent() != null) {
+                            throw new ComponentDefinitionException("Only one of " + REF_ATTRIBUTE
+ " attribute, " + BEAN_ELEMENT + " element, " + REFERENCE_ELEMENT + " element or " + REF_ELEMENT
+ " element can be set");
+                        }
+                        service.setServiceComponent((Target) parseReference(e, false));
                     }
                 }
             }
         }
         // Check service
         if (service.getServiceComponent() == null) {
-            throw new ComponentDefinitionException("One of " + REF_ATTRIBUTE + " attribute,
" + BEAN_ELEMENT + " element or " + REF_ELEMENT + " element must be set");
+            throw new ComponentDefinitionException("One of " + REF_ATTRIBUTE + " attribute,
" + BEAN_ELEMENT + " element, " + REFERENCE_ELEMENT + " element or " + REF_ELEMENT + " element
must be set");
         }
         // Check interface
         if (service.getAutoExport() == ServiceMetadata.AUTO_EXPORT_DISABLED && service.getInterfaces().isEmpty())
{



Mime
View raw message