[jboss-cvs] JBossAS SVN: r94256 - in projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src: main/java/org/jboss/osgi/plugins/deployment/xml and 7 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Oct 2 03:08:47 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-10-02 03:08:46 -0400 (Fri, 02 Oct 2009)
New Revision: 94256

Added:
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ActivationPolicyMetaData.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AttributeAware.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AttributeMetaData.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/DependencyMetaData.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/HolderMetaData.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ListenerMetaData.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/OSGiMetaData.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/PackageAttribute.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/Parameter.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ParameterizedAttribute.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ReferenceMetaData.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ServiceControllerContext.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ServiceDeployment.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ServiceMetaData.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ServiceMetaDataVisitor.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ServiceMetaDataVisitorNode.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ServiceValueMetaData.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/VersionRange.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/VersionRangeAttribute.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractActivationPolicyMetaData.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractAttributeAware.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractAttributeMetaData.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractDependencyMetaData.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractHolderMetaData.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractListenerMetaData.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractMetaDataVisitorNode.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractOSGiMetaData.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractPackageAttribute.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractParameter.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractParameterizedAttribute.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractReferenceMetaData.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractServiceDeployment.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractServiceMetaData.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractVersionRange.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/ActivationPolicyMDValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/BooleanValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/CollectionValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/IntegerValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/ListValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/OSGiParameters.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/PackageAttributeListValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/ParameterizedAttributeListValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/ParameterizedAttributeValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/PathAttributeListValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/QNameAttributeListValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/StringListValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/StringValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/URLValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/ValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/ValueCreatorUtil.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/VersionRangeValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/VersionValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/javacc/HeaderValue.jj
Removed:
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractActivationPolicyMetaData.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractAttributeAware.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractAttributeMetaData.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractDependencyMetaData.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractHolderMetaData.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractListenerMetaData.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractMetaDataVisitorNode.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractOSGiMetaData.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractPackageAttribute.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractParameter.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractParameterizedAttribute.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractReferenceMetaData.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractServiceDeployment.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractServiceMetaData.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractVersionRange.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ActivationPolicyMDValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/BooleanValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/CollectionValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/IntegerValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ListValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/OSGiParameters.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/PackageAttributeListValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ParameterizedAttributeListValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ParameterizedAttributeValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/PathAttributeListValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/QNameAttributeListValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/StringListValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/StringValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/URLValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ValueCreatorUtil.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/VersionRangeValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/VersionValueCreator.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/spi/
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/javacc/org/
Modified:
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiBundleStateDeployer.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiManifestParsingDeployer.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/deployment/xml/ListenerHandler.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/deployment/xml/ListenerInterceptor.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/deployment/xml/ReferenceHandler.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/deployment/xml/ServiceHandler.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/AbstractBundleState.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleState.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiSystemState.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiBundleCapability.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiBundleClassLoadingDeployer.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiBundleRequirement.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiPackageCapability.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiPackageRequirement.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/resolver/BundleResolver.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/test/java/org/jboss/test/bundle/metadata/HeaderValuesTestCase.java
   projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/test/java/org/jboss/test/bundle/metadata/VersionRangeTestCase.java
Log:


Modified: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiBundleStateDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiBundleStateDeployer.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiBundleStateDeployer.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -29,7 +29,7 @@
 import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.osgi.plugins.facade.bundle.OSGiBundleManager;
 import org.jboss.osgi.plugins.facade.bundle.OSGiBundleState;
-import org.jboss.osgi.plugins.metadata.spi.OSGiMetaData;
+import org.jboss.osgi.plugins.metadata.OSGiMetaData;
 
 /**
  * OSGiBundleStateDeployer.<p>

Modified: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiManifestParsingDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiManifestParsingDeployer.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiManifestParsingDeployer.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -25,8 +25,8 @@
 import java.util.jar.Attributes.Name;
 
 import org.jboss.deployers.vfs.spi.deployer.ManifestDeployer;
-import org.jboss.osgi.plugins.metadata.AbstractOSGiMetaData;
-import org.jboss.osgi.plugins.metadata.spi.OSGiMetaData;
+import org.jboss.osgi.plugins.metadata.OSGiMetaData;
+import org.jboss.osgi.plugins.metadata.impl.AbstractOSGiMetaData;
 import org.osgi.framework.Constants;
 
 /**

Modified: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/deployment/xml/ListenerHandler.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/deployment/xml/ListenerHandler.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/deployment/xml/ListenerHandler.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -24,7 +24,7 @@
 import javax.xml.namespace.NamespaceContext;
 import javax.xml.namespace.QName;
 
-import org.jboss.osgi.plugins.metadata.AbstractListenerMetaData;
+import org.jboss.osgi.plugins.metadata.impl.AbstractListenerMetaData;
 import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler;
 import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
 import org.xml.sax.Attributes;

Modified: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/deployment/xml/ListenerInterceptor.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/deployment/xml/ListenerInterceptor.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/deployment/xml/ListenerInterceptor.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -25,9 +25,9 @@
 import java.util.List;
 import javax.xml.namespace.QName;
 
-import org.jboss.osgi.plugins.metadata.AbstractListenerMetaData;
-import org.jboss.osgi.plugins.metadata.AbstractReferenceMetaData;
-import org.jboss.osgi.plugins.metadata.spi.ListenerMetaData;
+import org.jboss.osgi.plugins.metadata.ListenerMetaData;
+import org.jboss.osgi.plugins.metadata.impl.AbstractListenerMetaData;
+import org.jboss.osgi.plugins.metadata.impl.AbstractReferenceMetaData;
 import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor;
 
 /**

Modified: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/deployment/xml/ReferenceHandler.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/deployment/xml/ReferenceHandler.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/deployment/xml/ReferenceHandler.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -27,9 +27,9 @@
 
 import org.jboss.beans.metadata.spi.ClassLoaderMetaData;
 import org.jboss.dependency.spi.Cardinality;
-import org.jboss.osgi.plugins.metadata.AbstractDependencyMetaData;
-import org.jboss.osgi.plugins.metadata.AbstractReferenceMetaData;
-import org.jboss.osgi.plugins.metadata.spi.DependencyMetaData;
+import org.jboss.osgi.plugins.metadata.DependencyMetaData;
+import org.jboss.osgi.plugins.metadata.impl.AbstractDependencyMetaData;
+import org.jboss.osgi.plugins.metadata.impl.AbstractReferenceMetaData;
 import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler;
 import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
 import org.xml.sax.Attributes;

Modified: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/deployment/xml/ServiceHandler.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/deployment/xml/ServiceHandler.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/deployment/xml/ServiceHandler.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -26,9 +26,9 @@
 import javax.xml.namespace.QName;
 
 import org.jboss.beans.metadata.spi.ClassLoaderMetaData;
-import org.jboss.osgi.plugins.metadata.AbstractDependencyMetaData;
-import org.jboss.osgi.plugins.metadata.AbstractServiceMetaData;
-import org.jboss.osgi.plugins.metadata.spi.DependencyMetaData;
+import org.jboss.osgi.plugins.metadata.DependencyMetaData;
+import org.jboss.osgi.plugins.metadata.impl.AbstractDependencyMetaData;
+import org.jboss.osgi.plugins.metadata.impl.AbstractServiceMetaData;
 import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler;
 import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
 import org.xml.sax.Attributes;

Modified: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/AbstractBundleState.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/AbstractBundleState.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/AbstractBundleState.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -40,7 +40,7 @@
 import org.jboss.logging.Logger;
 import org.jboss.osgi.plugins.facade.api.BundleStoragePlugin;
 import org.jboss.osgi.plugins.facade.api.FrameworkEventsPlugin;
-import org.jboss.osgi.plugins.metadata.spi.OSGiMetaData;
+import org.jboss.osgi.plugins.metadata.OSGiMetaData;
 import org.jboss.osgi.spi.NotImplementedException;
 import org.jboss.osgi.spi.util.ConstantsHelper;
 import org.jboss.util.collection.ConcurrentSet;

Modified: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -66,8 +66,8 @@
 import org.jboss.osgi.plugins.facade.api.Plugin;
 import org.jboss.osgi.plugins.facade.api.ServicePlugin;
 import org.jboss.osgi.plugins.filter.NoFilter;
-import org.jboss.osgi.plugins.metadata.AbstractOSGiMetaData;
-import org.jboss.osgi.plugins.metadata.spi.OSGiMetaData;
+import org.jboss.osgi.plugins.metadata.OSGiMetaData;
+import org.jboss.osgi.plugins.metadata.impl.AbstractOSGiMetaData;
 import org.jboss.osgi.plugins.resolver.BundleResolver;
 import org.jboss.util.collection.ConcurrentSet;
 import org.jboss.virtual.VFS;

Modified: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleState.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleState.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleState.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -31,7 +31,7 @@
 import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
 import org.jboss.logging.Logger;
 import org.jboss.osgi.plugins.facade.api.PackageAdminServicePlugin;
-import org.jboss.osgi.plugins.metadata.spi.OSGiMetaData;
+import org.jboss.osgi.plugins.metadata.OSGiMetaData;
 import org.jboss.virtual.VirtualFile;
 import org.osgi.framework.AdminPermission;
 import org.osgi.framework.Bundle;

Modified: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiSystemState.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiSystemState.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiSystemState.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -26,7 +26,7 @@
 import java.net.URL;
 import java.util.Enumeration;
 
-import org.jboss.osgi.plugins.metadata.spi.OSGiMetaData;
+import org.jboss.osgi.plugins.metadata.OSGiMetaData;
 import org.jboss.osgi.spi.NotImplementedException;
 import org.osgi.framework.BundleException;
 import org.osgi.framework.Constants;

Modified: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiBundleCapability.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiBundleCapability.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiBundleCapability.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -26,9 +26,9 @@
 import org.jboss.classloading.plugins.metadata.ModuleCapability;
 import org.jboss.classloading.spi.dependency.Module;
 import org.jboss.classloading.spi.metadata.Requirement;
-import org.jboss.osgi.plugins.metadata.spi.OSGiMetaData;
-import org.jboss.osgi.plugins.metadata.spi.Parameter;
-import org.jboss.osgi.plugins.metadata.spi.ParameterizedAttribute;
+import org.jboss.osgi.plugins.metadata.OSGiMetaData;
+import org.jboss.osgi.plugins.metadata.Parameter;
+import org.jboss.osgi.plugins.metadata.ParameterizedAttribute;
 import org.osgi.framework.Constants;
 import org.osgi.framework.Version;
 

Modified: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiBundleClassLoadingDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiBundleClassLoadingDeployer.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiBundleClassLoadingDeployer.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -37,9 +37,9 @@
 import org.jboss.osgi.plugins.facade.api.SystemPackagesPlugin;
 import org.jboss.osgi.plugins.facade.bundle.OSGiBundleManager;
 import org.jboss.osgi.plugins.facade.bundle.OSGiBundleState;
-import org.jboss.osgi.plugins.metadata.spi.OSGiMetaData;
-import org.jboss.osgi.plugins.metadata.spi.PackageAttribute;
-import org.jboss.osgi.plugins.metadata.spi.ParameterizedAttribute;
+import org.jboss.osgi.plugins.metadata.OSGiMetaData;
+import org.jboss.osgi.plugins.metadata.PackageAttribute;
+import org.jboss.osgi.plugins.metadata.ParameterizedAttribute;
 
 /**
  * OSGiBundleClassLoadingDeployer.<p>

Modified: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiBundleRequirement.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiBundleRequirement.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiBundleRequirement.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -25,9 +25,9 @@
 
 import org.jboss.classloading.plugins.metadata.ModuleRequirement;
 import org.jboss.classloading.spi.version.VersionRange;
-import org.jboss.osgi.plugins.metadata.AbstractVersionRange;
-import org.jboss.osgi.plugins.metadata.spi.Parameter;
-import org.jboss.osgi.plugins.metadata.spi.ParameterizedAttribute;
+import org.jboss.osgi.plugins.metadata.Parameter;
+import org.jboss.osgi.plugins.metadata.ParameterizedAttribute;
+import org.jboss.osgi.plugins.metadata.impl.AbstractVersionRange;
 import org.osgi.framework.Constants;
 
 /**

Modified: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiPackageCapability.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiPackageCapability.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiPackageCapability.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -32,11 +32,11 @@
 import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.osgi.plugins.facade.bundle.OSGiBundleManager;
 import org.jboss.osgi.plugins.facade.bundle.OSGiBundleState;
-import org.jboss.osgi.plugins.metadata.AbstractVersionRange;
-import org.jboss.osgi.plugins.metadata.spi.OSGiMetaData;
-import org.jboss.osgi.plugins.metadata.spi.PackageAttribute;
-import org.jboss.osgi.plugins.metadata.spi.Parameter;
-import org.jboss.osgi.plugins.metadata.spi.ParameterizedAttribute;
+import org.jboss.osgi.plugins.metadata.OSGiMetaData;
+import org.jboss.osgi.plugins.metadata.PackageAttribute;
+import org.jboss.osgi.plugins.metadata.Parameter;
+import org.jboss.osgi.plugins.metadata.ParameterizedAttribute;
+import org.jboss.osgi.plugins.metadata.impl.AbstractVersionRange;
 import org.jboss.osgi.plugins.resolver.BundleCapability;
 import org.jboss.osgi.plugins.resolver.BundleResolver;
 import org.osgi.framework.Constants;

Modified: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiPackageRequirement.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiPackageRequirement.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/facade/classloading/OSGiPackageRequirement.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -29,9 +29,9 @@
 import org.jboss.classloading.spi.version.VersionRange;
 import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.osgi.plugins.facade.bundle.OSGiBundleState;
-import org.jboss.osgi.plugins.metadata.AbstractVersionRange;
-import org.jboss.osgi.plugins.metadata.spi.PackageAttribute;
-import org.jboss.osgi.plugins.metadata.spi.Parameter;
+import org.jboss.osgi.plugins.metadata.PackageAttribute;
+import org.jboss.osgi.plugins.metadata.Parameter;
+import org.jboss.osgi.plugins.metadata.impl.AbstractVersionRange;
 import org.osgi.framework.Constants;
 
 /**

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractActivationPolicyMetaData.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractActivationPolicyMetaData.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractActivationPolicyMetaData.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,71 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.plugins.metadata;
-
-import java.io.Serializable;
-import java.util.List;
-
-import org.jboss.osgi.plugins.metadata.spi.ActivationPolicyMetaData;
-
-/**
- * Activation policy impl.
- *
- * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
-public class AbstractActivationPolicyMetaData implements ActivationPolicyMetaData, Serializable
-{
-   private static final long serialVersionUID = 1L;
-
-   private String type = "lazy";
-   private List<String> includes;
-   private List<String> excludes;
-
-   public String getType()
-   {
-      return type;
-   }
-
-   public void setType(String type)
-   {
-      this.type = type;
-   }
-
-   public List<String> getIncludes()
-   {
-      return includes;
-   }
-
-   public void setIncludes(List<String> includes)
-   {
-      this.includes = includes;
-   }
-
-   public List<String> getExcludes()
-   {
-      return excludes;
-   }
-
-   public void setExcludes(List<String> excludes)
-   {
-      this.excludes = excludes;
-   }
-}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractAttributeAware.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractAttributeAware.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractAttributeAware.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,60 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-import java.io.Serializable;
-
-import org.jboss.osgi.plugins.metadata.spi.AttributeAware;
-import org.jboss.util.JBossObject;
-import org.jboss.util.JBossStringBuilder;
-
-/**
- * Attribute holder.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public abstract class AbstractAttributeAware extends JBossObject implements AttributeAware, Serializable
-{
-   private static final long serialVersionUID = 1l;
-
-   protected String attribute;
-
-   protected AbstractAttributeAware(String attribute)
-   {
-      this.attribute = attribute;
-   }
-
-   public String getAttribute()
-   {
-      return attribute;
-   }
-
-   public void toShortString(JBossStringBuilder buffer)
-   {
-      buffer.append("attribute=" + attribute);
-   }
-
-   protected void toString(JBossStringBuilder buffer)
-   {
-      buffer.append("attribute=" + attribute);
-   }
-}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractAttributeMetaData.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractAttributeMetaData.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractAttributeMetaData.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,100 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-import java.io.Serializable;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.osgi.plugins.metadata.spi.AttributeMetaData;
-import org.jboss.osgi.plugins.metadata.spi.ServiceValueMetaData;
-import org.jboss.util.UnreachableStatementException;
-import org.osgi.framework.BundleContext;
-
-/**
- * ServiceAttributeMetaData.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class AbstractAttributeMetaData extends AbstractMetaDataVisitorNode implements AttributeMetaData, Serializable
-{
-   private static final long serialVersionUID = 1L;
-
-   /** The attribute name */
-   private String name;
-
-   /** The value */
-   private ServiceValueMetaData value;
-
-   public String getName()
-   {
-      return name;
-   }
-
-   /**
-    * Set the name.
-    *
-    * @param name the name.
-    */
-   public void setName(String name)
-   {
-      if (name == null)
-         throw new IllegalArgumentException("Null name");
-      this.name = name;
-   }
-
-   public ServiceValueMetaData getValue()
-   {
-      return value;
-   }
-
-   /**
-    * Set the value.
-    *
-    * @param value the value.
-    */
-   public void setValue(ServiceValueMetaData value)
-   {
-      if (value == null)
-         throw new IllegalArgumentException("Null value");
-      this.value = value;
-   }
-
-   /**
-    * Get the value
-    *
-    * @param bundleContext the bundle context
-    * @return the value
-    * @throws Exception for any error
-    */
-   public Object getValue(BundleContext bundleContext) throws Exception
-   {
-      try
-      {
-         return value.getValue(bundleContext);
-      }
-      catch (Throwable t)
-      {
-         DeploymentException.rethrowAsDeploymentException("Error configuring attribute " + name, t);
-         throw new UnreachableStatementException();
-      }
-   }
-}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractDependencyMetaData.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractDependencyMetaData.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractDependencyMetaData.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,117 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-import java.io.Serializable;
-
-import org.jboss.dependency.plugins.AbstractDependencyItem;
-import org.jboss.dependency.spi.ControllerState;
-import org.jboss.dependency.spi.DependencyItem;
-import org.jboss.osgi.plugins.metadata.spi.DependencyMetaData;
-import org.jboss.osgi.plugins.metadata.spi.ServiceControllerContext;
-import org.jboss.osgi.plugins.metadata.spi.ServiceMetaDataVisitor;
-import org.jboss.util.JBossStringBuilder;
-
-/**
- * A dependency.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class AbstractDependencyMetaData extends AbstractMetaDataVisitorNode
-      implements DependencyMetaData, Serializable
-{
-   private static final long serialVersionUID = 1L;
-
-   /** The dependency, may transient? */
-   protected Object dependency;
-
-   /**
-    * Create a new dependency
-    */
-   public AbstractDependencyMetaData()
-   {
-   }
-
-   /**
-    * Create a new dependency
-    *
-    * @param dependency the dependency
-    */
-   public AbstractDependencyMetaData(Object dependency)
-   {
-      this.dependency = dependency;
-   }
-
-   /**
-    * Set the dependency
-    *
-    * @param dependency the dependency
-    */
-   public void setDependency(Object dependency)
-   {
-      this.dependency = dependency;
-      flushJBossObjectCache();
-   }
-
-   public Object getDependency()
-   {
-      return dependency;
-   }
-
-   public void visit(ServiceMetaDataVisitor visitor)
-   {
-      ServiceControllerContext context = visitor.getControllerContext();
-      DependencyItem item = new LifecycleDependencyItem(context.getName(), ControllerState.CREATE);
-      visitor.addDependency(item);
-      item = new LifecycleDependencyItem(context.getName(), ControllerState.START);
-      visitor.addDependency(item);
-      
-      visitor.visit(this);
-   }
-
-   public void toString(JBossStringBuilder buffer)
-   {
-      buffer.append("dependency=").append(dependency);
-   }
-
-   public void toShortString(JBossStringBuilder buffer)
-   {
-      buffer.append(dependency);
-   }
-
-   /**
-    * A LifecycleDependencyItem.
-    */
-   public class LifecycleDependencyItem extends AbstractDependencyItem
-   {
-      /**
-       * Create a new LifecycleDependencyItem.
-       *
-       * @param name the name
-       * @param state the state
-       */
-      public LifecycleDependencyItem(Object name, ControllerState state)
-      {
-         super(name, dependency, state, state);
-      }
-   }
-}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractHolderMetaData.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractHolderMetaData.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractHolderMetaData.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,85 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-import java.io.Serializable;
-import java.util.Set;
-
-import org.jboss.beans.metadata.spi.ClassLoaderMetaData;
-import org.jboss.osgi.plugins.metadata.spi.DependencyMetaData;
-import org.jboss.osgi.plugins.metadata.spi.HolderMetaData;
-
-/**
- * Common OSGi reference or service impl.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public abstract class AbstractHolderMetaData extends AbstractMetaDataVisitorNode
-      implements HolderMetaData, Serializable
-{
-   private static final long serialVersionUID = 1l;
-
-   private String id;
-   private String anInterface;
-   private Set<DependencyMetaData> depends;
-   private ClassLoaderMetaData classLoaderMetaData;
-
-   public String getId()
-   {
-      return id;
-   }
-
-   public String getInterface()
-   {
-      return anInterface;
-   }
-
-   public Set<DependencyMetaData> getDepends()
-   {
-      return depends;
-   }
-
-   public ClassLoaderMetaData getContextClassLoader()
-   {
-      return classLoaderMetaData;
-   }
-
-   public void setId(String id)
-   {
-      this.id = id;
-   }
-
-   public void setInterface(String anInterface)
-   {
-      this.anInterface = anInterface;
-   }
-
-   public void setDepends(Set<DependencyMetaData> depends)
-   {
-      this.depends = depends;
-   }
-
-   public void setClassLoaderMetaData(ClassLoaderMetaData classLoaderMetaData)
-   {
-      this.classLoaderMetaData = classLoaderMetaData;
-   }
-}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractListenerMetaData.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractListenerMetaData.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractListenerMetaData.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,72 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-import java.io.Serializable;
-
-import org.jboss.osgi.plugins.metadata.spi.ListenerMetaData;
-
-/**
- * Simple listener meta data.
- * Referencing ref bean as a reference listener.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class AbstractListenerMetaData implements ListenerMetaData, Serializable
-{
-   private static final long serialVersionUID = 1l;
-
-   private String ref;
-   private String bindMethod;
-   private String unbindMethod;
-
-   public String getRef()
-   {
-      return ref;
-   }
-
-   public String getBindMethod()
-   {
-      return bindMethod;
-   }
-
-   public String getUnbindMethod()
-   {
-      return unbindMethod;
-   }
-
-   public void setRef(String ref)
-   {
-      this.ref = ref;
-   }
-
-   public void setBindMethod(String bindMethod)
-   {
-      this.bindMethod = bindMethod;
-   }
-
-   public void setUnbindMethod(String unbindMethod)
-   {
-      this.unbindMethod = unbindMethod;
-   }
-
-}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractMetaDataVisitorNode.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractMetaDataVisitorNode.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractMetaDataVisitorNode.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,62 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-import java.util.Iterator;
-import java.util.Set;
-
-import org.jboss.osgi.plugins.metadata.spi.ServiceMetaDataVisitor;
-import org.jboss.osgi.plugins.metadata.spi.ServiceMetaDataVisitorNode;
-import org.jboss.util.JBossObject;
-import org.jboss.util.collection.CollectionsFactory;
-
-/**
- * AbstractMetaDataVisitorNode.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public abstract class AbstractMetaDataVisitorNode extends JBossObject implements ServiceMetaDataVisitorNode
-{
-   public Iterator<? extends ServiceMetaDataVisitorNode> getChildren()
-   {
-      Set<ServiceMetaDataVisitorNode> children = CollectionsFactory.createLazySet();
-      addChildren(children);
-      if (children.size() == 0)
-         return null;
-      else
-         return children.iterator();
-   }
-
-   public void visit(ServiceMetaDataVisitor visitor)
-   {
-      visitor.visit(this);
-   }
-
-   /**
-    * Add to the children
-    *
-    * @param children the children
-    */
-   protected void addChildren(Set<ServiceMetaDataVisitorNode> children)
-   {
-   }
-}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractOSGiMetaData.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractOSGiMetaData.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractOSGiMetaData.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,281 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-import static org.jboss.osgi.plugins.metadata.ValueCreatorUtil.ACTIVATION_POLICY_VC;
-import static org.jboss.osgi.plugins.metadata.ValueCreatorUtil.INTEGER_VC;
-import static org.jboss.osgi.plugins.metadata.ValueCreatorUtil.PACKAGE_LIST_VC;
-import static org.jboss.osgi.plugins.metadata.ValueCreatorUtil.PARAM_ATTRIB_VC;
-import static org.jboss.osgi.plugins.metadata.ValueCreatorUtil.PATH_ATTRIB_LIST_VC;
-import static org.jboss.osgi.plugins.metadata.ValueCreatorUtil.QNAME_ATTRIB_LIST_VC;
-import static org.jboss.osgi.plugins.metadata.ValueCreatorUtil.STRING_LIST_VC;
-import static org.jboss.osgi.plugins.metadata.ValueCreatorUtil.STRING_VC;
-import static org.jboss.osgi.plugins.metadata.ValueCreatorUtil.URL_VC;
-import static org.jboss.osgi.plugins.metadata.ValueCreatorUtil.VERSION_VC;
-import static org.osgi.framework.Constants.BUNDLE_ACTIVATOR;
-import static org.osgi.framework.Constants.BUNDLE_CATEGORY;
-import static org.osgi.framework.Constants.BUNDLE_CLASSPATH;
-import static org.osgi.framework.Constants.BUNDLE_DESCRIPTION;
-import static org.osgi.framework.Constants.BUNDLE_LOCALIZATION;
-import static org.osgi.framework.Constants.BUNDLE_LOCALIZATION_DEFAULT_BASENAME;
-import static org.osgi.framework.Constants.BUNDLE_MANIFESTVERSION;
-import static org.osgi.framework.Constants.BUNDLE_NAME;
-import static org.osgi.framework.Constants.BUNDLE_NATIVECODE;
-import static org.osgi.framework.Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT;
-import static org.osgi.framework.Constants.BUNDLE_SYMBOLICNAME;
-import static org.osgi.framework.Constants.BUNDLE_UPDATELOCATION;
-import static org.osgi.framework.Constants.BUNDLE_VERSION;
-import static org.osgi.framework.Constants.DYNAMICIMPORT_PACKAGE;
-import static org.osgi.framework.Constants.EXPORT_PACKAGE;
-import static org.osgi.framework.Constants.FRAGMENT_HOST;
-import static org.osgi.framework.Constants.IMPORT_PACKAGE;
-import static org.osgi.framework.Constants.REQUIRE_BUNDLE;
-
-import java.net.URL;
-import java.util.Arrays;
-import java.util.Dictionary;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.jar.Manifest;
-import java.util.jar.Attributes.Name;
-
-import org.jboss.classloading.spi.version.VersionComparatorRegistry;
-import org.jboss.deployers.vfs.spi.deployer.helpers.AbstractManifestMetaData;
-import org.jboss.osgi.plugins.metadata.AbstractVersionRange.OSGiVersionToOSGiVersionComparator;
-import org.jboss.osgi.plugins.metadata.AbstractVersionRange.OSGiVersionToStringComparator;
-import org.jboss.osgi.plugins.metadata.AbstractVersionRange.OSGiVersionToVersionComparator;
-import org.jboss.osgi.plugins.metadata.spi.ActivationPolicyMetaData;
-import org.jboss.osgi.plugins.metadata.spi.OSGiMetaData;
-import org.jboss.osgi.plugins.metadata.spi.PackageAttribute;
-import org.jboss.osgi.plugins.metadata.spi.ParameterizedAttribute;
-import org.osgi.framework.Constants;
-import org.osgi.framework.Version;
-
-/**
- * Abstract OSGi meta data.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class AbstractOSGiMetaData extends AbstractManifestMetaData implements OSGiMetaData
-{
-   private static final long serialVersionUID = 1L;
-
-   static
-   {
-      VersionComparatorRegistry registry = VersionComparatorRegistry.getInstance();
-      registry.registerVersionComparator(Version.class, Version.class, new OSGiVersionToOSGiVersionComparator());
-      registry.registerVersionComparator(Version.class, org.jboss.classloading.spi.version.Version.class, new OSGiVersionToVersionComparator());
-      registry.registerVersionComparator(Version.class, String.class, new OSGiVersionToStringComparator());
-   }
-
-   protected transient Map<String, Object> cachedAttributes = new HashMap<String, Object>();
-
-   protected transient ParameterizedAttribute parameters;
-   
-   public AbstractOSGiMetaData()
-   {
-   }
-
-   public AbstractOSGiMetaData(Manifest manifest)
-   {
-      super(manifest);
-   }
-
-   @SuppressWarnings("unchecked")
-   public Dictionary<String, String> getHeaders(String locale)
-   {
-      // TODO localisation
-      Map<Name, String> attributes = (Map) getManifest().getMainAttributes();
-      Hashtable<String, String> result = new Hashtable<String, String>();
-      for (Entry<Name, String> entry : attributes.entrySet())
-         result.put(entry.getKey().toString(), entry.getValue());
-      return result;
-   }
-
-   public String getHeader(String key)
-   {
-      return get(key, STRING_VC);
-   }
-
-   public ActivationPolicyMetaData getBundleActivationPolicy()
-   {
-      return get("Bundle-ActivationPolicy", ACTIVATION_POLICY_VC);
-   }
-
-   public String getBundleActivator()
-   {
-      return get(BUNDLE_ACTIVATOR, STRING_VC);
-   }
-
-   public List<String> getBundleCategory()
-   {
-      return get(BUNDLE_CATEGORY, STRING_LIST_VC);
-   }
-
-   public List<String> getBundleClassPath()
-   {
-      return get(BUNDLE_CLASSPATH, STRING_LIST_VC, Arrays.asList("."));
-   }
-
-   public String getBundleDescription()
-   {
-      return get(BUNDLE_DESCRIPTION, STRING_VC);
-   }
-
-   public String getBundleLocalization()
-   {
-      return get(BUNDLE_LOCALIZATION, STRING_VC, BUNDLE_LOCALIZATION_DEFAULT_BASENAME);
-   }
-
-   public int getBundleManifestVersion()
-   {
-      return get(BUNDLE_MANIFESTVERSION, INTEGER_VC, 1);
-   }
-
-   public String getBundleName()
-   {
-      return get(BUNDLE_NAME, STRING_VC);
-   }
-
-   public List<ParameterizedAttribute> getBundleNativeCode()
-   {
-      return get(BUNDLE_NATIVECODE, PATH_ATTRIB_LIST_VC);
-   }
-
-   public List<String> getRequiredExecutionEnvironment()
-   {
-      return get(BUNDLE_REQUIREDEXECUTIONENVIRONMENT, STRING_LIST_VC);
-   }
-
-   public String getBundleSymbolicName()
-   {
-      String symbolicName = null;
-      
-      ParameterizedAttribute parameters = parseSymbolicName();
-      if (parameters != null)
-         symbolicName = parameters.getAttribute();
-
-      // [TODO] [JBOSGI-137] Cannot parse Bundle-SymbolicName
-      if (symbolicName == null)
-         symbolicName = getMainAttribute(Constants.BUNDLE_SYMBOLICNAME);
-      
-      return symbolicName;
-   }
-
-   public ParameterizedAttribute getBundleParameters()
-   {
-      return parseSymbolicName();
-   }
-   
-   public URL getBundleUpdateLocation()
-   {
-      return get(BUNDLE_UPDATELOCATION, URL_VC);
-   }
-
-   public Version getBundleVersion()
-   {
-      return get(BUNDLE_VERSION, VERSION_VC , Version.emptyVersion);
-   }
-
-   public List<PackageAttribute> getDynamicImports()
-   {
-      return get(DYNAMICIMPORT_PACKAGE, PACKAGE_LIST_VC);
-   }
-
-   public List<PackageAttribute> getExportPackages()
-   {
-      return get(EXPORT_PACKAGE, PACKAGE_LIST_VC);
-   }
-
-   public ParameterizedAttribute getFragmentHost()
-   {
-      return get(FRAGMENT_HOST, PARAM_ATTRIB_VC);
-   }
-
-   public List<PackageAttribute> getImportPackages()
-   {
-      return get(IMPORT_PACKAGE, PACKAGE_LIST_VC);
-   }
-
-   public List<ParameterizedAttribute> getRequireBundles()
-   {
-      return get(REQUIRE_BUNDLE, QNAME_ATTRIB_LIST_VC);
-   }
-
-   public boolean isSingleton()
-   {
-      parseSymbolicName();
-      if (parameters == null)
-         return false;
-      return "true".equals(parameters.getParameterValue(Constants.SINGLETON_DIRECTIVE, String.class));
-   }
-
-   public String getFragmentAttachment()
-   {
-      parseSymbolicName();
-      if (parameters == null)
-         return null;
-      return parameters.getParameterValue(Constants.FRAGMENT_ATTACHMENT_DIRECTIVE, String.class);
-   }
-
-   protected ParameterizedAttribute parseSymbolicName()
-   {
-      if (parameters == null)
-      {
-         List<ParameterizedAttribute> parsed = get(BUNDLE_SYMBOLICNAME, QNAME_ATTRIB_LIST_VC);
-         if (parsed == null || parsed.size() != 1)
-            return null;
-         parameters = parsed.get(0);
-      }
-      return parameters;
-   }
-
-   protected <T> T get(String key, ValueCreator<T> creator)
-   {
-      return get(key, creator, null);
-   }
-
-   @SuppressWarnings("unchecked")
-   protected <T> T get(String key, ValueCreator<T> creator, T defaultValue)
-   {
-      T value = (T)cachedAttributes.get(key);
-      if (value == null)
-      {
-         String attribute = getMainAttribute(key);
-         if (attribute != null)
-         {
-            value = creator.createValue(attribute);
-         }
-         else if (defaultValue != null)
-         {
-            value = defaultValue;
-         }
-         if (value != null)
-            cachedAttributes.put(key, value);
-      }
-      return value;
-   }
-
-}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractPackageAttribute.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractPackageAttribute.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractPackageAttribute.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,75 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-import java.io.Serializable;
-import java.util.Map;
-
-import org.jboss.osgi.plugins.metadata.spi.PackageAttribute;
-import org.jboss.osgi.plugins.metadata.spi.Parameter;
-import org.jboss.osgi.plugins.metadata.spi.VersionRange;
-import org.jboss.reflect.plugins.PackageInfoImpl;
-import org.jboss.reflect.spi.PackageInfo;
-import org.osgi.framework.Constants;
-
-/**
- * Package attribute impl.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class AbstractPackageAttribute extends AbstractParameterizedAttribute implements PackageAttribute, Serializable
-{
-   private static final long serialVersionUID = 1l;
-
-   protected PackageInfo packageInfo;
-   protected VersionRange versionRange;
-
-   public AbstractPackageAttribute(String attribute, Map<String, Parameter> parameters)
-   {
-      super(attribute, parameters);
-      packageInfo = new PackageInfoImpl(attribute);
-   }
-
-   public PackageInfo getPackageInfo()
-   {
-      return packageInfo;
-   }
-
-   public VersionRange getVersion()
-   {
-      if (versionRange == null)
-      {
-         Parameter parameter = getParameter(Constants.VERSION_ATTRIBUTE);
-         if (parameter != null)
-         {
-            if (parameter.isCollection())
-               throw new IllegalArgumentException("Duplicate version parameter.");
-            Object value = parameter.getValue();
-            if (value != null)
-            {
-               versionRange = AbstractVersionRange.parseRangeSpec(value.toString());
-            }
-         }
-      }
-      return versionRange;
-   }
-}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractParameter.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractParameter.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractParameter.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,97 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.HashSet;
-
-import org.jboss.osgi.plugins.metadata.spi.Parameter;
-import org.jboss.util.JBossObject;
-import org.jboss.util.JBossStringBuilder;
-
-/**
- * Parameter impl.
- * It uses [Hash]Set to hold the values.
- * So duplicate values (by hash) will be ignored.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class AbstractParameter extends JBossObject implements Parameter, Serializable
-{
-   /** The serialVersionUID */
-   private static final long serialVersionUID = -7920499358318841779L
-   ;
-   protected Collection<String> values;
-
-   public AbstractParameter()
-   {
-      super();
-      values = new HashSet<String>();
-   }
-
-   public AbstractParameter(String parameter)
-   {
-      this();
-      addValue(parameter);
-   }
-
-   public void addValue(String value)
-   {
-      values.add(value);
-   }
-
-   public Object getValue()
-   {
-      if (values.isEmpty())
-         return null;
-      else if (values.size() == 1)
-         return values.iterator().next();
-      else
-         return values;
-   }
-
-   public boolean isCollection()
-   {
-      return values.size() > 1;
-   }
-
-   protected int getHashCode()
-   {
-      return values.hashCode();
-   }
-
-   public boolean equals(Object obj)
-   {
-      return (obj instanceof AbstractParameter && values.equals(((AbstractParameter)obj).values));
-   }
-
-   public void toShortString(JBossStringBuilder buffer)
-   {
-      buffer.append("value=" + getValue());
-   }
-
-   protected void toString(JBossStringBuilder buffer)
-   {
-      buffer.append("value=" + getValue());
-   }
-}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractParameterizedAttribute.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractParameterizedAttribute.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractParameterizedAttribute.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,83 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-import java.util.Map;
-
-import org.jboss.osgi.plugins.metadata.spi.Parameter;
-import org.jboss.osgi.plugins.metadata.spi.ParameterizedAttribute;
-import org.jboss.util.JBossStringBuilder;
-
-/**
- * Parameter attribute impl.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class AbstractParameterizedAttribute extends AbstractAttributeAware implements ParameterizedAttribute
-{
-   private static final long serialVersionUID = 1l;
-   
-   protected Map<String, Parameter> parameters;
-
-   public AbstractParameterizedAttribute(String attribute, Map<String, Parameter> parameters)
-   {
-      super(attribute);
-      this.parameters = parameters;
-   }
-
-   public Map<String, Parameter> getParameters()
-   {
-      return parameters;
-   }
-
-   public Parameter getParameter(String name)
-   {
-      return parameters.get(name);
-   }
-
-   /**
-    * Get a parameter
-    * 
-    * @param <T> the expected type
-    * @param name the name of the parameter
-    * @param type the expected type
-    * @return the parmaeter value
-    */
-   public <T> T getParameterValue(String name, Class<T> type)
-   {
-      Parameter parameter = getParameter(name);
-      if (parameter == null)
-         return null;
-      if (parameter.isCollection())
-         throw new IllegalArgumentException("Duplicate " + name + " parameter.");
-      Object value = parameter.getValue();
-      if (value == null)
-         return null;
-      return type.cast(value);
-   }
-
-   protected void toString(JBossStringBuilder buffer)
-   {
-      super.toString(buffer);
-      buffer.append(" parameters=" + parameters);
-   }
-}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractReferenceMetaData.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractReferenceMetaData.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractReferenceMetaData.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,123 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-import java.util.List;
-import java.util.Set;
-
-import org.jboss.aop.proxy.container.GeneratedAOPProxyFactory;
-import org.jboss.beans.metadata.spi.MetaDataVisitor;
-import org.jboss.beans.metadata.spi.MetaDataVisitorNode;
-import org.jboss.beans.metadata.spi.PropertyMetaData;
-import org.jboss.dependency.spi.Cardinality;
-import org.jboss.osgi.plugins.metadata.spi.ListenerMetaData;
-import org.jboss.osgi.plugins.metadata.spi.ReferenceMetaData;
-import org.jboss.osgi.plugins.metadata.spi.ServiceMetaDataVisitor;
-import org.osgi.framework.BundleContext;
-
-/**
- * OSGi reference meta data.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class AbstractReferenceMetaData extends AbstractHolderMetaData implements ReferenceMetaData
-{
-   private static final long serialVersionUID = 1l;
-
-   private String filter;
-   private Cardinality cardinality = Cardinality.ONE_TO_ONE;
-   private Integer timeout;
-   private List<ListenerMetaData> listeners;
-   private Set<PropertyMetaData> properties;
-
-   public Object getUnderlyingValue()
-   {
-      return getId();
-   }
-
-   public Object getValue(BundleContext bundleContext) throws Throwable
-   {
-      // tdo - add dynamic behaviour
-      return GeneratedAOPProxyFactory.createProxy(null, null);
-   }
-
-   public void visit(ServiceMetaDataVisitor visitor)
-   {
-      // tdo - add dependency
-      super.visit(visitor);
-   }
-
-   public String getFilter()
-   {
-      return filter;
-   }
-
-   public Cardinality getCardinality()
-   {
-      return cardinality;
-   }
-
-   public Integer getTimeout()
-   {
-      return timeout;
-   }
-
-   public List<ListenerMetaData> getListeners()
-   {
-      return listeners;
-   }
-
-   public Set<PropertyMetaData> getProperties()
-   {
-      return properties;
-   }
-
-   public Class<?> getType(MetaDataVisitor visitor, MetaDataVisitorNode previous) throws Throwable
-   {
-      return null;
-   }
-
-   public void setFilter(String filter)
-   {
-      this.filter = filter;
-   }
-
-   public void setCardinality(Cardinality cardinality)
-   {
-      this.cardinality = cardinality;
-   }
-
-   public void setTimeout(Integer timeout)
-   {
-      this.timeout = timeout;
-   }
-
-   public void setListeners(List<ListenerMetaData> listeners)
-   {
-      this.listeners = listeners;
-   }
-
-   public void setProperties(Set<PropertyMetaData> properties)
-   {
-      this.properties = properties;
-   }
-}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractServiceDeployment.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractServiceDeployment.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractServiceDeployment.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,77 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-import java.util.List;
-
-import org.jboss.osgi.plugins.metadata.spi.ServiceDeployment;
-import org.jboss.osgi.plugins.metadata.spi.ServiceMetaData;
-import org.jboss.util.JBossObject;
-import org.jboss.util.JBossStringBuilder;
-
-/**
- * An abstract service deployment
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class AbstractServiceDeployment extends JBossObject implements ServiceDeployment
-{
-   /** The name of the deployment */
-   protected String name;
-
-   /* The services list */
-   protected List<ServiceMetaData> services;
-
-   public String getName()
-   {
-      return name;
-   }
-
-   public void setName(String name)
-   {
-      this.name = name;
-      flushJBossObjectCache();
-   }
-
-   public List<ServiceMetaData> getServices()
-   {
-      return services;
-   }
-
-   public void setServices(List<ServiceMetaData> services)
-   {
-      this.services = services;
-   }
-
-   public void toString(JBossStringBuilder buffer)
-   {
-      buffer.append("name=").append(name);
-      if (services != null)
-         buffer.append(" services=").append(services);
-   }
-
-   public void toShortString(JBossStringBuilder buffer)
-   {
-      buffer.append(name);
-   }
-
-}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractServiceMetaData.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractServiceMetaData.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractServiceMetaData.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,109 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.jboss.osgi.plugins.metadata.spi.AttributeMetaData;
-import org.jboss.osgi.plugins.metadata.spi.ServiceMetaData;
-import org.jboss.osgi.plugins.metadata.spi.ServiceMetaDataVisitor;
-
-/**
- * OSGi service meta data.
- * Register ref bean as an OSGi service with interface or interfaces.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class AbstractServiceMetaData extends AbstractHolderMetaData implements ServiceMetaData
-{
-   private static final long serialVersionUID = 1l;
-
-   private Set<String> interfaces;
-   private Map<String, String> serviceProperties;
-   private String ref;
-   private boolean lazyInit;
-
-   /** The references */
-   private List<AttributeMetaData> attributes = Collections.emptyList();
-
-   /** The dependencies */
-
-   public void visit(ServiceMetaDataVisitor visitor)
-   {
-      // tdo - add children, depend on ref bean from MC
-      super.visit(visitor);
-   }
-
-   public List<AttributeMetaData> getAttributes()
-   {
-      return attributes;
-   }
-
-   public Set<String> getInterfaces()
-   {
-      return interfaces;
-   }
-
-   public Map<String, String> getServiceProperties()
-   {
-      return serviceProperties;
-   }
-
-   public String getRef()
-   {
-      return ref;
-   }
-
-   public boolean getLazyInit()
-   {
-      return lazyInit;
-   }
-
-   public void setAttributes(List<AttributeMetaData> attributes)
-   {
-      this.attributes = attributes;
-   }
-
-   public void setInterfaces(Set<String> interfaces)
-   {
-      this.interfaces = interfaces;
-   }
-
-   public void setServiceProperties(Map<String, String> serviceProperties)
-   {
-      this.serviceProperties = serviceProperties;
-   }
-
-   public void setRef(String ref)
-   {
-      this.ref = ref;
-   }
-
-   public void setLazyInit(boolean lazyInit)
-   {
-      this.lazyInit = lazyInit;
-   }
-
-}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractValueCreator.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractValueCreator.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,62 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-import org.jboss.logging.Logger;
-
-/**
- * Abstract value creator.
- * Extend this one for safe string usage.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
-*/
-abstract class AbstractValueCreator<T> implements ValueCreator<T>
-{
-   protected Logger log = Logger.getLogger(getClass());
-   private boolean trim;
-
-   protected AbstractValueCreator()
-   {
-      this(false);
-   }
-
-   protected AbstractValueCreator(boolean trim)
-   {
-      this.trim = trim;
-   }
-
-   public T createValue(String attribute)
-   {
-      if (attribute == null)
-         return null;
-      if (trim)
-         attribute = attribute.trim();
-      return useString(attribute);
-   }
-
-   /**
-    * Use this method on non-null trimmed string.
-    * @param attibute non-null trimmed string
-    * @return expected value
-    */
-   protected abstract T useString(String attibute);
-}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractVersionRange.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractVersionRange.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractVersionRange.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,207 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-import java.io.Serializable;
-import java.util.StringTokenizer;
-
-import org.jboss.classloading.spi.version.VersionComparator;
-import org.jboss.osgi.plugins.metadata.spi.VersionRange;
-import org.osgi.framework.Version;
-
-/**
- * Represents an OSGi version range:
- * version-range ::= interval | atleast
- * interval ::= ( '[' | '(' ) floor ',' ceiling ( ']' | ')' )
- * atleast ::= version
- * floor ::= version
- * ceiling ::= version
- *
- * [TODO] do we really need this extra class or just use our version range?
- * @author Scott.Stark at jboss.org
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- * @author adrian at jboss.org
- */
-public class AbstractVersionRange extends org.jboss.classloading.spi.version.VersionRange implements VersionRange, Serializable
-{
-   /** The serialVersionUID */
-   private static final long serialVersionUID = -178825219621278882L;
-   
-   /**
-    * Get the version range from a string
-    * 
-    * @param rangeSpec the range spec
-    * @return the version range
-    */
-   public static VersionRange valueOf(String rangeSpec)
-   {
-      return parseRangeSpec(rangeSpec);
-   }
-
-   /**
-    * Parse a range spec
-    * 
-    * @param rangeSpec
-    * @return the version range
-    */
-   public static VersionRange parseRangeSpec(String rangeSpec)
-   {
-      if (rangeSpec == null)
-         throw new IllegalArgumentException("Null rangeSpec");
-      
-      // Handle version strings with quotes 
-      if (rangeSpec.startsWith("\"") && rangeSpec.endsWith("\""))
-         rangeSpec = rangeSpec.substring(1, rangeSpec.length() - 1);
-      
-      Version floor = null;
-      Version ceiling = null;
-      StringTokenizer st = new StringTokenizer(rangeSpec, ",[]()", true);
-      Boolean floorIsGreaterThan = null;
-      Boolean ceilingIsLessThan = null;
-      boolean mid = false;
-      while (st.hasMoreTokens())
-      {
-         String token = st.nextToken();
-         if (token.equals("["))
-            floorIsGreaterThan = false;
-         else if (token.equals("("))
-            floorIsGreaterThan = true;
-         else if (token.equals("]"))
-            ceilingIsLessThan = false;
-         else if (token.equals(")"))
-            ceilingIsLessThan = true;
-         else if (token.equals(","))
-            mid = true;
-         else if (token.equals("\"") == false)
-         {
-            // A version token
-            if (floor == null)
-               floor = new Version(token);
-            else
-               ceiling = new Version(token);
-         }
-
-      }
-      // check for parenthesis
-      if (floorIsGreaterThan == null || ceilingIsLessThan == null)
-      {
-         // non-empty interval usage
-         if (mid)
-            throw new IllegalArgumentException("Missing parenthesis: " + rangeSpec);
-         // single value
-         floorIsGreaterThan = false;
-         ceilingIsLessThan = false;
-      }
-
-      return new AbstractVersionRange(floor, ceiling, floorIsGreaterThan, ceilingIsLessThan);
-   }
-
-   /**
-    * Create a new AbstractVersionRange.
-    * 
-    * @param floor the floor
-    * @param ceiling the ceiling
-    * @param floorIsLessThan whether the floor is <
-    * @param ceilingIsLessThan whether the ceiling is <
-    */
-   public AbstractVersionRange(Version floor, Version ceiling, boolean floorIsLessThan, boolean ceilingIsLessThan)
-   {
-      super(floor == null ? Version.emptyVersion : floor, floorIsLessThan == false, ceiling, ceilingIsLessThan == false);
-   }
-
-   /**
-    * Get the floor
-    * 
-    * @return the floor
-    */
-   public Version getFloor()
-   {
-      return (Version) getLow();
-   }
-
-   /**
-    * Get the ceiling
-    * 
-    * @return the ceiling
-    */
-   public Version getCeiling()
-   {
-      return (Version) getHigh();
-   }
-
-   /**
-    * Test whether the version is in range
-    * 
-    * @return true when the version is in range
-    */
-   public boolean isInRange(Version v)
-   {
-      return super.isInRange(v);
-   }
-
-   /**
-    * OSGiVersionToOSGiVersionComparator.
-    */
-   public static class OSGiVersionToOSGiVersionComparator implements VersionComparator<Version, Version>
-   {
-      public int compare(Version t, Version u)
-      {
-         return t.compareTo(u);
-      }
-   }
-
-   /**
-    * OSGiVersionToVersionComparator.
-    */
-   public static class OSGiVersionToVersionComparator implements VersionComparator<Version, org.jboss.classloading.spi.version.Version>
-   {
-      public int compare(Version t, org.jboss.classloading.spi.version.Version u)
-      {
-         int result = t.getMajor() - u.getMajor();
-         if (result != 0)
-            return result;
-
-         result = t.getMinor() - u.getMinor();
-         if (result != 0)
-            return result;
-
-         result = t.getMicro() - u.getMicro();
-         if (result != 0)
-            return result;
-
-         String q1 = t.getQualifier();
-         String q2 = u.getQualifier();
-         return q1.compareTo(q2);
-      }
-   }
-
-   /**
-    * VersionToStringComparator.
-    */
-   public static class OSGiVersionToStringComparator implements VersionComparator<Version, String>
-   {
-      public int compare(Version t, String u)
-      {
-         return t.compareTo(Version.parseVersion(u));
-      }
-   }
-}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ActivationPolicyMDValueCreator.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ActivationPolicyMDValueCreator.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ActivationPolicyMDValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,74 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-import java.util.Arrays;
-
-import org.jboss.osgi.plugins.metadata.spi.ActivationPolicyMetaData;
-
-/**
- * Activation policy value creator.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
-*/
-class ActivationPolicyMDValueCreator extends AbstractValueCreator<ActivationPolicyMetaData>
-{
-   private static final String INCLUDE = "include:=";
-   private static final String EXCLUDE = "exclude:=";
-
-   public ActivationPolicyMDValueCreator()
-   {
-      super(true);
-   }
-
-   protected ActivationPolicyMetaData useString(String attibute)
-   {
-      AbstractActivationPolicyMetaData aap = new AbstractActivationPolicyMetaData();
-      String[] split = attibute.split(";");
-      aap.setType(split[0]);
-      if (split.length > 1)
-         readDirective(aap, split[1]);
-      if (split.length > 2)
-         readDirective(aap, split[2]);
-      return aap;
-   }
-
-   /**
-    * Read the directive.
-    *
-    * @param aap the activation policy
-    * @param directive the directive
-    */
-   protected void readDirective(AbstractActivationPolicyMetaData aap, String directive)
-   {
-      if (directive.startsWith(INCLUDE))
-      {
-         String[] includes = directive.substring(INCLUDE.length() + 1, directive.length() - 1).split(",");
-         aap.setIncludes(Arrays.asList(includes));
-      }
-      else if (directive.startsWith(EXCLUDE))
-      {
-         String[] excludes = directive.substring(EXCLUDE.length() + 1, directive.length() - 1).split(",");
-         aap.setExcludes(Arrays.asList(excludes));
-      }
-   }
-}
\ No newline at end of file

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ActivationPolicyMetaData.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/spi/ActivationPolicyMetaData.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ActivationPolicyMetaData.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ActivationPolicyMetaData.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,53 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata;
+
+import java.util.List;
+
+/**
+ * OSGi activation policy metadata.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface ActivationPolicyMetaData
+{
+   /**
+    * Get the type.
+    *
+    * @return the type
+    */
+   String getType();
+
+   /**
+    * Get include packages.
+    *
+    * @return the include packages
+    */
+   List<String> getIncludes();
+
+   /**
+    * Get the exclude packages.
+    *
+    * @return the exclude packages
+    */
+   List<String> getExcludes();
+}
\ No newline at end of file

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AttributeAware.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/spi/AttributeAware.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AttributeAware.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AttributeAware.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,37 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata;
+
+/**
+ * Attribute string value holder.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface AttributeAware
+{
+   /**
+    * Get the attribute.
+    *
+    * @return string attribute value
+    */
+   String getAttribute();
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AttributeMetaData.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/spi/AttributeMetaData.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AttributeMetaData.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AttributeMetaData.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,44 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata;
+
+/**
+ * ServiceAttributeMetaData.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface AttributeMetaData
+{
+   /**
+    * Get the name.
+    *
+    * @return the name.
+    */
+   String getName();
+
+   /**
+    * Get the value.
+    *
+    * @return the value.
+    */
+   ServiceValueMetaData getValue();
+}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/BooleanValueCreator.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/BooleanValueCreator.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/BooleanValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,45 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-/**
- * Parse boolean from string.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
-*/
-class BooleanValueCreator extends AbstractValueCreator<Boolean>
-{
-   public BooleanValueCreator()
-   {
-      super();
-   }
-
-   public BooleanValueCreator(boolean trim)
-   {
-      super(trim);
-   }
-
-   public Boolean useString(String attribute)
-   {
-      return Boolean.valueOf(attribute);
-   }
-}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/CollectionValueCreator.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/CollectionValueCreator.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/CollectionValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,41 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-import java.util.Collection;
-
-/**
- * Create value from collection of attributes.
- *
- * @param <T> expected type
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public interface CollectionValueCreator<T> extends ValueCreator<T>
-{
-   /**
-    * Create value from string attribute.
-    *
-    * @param attributes collection of strings to get value from
-    * @return value
-    */
-   T createValue(Collection<String> attributes);
-}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/DependencyMetaData.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/spi/DependencyMetaData.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/DependencyMetaData.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/DependencyMetaData.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,37 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata;
+
+/**
+ * Metadata about what a osgi service's dependency.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface DependencyMetaData
+{
+   /**
+    * What is the dependency
+    *
+    * @return the dependency
+    */
+   Object getDependency();
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/HolderMetaData.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/spi/HolderMetaData.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/HolderMetaData.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/HolderMetaData.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,62 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata;
+
+import java.util.Set;
+
+import org.jboss.beans.metadata.spi.ClassLoaderMetaData;
+
+/**
+ * Common OSGi meta data mainAttributes.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface HolderMetaData
+{
+   /**
+    * Get the element id.
+    *
+    * @return unique string id
+    */
+   String getId();
+
+   /**
+    * Get the exposed interface.
+    *
+    * @return qualified interface name.
+    */
+   String getInterface();
+
+   /**
+    * Get the dependencies.
+    *
+    * @return set of dependencies.
+    */
+   Set<DependencyMetaData> getDepends();
+
+   /**
+    * Get the classloader metadata.
+    *
+    * @return classloader metadata
+    */
+   ClassLoaderMetaData getContextClassLoader();
+}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/IntegerValueCreator.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/IntegerValueCreator.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/IntegerValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,45 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-/**
- * Parse int from string.
- * 
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
-*/
-class IntegerValueCreator extends AbstractValueCreator<Integer>
-{
-   public IntegerValueCreator()
-   {
-      super();
-   }
-
-   public IntegerValueCreator(boolean trim)
-   {
-      super(trim);
-   }
-
-   public Integer useString(String attribute)
-   {
-      return Integer.valueOf(attribute);
-   }
-}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ListValueCreator.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ListValueCreator.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ListValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,43 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-import java.util.List;
-
-/**
- * Create value list from string attribute.
- *
- * @param <T> expected component type
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-abstract class ListValueCreator<T> extends AbstractValueCreator<List<T>>   
-{
-   protected ListValueCreator()
-   {
-      super();
-   }
-
-   protected ListValueCreator(boolean trim)
-   {
-      super(trim);
-   }
-}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ListenerMetaData.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/spi/ListenerMetaData.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ListenerMetaData.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ListenerMetaData.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,36 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata;
+
+/**
+ * Simple listener meta data - referencing bean as listener.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface ListenerMetaData
+{
+   String getRef();
+
+   String getBindMethod();
+
+   String getUnbindMethod();
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/OSGiMetaData.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/spi/OSGiMetaData.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/OSGiMetaData.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/OSGiMetaData.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,200 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata;
+
+import java.net.URL;
+import java.util.Dictionary;
+import java.util.List;
+
+import org.jboss.deployers.vfs.spi.deployer.ManifestMetaData;
+import org.osgi.framework.Version;
+
+/**
+ * OSGi specific manifest meta data.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface OSGiMetaData extends ManifestMetaData
+{
+   /**
+    * Get the headers
+    * 
+    * @param locale the locale to use
+    * @return the headers
+    */
+   Dictionary<String, String> getHeaders(String locale);
+   
+   /**
+    * Extension point to read custom manifest headers.
+    *
+    * @param key the header key
+    * @return value or null of no such header
+    */
+   String getHeader(String key);
+
+   /**
+    * Get bundle activation policy.
+    *
+    * @return bundle activation policy
+    */
+   ActivationPolicyMetaData getBundleActivationPolicy();
+
+   /**
+    * Get bundle activator class name.
+    *
+    * @return bundle activator classname or null if no such attribute
+    */
+   String getBundleActivator();
+
+   /**
+    * Get the bundle category
+    *
+    * @return list of category names
+    */
+   List<String> getBundleCategory();
+
+   /**
+    * Get the bundle classpath
+    *
+    * @return list of JAR file path names or directories inside bundle
+    */
+   List<String> getBundleClassPath();
+
+   /**
+    * Get the description
+    *
+    * @return a description
+    */
+   String getBundleDescription();
+
+   /**
+    * Get the localization's location
+    *
+    * @return location in the bundle for localization files
+    */
+   String getBundleLocalization();
+
+   /**
+    * Get the bundle manifest version
+    *
+    * @return bundle's specification number
+    */
+   int getBundleManifestVersion();
+
+   /**
+    * Get the name
+    *
+    * @return readable name
+    */
+   String getBundleName();
+
+   /**
+    * Get native code libs
+    * @return native libs contained in the bundle
+    */
+   List<ParameterizedAttribute> getBundleNativeCode();
+
+   /**
+    * Get required exectuion envs
+    *
+    * @return list of execution envs that must be present on the Service Platform
+    */
+   List<String> getRequiredExecutionEnvironment();
+
+   /**
+    * Get bundle symbolic name.
+    *
+    * @return bundle's symbolic name
+    */
+   String getBundleSymbolicName();
+
+   /**
+    * Get the bundle parameters
+    * 
+    * @return the bundle parameters
+    */
+   ParameterizedAttribute getBundleParameters();
+
+   /**
+    * Get the update url.
+    *
+    * @return URL of an update bundle location
+    */
+   URL getBundleUpdateLocation();
+
+   /**
+    * Get bundle's version.
+    *
+    * @return version of this bundle
+    */
+   Version getBundleVersion();
+
+   /**
+    * Get dynamic imports.
+    *
+    * @return package names that should be dynamically imported when needed
+    */
+   List<PackageAttribute> getDynamicImports();
+
+   /**
+    * Get the export packages.
+    *
+    * @return exported packages
+    */
+   List<PackageAttribute> getExportPackages();
+
+   /**
+    * Get the fragment host.
+    *
+    * @return host bundle for this fragment
+    */
+   ParameterizedAttribute getFragmentHost();
+
+   /**
+    * Get the import packages.
+    *
+    * @return imported packages.
+    */
+   List<PackageAttribute> getImportPackages();
+
+   /**
+    * Get the required exports
+    *
+    * @return required exports from anoter bundle
+    */
+   List<ParameterizedAttribute> getRequireBundles();
+   
+   /**
+    * Whether the bundle is a singleton
+    * 
+    * @return true when it is a singleton
+    */
+   boolean isSingleton();
+   
+   /**
+    * Get the fragment attrachment
+    * 
+    * todo fragments
+    * @return the fragment attachment
+    */
+   String getFragmentAttachment();
+}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/OSGiParameters.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/OSGiParameters.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/OSGiParameters.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,125 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jboss.logging.Logger;
-import org.jboss.osgi.plugins.metadata.spi.Parameter;
-import org.jboss.osgi.plugins.metadata.spi.VersionRange;
-
-import static org.osgi.framework.Constants.*;
-
-/**
- * OSGi parameter values.
- * Util for transforming parameter info to actual useful values.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class OSGiParameters
-{
-   protected static Logger log = Logger.getLogger(OSGiParameters.class);
-
-   protected Map<String, Parameter> parameters;
-   protected Map<String, Object> cachedAttributes;
-
-   public OSGiParameters(Map<String, Parameter> parameters)
-   {
-      this.parameters = Collections.unmodifiableMap(parameters);
-      this.cachedAttributes = new HashMap<String, Object>();
-   }
-
-   protected Map<String, Parameter> getParameters()
-   {
-      return parameters;
-   }
-
-   public VersionRange getVersion()
-   {
-      return get(VERSION_ATTRIBUTE, ValueCreatorUtil.VERSION_RANGE_VC);
-   }
-
-   public String getBundleSymbolicName()
-   {
-      return get(BUNDLE_SYMBOLICNAME_ATTRIBUTE, ValueCreatorUtil.STRING_VC);
-   }
-
-   public VersionRange getBundleVersion()
-   {
-      return get(BUNDLE_VERSION_ATTRIBUTE, ValueCreatorUtil.VERSION_RANGE_VC);
-   }
-
-   public String getVisibility()
-   {
-      return get(VISIBILITY_DIRECTIVE, ValueCreatorUtil.STRING_VC, VISIBILITY_PRIVATE);
-   }
-
-   public String getResolution()
-   {
-      return get(RESOLUTION_DIRECTIVE, ValueCreatorUtil.STRING_VC, RESOLUTION_MANDATORY);
-   }
-
-   protected <T> T get(String key, ValueCreator<T> creator)
-   {
-      return get(key, creator, null);
-   }
-
-   @SuppressWarnings("unchecked")
-   protected <T> T get(String key, ValueCreator<T> creator, T defaultValue)
-   {
-      T value = (T)cachedAttributes.get(key);
-      if (value == null)
-      {
-         Parameter parameter = parameters.get(key);
-         if (parameter != null)
-         {
-            Object paramValue = parameter.getValue();
-            if(parameter.isCollection())
-            {
-               if (creator instanceof CollectionValueCreator)
-               {
-                  CollectionValueCreator<T> cvc = (CollectionValueCreator<T>)creator;
-                  value = cvc.createValue((Collection<String>)paramValue);
-               }
-               else
-               {
-                  log.warn("Unable to create proper value from " + creator + " for parameter: " + parameter);
-               }
-            }
-            else
-            {
-               value = creator.createValue(paramValue.toString());
-            }
-         }
-         else if (defaultValue != null)
-         {
-            value = defaultValue;
-         }
-         if (value != null)
-            cachedAttributes.put(key, value);
-      }
-      return value;
-   }
-}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/PackageAttribute.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/spi/PackageAttribute.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/PackageAttribute.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/PackageAttribute.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,42 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata;
+
+import org.jboss.reflect.spi.PackageInfo;
+
+/**
+ * A package info.
+ * Includes version and properties.
+ * 
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface PackageAttribute extends VersionRangeAttribute, ParameterizedAttribute
+{
+   /**
+    * Get the package info.
+    * Must 'match' getAttribute method
+    * from AttributeAware interface. 
+    *
+    * @return package info
+    */
+   PackageInfo getPackageInfo();
+}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/PackageAttributeListValueCreator.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/PackageAttributeListValueCreator.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/PackageAttributeListValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,49 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.osgi.plugins.metadata.spi.PackageAttribute;
-
-/**
- * Create package attribute list from string attribute.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-class PackageAttributeListValueCreator extends ListValueCreator<PackageAttribute>
-{
-   public List<PackageAttribute> useString(String attibute)
-   {
-      List<PackageAttribute> list = new ArrayList<PackageAttribute>();
-      try
-      {
-         HeaderValue.parsePackages(attibute, list, log.isTraceEnabled());
-      }
-      catch (ParseException e)
-      {
-         log.error("Exception parsing package headers.", e);
-      }
-      return list;
-   }
-}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/Parameter.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/spi/Parameter.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/Parameter.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/Parameter.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,54 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata;
+
+/**
+ * Parameter interface - single value or set of values.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface Parameter
+{
+   /**
+    * Get value.
+    * Simple string value or collection of string values.
+    *
+    * @return value
+    */
+   Object getValue();
+
+   /**
+    * Add value.
+    * 
+    * @param value string to add
+    */
+   void addValue(String value);
+
+   /**
+    * Has multiple values.
+    * Used when same name is used for multiple parameter values.
+    * Value _can_ be casted into Collection<String>.
+    *
+    * @return true is returned type is Collection, otherwise false
+    */
+   boolean isCollection();
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ParameterizedAttribute.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/spi/ParameterizedAttribute.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ParameterizedAttribute.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ParameterizedAttribute.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,59 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata;
+
+import java.util.Map;
+
+/**
+ * Attribute with parameters.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ */
+public interface ParameterizedAttribute extends AttributeAware
+{
+   /**
+    * Get the parameters.
+    *
+    * @return properties for this attribute
+    */
+   Map<String, Parameter> getParameters();
+
+   /**
+    * Get the parameter by name.
+    * Helper method to getParameters method.
+    *
+    * @param name parameter's name
+    * @return parameter value
+    */
+   Parameter getParameter(String name);
+
+   /**
+    * Get a parameter value
+    * 
+    * @param <T> the expected type
+    * @param name the name of the parameter
+    * @param type the expected type
+    * @return the parmaeter value
+    */
+   <T> T getParameterValue(String name, Class<T> type);
+}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ParameterizedAttributeListValueCreator.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ParameterizedAttributeListValueCreator.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ParameterizedAttributeListValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,52 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.osgi.plugins.metadata.spi.ParameterizedAttribute;
-
-/**
- * Create parameterized attribute list from string attribute.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-abstract class ParameterizedAttributeListValueCreator extends ListValueCreator<ParameterizedAttribute>
-{
-   public List<ParameterizedAttribute> useString(String attribute)
-   {
-      List<ParameterizedAttribute> list = new ArrayList<ParameterizedAttribute>();
-      parseAttribute(attribute, list, log.isTraceEnabled());
-      return list;
-   }
-
-   /**
-    * Use appropriate JavaCC parsing util.
-    *
-    * @param attribute string value to parse
-    * @param list data holder list
-    * @param trace log trace
-    */
-   protected abstract void parseAttribute(String attribute, List<ParameterizedAttribute> list, boolean trace);
-
-}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ParameterizedAttributeValueCreator.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ParameterizedAttributeValueCreator.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ParameterizedAttributeValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,41 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-import java.util.List;
-
-import org.jboss.osgi.plugins.metadata.spi.ParameterizedAttribute;
-
-/**
- * Create paramertized attribute from string attribute.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-class ParameterizedAttributeValueCreator extends AbstractValueCreator<ParameterizedAttribute>
-{
-   public ParameterizedAttribute useString(String attribute)
-   {
-      ParameterizedAttributeListValueCreator palvc = new QNameAttributeListValueCreator();
-      List<ParameterizedAttribute> list = palvc.useString(attribute);
-      return list.size() > 0 ? list.get(0) : null;
-   }
-}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/PathAttributeListValueCreator.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/PathAttributeListValueCreator.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/PathAttributeListValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,46 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-import java.util.List;
-
-import org.jboss.osgi.plugins.metadata.spi.ParameterizedAttribute;
-
-/**
- * Create path attribute list from string attribute.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-class PathAttributeListValueCreator extends ParameterizedAttributeListValueCreator
-{
-   protected void parseAttribute(String attribute, List<ParameterizedAttribute> list, boolean trace)
-   {
-      try
-      {
-         HeaderValue.parsePaths(attribute, list, trace);
-      }
-      catch (ParseException e)
-      {
-         log.error("Exception parsing parameters.", e);
-      }
-   }
-}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/QNameAttributeListValueCreator.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/QNameAttributeListValueCreator.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/QNameAttributeListValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,46 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-import java.util.List;
-
-import org.jboss.osgi.plugins.metadata.spi.ParameterizedAttribute;
-
-/**
- * Create [dynamic]qname attribute list from string attribute.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-class QNameAttributeListValueCreator extends ParameterizedAttributeListValueCreator
-{
-   protected void parseAttribute(String attribute, List<ParameterizedAttribute> list, boolean trace)
-   {
-      try
-      {
-         HeaderValue.parseParameters(attribute, list, trace);
-      }
-      catch (ParseException e)
-      {
-         log.debug("Exception parsing parameters.", e);
-      }
-   }
-}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ReferenceMetaData.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/spi/ReferenceMetaData.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ReferenceMetaData.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ReferenceMetaData.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata;
+
+import java.util.List;
+import java.util.Set;
+
+import org.jboss.beans.metadata.spi.PropertyMetaData;
+
+/**
+ * OSGi reference meta data.
+ * Extends ValueMetaData - can be used as a value via proxy.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface ReferenceMetaData extends HolderMetaData, ServiceValueMetaData
+{
+   String getFilter();
+
+//   Cardinality getCardinality();
+
+   Integer getTimeout();
+
+   List<ListenerMetaData> getListeners();
+
+   Set<PropertyMetaData> getProperties();
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ServiceControllerContext.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/spi/ServiceControllerContext.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ServiceControllerContext.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ServiceControllerContext.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,48 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata;
+
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.dependency.spi.dispatch.InvokeDispatchContext;
+import org.osgi.framework.BundleContext;
+
+/**
+ * Information about Bundle[Context] and ServiceMetaData.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface ServiceControllerContext extends ControllerContext, InvokeDispatchContext
+{
+   /**
+    * Get the metadata
+    *
+    * @return the service metadata
+    */
+   ServiceMetaData getServiceMetaData();
+
+   /**
+    * Get the BundleContext
+    *
+    * @return underlying bundle context
+    */
+   BundleContext getBundleContext();
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ServiceDeployment.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/spi/ServiceDeployment.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ServiceDeployment.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ServiceDeployment.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata;
+
+import java.util.List;
+
+/**
+ * An osgi service deployment
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface ServiceDeployment
+{
+   /**
+    * Get the name of the deployment
+    *
+    * @return the name
+    */
+   String getName();
+
+   /**
+    * Set the name of the deployment
+    *
+    * @param name the name
+    */
+   void setName(String name);
+
+   /**
+    * Get the services in the deployment
+    * @return List<ServiceMetaData>
+    */
+   List<ServiceMetaData> getServices();
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ServiceMetaData.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/spi/ServiceMetaData.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ServiceMetaData.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ServiceMetaData.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,44 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * OSGi service meta data.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface ServiceMetaData extends HolderMetaData, ServiceMetaDataVisitorNode
+{
+   List<AttributeMetaData> getAttributes();
+
+   Set<String> getInterfaces();
+
+   Map<String, String> getServiceProperties();
+
+   String getRef();
+
+   boolean getLazyInit();
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ServiceMetaDataVisitor.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/spi/ServiceMetaDataVisitor.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ServiceMetaDataVisitor.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ServiceMetaDataVisitor.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,68 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata;
+
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.dependency.spi.DependencyItem;
+
+/**
+ * ServiceMetaDataVisitor.
+ * 
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface ServiceMetaDataVisitor
+{
+   /**
+    * Get the controller context
+    * 
+    * @return the context
+    */
+   ServiceControllerContext getControllerContext();
+
+   /**
+    * Get the context state
+    * 
+    * @return the context state
+    */
+   ControllerState getContextState();
+
+   /**
+    * Set the context state
+    * 
+    * @param contextState the context state
+    */
+   void setContextState(ControllerState contextState);
+
+   /**
+    * Add a dependency
+    * 
+    * @param dependency the dependency
+    */
+   void addDependency(DependencyItem dependency);
+   
+   /**
+    * Visit the node
+    * 
+    * @param node the node
+    */
+   void visit(ServiceMetaDataVisitorNode node);
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ServiceMetaDataVisitorNode.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/spi/ServiceMetaDataVisitorNode.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ServiceMetaDataVisitorNode.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ServiceMetaDataVisitorNode.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata;
+
+import java.util.Iterator;
+
+/**
+ * ServiceMetaDataVisitorNode.
+ * 
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface ServiceMetaDataVisitorNode
+{
+   /**
+    * Visit the node
+    * 
+    * @param vistor the visitor
+    */
+   public void visit(ServiceMetaDataVisitor vistor);
+   
+   /**
+    * Return the child nodes
+    * 
+    * @return Iterator<MetaDataVisitorNode> or null if there aren't any
+    */
+   public Iterator<? extends ServiceMetaDataVisitorNode> getChildren();
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ServiceValueMetaData.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/spi/ServiceValueMetaData.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ServiceValueMetaData.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ServiceValueMetaData.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata;
+
+import org.osgi.framework.BundleContext;
+
+/**
+ * ServiceValueMetaData.
+ * 
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface ServiceValueMetaData extends ServiceMetaDataVisitorNode
+{
+   /**
+    * Get the value
+    * 
+    * @param bundleContext the bundle context
+    * @return the value
+    * @throws Throwable for any error
+    */
+   Object getValue(BundleContext bundleContext) throws Throwable;
+}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/StringListValueCreator.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/StringListValueCreator.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/StringListValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,62 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * Split string into list of strings.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
-*/
-class StringListValueCreator extends ListValueCreator<String>
-{
-   protected String delimiter = ",";
-
-   public StringListValueCreator()
-   {
-      super();
-   }
-
-   public StringListValueCreator(boolean trim)
-   {
-      super(trim);
-   }
-
-   public StringListValueCreator(String delimiter)
-   {
-      this();
-      this.delimiter = delimiter;
-   }
-
-   public StringListValueCreator(String delimiter, boolean trim)
-   {
-      this(trim);
-      this.delimiter = delimiter;
-   }
-
-   public List<String> useString(String attribute)
-   {
-      return Arrays.asList(attribute.split(delimiter));
-   }
-}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/StringValueCreator.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/StringValueCreator.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/StringValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,45 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-/**
- * Plain string forwarding - no conversion.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
-*/
-class StringValueCreator extends AbstractValueCreator<String>
-{
-   public StringValueCreator()
-   {
-      super();
-   }
-
-   public StringValueCreator(boolean trim)
-   {
-      super(trim);
-   }
-
-   protected String useString(String attibute)
-   {
-      return attibute;
-   }
-}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/URLValueCreator.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/URLValueCreator.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/URLValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,56 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-/**
- * Create URL from string.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
-*/
-class URLValueCreator extends AbstractValueCreator<URL>
-{
-   public URLValueCreator()
-   {
-      super();
-   }
-
-   public URLValueCreator(boolean trim)
-   {
-      super(trim);
-   }
-
-   public URL useString(String attribute)
-   {
-      try
-      {
-         return new URL(attribute);
-      }
-      catch (MalformedURLException e)
-      {
-         log.warn("Exception while creating URL.", e);
-         return null;
-      }
-   }
-}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ValueCreator.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ValueCreator.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,39 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-/**
- * Create value from attribute.
- *
- * @param <T> expected type
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public interface ValueCreator<T>
-{
-   /**
-    * Create value from string attribute.
-    *
-    * @param attribute string to get value from
-    * @return value
-    */
-   T createValue(String attribute);
-}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ValueCreatorUtil.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ValueCreatorUtil.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ValueCreatorUtil.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,43 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-/**
- * ValueCreator holder.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class ValueCreatorUtil
-{
-   public static StringValueCreator STRING_VC = new StringValueCreator();
-   public static IntegerValueCreator INTEGER_VC = new IntegerValueCreator();
-   public static BooleanValueCreator BOOLEAN_VC = new BooleanValueCreator();
-   public static VersionValueCreator VERSION_VC = new VersionValueCreator();
-   public static VersionRangeValueCreator VERSION_RANGE_VC = new VersionRangeValueCreator();
-   public static URLValueCreator URL_VC = new URLValueCreator();
-   public static StringListValueCreator STRING_LIST_VC = new StringListValueCreator();
-   public static ParameterizedAttributeValueCreator PARAM_ATTRIB_VC = new ParameterizedAttributeValueCreator();
-   public static ParameterizedAttributeListValueCreator QNAME_ATTRIB_LIST_VC = new QNameAttributeListValueCreator();
-   public static ParameterizedAttributeListValueCreator PATH_ATTRIB_LIST_VC = new PathAttributeListValueCreator();
-   public static PackageAttributeListValueCreator PACKAGE_LIST_VC = new PackageAttributeListValueCreator();
-   public static ActivationPolicyMDValueCreator ACTIVATION_POLICY_VC = new ActivationPolicyMDValueCreator();
-}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/VersionRange.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/spi/VersionRange.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/VersionRange.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/VersionRange.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,55 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata;
+
+import org.osgi.framework.Version;
+
+/**
+ * Version range.
+ * [floor, ceiling]
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface VersionRange
+{
+   /**
+    * Get the floor version.
+    *
+    * @return floor version
+    */
+   Version getFloor();
+
+   /**
+    * Get the ceiling version.
+    *
+    * @return ceiling version
+    */
+   Version getCeiling();
+
+   /**
+    * Is param verision between (including) floor and ceiling.
+    *
+    * @param version version parameter to compare
+    * @return true if version param in version range interval
+    */
+   boolean isInRange(Version version);
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/VersionRangeAttribute.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/spi/VersionRangeAttribute.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/VersionRangeAttribute.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/VersionRangeAttribute.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,37 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata;
+
+/**
+ * Attribute with VersionRange attribute.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface VersionRangeAttribute extends AttributeAware
+{
+   /**
+    * Get the version range.
+    *
+    * @return version range for this attribute
+    */
+   VersionRange getVersion();
+}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/VersionRangeValueCreator.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/VersionRangeValueCreator.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/VersionRangeValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,47 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-import org.jboss.osgi.plugins.metadata.spi.VersionRange;
-
-/**
- * Parse VersionRange from string.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
-*/
-class VersionRangeValueCreator extends AbstractValueCreator<VersionRange>
-{
-   public VersionRangeValueCreator()
-   {
-      super();
-   }
-
-   public VersionRangeValueCreator(boolean trim)
-   {
-      super(trim);
-   }
-
-   public VersionRange useString(String attribute)
-   {
-      return AbstractVersionRange.parseRangeSpec(attribute);
-   }
-}

Deleted: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/VersionValueCreator.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/VersionValueCreator.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/VersionValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -1,47 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.plugins.metadata;
-
-import org.osgi.framework.Version;
-
-/**
- * Parse Version from string.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
-*/
-class VersionValueCreator extends AbstractValueCreator<Version>
-{
-   public VersionValueCreator()
-   {
-      super();
-   }
-
-   public VersionValueCreator(boolean trim)
-   {
-      super(trim);
-   }
-
-   public Version useString(String attribute)
-   {
-      return new Version(attribute);
-   }
-}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractActivationPolicyMetaData.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractActivationPolicyMetaData.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractActivationPolicyMetaData.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractActivationPolicyMetaData.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.plugins.metadata.impl;
+
+import java.io.Serializable;
+import java.util.List;
+
+import org.jboss.osgi.plugins.metadata.ActivationPolicyMetaData;
+
+/**
+ * Activation policy impl.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class AbstractActivationPolicyMetaData implements ActivationPolicyMetaData, Serializable
+{
+   private static final long serialVersionUID = 1L;
+
+   private String type = "lazy";
+   private List<String> includes;
+   private List<String> excludes;
+
+   public String getType()
+   {
+      return type;
+   }
+
+   public void setType(String type)
+   {
+      this.type = type;
+   }
+
+   public List<String> getIncludes()
+   {
+      return includes;
+   }
+
+   public void setIncludes(List<String> includes)
+   {
+      this.includes = includes;
+   }
+
+   public List<String> getExcludes()
+   {
+      return excludes;
+   }
+
+   public void setExcludes(List<String> excludes)
+   {
+      this.excludes = excludes;
+   }
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractAttributeAware.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractAttributeAware.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractAttributeAware.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractAttributeAware.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,60 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+import java.io.Serializable;
+
+import org.jboss.osgi.plugins.metadata.AttributeAware;
+import org.jboss.util.JBossObject;
+import org.jboss.util.JBossStringBuilder;
+
+/**
+ * Attribute holder.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class AbstractAttributeAware extends JBossObject implements AttributeAware, Serializable
+{
+   private static final long serialVersionUID = 1l;
+
+   protected String attribute;
+
+   protected AbstractAttributeAware(String attribute)
+   {
+      this.attribute = attribute;
+   }
+
+   public String getAttribute()
+   {
+      return attribute;
+   }
+
+   public void toShortString(JBossStringBuilder buffer)
+   {
+      buffer.append("attribute=" + attribute);
+   }
+
+   protected void toString(JBossStringBuilder buffer)
+   {
+      buffer.append("attribute=" + attribute);
+   }
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractAttributeMetaData.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractAttributeMetaData.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractAttributeMetaData.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractAttributeMetaData.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,100 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+import java.io.Serializable;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.osgi.plugins.metadata.AttributeMetaData;
+import org.jboss.osgi.plugins.metadata.ServiceValueMetaData;
+import org.jboss.util.UnreachableStatementException;
+import org.osgi.framework.BundleContext;
+
+/**
+ * ServiceAttributeMetaData.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class AbstractAttributeMetaData extends AbstractMetaDataVisitorNode implements AttributeMetaData, Serializable
+{
+   private static final long serialVersionUID = 1L;
+
+   /** The attribute name */
+   private String name;
+
+   /** The value */
+   private ServiceValueMetaData value;
+
+   public String getName()
+   {
+      return name;
+   }
+
+   /**
+    * Set the name.
+    *
+    * @param name the name.
+    */
+   public void setName(String name)
+   {
+      if (name == null)
+         throw new IllegalArgumentException("Null name");
+      this.name = name;
+   }
+
+   public ServiceValueMetaData getValue()
+   {
+      return value;
+   }
+
+   /**
+    * Set the value.
+    *
+    * @param value the value.
+    */
+   public void setValue(ServiceValueMetaData value)
+   {
+      if (value == null)
+         throw new IllegalArgumentException("Null value");
+      this.value = value;
+   }
+
+   /**
+    * Get the value
+    *
+    * @param bundleContext the bundle context
+    * @return the value
+    * @throws Exception for any error
+    */
+   public Object getValue(BundleContext bundleContext) throws Exception
+   {
+      try
+      {
+         return value.getValue(bundleContext);
+      }
+      catch (Throwable t)
+      {
+         DeploymentException.rethrowAsDeploymentException("Error configuring attribute " + name, t);
+         throw new UnreachableStatementException();
+      }
+   }
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractDependencyMetaData.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractDependencyMetaData.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractDependencyMetaData.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractDependencyMetaData.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,117 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+import java.io.Serializable;
+
+import org.jboss.dependency.plugins.AbstractDependencyItem;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.dependency.spi.DependencyItem;
+import org.jboss.osgi.plugins.metadata.DependencyMetaData;
+import org.jboss.osgi.plugins.metadata.ServiceControllerContext;
+import org.jboss.osgi.plugins.metadata.ServiceMetaDataVisitor;
+import org.jboss.util.JBossStringBuilder;
+
+/**
+ * A dependency.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class AbstractDependencyMetaData extends AbstractMetaDataVisitorNode
+      implements DependencyMetaData, Serializable
+{
+   private static final long serialVersionUID = 1L;
+
+   /** The dependency, may transient? */
+   protected Object dependency;
+
+   /**
+    * Create a new dependency
+    */
+   public AbstractDependencyMetaData()
+   {
+   }
+
+   /**
+    * Create a new dependency
+    *
+    * @param dependency the dependency
+    */
+   public AbstractDependencyMetaData(Object dependency)
+   {
+      this.dependency = dependency;
+   }
+
+   /**
+    * Set the dependency
+    *
+    * @param dependency the dependency
+    */
+   public void setDependency(Object dependency)
+   {
+      this.dependency = dependency;
+      flushJBossObjectCache();
+   }
+
+   public Object getDependency()
+   {
+      return dependency;
+   }
+
+   public void visit(ServiceMetaDataVisitor visitor)
+   {
+      ServiceControllerContext context = visitor.getControllerContext();
+      DependencyItem item = new LifecycleDependencyItem(context.getName(), ControllerState.CREATE);
+      visitor.addDependency(item);
+      item = new LifecycleDependencyItem(context.getName(), ControllerState.START);
+      visitor.addDependency(item);
+      
+      visitor.visit(this);
+   }
+
+   public void toString(JBossStringBuilder buffer)
+   {
+      buffer.append("dependency=").append(dependency);
+   }
+
+   public void toShortString(JBossStringBuilder buffer)
+   {
+      buffer.append(dependency);
+   }
+
+   /**
+    * A LifecycleDependencyItem.
+    */
+   public class LifecycleDependencyItem extends AbstractDependencyItem
+   {
+      /**
+       * Create a new LifecycleDependencyItem.
+       *
+       * @param name the name
+       * @param state the state
+       */
+      public LifecycleDependencyItem(Object name, ControllerState state)
+      {
+         super(name, dependency, state, state);
+      }
+   }
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractHolderMetaData.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractHolderMetaData.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractHolderMetaData.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractHolderMetaData.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,85 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+import java.io.Serializable;
+import java.util.Set;
+
+import org.jboss.beans.metadata.spi.ClassLoaderMetaData;
+import org.jboss.osgi.plugins.metadata.DependencyMetaData;
+import org.jboss.osgi.plugins.metadata.HolderMetaData;
+
+/**
+ * Common OSGi reference or service impl.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class AbstractHolderMetaData extends AbstractMetaDataVisitorNode
+      implements HolderMetaData, Serializable
+{
+   private static final long serialVersionUID = 1l;
+
+   private String id;
+   private String anInterface;
+   private Set<DependencyMetaData> depends;
+   private ClassLoaderMetaData classLoaderMetaData;
+
+   public String getId()
+   {
+      return id;
+   }
+
+   public String getInterface()
+   {
+      return anInterface;
+   }
+
+   public Set<DependencyMetaData> getDepends()
+   {
+      return depends;
+   }
+
+   public ClassLoaderMetaData getContextClassLoader()
+   {
+      return classLoaderMetaData;
+   }
+
+   public void setId(String id)
+   {
+      this.id = id;
+   }
+
+   public void setInterface(String anInterface)
+   {
+      this.anInterface = anInterface;
+   }
+
+   public void setDepends(Set<DependencyMetaData> depends)
+   {
+      this.depends = depends;
+   }
+
+   public void setClassLoaderMetaData(ClassLoaderMetaData classLoaderMetaData)
+   {
+      this.classLoaderMetaData = classLoaderMetaData;
+   }
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractListenerMetaData.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractListenerMetaData.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractListenerMetaData.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractListenerMetaData.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,72 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+import java.io.Serializable;
+
+import org.jboss.osgi.plugins.metadata.ListenerMetaData;
+
+/**
+ * Simple listener meta data.
+ * Referencing ref bean as a reference listener.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class AbstractListenerMetaData implements ListenerMetaData, Serializable
+{
+   private static final long serialVersionUID = 1l;
+
+   private String ref;
+   private String bindMethod;
+   private String unbindMethod;
+
+   public String getRef()
+   {
+      return ref;
+   }
+
+   public String getBindMethod()
+   {
+      return bindMethod;
+   }
+
+   public String getUnbindMethod()
+   {
+      return unbindMethod;
+   }
+
+   public void setRef(String ref)
+   {
+      this.ref = ref;
+   }
+
+   public void setBindMethod(String bindMethod)
+   {
+      this.bindMethod = bindMethod;
+   }
+
+   public void setUnbindMethod(String unbindMethod)
+   {
+      this.unbindMethod = unbindMethod;
+   }
+
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractMetaDataVisitorNode.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractMetaDataVisitorNode.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractMetaDataVisitorNode.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractMetaDataVisitorNode.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,62 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+import java.util.Iterator;
+import java.util.Set;
+
+import org.jboss.osgi.plugins.metadata.ServiceMetaDataVisitor;
+import org.jboss.osgi.plugins.metadata.ServiceMetaDataVisitorNode;
+import org.jboss.util.JBossObject;
+import org.jboss.util.collection.CollectionsFactory;
+
+/**
+ * AbstractMetaDataVisitorNode.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class AbstractMetaDataVisitorNode extends JBossObject implements ServiceMetaDataVisitorNode
+{
+   public Iterator<? extends ServiceMetaDataVisitorNode> getChildren()
+   {
+      Set<ServiceMetaDataVisitorNode> children = CollectionsFactory.createLazySet();
+      addChildren(children);
+      if (children.size() == 0)
+         return null;
+      else
+         return children.iterator();
+   }
+
+   public void visit(ServiceMetaDataVisitor visitor)
+   {
+      visitor.visit(this);
+   }
+
+   /**
+    * Add to the children
+    *
+    * @param children the children
+    */
+   protected void addChildren(Set<ServiceMetaDataVisitorNode> children)
+   {
+   }
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractOSGiMetaData.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractOSGiMetaData.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractOSGiMetaData.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractOSGiMetaData.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,281 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+import static org.jboss.osgi.plugins.metadata.impl.ValueCreatorUtil.ACTIVATION_POLICY_VC;
+import static org.jboss.osgi.plugins.metadata.impl.ValueCreatorUtil.INTEGER_VC;
+import static org.jboss.osgi.plugins.metadata.impl.ValueCreatorUtil.PACKAGE_LIST_VC;
+import static org.jboss.osgi.plugins.metadata.impl.ValueCreatorUtil.PARAM_ATTRIB_VC;
+import static org.jboss.osgi.plugins.metadata.impl.ValueCreatorUtil.PATH_ATTRIB_LIST_VC;
+import static org.jboss.osgi.plugins.metadata.impl.ValueCreatorUtil.QNAME_ATTRIB_LIST_VC;
+import static org.jboss.osgi.plugins.metadata.impl.ValueCreatorUtil.STRING_LIST_VC;
+import static org.jboss.osgi.plugins.metadata.impl.ValueCreatorUtil.STRING_VC;
+import static org.jboss.osgi.plugins.metadata.impl.ValueCreatorUtil.URL_VC;
+import static org.jboss.osgi.plugins.metadata.impl.ValueCreatorUtil.VERSION_VC;
+import static org.osgi.framework.Constants.BUNDLE_ACTIVATOR;
+import static org.osgi.framework.Constants.BUNDLE_CATEGORY;
+import static org.osgi.framework.Constants.BUNDLE_CLASSPATH;
+import static org.osgi.framework.Constants.BUNDLE_DESCRIPTION;
+import static org.osgi.framework.Constants.BUNDLE_LOCALIZATION;
+import static org.osgi.framework.Constants.BUNDLE_LOCALIZATION_DEFAULT_BASENAME;
+import static org.osgi.framework.Constants.BUNDLE_MANIFESTVERSION;
+import static org.osgi.framework.Constants.BUNDLE_NAME;
+import static org.osgi.framework.Constants.BUNDLE_NATIVECODE;
+import static org.osgi.framework.Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT;
+import static org.osgi.framework.Constants.BUNDLE_SYMBOLICNAME;
+import static org.osgi.framework.Constants.BUNDLE_UPDATELOCATION;
+import static org.osgi.framework.Constants.BUNDLE_VERSION;
+import static org.osgi.framework.Constants.DYNAMICIMPORT_PACKAGE;
+import static org.osgi.framework.Constants.EXPORT_PACKAGE;
+import static org.osgi.framework.Constants.FRAGMENT_HOST;
+import static org.osgi.framework.Constants.IMPORT_PACKAGE;
+import static org.osgi.framework.Constants.REQUIRE_BUNDLE;
+
+import java.net.URL;
+import java.util.Arrays;
+import java.util.Dictionary;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.jar.Manifest;
+import java.util.jar.Attributes.Name;
+
+import org.jboss.classloading.spi.version.VersionComparatorRegistry;
+import org.jboss.deployers.vfs.spi.deployer.helpers.AbstractManifestMetaData;
+import org.jboss.osgi.plugins.metadata.ActivationPolicyMetaData;
+import org.jboss.osgi.plugins.metadata.OSGiMetaData;
+import org.jboss.osgi.plugins.metadata.PackageAttribute;
+import org.jboss.osgi.plugins.metadata.ParameterizedAttribute;
+import org.jboss.osgi.plugins.metadata.impl.AbstractVersionRange.OSGiVersionToOSGiVersionComparator;
+import org.jboss.osgi.plugins.metadata.impl.AbstractVersionRange.OSGiVersionToStringComparator;
+import org.jboss.osgi.plugins.metadata.impl.AbstractVersionRange.OSGiVersionToVersionComparator;
+import org.osgi.framework.Constants;
+import org.osgi.framework.Version;
+
+/**
+ * Abstract OSGi meta data.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class AbstractOSGiMetaData extends AbstractManifestMetaData implements OSGiMetaData
+{
+   private static final long serialVersionUID = 1L;
+
+   static
+   {
+      VersionComparatorRegistry registry = VersionComparatorRegistry.getInstance();
+      registry.registerVersionComparator(Version.class, Version.class, new OSGiVersionToOSGiVersionComparator());
+      registry.registerVersionComparator(Version.class, org.jboss.classloading.spi.version.Version.class, new OSGiVersionToVersionComparator());
+      registry.registerVersionComparator(Version.class, String.class, new OSGiVersionToStringComparator());
+   }
+
+   protected transient Map<String, Object> cachedAttributes = new HashMap<String, Object>();
+
+   protected transient ParameterizedAttribute parameters;
+   
+   public AbstractOSGiMetaData()
+   {
+   }
+
+   public AbstractOSGiMetaData(Manifest manifest)
+   {
+      super(manifest);
+   }
+
+   @SuppressWarnings("unchecked")
+   public Dictionary<String, String> getHeaders(String locale)
+   {
+      // TODO localisation
+      Map<Name, String> attributes = (Map) getManifest().getMainAttributes();
+      Hashtable<String, String> result = new Hashtable<String, String>();
+      for (Entry<Name, String> entry : attributes.entrySet())
+         result.put(entry.getKey().toString(), entry.getValue());
+      return result;
+   }
+
+   public String getHeader(String key)
+   {
+      return get(key, STRING_VC);
+   }
+
+   public ActivationPolicyMetaData getBundleActivationPolicy()
+   {
+      return get("Bundle-ActivationPolicy", ACTIVATION_POLICY_VC);
+   }
+
+   public String getBundleActivator()
+   {
+      return get(BUNDLE_ACTIVATOR, STRING_VC);
+   }
+
+   public List<String> getBundleCategory()
+   {
+      return get(BUNDLE_CATEGORY, STRING_LIST_VC);
+   }
+
+   public List<String> getBundleClassPath()
+   {
+      return get(BUNDLE_CLASSPATH, STRING_LIST_VC, Arrays.asList("."));
+   }
+
+   public String getBundleDescription()
+   {
+      return get(BUNDLE_DESCRIPTION, STRING_VC);
+   }
+
+   public String getBundleLocalization()
+   {
+      return get(BUNDLE_LOCALIZATION, STRING_VC, BUNDLE_LOCALIZATION_DEFAULT_BASENAME);
+   }
+
+   public int getBundleManifestVersion()
+   {
+      return get(BUNDLE_MANIFESTVERSION, INTEGER_VC, 1);
+   }
+
+   public String getBundleName()
+   {
+      return get(BUNDLE_NAME, STRING_VC);
+   }
+
+   public List<ParameterizedAttribute> getBundleNativeCode()
+   {
+      return get(BUNDLE_NATIVECODE, PATH_ATTRIB_LIST_VC);
+   }
+
+   public List<String> getRequiredExecutionEnvironment()
+   {
+      return get(BUNDLE_REQUIREDEXECUTIONENVIRONMENT, STRING_LIST_VC);
+   }
+
+   public String getBundleSymbolicName()
+   {
+      String symbolicName = null;
+      
+      ParameterizedAttribute parameters = parseSymbolicName();
+      if (parameters != null)
+         symbolicName = parameters.getAttribute();
+
+      // [TODO] [JBOSGI-137] Cannot parse Bundle-SymbolicName
+      if (symbolicName == null)
+         symbolicName = getMainAttribute(Constants.BUNDLE_SYMBOLICNAME);
+      
+      return symbolicName;
+   }
+
+   public ParameterizedAttribute getBundleParameters()
+   {
+      return parseSymbolicName();
+   }
+   
+   public URL getBundleUpdateLocation()
+   {
+      return get(BUNDLE_UPDATELOCATION, URL_VC);
+   }
+
+   public Version getBundleVersion()
+   {
+      return get(BUNDLE_VERSION, VERSION_VC , Version.emptyVersion);
+   }
+
+   public List<PackageAttribute> getDynamicImports()
+   {
+      return get(DYNAMICIMPORT_PACKAGE, PACKAGE_LIST_VC);
+   }
+
+   public List<PackageAttribute> getExportPackages()
+   {
+      return get(EXPORT_PACKAGE, PACKAGE_LIST_VC);
+   }
+
+   public ParameterizedAttribute getFragmentHost()
+   {
+      return get(FRAGMENT_HOST, PARAM_ATTRIB_VC);
+   }
+
+   public List<PackageAttribute> getImportPackages()
+   {
+      return get(IMPORT_PACKAGE, PACKAGE_LIST_VC);
+   }
+
+   public List<ParameterizedAttribute> getRequireBundles()
+   {
+      return get(REQUIRE_BUNDLE, QNAME_ATTRIB_LIST_VC);
+   }
+
+   public boolean isSingleton()
+   {
+      parseSymbolicName();
+      if (parameters == null)
+         return false;
+      return "true".equals(parameters.getParameterValue(Constants.SINGLETON_DIRECTIVE, String.class));
+   }
+
+   public String getFragmentAttachment()
+   {
+      parseSymbolicName();
+      if (parameters == null)
+         return null;
+      return parameters.getParameterValue(Constants.FRAGMENT_ATTACHMENT_DIRECTIVE, String.class);
+   }
+
+   protected ParameterizedAttribute parseSymbolicName()
+   {
+      if (parameters == null)
+      {
+         List<ParameterizedAttribute> parsed = get(BUNDLE_SYMBOLICNAME, QNAME_ATTRIB_LIST_VC);
+         if (parsed == null || parsed.size() != 1)
+            return null;
+         parameters = parsed.get(0);
+      }
+      return parameters;
+   }
+
+   protected <T> T get(String key, ValueCreator<T> creator)
+   {
+      return get(key, creator, null);
+   }
+
+   @SuppressWarnings("unchecked")
+   protected <T> T get(String key, ValueCreator<T> creator, T defaultValue)
+   {
+      T value = (T)cachedAttributes.get(key);
+      if (value == null)
+      {
+         String attribute = getMainAttribute(key);
+         if (attribute != null)
+         {
+            value = creator.createValue(attribute);
+         }
+         else if (defaultValue != null)
+         {
+            value = defaultValue;
+         }
+         if (value != null)
+            cachedAttributes.put(key, value);
+      }
+      return value;
+   }
+
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractPackageAttribute.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractPackageAttribute.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractPackageAttribute.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractPackageAttribute.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,75 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+import java.io.Serializable;
+import java.util.Map;
+
+import org.jboss.osgi.plugins.metadata.PackageAttribute;
+import org.jboss.osgi.plugins.metadata.Parameter;
+import org.jboss.osgi.plugins.metadata.VersionRange;
+import org.jboss.reflect.plugins.PackageInfoImpl;
+import org.jboss.reflect.spi.PackageInfo;
+import org.osgi.framework.Constants;
+
+/**
+ * Package attribute impl.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class AbstractPackageAttribute extends AbstractParameterizedAttribute implements PackageAttribute, Serializable
+{
+   private static final long serialVersionUID = 1l;
+
+   protected PackageInfo packageInfo;
+   protected VersionRange versionRange;
+
+   public AbstractPackageAttribute(String attribute, Map<String, Parameter> parameters)
+   {
+      super(attribute, parameters);
+      packageInfo = new PackageInfoImpl(attribute);
+   }
+
+   public PackageInfo getPackageInfo()
+   {
+      return packageInfo;
+   }
+
+   public VersionRange getVersion()
+   {
+      if (versionRange == null)
+      {
+         Parameter parameter = getParameter(Constants.VERSION_ATTRIBUTE);
+         if (parameter != null)
+         {
+            if (parameter.isCollection())
+               throw new IllegalArgumentException("Duplicate version parameter.");
+            Object value = parameter.getValue();
+            if (value != null)
+            {
+               versionRange = AbstractVersionRange.parseRangeSpec(value.toString());
+            }
+         }
+      }
+      return versionRange;
+   }
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractParameter.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractParameter.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractParameter.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractParameter.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,97 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.HashSet;
+
+import org.jboss.osgi.plugins.metadata.Parameter;
+import org.jboss.util.JBossObject;
+import org.jboss.util.JBossStringBuilder;
+
+/**
+ * Parameter impl.
+ * It uses [Hash]Set to hold the values.
+ * So duplicate values (by hash) will be ignored.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class AbstractParameter extends JBossObject implements Parameter, Serializable
+{
+   /** The serialVersionUID */
+   private static final long serialVersionUID = -7920499358318841779L
+   ;
+   protected Collection<String> values;
+
+   public AbstractParameter()
+   {
+      super();
+      values = new HashSet<String>();
+   }
+
+   public AbstractParameter(String parameter)
+   {
+      this();
+      addValue(parameter);
+   }
+
+   public void addValue(String value)
+   {
+      values.add(value);
+   }
+
+   public Object getValue()
+   {
+      if (values.isEmpty())
+         return null;
+      else if (values.size() == 1)
+         return values.iterator().next();
+      else
+         return values;
+   }
+
+   public boolean isCollection()
+   {
+      return values.size() > 1;
+   }
+
+   protected int getHashCode()
+   {
+      return values.hashCode();
+   }
+
+   public boolean equals(Object obj)
+   {
+      return (obj instanceof AbstractParameter && values.equals(((AbstractParameter)obj).values));
+   }
+
+   public void toShortString(JBossStringBuilder buffer)
+   {
+      buffer.append("value=" + getValue());
+   }
+
+   protected void toString(JBossStringBuilder buffer)
+   {
+      buffer.append("value=" + getValue());
+   }
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractParameterizedAttribute.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractParameterizedAttribute.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractParameterizedAttribute.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractParameterizedAttribute.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,83 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+import java.util.Map;
+
+import org.jboss.osgi.plugins.metadata.Parameter;
+import org.jboss.osgi.plugins.metadata.ParameterizedAttribute;
+import org.jboss.util.JBossStringBuilder;
+
+/**
+ * Parameter attribute impl.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class AbstractParameterizedAttribute extends AbstractAttributeAware implements ParameterizedAttribute
+{
+   private static final long serialVersionUID = 1l;
+   
+   protected Map<String, Parameter> parameters;
+
+   public AbstractParameterizedAttribute(String attribute, Map<String, Parameter> parameters)
+   {
+      super(attribute);
+      this.parameters = parameters;
+   }
+
+   public Map<String, Parameter> getParameters()
+   {
+      return parameters;
+   }
+
+   public Parameter getParameter(String name)
+   {
+      return parameters.get(name);
+   }
+
+   /**
+    * Get a parameter
+    * 
+    * @param <T> the expected type
+    * @param name the name of the parameter
+    * @param type the expected type
+    * @return the parmaeter value
+    */
+   public <T> T getParameterValue(String name, Class<T> type)
+   {
+      Parameter parameter = getParameter(name);
+      if (parameter == null)
+         return null;
+      if (parameter.isCollection())
+         throw new IllegalArgumentException("Duplicate " + name + " parameter.");
+      Object value = parameter.getValue();
+      if (value == null)
+         return null;
+      return type.cast(value);
+   }
+
+   protected void toString(JBossStringBuilder buffer)
+   {
+      super.toString(buffer);
+      buffer.append(" parameters=" + parameters);
+   }
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractReferenceMetaData.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractReferenceMetaData.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractReferenceMetaData.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractReferenceMetaData.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,123 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+import java.util.List;
+import java.util.Set;
+
+import org.jboss.aop.proxy.container.GeneratedAOPProxyFactory;
+import org.jboss.beans.metadata.spi.MetaDataVisitor;
+import org.jboss.beans.metadata.spi.MetaDataVisitorNode;
+import org.jboss.beans.metadata.spi.PropertyMetaData;
+import org.jboss.dependency.spi.Cardinality;
+import org.jboss.osgi.plugins.metadata.ListenerMetaData;
+import org.jboss.osgi.plugins.metadata.ReferenceMetaData;
+import org.jboss.osgi.plugins.metadata.ServiceMetaDataVisitor;
+import org.osgi.framework.BundleContext;
+
+/**
+ * OSGi reference meta data.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class AbstractReferenceMetaData extends AbstractHolderMetaData implements ReferenceMetaData
+{
+   private static final long serialVersionUID = 1l;
+
+   private String filter;
+   private Cardinality cardinality = Cardinality.ONE_TO_ONE;
+   private Integer timeout;
+   private List<ListenerMetaData> listeners;
+   private Set<PropertyMetaData> properties;
+
+   public Object getUnderlyingValue()
+   {
+      return getId();
+   }
+
+   public Object getValue(BundleContext bundleContext) throws Throwable
+   {
+      // tdo - add dynamic behaviour
+      return GeneratedAOPProxyFactory.createProxy(null, null);
+   }
+
+   public void visit(ServiceMetaDataVisitor visitor)
+   {
+      // tdo - add dependency
+      super.visit(visitor);
+   }
+
+   public String getFilter()
+   {
+      return filter;
+   }
+
+   public Cardinality getCardinality()
+   {
+      return cardinality;
+   }
+
+   public Integer getTimeout()
+   {
+      return timeout;
+   }
+
+   public List<ListenerMetaData> getListeners()
+   {
+      return listeners;
+   }
+
+   public Set<PropertyMetaData> getProperties()
+   {
+      return properties;
+   }
+
+   public Class<?> getType(MetaDataVisitor visitor, MetaDataVisitorNode previous) throws Throwable
+   {
+      return null;
+   }
+
+   public void setFilter(String filter)
+   {
+      this.filter = filter;
+   }
+
+   public void setCardinality(Cardinality cardinality)
+   {
+      this.cardinality = cardinality;
+   }
+
+   public void setTimeout(Integer timeout)
+   {
+      this.timeout = timeout;
+   }
+
+   public void setListeners(List<ListenerMetaData> listeners)
+   {
+      this.listeners = listeners;
+   }
+
+   public void setProperties(Set<PropertyMetaData> properties)
+   {
+      this.properties = properties;
+   }
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractServiceDeployment.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractServiceDeployment.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractServiceDeployment.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractServiceDeployment.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,77 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+import java.util.List;
+
+import org.jboss.osgi.plugins.metadata.ServiceDeployment;
+import org.jboss.osgi.plugins.metadata.ServiceMetaData;
+import org.jboss.util.JBossObject;
+import org.jboss.util.JBossStringBuilder;
+
+/**
+ * An abstract service deployment
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class AbstractServiceDeployment extends JBossObject implements ServiceDeployment
+{
+   /** The name of the deployment */
+   protected String name;
+
+   /* The services list */
+   protected List<ServiceMetaData> services;
+
+   public String getName()
+   {
+      return name;
+   }
+
+   public void setName(String name)
+   {
+      this.name = name;
+      flushJBossObjectCache();
+   }
+
+   public List<ServiceMetaData> getServices()
+   {
+      return services;
+   }
+
+   public void setServices(List<ServiceMetaData> services)
+   {
+      this.services = services;
+   }
+
+   public void toString(JBossStringBuilder buffer)
+   {
+      buffer.append("name=").append(name);
+      if (services != null)
+         buffer.append(" services=").append(services);
+   }
+
+   public void toShortString(JBossStringBuilder buffer)
+   {
+      buffer.append(name);
+   }
+
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractServiceMetaData.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractServiceMetaData.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractServiceMetaData.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractServiceMetaData.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,109 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.osgi.plugins.metadata.AttributeMetaData;
+import org.jboss.osgi.plugins.metadata.ServiceMetaData;
+import org.jboss.osgi.plugins.metadata.ServiceMetaDataVisitor;
+
+/**
+ * OSGi service meta data.
+ * Register ref bean as an OSGi service with interface or interfaces.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class AbstractServiceMetaData extends AbstractHolderMetaData implements ServiceMetaData
+{
+   private static final long serialVersionUID = 1l;
+
+   private Set<String> interfaces;
+   private Map<String, String> serviceProperties;
+   private String ref;
+   private boolean lazyInit;
+
+   /** The references */
+   private List<AttributeMetaData> attributes = Collections.emptyList();
+
+   /** The dependencies */
+
+   public void visit(ServiceMetaDataVisitor visitor)
+   {
+      // tdo - add children, depend on ref bean from MC
+      super.visit(visitor);
+   }
+
+   public List<AttributeMetaData> getAttributes()
+   {
+      return attributes;
+   }
+
+   public Set<String> getInterfaces()
+   {
+      return interfaces;
+   }
+
+   public Map<String, String> getServiceProperties()
+   {
+      return serviceProperties;
+   }
+
+   public String getRef()
+   {
+      return ref;
+   }
+
+   public boolean getLazyInit()
+   {
+      return lazyInit;
+   }
+
+   public void setAttributes(List<AttributeMetaData> attributes)
+   {
+      this.attributes = attributes;
+   }
+
+   public void setInterfaces(Set<String> interfaces)
+   {
+      this.interfaces = interfaces;
+   }
+
+   public void setServiceProperties(Map<String, String> serviceProperties)
+   {
+      this.serviceProperties = serviceProperties;
+   }
+
+   public void setRef(String ref)
+   {
+      this.ref = ref;
+   }
+
+   public void setLazyInit(boolean lazyInit)
+   {
+      this.lazyInit = lazyInit;
+   }
+
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractValueCreator.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractValueCreator.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractValueCreator.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,62 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+import org.jboss.logging.Logger;
+
+/**
+ * Abstract value creator.
+ * Extend this one for safe string usage.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+*/
+abstract class AbstractValueCreator<T> implements ValueCreator<T>
+{
+   protected Logger log = Logger.getLogger(getClass());
+   private boolean trim;
+
+   protected AbstractValueCreator()
+   {
+      this(false);
+   }
+
+   protected AbstractValueCreator(boolean trim)
+   {
+      this.trim = trim;
+   }
+
+   public T createValue(String attribute)
+   {
+      if (attribute == null)
+         return null;
+      if (trim)
+         attribute = attribute.trim();
+      return useString(attribute);
+   }
+
+   /**
+    * Use this method on non-null trimmed string.
+    * @param attibute non-null trimmed string
+    * @return expected value
+    */
+   protected abstract T useString(String attibute);
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractVersionRange.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/AbstractVersionRange.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractVersionRange.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/AbstractVersionRange.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,207 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+import java.io.Serializable;
+import java.util.StringTokenizer;
+
+import org.jboss.classloading.spi.version.VersionComparator;
+import org.jboss.osgi.plugins.metadata.VersionRange;
+import org.osgi.framework.Version;
+
+/**
+ * Represents an OSGi version range:
+ * version-range ::= interval | atleast
+ * interval ::= ( '[' | '(' ) floor ',' ceiling ( ']' | ')' )
+ * atleast ::= version
+ * floor ::= version
+ * ceiling ::= version
+ *
+ * [TODO] do we really need this extra class or just use our version range?
+ * @author Scott.Stark at jboss.org
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ * @author adrian at jboss.org
+ */
+public class AbstractVersionRange extends org.jboss.classloading.spi.version.VersionRange implements VersionRange, Serializable
+{
+   /** The serialVersionUID */
+   private static final long serialVersionUID = -178825219621278882L;
+   
+   /**
+    * Get the version range from a string
+    * 
+    * @param rangeSpec the range spec
+    * @return the version range
+    */
+   public static VersionRange valueOf(String rangeSpec)
+   {
+      return parseRangeSpec(rangeSpec);
+   }
+
+   /**
+    * Parse a range spec
+    * 
+    * @param rangeSpec
+    * @return the version range
+    */
+   public static VersionRange parseRangeSpec(String rangeSpec)
+   {
+      if (rangeSpec == null)
+         throw new IllegalArgumentException("Null rangeSpec");
+      
+      // Handle version strings with quotes 
+      if (rangeSpec.startsWith("\"") && rangeSpec.endsWith("\""))
+         rangeSpec = rangeSpec.substring(1, rangeSpec.length() - 1);
+      
+      Version floor = null;
+      Version ceiling = null;
+      StringTokenizer st = new StringTokenizer(rangeSpec, ",[]()", true);
+      Boolean floorIsGreaterThan = null;
+      Boolean ceilingIsLessThan = null;
+      boolean mid = false;
+      while (st.hasMoreTokens())
+      {
+         String token = st.nextToken();
+         if (token.equals("["))
+            floorIsGreaterThan = false;
+         else if (token.equals("("))
+            floorIsGreaterThan = true;
+         else if (token.equals("]"))
+            ceilingIsLessThan = false;
+         else if (token.equals(")"))
+            ceilingIsLessThan = true;
+         else if (token.equals(","))
+            mid = true;
+         else if (token.equals("\"") == false)
+         {
+            // A version token
+            if (floor == null)
+               floor = new Version(token);
+            else
+               ceiling = new Version(token);
+         }
+
+      }
+      // check for parenthesis
+      if (floorIsGreaterThan == null || ceilingIsLessThan == null)
+      {
+         // non-empty interval usage
+         if (mid)
+            throw new IllegalArgumentException("Missing parenthesis: " + rangeSpec);
+         // single value
+         floorIsGreaterThan = false;
+         ceilingIsLessThan = false;
+      }
+
+      return new AbstractVersionRange(floor, ceiling, floorIsGreaterThan, ceilingIsLessThan);
+   }
+
+   /**
+    * Create a new AbstractVersionRange.
+    * 
+    * @param floor the floor
+    * @param ceiling the ceiling
+    * @param floorIsLessThan whether the floor is <
+    * @param ceilingIsLessThan whether the ceiling is <
+    */
+   public AbstractVersionRange(Version floor, Version ceiling, boolean floorIsLessThan, boolean ceilingIsLessThan)
+   {
+      super(floor == null ? Version.emptyVersion : floor, floorIsLessThan == false, ceiling, ceilingIsLessThan == false);
+   }
+
+   /**
+    * Get the floor
+    * 
+    * @return the floor
+    */
+   public Version getFloor()
+   {
+      return (Version) getLow();
+   }
+
+   /**
+    * Get the ceiling
+    * 
+    * @return the ceiling
+    */
+   public Version getCeiling()
+   {
+      return (Version) getHigh();
+   }
+
+   /**
+    * Test whether the version is in range
+    * 
+    * @return true when the version is in range
+    */
+   public boolean isInRange(Version v)
+   {
+      return super.isInRange(v);
+   }
+
+   /**
+    * OSGiVersionToOSGiVersionComparator.
+    */
+   public static class OSGiVersionToOSGiVersionComparator implements VersionComparator<Version, Version>
+   {
+      public int compare(Version t, Version u)
+      {
+         return t.compareTo(u);
+      }
+   }
+
+   /**
+    * OSGiVersionToVersionComparator.
+    */
+   public static class OSGiVersionToVersionComparator implements VersionComparator<Version, org.jboss.classloading.spi.version.Version>
+   {
+      public int compare(Version t, org.jboss.classloading.spi.version.Version u)
+      {
+         int result = t.getMajor() - u.getMajor();
+         if (result != 0)
+            return result;
+
+         result = t.getMinor() - u.getMinor();
+         if (result != 0)
+            return result;
+
+         result = t.getMicro() - u.getMicro();
+         if (result != 0)
+            return result;
+
+         String q1 = t.getQualifier();
+         String q2 = u.getQualifier();
+         return q1.compareTo(q2);
+      }
+   }
+
+   /**
+    * VersionToStringComparator.
+    */
+   public static class OSGiVersionToStringComparator implements VersionComparator<Version, String>
+   {
+      public int compare(Version t, String u)
+      {
+         return t.compareTo(Version.parseVersion(u));
+      }
+   }
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/ActivationPolicyMDValueCreator.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ActivationPolicyMDValueCreator.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/ActivationPolicyMDValueCreator.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/ActivationPolicyMDValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,74 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+import java.util.Arrays;
+
+import org.jboss.osgi.plugins.metadata.ActivationPolicyMetaData;
+
+/**
+ * Activation policy value creator.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+*/
+class ActivationPolicyMDValueCreator extends AbstractValueCreator<ActivationPolicyMetaData>
+{
+   private static final String INCLUDE = "include:=";
+   private static final String EXCLUDE = "exclude:=";
+
+   public ActivationPolicyMDValueCreator()
+   {
+      super(true);
+   }
+
+   protected ActivationPolicyMetaData useString(String attibute)
+   {
+      AbstractActivationPolicyMetaData aap = new AbstractActivationPolicyMetaData();
+      String[] split = attibute.split(";");
+      aap.setType(split[0]);
+      if (split.length > 1)
+         readDirective(aap, split[1]);
+      if (split.length > 2)
+         readDirective(aap, split[2]);
+      return aap;
+   }
+
+   /**
+    * Read the directive.
+    *
+    * @param aap the activation policy
+    * @param directive the directive
+    */
+   protected void readDirective(AbstractActivationPolicyMetaData aap, String directive)
+   {
+      if (directive.startsWith(INCLUDE))
+      {
+         String[] includes = directive.substring(INCLUDE.length() + 1, directive.length() - 1).split(",");
+         aap.setIncludes(Arrays.asList(includes));
+      }
+      else if (directive.startsWith(EXCLUDE))
+      {
+         String[] excludes = directive.substring(EXCLUDE.length() + 1, directive.length() - 1).split(",");
+         aap.setExcludes(Arrays.asList(excludes));
+      }
+   }
+}
\ No newline at end of file

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/BooleanValueCreator.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/BooleanValueCreator.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/BooleanValueCreator.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/BooleanValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+/**
+ * Parse boolean from string.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+*/
+class BooleanValueCreator extends AbstractValueCreator<Boolean>
+{
+   public BooleanValueCreator()
+   {
+      super();
+   }
+
+   public BooleanValueCreator(boolean trim)
+   {
+      super(trim);
+   }
+
+   public Boolean useString(String attribute)
+   {
+      return Boolean.valueOf(attribute);
+   }
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/CollectionValueCreator.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/CollectionValueCreator.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/CollectionValueCreator.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/CollectionValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+import java.util.Collection;
+
+/**
+ * Create value from collection of attributes.
+ *
+ * @param <T> expected type
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface CollectionValueCreator<T> extends ValueCreator<T>
+{
+   /**
+    * Create value from string attribute.
+    *
+    * @param attributes collection of strings to get value from
+    * @return value
+    */
+   T createValue(Collection<String> attributes);
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/IntegerValueCreator.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/IntegerValueCreator.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/IntegerValueCreator.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/IntegerValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+/**
+ * Parse int from string.
+ * 
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+*/
+class IntegerValueCreator extends AbstractValueCreator<Integer>
+{
+   public IntegerValueCreator()
+   {
+      super();
+   }
+
+   public IntegerValueCreator(boolean trim)
+   {
+      super(trim);
+   }
+
+   public Integer useString(String attribute)
+   {
+      return Integer.valueOf(attribute);
+   }
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/ListValueCreator.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ListValueCreator.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/ListValueCreator.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/ListValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,43 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+import java.util.List;
+
+/**
+ * Create value list from string attribute.
+ *
+ * @param <T> expected component type
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+abstract class ListValueCreator<T> extends AbstractValueCreator<List<T>>   
+{
+   protected ListValueCreator()
+   {
+      super();
+   }
+
+   protected ListValueCreator(boolean trim)
+   {
+      super(trim);
+   }
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/OSGiParameters.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/OSGiParameters.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/OSGiParameters.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/OSGiParameters.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,125 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.logging.Logger;
+import org.jboss.osgi.plugins.metadata.Parameter;
+import org.jboss.osgi.plugins.metadata.VersionRange;
+
+import static org.osgi.framework.Constants.*;
+
+/**
+ * OSGi parameter values.
+ * Util for transforming parameter info to actual useful values.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class OSGiParameters
+{
+   protected static Logger log = Logger.getLogger(OSGiParameters.class);
+
+   protected Map<String, Parameter> parameters;
+   protected Map<String, Object> cachedAttributes;
+
+   public OSGiParameters(Map<String, Parameter> parameters)
+   {
+      this.parameters = Collections.unmodifiableMap(parameters);
+      this.cachedAttributes = new HashMap<String, Object>();
+   }
+
+   protected Map<String, Parameter> getParameters()
+   {
+      return parameters;
+   }
+
+   public VersionRange getVersion()
+   {
+      return get(VERSION_ATTRIBUTE, ValueCreatorUtil.VERSION_RANGE_VC);
+   }
+
+   public String getBundleSymbolicName()
+   {
+      return get(BUNDLE_SYMBOLICNAME_ATTRIBUTE, ValueCreatorUtil.STRING_VC);
+   }
+
+   public VersionRange getBundleVersion()
+   {
+      return get(BUNDLE_VERSION_ATTRIBUTE, ValueCreatorUtil.VERSION_RANGE_VC);
+   }
+
+   public String getVisibility()
+   {
+      return get(VISIBILITY_DIRECTIVE, ValueCreatorUtil.STRING_VC, VISIBILITY_PRIVATE);
+   }
+
+   public String getResolution()
+   {
+      return get(RESOLUTION_DIRECTIVE, ValueCreatorUtil.STRING_VC, RESOLUTION_MANDATORY);
+   }
+
+   protected <T> T get(String key, ValueCreator<T> creator)
+   {
+      return get(key, creator, null);
+   }
+
+   @SuppressWarnings("unchecked")
+   protected <T> T get(String key, ValueCreator<T> creator, T defaultValue)
+   {
+      T value = (T)cachedAttributes.get(key);
+      if (value == null)
+      {
+         Parameter parameter = parameters.get(key);
+         if (parameter != null)
+         {
+            Object paramValue = parameter.getValue();
+            if(parameter.isCollection())
+            {
+               if (creator instanceof CollectionValueCreator)
+               {
+                  CollectionValueCreator<T> cvc = (CollectionValueCreator<T>)creator;
+                  value = cvc.createValue((Collection<String>)paramValue);
+               }
+               else
+               {
+                  log.warn("Unable to create proper value from " + creator + " for parameter: " + parameter);
+               }
+            }
+            else
+            {
+               value = creator.createValue(paramValue.toString());
+            }
+         }
+         else if (defaultValue != null)
+         {
+            value = defaultValue;
+         }
+         if (value != null)
+            cachedAttributes.put(key, value);
+      }
+      return value;
+   }
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/PackageAttributeListValueCreator.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/PackageAttributeListValueCreator.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/PackageAttributeListValueCreator.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/PackageAttributeListValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,49 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.osgi.plugins.metadata.PackageAttribute;
+
+/**
+ * Create package attribute list from string attribute.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+class PackageAttributeListValueCreator extends ListValueCreator<PackageAttribute>
+{
+   public List<PackageAttribute> useString(String attibute)
+   {
+      List<PackageAttribute> list = new ArrayList<PackageAttribute>();
+      try
+      {
+         HeaderValue.parsePackages(attibute, list, log.isTraceEnabled());
+      }
+      catch (ParseException e)
+      {
+         log.error("Exception parsing package headers.", e);
+      }
+      return list;
+   }
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/ParameterizedAttributeListValueCreator.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ParameterizedAttributeListValueCreator.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/ParameterizedAttributeListValueCreator.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/ParameterizedAttributeListValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.osgi.plugins.metadata.ParameterizedAttribute;
+
+/**
+ * Create parameterized attribute list from string attribute.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+abstract class ParameterizedAttributeListValueCreator extends ListValueCreator<ParameterizedAttribute>
+{
+   public List<ParameterizedAttribute> useString(String attribute)
+   {
+      List<ParameterizedAttribute> list = new ArrayList<ParameterizedAttribute>();
+      parseAttribute(attribute, list, log.isTraceEnabled());
+      return list;
+   }
+
+   /**
+    * Use appropriate JavaCC parsing util.
+    *
+    * @param attribute string value to parse
+    * @param list data holder list
+    * @param trace log trace
+    */
+   protected abstract void parseAttribute(String attribute, List<ParameterizedAttribute> list, boolean trace);
+
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/ParameterizedAttributeValueCreator.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ParameterizedAttributeValueCreator.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/ParameterizedAttributeValueCreator.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/ParameterizedAttributeValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+import java.util.List;
+
+import org.jboss.osgi.plugins.metadata.ParameterizedAttribute;
+
+/**
+ * Create paramertized attribute from string attribute.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+class ParameterizedAttributeValueCreator extends AbstractValueCreator<ParameterizedAttribute>
+{
+   public ParameterizedAttribute useString(String attribute)
+   {
+      ParameterizedAttributeListValueCreator palvc = new QNameAttributeListValueCreator();
+      List<ParameterizedAttribute> list = palvc.useString(attribute);
+      return list.size() > 0 ? list.get(0) : null;
+   }
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/PathAttributeListValueCreator.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/PathAttributeListValueCreator.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/PathAttributeListValueCreator.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/PathAttributeListValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+import java.util.List;
+
+import org.jboss.osgi.plugins.metadata.ParameterizedAttribute;
+
+/**
+ * Create path attribute list from string attribute.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+class PathAttributeListValueCreator extends ParameterizedAttributeListValueCreator
+{
+   protected void parseAttribute(String attribute, List<ParameterizedAttribute> list, boolean trace)
+   {
+      try
+      {
+         HeaderValue.parsePaths(attribute, list, trace);
+      }
+      catch (ParseException e)
+      {
+         log.error("Exception parsing parameters.", e);
+      }
+   }
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/QNameAttributeListValueCreator.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/QNameAttributeListValueCreator.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/QNameAttributeListValueCreator.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/QNameAttributeListValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+import java.util.List;
+
+import org.jboss.osgi.plugins.metadata.ParameterizedAttribute;
+
+/**
+ * Create [dynamic]qname attribute list from string attribute.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+class QNameAttributeListValueCreator extends ParameterizedAttributeListValueCreator
+{
+   protected void parseAttribute(String attribute, List<ParameterizedAttribute> list, boolean trace)
+   {
+      try
+      {
+         HeaderValue.parseParameters(attribute, list, trace);
+      }
+      catch (ParseException e)
+      {
+         log.debug("Exception parsing parameters.", e);
+      }
+   }
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/StringListValueCreator.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/StringListValueCreator.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/StringListValueCreator.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/StringListValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,62 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Split string into list of strings.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+*/
+class StringListValueCreator extends ListValueCreator<String>
+{
+   protected String delimiter = ",";
+
+   public StringListValueCreator()
+   {
+      super();
+   }
+
+   public StringListValueCreator(boolean trim)
+   {
+      super(trim);
+   }
+
+   public StringListValueCreator(String delimiter)
+   {
+      this();
+      this.delimiter = delimiter;
+   }
+
+   public StringListValueCreator(String delimiter, boolean trim)
+   {
+      this(trim);
+      this.delimiter = delimiter;
+   }
+
+   public List<String> useString(String attribute)
+   {
+      return Arrays.asList(attribute.split(delimiter));
+   }
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/StringValueCreator.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/StringValueCreator.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/StringValueCreator.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/StringValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+/**
+ * Plain string forwarding - no conversion.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+*/
+class StringValueCreator extends AbstractValueCreator<String>
+{
+   public StringValueCreator()
+   {
+      super();
+   }
+
+   public StringValueCreator(boolean trim)
+   {
+      super(trim);
+   }
+
+   protected String useString(String attibute)
+   {
+      return attibute;
+   }
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/URLValueCreator.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/URLValueCreator.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/URLValueCreator.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/URLValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,56 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+/**
+ * Create URL from string.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+*/
+class URLValueCreator extends AbstractValueCreator<URL>
+{
+   public URLValueCreator()
+   {
+      super();
+   }
+
+   public URLValueCreator(boolean trim)
+   {
+      super(trim);
+   }
+
+   public URL useString(String attribute)
+   {
+      try
+      {
+         return new URL(attribute);
+      }
+      catch (MalformedURLException e)
+      {
+         log.warn("Exception while creating URL.", e);
+         return null;
+      }
+   }
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/ValueCreator.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ValueCreator.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/ValueCreator.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/ValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,39 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+/**
+ * Create value from attribute.
+ *
+ * @param <T> expected type
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface ValueCreator<T>
+{
+   /**
+    * Create value from string attribute.
+    *
+    * @param attribute string to get value from
+    * @return value
+    */
+   T createValue(String attribute);
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/ValueCreatorUtil.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/ValueCreatorUtil.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/ValueCreatorUtil.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/ValueCreatorUtil.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,43 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+/**
+ * ValueCreator holder.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ValueCreatorUtil
+{
+   public static StringValueCreator STRING_VC = new StringValueCreator();
+   public static IntegerValueCreator INTEGER_VC = new IntegerValueCreator();
+   public static BooleanValueCreator BOOLEAN_VC = new BooleanValueCreator();
+   public static VersionValueCreator VERSION_VC = new VersionValueCreator();
+   public static VersionRangeValueCreator VERSION_RANGE_VC = new VersionRangeValueCreator();
+   public static URLValueCreator URL_VC = new URLValueCreator();
+   public static StringListValueCreator STRING_LIST_VC = new StringListValueCreator();
+   public static ParameterizedAttributeValueCreator PARAM_ATTRIB_VC = new ParameterizedAttributeValueCreator();
+   public static ParameterizedAttributeListValueCreator QNAME_ATTRIB_LIST_VC = new QNameAttributeListValueCreator();
+   public static ParameterizedAttributeListValueCreator PATH_ATTRIB_LIST_VC = new PathAttributeListValueCreator();
+   public static PackageAttributeListValueCreator PACKAGE_LIST_VC = new PackageAttributeListValueCreator();
+   public static ActivationPolicyMDValueCreator ACTIVATION_POLICY_VC = new ActivationPolicyMDValueCreator();
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/VersionRangeValueCreator.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/VersionRangeValueCreator.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/VersionRangeValueCreator.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/VersionRangeValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,47 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+import org.jboss.osgi.plugins.metadata.VersionRange;
+
+/**
+ * Parse VersionRange from string.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+*/
+class VersionRangeValueCreator extends AbstractValueCreator<VersionRange>
+{
+   public VersionRangeValueCreator()
+   {
+      super();
+   }
+
+   public VersionRangeValueCreator(boolean trim)
+   {
+      super(trim);
+   }
+
+   public VersionRange useString(String attribute)
+   {
+      return AbstractVersionRange.parseRangeSpec(attribute);
+   }
+}

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/VersionValueCreator.java (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/VersionValueCreator.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/VersionValueCreator.java	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/metadata/impl/VersionValueCreator.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,47 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.plugins.metadata.impl;
+
+import org.osgi.framework.Version;
+
+/**
+ * Parse Version from string.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+*/
+class VersionValueCreator extends AbstractValueCreator<Version>
+{
+   public VersionValueCreator()
+   {
+      super();
+   }
+
+   public VersionValueCreator(boolean trim)
+   {
+      super(trim);
+   }
+
+   public Version useString(String attribute)
+   {
+      return new Version(attribute);
+   }
+}

Modified: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/resolver/BundleResolver.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/resolver/BundleResolver.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/java/org/jboss/osgi/plugins/resolver/BundleResolver.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -42,9 +42,9 @@
 import org.jboss.osgi.plugins.facade.bundle.OSGiBundleState;
 import org.jboss.osgi.plugins.facade.bundle.OSGiBundleWrapper;
 import org.jboss.osgi.plugins.facade.classloading.OSGiPackageRequirement;
-import org.jboss.osgi.plugins.metadata.spi.OSGiMetaData;
-import org.jboss.osgi.plugins.metadata.spi.Parameter;
-import org.jboss.osgi.plugins.metadata.spi.ParameterizedAttribute;
+import org.jboss.osgi.plugins.metadata.OSGiMetaData;
+import org.jboss.osgi.plugins.metadata.Parameter;
+import org.jboss.osgi.plugins.metadata.ParameterizedAttribute;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.Constants;
 

Copied: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/javacc/HeaderValue.jj (from rev 94254, projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/javacc/org/jboss/osgi/plugins/metadata/HeaderValue.jj)
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/javacc/HeaderValue.jj	                        (rev 0)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/main/javacc/HeaderValue.jj	2009-10-02 07:08:46 UTC (rev 94256)
@@ -0,0 +1,312 @@
+ options {
+   LOOKAHEAD=2;
+   DEBUG_PARSER=true;
+   DEBUG_LOOKAHEAD=true;
+   DEBUG_TOKEN_MANAGER=false;
+   STATIC=false;
+}
+
+PARSER_BEGIN(HeaderValue)
+package org.jboss.osgi.plugins.metadata.impl;
+
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.osgi.plugins.metadata.*;
+
+/**
+ * A JavaCC 3.2 grammar for the OSGi R4 bundle headers
+ *
+ * @author Scott.Stark at jboss.org
+ * @author Ales.Justin at jboss.org
+ */
+public class HeaderValue
+{
+   public HeaderValue()
+   {
+      this(new StringReader(""));
+   }
+
+   public HeaderValue(String value)
+   {
+      this(new StringReader(value));
+   }
+
+   private void applyTracing(boolean trace)
+   {
+      if (trace)
+      {
+         enable_tracing();
+      }
+      else
+      {
+         disable_tracing();
+      }
+   }
+
+   private void addParameter(Map<String, Parameter> parameters, String key, String value)
+   {
+      Parameter parameter = parameters.get(key);
+      if (parameter == null)
+      {
+         parameter = new AbstractParameter();
+         parameters.put(key, parameter);
+      }
+      parameter.addValue(value);
+   }
+
+   public void parsePackages(List<PackageAttribute> list, boolean trace)
+      throws ParseException
+   {
+      // This will have no effect unless the debugging options are true
+      applyTracing(trace);
+      parsePackages(list);
+   }
+
+   public void parseParameters(List<ParameterizedAttribute> list, boolean trace)
+      throws ParseException
+   {
+      // This will have no effect unless the debugging options are true
+      applyTracing(trace);
+      parseParameters(list);
+   }
+
+   public void parsePaths(List<ParameterizedAttribute> list, boolean trace)
+      throws ParseException
+   {
+      // This will have no effect unless the debugging options are true
+      applyTracing(trace);
+      parsePaths(list);
+   }
+
+   public static void parsePackages(String header, List<PackageAttribute> list, boolean trace)
+      throws ParseException
+   {
+      HeaderValue parser = new HeaderValue(header);
+      parser.parsePackages(list, trace);
+   }
+
+   public static void parseParameters(String header, List<ParameterizedAttribute> list, boolean trace)
+      throws ParseException
+   {
+      HeaderValue parser = new HeaderValue(header);
+      parser.parseParameters(list, trace);
+   }
+
+   public static void parsePaths(String header, List<ParameterizedAttribute> list, boolean trace)
+      throws ParseException
+   {
+      HeaderValue parser = new HeaderValue(header);
+      parser.parsePaths(list, trace);
+   }
+}
+PARSER_END(HeaderValue)
+
+/* IGNORE WHITESPACE */
+
+SKIP :
+{
+    " "
+  | "\r"
+  | "\t"
+  | "\n"
+}
+
+/* Common tokens */
+TOKEN:
+{
+  <#ALPHA: [ "a"-"z", "A"-"Z" ] >
+|
+  <#DIGIT: ["0" - "9"] >
+|
+  <STAR: "*" >
+|
+  <NUMBER: (<DIGIT>)+ >
+|
+  <DECIMAL_NUMBER: <NUMBER> ( "." <NUMBER> )? >
+|
+  <#ALPHANUM: <ALPHA>|<DECIMAL_NUMBER> >
+|
+  <VERSION_VALUE: (<NUMBER> ("." <NUMBER> ("." <NUMBER> ("." <ALPHANUM>)? )?  )?) >
+|
+  <#TOKN: (<ALPHANUM>|<VERSION_VALUE>|"_"|"-")+ >
+|
+  <#JLETTER: [ "_", "a"-"z", "A"-"Z" ] >
+|
+  <#JLETTER_OR_DIGIT: <JLETTER> | <DIGIT> >
+|
+  <QNAME: <JLETTER> (<JLETTER_OR_DIGIT>)* ("." <JLETTER> (<JLETTER_OR_DIGIT>)*)* (".*")? >
+|
+  <QUOTED_STRING: "\"" ( ~["\"", "\\", "\r", "\n", "\u0000"] | "\\\"")* "\"" >
+|
+  <#ARGUMENT: <TOKN>|<QUOTED_STRING> >
+|
+  <ATTRIBUTE: <TOKN> "=" <ARGUMENT> >
+|
+  <DIRECTIVE: <TOKN> ":=" <ARGUMENT> >
+|
+  <PATH_ELEMENT: (~["/", "\"", "\n", "\r", "\u0000", ";", ","])+ >
+|
+  <PATH_SEP: "/" >
+|
+  <#PATH_UNQUOTED: <PATH_SEP> | (<PATH_SEP>)? <PATH_ELEMENT> (<PATH_SEP> <PATH_ELEMENT>)* >
+|
+  <PATH: <PATH_UNQUOTED> | "\"" <PATH_UNQUOTED> "\"" >
+}
+
+/** Start of the grammar */
+/** Entry point for the Import-Package header value parsing. */
+
+void parsePackages(List<PackageAttribute> list) :
+{
+}
+{
+  packageInfo(list) ( "," packageInfo(list) )*
+  {
+  }
+}
+
+void parseParameters(List<ParameterizedAttribute> list) :
+{
+}
+{
+  parameterInfo(list) ( "," parameterInfo(list) )*
+  {
+  }
+}
+
+void parsePaths(List<ParameterizedAttribute> list) :
+{
+}
+{
+  pathInfo(list) ( "," pathInfo(list) )*
+  {
+  }
+}
+
+void packageInfo(List<PackageAttribute> list) :
+{
+   List<String> packages = new ArrayList<String>();
+   Map<String, Parameter> parameters = new HashMap<String, Parameter>();
+}
+{
+   packageNames(packages) ( ";" parsePackageParameters(parameters) )*
+   {
+      for(String pckg : packages)
+      {
+         list.add(new AbstractPackageAttribute(pckg, parameters));
+      }
+   }
+}
+
+void pathInfo(List<ParameterizedAttribute> list) :
+{
+   List<String> paths = new ArrayList<String>();
+   Map<String, Parameter> parameters = new HashMap<String, Parameter>();
+}
+{
+   pathNames(paths) ( ";" parsePathParameters(parameters) )+
+   {
+      for(String path : paths)
+      {
+         list.add(new AbstractPackageAttribute(path, parameters));
+      }
+   }
+}
+
+void parameterInfo(List<ParameterizedAttribute> list) :
+{
+   Token t;
+   Map<String, Parameter> parameters = new HashMap<String, Parameter>();
+}
+{
+   t = <QNAME> ( ";" parseAttributeParameters(parameters) )*
+   {
+      list.add(new AbstractParameterizedAttribute(t.toString(), parameters));
+   }
+}
+
+void packageNames(List<String> packages) :
+{
+	Token t;
+}
+{
+  t=<QNAME> {packages.add(t.image);} ( ";" packageNames(packages))*
+  |
+  t=<STAR> {packages.add(t.image);} ( ";" packageNames(packages))*
+}
+
+void pathNames(List<String> paths) :
+{
+	Token t;
+}
+{
+  t=<PATH> {paths.add(t.image);} ( ";" pathNames(paths))*
+}
+
+void parsePackageParameters(Map<String, Parameter> parameters) :
+{
+   Token t;
+}
+{
+   t = <DIRECTIVE>
+   {
+      String ts = t.toString();
+      String[] params = ts.split(":=");
+      addParameter(parameters, params[0], params[1]);
+   }
+|
+   t = <ATTRIBUTE>
+   {
+      String ts = t.toString();
+      String[] params = ts.split("=");
+      addParameter(parameters, params[0], params[1]);
+   }
+   ( ";" parsePackageParameters(parameters))*
+}
+
+void parseAttributeParameters(Map<String, Parameter> parameters) :
+{
+   Token t;
+}
+{
+   t = <DIRECTIVE>
+   {
+      String ts = t.toString();
+      String[] params = ts.split(":=");
+      addParameter(parameters, params[0], params[1]);
+   }
+|
+   t = <ATTRIBUTE>
+   {
+      String ts = t.toString();
+      String[] params = ts.split("=");
+      addParameter(parameters, params[0], params[1]);
+   }
+   ( ";" parseAttributeParameters(parameters))*
+}
+
+void parsePathParameters(Map<String, Parameter> parameters) :
+{
+   Token t;
+}
+{
+   t = <DIRECTIVE>
+   {
+      String ts = t.toString();
+      String[] params = ts.split(":=");
+      addParameter(parameters, params[0], params[1]);
+   }
+|
+   t = <ATTRIBUTE>
+   {
+      String ts = t.toString();
+      String[] params = ts.split("=");
+      addParameter(parameters, params[0], params[1]);
+   }
+   ( ";" parsePathParameters(parameters))*
+}
+

Modified: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/test/java/org/jboss/test/bundle/metadata/HeaderValuesTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/test/java/org/jboss/test/bundle/metadata/HeaderValuesTestCase.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/test/java/org/jboss/test/bundle/metadata/HeaderValuesTestCase.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -31,17 +31,18 @@
 import java.io.Serializable;
 
 import junit.framework.Test;
-import org.jboss.osgi.plugins.metadata.AbstractOSGiMetaData;
-import org.jboss.osgi.plugins.metadata.AbstractPackageAttribute;
-import org.jboss.osgi.plugins.metadata.AbstractParameter;
-import org.jboss.osgi.plugins.metadata.AbstractParameterizedAttribute;
-import org.jboss.osgi.plugins.metadata.OSGiParameters;
-import org.jboss.osgi.plugins.metadata.spi.ActivationPolicyMetaData;
-import org.jboss.osgi.plugins.metadata.spi.OSGiMetaData;
-import org.jboss.osgi.plugins.metadata.spi.PackageAttribute;
-import org.jboss.osgi.plugins.metadata.spi.Parameter;
-import org.jboss.osgi.plugins.metadata.spi.ParameterizedAttribute;
-import org.jboss.osgi.plugins.metadata.spi.VersionRange;
+
+import org.jboss.osgi.plugins.metadata.ActivationPolicyMetaData;
+import org.jboss.osgi.plugins.metadata.OSGiMetaData;
+import org.jboss.osgi.plugins.metadata.PackageAttribute;
+import org.jboss.osgi.plugins.metadata.Parameter;
+import org.jboss.osgi.plugins.metadata.ParameterizedAttribute;
+import org.jboss.osgi.plugins.metadata.VersionRange;
+import org.jboss.osgi.plugins.metadata.impl.AbstractOSGiMetaData;
+import org.jboss.osgi.plugins.metadata.impl.AbstractPackageAttribute;
+import org.jboss.osgi.plugins.metadata.impl.AbstractParameter;
+import org.jboss.osgi.plugins.metadata.impl.AbstractParameterizedAttribute;
+import org.jboss.osgi.plugins.metadata.impl.OSGiParameters;
 import org.osgi.framework.Version;
 
 /**

Modified: projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/test/java/org/jboss/test/bundle/metadata/VersionRangeTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/test/java/org/jboss/test/bundle/metadata/VersionRangeTestCase.java	2009-10-02 06:25:37 UTC (rev 94255)
+++ projects/jboss-osgi/projects/runtime/microcontainer/branches/tdiesler/src/test/java/org/jboss/test/bundle/metadata/VersionRangeTestCase.java	2009-10-02 07:08:46 UTC (rev 94256)
@@ -6,8 +6,8 @@
 import junit.framework.Test;
 
 import org.jboss.logging.Logger;
-import org.jboss.osgi.plugins.metadata.AbstractVersionRange;
-import org.jboss.osgi.plugins.metadata.spi.VersionRange;
+import org.jboss.osgi.plugins.metadata.VersionRange;
+import org.jboss.osgi.plugins.metadata.impl.AbstractVersionRange;
 import org.jboss.test.BaseTestCase;
 import org.osgi.framework.Version;
 




More information about the jboss-cvs-commits mailing list