JBoss-OSGI SVN: r90428 - projects/jboss-osgi/projects/bundles/microcontainer/trunk.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-18 10:17:09 -0400 (Thu, 18 Jun 2009)
New Revision: 90428
Modified:
projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml
Log:
Update to SPI-1.0.0-SNAPSHOT
Modified: projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml 2009-06-18 14:16:51 UTC (rev 90427)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml 2009-06-18 14:17:09 UTC (rev 90428)
@@ -24,9 +24,9 @@
<version.jboss.osgi.apache.xerces>2.9.1</version.jboss.osgi.apache.xerces>
<version.jboss.osgi.common>1.0.0.Beta2</version.jboss.osgi.common>
<version.jboss.osgi.deployers>1.0.0.Beta2</version.jboss.osgi.deployers>
- <version.jboss.osgi.jbossas>1.0.0.Beta2</version.jboss.osgi.jbossas>
+ <version.jboss.osgi.jbossas>1.0.0-SNAPSHOT</version.jboss.osgi.jbossas>
<version.jboss.osgi.jmx>1.0.0.Beta2</version.jboss.osgi.jmx>
- <version.jboss.osgi.spi>1.0.0.Beta2</version.jboss.osgi.spi>
+ <version.jboss.osgi.spi>1.0.0-SNAPSHOT</version.jboss.osgi.spi>
<version.jboss.osgi.xml.binding>2.0.0</version.jboss.osgi.xml.binding>
<version.osgi>r4v41</version.osgi>
</properties>
@@ -107,7 +107,6 @@
<Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
<Bundle-Activator>org.jboss.osgi.microcontainer.internal.MicrocontainerServiceActivator</Bundle-Activator>
<Export-Package>
- org.jboss.osgi.microcontainer;version=${version.jboss.microcontainer}
</Export-Package>
<Private-Package>
org.jboss.osgi.microcontainer.internal
@@ -172,9 +171,10 @@
jboss-kernel;inline=false,
</Embed-Dependency>
<_exportcontents>
- .,
- org.jboss.dependency*,
- org.jboss.deployers*,
+ org.jboss.beans*;version=${version.jboss.microcontainer},
+ org.jboss.kernel.spi*;version=${version.jboss.microcontainer},
+ org.jboss.dependency*;version=${version.jboss.microcontainer},
+ org.jboss.deployers*;version=${version.jboss.deployers},
</_exportcontents>
</instructions>
</configuration>
15 years
JBoss-OSGI SVN: r90427 - in projects/jboss-osgi/projects/integration/jbossas/trunk: src/main/java/org/jboss/osgi/integration/jbossas and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-18 10:16:51 -0400 (Thu, 18 Jun 2009)
New Revision: 90427
Modified:
projects/jboss-osgi/projects/integration/jbossas/trunk/pom.xml
projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/integration/jbossas/AbstractMicrocontainerService.java
Log:
Update to SPI-1.0.0-SNAPSHOT
Modified: projects/jboss-osgi/projects/integration/jbossas/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/integration/jbossas/trunk/pom.xml 2009-06-18 14:16:14 UTC (rev 90426)
+++ projects/jboss-osgi/projects/integration/jbossas/trunk/pom.xml 2009-06-18 14:16:51 UTC (rev 90427)
@@ -17,7 +17,7 @@
</parent>
<properties>
- <version.jboss.osgi.spi>1.0.0.Beta2</version.jboss.osgi.spi>
+ <version.jboss.osgi.spi>1.0.0-SNAPSHOT</version.jboss.osgi.spi>
<version.osgi>r4v41</version.osgi>
</properties>
Modified: projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/integration/jbossas/AbstractMicrocontainerService.java
===================================================================
--- projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/integration/jbossas/AbstractMicrocontainerService.java 2009-06-18 14:16:14 UTC (rev 90426)
+++ projects/jboss-osgi/projects/integration/jbossas/trunk/src/main/java/org/jboss/osgi/integration/jbossas/AbstractMicrocontainerService.java 2009-06-18 14:16:51 UTC (rev 90427)
@@ -99,6 +99,12 @@
return context != null ? context.getTarget() : null;
}
+ @SuppressWarnings("unchecked")
+ public <T> T getRegisteredBean(Class<T> clazz, String beanName)
+ {
+ return (T)getRegisteredBean(beanName);
+ }
+
public void deploy(URL url) throws BundleException
{
deployInternal(new URL[] { url });
@@ -136,7 +142,7 @@
URL[] urls = new URL[bundles.length];
for (int i = 0; i < bundles.length; i++)
urls[i] = bundles[i].getLocation();
-
+
deployInternal(urls);
}
15 years
JBoss-OSGI SVN: r90426 - in projects/jboss-osgi/trunk/blueprint: impl/src/main/java/org/jboss/osgi/blueprint/reflect and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-18 10:16:14 -0400 (Thu, 18 Jun 2009)
New Revision: 90426
Modified:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/AbstractManager.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BeanManager.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/ServiceManager.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BeanMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintMetadata.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentFactory.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/bundle/BeanA.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/bundle/BeanB.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/container/container-basic.bnd
Log:
KernelBeans get installed
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/AbstractManager.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/AbstractManager.java 2009-06-18 14:11:06 UTC (rev 90425)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/AbstractManager.java 2009-06-18 14:16:14 UTC (rev 90426)
@@ -27,6 +27,7 @@
import org.jboss.beans.metadata.spi.BeanMetaData;
import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.osgi.spi.service.MicrocontainerService;
import org.osgi.framework.BundleContext;
@@ -79,6 +80,11 @@
return component.getInitialization();
}
+ public void install()
+ {
+ log.log(LogService.LOG_DEBUG, "install: " + component);
+ }
+
public void activate()
{
log.log(LogService.LOG_DEBUG, "activate: " + component);
@@ -89,12 +95,13 @@
log.log(LogService.LOG_DEBUG, "shutdown: " + component);
}
- protected void installKernelBean(BeanMetaData kernelBean)
+ protected KernelControllerContext installKernelBean(BeanMetaData kernelBean)
{
- KernelController controller = getKernelController();
try
{
- controller.install(kernelBean);
+ KernelControllerContext ctrlContext = getKernelController().install(kernelBean);
+ log.log(LogService.LOG_DEBUG, "installed: " + ctrlContext);
+ return ctrlContext;
}
catch (RuntimeException rte)
{
@@ -108,8 +115,8 @@
protected void uninstallKernelBean(BeanMetaData kernelBean)
{
- KernelController controller = getKernelController();
- controller.uninstall(kernelBean);
+ getKernelController().uninstall(kernelBean.getName());
+ log.log(LogService.LOG_DEBUG, "uninstalled: " + kernelBean.getName());
}
protected KernelController getKernelController()
@@ -120,6 +127,9 @@
MicrocontainerService service = (MicrocontainerService)context.getService(sref);
KernelController controller = service.getRegisteredBean(KernelController.class, BEAN_KERNEL_CONTROLLER);
+ if (controller == null)
+ throw new IllegalStateException("Cannot obtain KernelController");
+
return controller;
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BeanManager.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BeanManager.java 2009-06-18 14:11:06 UTC (rev 90425)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BeanManager.java 2009-06-18 14:16:14 UTC (rev 90426)
@@ -23,7 +23,6 @@
//$Id$
-
import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory;
import org.jboss.beans.metadata.spi.BeanMetaData;
import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
@@ -63,9 +62,9 @@
}
@Override
- public void activate()
+ public void install()
{
- super.activate();
+ super.install();
kernelBean = getKernelBean(beanMetadata);
installKernelBean(kernelBean);
@@ -76,7 +75,7 @@
{
if (kernelBean != null)
uninstallKernelBean(kernelBean);
-
+
super.shutdown();
}
@@ -84,7 +83,7 @@
{
String name = compMetadata.getKey();
String clazz = compMetadata.getClassName();
-
+
BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder(name, clazz);
return builder.getBeanMetaData();
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java 2009-06-18 14:11:06 UTC (rev 90425)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java 2009-06-18 14:16:14 UTC (rev 90426)
@@ -67,17 +67,17 @@
* @author thomas.diesler(a)jboss.com
* @since 17-Jun-2009
*/
-public class BlueprintContainerImpl implements BlueprintContainer
+public class BlueprintContainerImpl implements BlueprintContainer
{
public static final String HEADER_BUNDLE_BLUEPRINT = "Bundle-Blueprint";
public static final String PROPERTY_BLUEPRINT_BUNDLE_SYMBOLIC_NAME = "osgi.blueprint.container.symbolicname";
public static final String PROPERTY_BLUEPRINT_BUNDLE_VERSION = "osgi.blueprint.container.version";
-
+
private BundleContext context;
private Bundle bundle;
-
+
private Map<String, AbstractManager> managers = new LinkedHashMap<String, AbstractManager>();
-
+
public BlueprintContainerImpl(BundleContext context, Bundle bundle)
{
this.context = context;
@@ -88,34 +88,31 @@
{
// The Blueprint Container parses the definitions into metadata objects.
BlueprintMetadata bpMetadata = getBlueprintMetadata();
-
- // For each of the ComponentMetadata objects, the Blueprint Container
+
+ // For each of the ComponentMetadata objects, the Blueprint Container
// has a corresponding component manager.
createManagers(bpMetadata);
-
+
// If the Blueprint Container has successfully activated the eager managers, it
// will register a Blueprint Container service.
registerBlueprintContainerService();
}
/*
- * When the Blueprint Container must be destroyed because the Blueprint
- * bundle has stopped, there is a failure, or the Blueprint extender is stopped,
- * then the Blueprint Container service is unregistered and all managers are
- * deactivated. This will unregister any services and listeners, which release
- * the component instances. Then all component instances are destroyed in
- * reverse dependency order. That is, a component instance is destroyed when
- * no other component instances depends on it.
+ * When the Blueprint Container must be destroyed because the Blueprint bundle has stopped, there is a failure, or the Blueprint extender is stopped, then the
+ * Blueprint Container service is unregistered and all managers are deactivated. This will unregister any services and listeners, which release the component
+ * instances. Then all component instances are destroyed in reverse dependency order. That is, a component instance is destroyed when no other component instances
+ * depends on it.
*/
public void shutdown()
{
List<AbstractManager> list = new ArrayList<AbstractManager>(managers.values());
Collections.reverse(list);
-
+
for (AbstractManager manager : list)
manager.shutdown();
}
-
+
public BundleContext getBundleContext()
{
return bundle.getBundleContext();
@@ -136,7 +133,7 @@
AbstractManager manager = managers.get(name);
if (manager == null)
throw new NoSuchComponentException(name);
-
+
return manager.getComponentMetadata();
}
@@ -157,12 +154,12 @@
{
throw new NotImplementedException();
}
-
+
private void registerBlueprintContainerService()
{
String symbolicName = bundle.getSymbolicName();
String version = (String)bundle.getHeaders().get(Constants.BUNDLE_VERSION);
-
+
Properties props = new Properties();
props.setProperty(PROPERTY_BLUEPRINT_BUNDLE_SYMBOLIC_NAME, symbolicName);
props.setProperty(PROPERTY_BLUEPRINT_BUNDLE_VERSION, version);
@@ -174,7 +171,7 @@
for (ComponentMetadata comp : bpMetadata.getComponents())
{
AbstractManager manager = AbstractManager.createManager(context, comp);
-
+
String key = manager.getId();
if (key == null)
throw new IllegalStateException("Component id cannot be null for: " + comp);
@@ -183,10 +180,14 @@
// That is, it is an error if the same id is used multiple times.
if (managers.get(key) != null)
throw new IllegalStateException("Duplicate top-level component: " + key);
-
+
managers.put(key, manager);
}
-
+
+ // Invoke install for every manager
+ for (AbstractManager manager : managers.values())
+ manager.install();
+
// Activated the eager managers
for (AbstractManager manager : managers.values())
{
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/ServiceManager.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/ServiceManager.java 2009-06-18 14:11:06 UTC (rev 90425)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/ServiceManager.java 2009-06-18 14:16:14 UTC (rev 90426)
@@ -23,8 +23,13 @@
//$Id$
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
import org.jboss.osgi.blueprint.reflect.ServiceMetadataImpl;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
import org.osgi.service.blueprint.reflect.BeanMetadata;
import org.osgi.service.blueprint.reflect.ServiceMetadata;
@@ -41,7 +46,9 @@
public class ServiceManager extends AbstractManager
{
private ServiceMetadataImpl serviceMetadata;
- private AbstractManager beanManager;
+
+ private BeanManager anonymousBean;
+ private List<ServiceRegistration> serviceRegs = new ArrayList<ServiceRegistration>();
public ServiceManager(BundleContext context, ServiceMetadata compMetadata)
{
@@ -49,26 +56,50 @@
this.serviceMetadata = (ServiceMetadataImpl)compMetadata;
// Create the anonymous bean manager
- BeanMetadata beanMetadata = serviceMetadata.getBeanMetadata();
+ BeanMetadata beanMetadata = (BeanMetadata)serviceMetadata.getServiceComponent();
if (beanMetadata != null)
- beanManager = (AbstractManager)AbstractManager.createManager(context, beanMetadata);
+ anonymousBean = (BeanManager)AbstractManager.createManager(context, beanMetadata);
}
@Override
+ public void install()
+ {
+ super.install();
+
+ if (anonymousBean != null)
+ anonymousBean.install();
+ }
+
+ @Override
public void activate()
{
super.activate();
- if (beanManager != null)
- beanManager.activate();
+ BeanManager beanManager = anonymousBean;
+ if (beanManager == null)
+ {
+ }
+
+ // Register the services
+ for (String interf : serviceMetadata.getInterfaces())
+ {
+ //ServiceRegistration sreg = context.registerService(interf, this, null);
+ //serviceRegs.add(sreg);
+ }
}
@Override
public void shutdown()
{
- if (beanManager != null)
- beanManager.shutdown();
+ // Unregister the services
+ List<ServiceRegistration> list = new ArrayList<ServiceRegistration>(serviceRegs);
+ Collections.reverse(list);
+ for (ServiceRegistration sreg : list)
+ sreg.unregister();
+ if (anonymousBean != null)
+ anonymousBean.shutdown();
+
super.shutdown();
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BeanMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BeanMetadataImpl.java 2009-06-18 14:11:06 UTC (rev 90425)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BeanMetadataImpl.java 2009-06-18 14:16:14 UTC (rev 90426)
@@ -45,14 +45,14 @@
private ComponentMetadata parent;
private TBean tBean;
- public BeanMetadataImpl(BundleContext context, TBean tBean)
+ public BeanMetadataImpl(BundleContext context, BlueprintMetadata blueprint, TBean tBean)
{
- this(context, null, tBean);
+ this(context, blueprint, null, tBean);
}
- public BeanMetadataImpl(BundleContext context, ComponentMetadata parent, TBean tBean)
+ public BeanMetadataImpl(BundleContext context, BlueprintMetadata blueprint, ComponentMetadata parent, TBean tBean)
{
- super(context, tBean);
+ super(context, blueprint, tBean);
this.parent = parent;
this.tBean = tBean;
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintMetadata.java 2009-06-18 14:11:06 UTC (rev 90425)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintMetadata.java 2009-06-18 14:16:14 UTC (rev 90426)
@@ -33,6 +33,7 @@
import org.jboss.osgi.blueprint.parser.xb.TComponent;
import org.jboss.osgi.spi.NotImplementedException;
import org.osgi.framework.BundleContext;
+import org.osgi.service.blueprint.container.NoSuchComponentException;
import org.osgi.service.blueprint.reflect.ComponentMetadata;
/**
@@ -63,7 +64,7 @@
public void initialize()
{
- ComponentFactory factory = new ComponentFactory(context);
+ ComponentFactory factory = new ComponentFactory(context, this);
for (TComponent tComp : tBlueprint.getComponents())
{
ComponentMetadata comp = factory.createComponent(tComp);
@@ -78,6 +79,15 @@
}
}
+ public ComponentMetadata getComponent(String name)
+ {
+ ComponentMetadata comp = components.get(name);
+ if (comp == null)
+ throw new NoSuchComponentException(name);
+
+ return comp;
+ }
+
public List<ComponentMetadata> getComponents()
{
ArrayList<ComponentMetadata> list = new ArrayList<ComponentMetadata>(components.values());
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentFactory.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentFactory.java 2009-06-18 14:11:06 UTC (rev 90425)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentFactory.java 2009-06-18 14:16:14 UTC (rev 90426)
@@ -39,11 +39,13 @@
public class ComponentFactory
{
private BundleContext context;
+ private BlueprintMetadata blueprint;
private int anonymousId;
- public ComponentFactory(BundleContext context)
+ public ComponentFactory(BundleContext context, BlueprintMetadata blueprint)
{
this.context = context;
+ this.blueprint = blueprint;
}
public ComponentMetadata createComponent(TComponent tComp)
@@ -59,13 +61,13 @@
tComp.setId(".anonymousId#" + (++anonymousId));
if (tComp instanceof TBean)
- comp = new BeanMetadataImpl(context, parent, (TBean)tComp);
+ comp = new BeanMetadataImpl(context, blueprint, parent, (TBean)tComp);
else if (tComp instanceof TService)
- comp = new ServiceMetadataImpl(context, (TService)tComp);
+ comp = new ServiceMetadataImpl(context, blueprint, (TService)tComp);
else if (tComp instanceof TServiceReference)
- comp = new ServiceReferenceMetadataImpl(context, (TServiceReference)tComp);
+ comp = new ServiceReferenceMetadataImpl(context, blueprint, (TServiceReference)tComp);
if (comp == null)
throw new IllegalArgumentException("Unsupported component type: " + tComp);
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentMetadataImpl.java 2009-06-18 14:11:06 UTC (rev 90425)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentMetadataImpl.java 2009-06-18 14:16:14 UTC (rev 90426)
@@ -38,11 +38,13 @@
public class ComponentMetadataImpl implements ComponentMetadata
{
protected BundleContext context;
+ protected BlueprintMetadata blueprint;
protected TComponent tComp;
- public ComponentMetadataImpl(BundleContext context, TComponent tComp)
+ public ComponentMetadataImpl(BundleContext context, BlueprintMetadata blueprint, TComponent tComp)
{
this.context = context;
+ this.blueprint = blueprint;
this.tComp = tComp;
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java 2009-06-18 14:11:06 UTC (rev 90425)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java 2009-06-18 14:16:14 UTC (rev 90426)
@@ -47,9 +47,9 @@
private TService tService;
private BeanMetadata beanMetadata;
- public ServiceMetadataImpl(BundleContext context, TService tService)
+ public ServiceMetadataImpl(BundleContext context, BlueprintMetadata blueprint, TService tService)
{
- super(context, tService);
+ super(context, blueprint, tService);
this.tService = tService;
}
@@ -85,24 +85,30 @@
public Target getServiceComponent()
{
- throw new NotImplementedException();
+ if (beanMetadata == null)
+ {
+ if (tService.getBean() != null)
+ {
+ ComponentFactory factory = new ComponentFactory(context, blueprint);
+ beanMetadata = (BeanMetadata)factory.createComponent(this, tService.getBean(), true);
+ }
+ //else if (tService.getRef() != null)
+ //{
+ // beanMetadata = (BeanMetadata)blueprint.getComponent(tService.getRef());
+ //}
+ }
+
+ //if (beanMetadata == null)
+ // throw new IllegalStateException("Cannot get service component");
+
+ return beanMetadata;
}
public List<MapEntry> getServiceProperties()
{
throw new NotImplementedException();
}
-
- public BeanMetadata getBeanMetadata()
- {
- if (beanMetadata == null && tService.getBean() != null)
- {
- ComponentFactory factory = new ComponentFactory(context);
- beanMetadata = (BeanMetadata)factory.createComponent(this, tService.getBean(), true);
- }
- return beanMetadata;
- }
-
+
public String toString()
{
return "Service[id=" + getId() + "]";
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java 2009-06-18 14:11:06 UTC (rev 90425)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java 2009-06-18 14:16:14 UTC (rev 90426)
@@ -43,9 +43,9 @@
{
private TServiceReference tService;
- public ServiceReferenceMetadataImpl(BundleContext context, TServiceReference tService)
+ public ServiceReferenceMetadataImpl(BundleContext context, BlueprintMetadata blueprint, TServiceReference tService)
{
- super(context, tService);
+ super(context, blueprint, tService);
this.tService = tService;
}
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/bundle/BeanA.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/bundle/BeanA.java 2009-06-18 14:11:06 UTC (rev 90425)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/bundle/BeanA.java 2009-06-18 14:16:14 UTC (rev 90426)
@@ -37,6 +37,11 @@
private MBeanServer mbeanServer;
private BeanB beanB;
+ public BeanA()
+ {
+ System.out.println("new BeanA");
+ }
+
public MBeanServer getMbeanServer()
{
return mbeanServer;
@@ -44,6 +49,7 @@
public void setMbeanServer(MBeanServer mbeanServer)
{
+ System.out.println("BeanA: setMbeanServer");
this.mbeanServer = mbeanServer;
}
@@ -54,6 +60,7 @@
public void setBeanB(BeanB beanB)
{
+ System.out.println("BeanA: setBeanB");
this.beanB = beanB;
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/bundle/BeanB.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/bundle/BeanB.java 2009-06-18 14:11:06 UTC (rev 90425)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/bundle/BeanB.java 2009-06-18 14:16:14 UTC (rev 90426)
@@ -34,6 +34,11 @@
{
private BeanA beanA;
+ public BeanB()
+ {
+ System.out.println("new BeanB");
+ }
+
public BeanA getBeanA()
{
return beanA;
@@ -41,6 +46,7 @@
public void setBeanA(BeanA beanA)
{
+ System.out.println("BeanB: setBeanA");
this.beanA = beanA;
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/container/container-basic.bnd
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/container/container-basic.bnd 2009-06-18 14:11:06 UTC (rev 90425)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/container/container-basic.bnd 2009-06-18 14:16:14 UTC (rev 90426)
@@ -2,7 +2,7 @@
Bundle-SymbolicName: container-basic
-Export-Package: org.jboss.test.osgi.blueprint.container
+Export-Package: org.jboss.test.osgi.blueprint.container, org.jboss.test.osgi.blueprint.container.bundle
Private-Package: org.jboss.test.osgi.blueprint.container.bundle
15 years
JBoss-OSGI SVN: r90422 - in projects/jboss-osgi/trunk: blueprint/impl and 9 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-18 08:53:44 -0400 (Thu, 18 Jun 2009)
New Revision: 90422
Added:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentFactory.java
Modified:
projects/jboss-osgi/trunk/blueprint/impl/pom.xml
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/AbstractManager.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BeanManager.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/ServiceManager.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/ServiceReferenceManager.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TComponent.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BeanMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintMetadata.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java
projects/jboss-osgi/trunk/distribution/pom.xml
projects/jboss-osgi/trunk/husky/harness/pom.xml
projects/jboss-osgi/trunk/husky/pom.xml
projects/jboss-osgi/trunk/husky/testsuite/pom.xml
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/spi/pom.xml
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/MicrocontainerService.java
Log:
Install top-level beans in MC
Modified: projects/jboss-osgi/trunk/blueprint/impl/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/pom.xml 2009-06-18 12:37:06 UTC (rev 90421)
+++ projects/jboss-osgi/trunk/blueprint/impl/pom.xml 2009-06-18 12:53:44 UTC (rev 90422)
@@ -19,7 +19,6 @@
<dependency>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-spi</artifactId>
- <version>${version}</version>
</dependency>
<!-- Provided Dependencies -->
@@ -66,6 +65,9 @@
</Export-Package>
<Import-Package>
org.apache.xerces.dom,
+ org.jboss.beans.metadata.*,
+ org.jboss.dependency.spi*,
+ org.jboss.kernel.spi*,
org.jboss.osgi.common.log;version=1.0,
org.jboss.osgi.spi;version=1.0,
org.jboss.osgi.spi.service;version=1.0,
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/AbstractManager.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/AbstractManager.java 2009-06-18 12:37:06 UTC (rev 90421)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/AbstractManager.java 2009-06-18 12:53:44 UTC (rev 90422)
@@ -23,11 +23,19 @@
//$Id$
+import static org.jboss.osgi.spi.service.MicrocontainerService.BEAN_KERNEL_CONTROLLER;
+
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.spi.service.MicrocontainerService;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
import org.osgi.service.blueprint.reflect.BeanMetadata;
import org.osgi.service.blueprint.reflect.ComponentMetadata;
import org.osgi.service.blueprint.reflect.ServiceMetadata;
import org.osgi.service.blueprint.reflect.ServiceReferenceMetadata;
+import org.osgi.service.log.LogService;
/**
* For each of the ComponentMetadata objects, the Blueprint Container has a
@@ -44,11 +52,14 @@
*/
public abstract class AbstractManager
{
+ protected LogService log;
protected BundleContext context;
+
private ComponentMetadata component;
public AbstractManager(BundleContext context, ComponentMetadata component)
{
+ this.log = new LogServiceTracker(context);
this.context = context;
this.component = component;
}
@@ -63,16 +74,55 @@
return component;
}
+ public int getInitialization()
+ {
+ return component.getInitialization();
+ }
+
public void activate()
{
- // do nothing
+ log.log(LogService.LOG_DEBUG, "activate: " + component);
}
public void shutdown()
{
- // do nothing
+ log.log(LogService.LOG_DEBUG, "shutdown: " + component);
}
+ protected void installKernelBean(BeanMetaData kernelBean)
+ {
+ KernelController controller = getKernelController();
+ try
+ {
+ controller.install(kernelBean);
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Throwable th)
+ {
+ throw new IllegalStateException("Cannot install kernel bean", th);
+ }
+ }
+
+ protected void uninstallKernelBean(BeanMetaData kernelBean)
+ {
+ KernelController controller = getKernelController();
+ controller.uninstall(kernelBean);
+ }
+
+ protected KernelController getKernelController()
+ {
+ ServiceReference sref = context.getServiceReference(MicrocontainerService.class.getName());
+ if (sref == null)
+ throw new IllegalStateException("Cannot obtain MicrocontainerService");
+
+ MicrocontainerService service = (MicrocontainerService)context.getService(sref);
+ KernelController controller = service.getRegisteredBean(KernelController.class, BEAN_KERNEL_CONTROLLER);
+ return controller;
+ }
+
static AbstractManager createManager(BundleContext context, ComponentMetadata comp)
{
AbstractManager manager = null;
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BeanManager.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BeanManager.java 2009-06-18 12:37:06 UTC (rev 90421)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BeanManager.java 2009-06-18 12:53:44 UTC (rev 90422)
@@ -23,6 +23,11 @@
//$Id$
+
+import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
+import org.jboss.osgi.blueprint.reflect.BeanMetadataImpl;
import org.osgi.framework.BundleContext;
import org.osgi.service.blueprint.reflect.BeanMetadata;
@@ -48,11 +53,39 @@
*/
public class BeanManager extends AbstractManager
{
- private BeanMetadata beanMetadata;
+ private BeanMetadataImpl beanMetadata;
+ private BeanMetaData kernelBean;
- public BeanManager(BundleContext context, BeanMetadata beanMetadata)
+ public BeanManager(BundleContext context, BeanMetadata compMetadata)
{
- super(context, beanMetadata);
- this.beanMetadata = beanMetadata;
+ super(context, compMetadata);
+ this.beanMetadata = (BeanMetadataImpl)compMetadata;
}
+
+ @Override
+ public void activate()
+ {
+ super.activate();
+
+ kernelBean = getKernelBean(beanMetadata);
+ installKernelBean(kernelBean);
+ }
+
+ @Override
+ public void shutdown()
+ {
+ if (kernelBean != null)
+ uninstallKernelBean(kernelBean);
+
+ super.shutdown();
+ }
+
+ private BeanMetaData getKernelBean(BeanMetadataImpl compMetadata)
+ {
+ String name = compMetadata.getKey();
+ String clazz = compMetadata.getClassName();
+
+ BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder(name, clazz);
+ return builder.getBeanMetaData();
+ }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java 2009-06-18 12:37:06 UTC (rev 90421)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java 2009-06-18 12:53:44 UTC (rev 90422)
@@ -23,6 +23,8 @@
//$Id: BlueprintContextImpl.java 90313 2009-06-17 10:37:51Z thomas.diesler(a)jboss.com $
+import static org.osgi.service.blueprint.reflect.ComponentMetadata.INITIALIZATION_EAGER;
+
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -107,10 +109,11 @@
*/
public void shutdown()
{
- for (AbstractManager manager : managers.values())
- {
+ List<AbstractManager> list = new ArrayList<AbstractManager>(managers.values());
+ Collections.reverse(list);
+
+ for (AbstractManager manager : list)
manager.shutdown();
- }
}
public BundleContext getBundleContext()
@@ -171,8 +174,25 @@
for (ComponentMetadata comp : bpMetadata.getComponents())
{
AbstractManager manager = AbstractManager.createManager(context, comp);
- managers.put(manager.getId(), manager);
+
+ String key = manager.getId();
+ if (key == null)
+ throw new IllegalStateException("Component id cannot be null for: " + comp);
+
+ // All top level components share a single namespace.
+ // That is, it is an error if the same id is used multiple times.
+ if (managers.get(key) != null)
+ throw new IllegalStateException("Duplicate top-level component: " + key);
+
+ managers.put(key, manager);
}
+
+ // Activated the eager managers
+ for (AbstractManager manager : managers.values())
+ {
+ if (manager.getInitialization() == INITIALIZATION_EAGER)
+ manager.activate();
+ }
}
private BlueprintMetadata getBlueprintMetadata()
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/ServiceManager.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/ServiceManager.java 2009-06-18 12:37:06 UTC (rev 90421)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/ServiceManager.java 2009-06-18 12:53:44 UTC (rev 90422)
@@ -23,7 +23,9 @@
//$Id$
+import org.jboss.osgi.blueprint.reflect.ServiceMetadataImpl;
import org.osgi.framework.BundleContext;
+import org.osgi.service.blueprint.reflect.BeanMetadata;
import org.osgi.service.blueprint.reflect.ServiceMetadata;
/**
@@ -38,11 +40,35 @@
*/
public class ServiceManager extends AbstractManager
{
- private ServiceMetadata serviceMetadata;
+ private ServiceMetadataImpl serviceMetadata;
+ private AbstractManager beanManager;
- public ServiceManager(BundleContext context, ServiceMetadata serviceMetadata)
+ public ServiceManager(BundleContext context, ServiceMetadata compMetadata)
{
- super(context, serviceMetadata);
- this.serviceMetadata = serviceMetadata;
+ super(context, compMetadata);
+ this.serviceMetadata = (ServiceMetadataImpl)compMetadata;
+
+ // Create the anonymous bean manager
+ BeanMetadata beanMetadata = serviceMetadata.getBeanMetadata();
+ if (beanMetadata != null)
+ beanManager = (AbstractManager)AbstractManager.createManager(context, beanMetadata);
}
+
+ @Override
+ public void activate()
+ {
+ super.activate();
+
+ if (beanManager != null)
+ beanManager.activate();
+ }
+
+ @Override
+ public void shutdown()
+ {
+ if (beanManager != null)
+ beanManager.shutdown();
+
+ super.shutdown();
+ }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/ServiceReferenceManager.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/ServiceReferenceManager.java 2009-06-18 12:37:06 UTC (rev 90421)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/ServiceReferenceManager.java 2009-06-18 12:53:44 UTC (rev 90422)
@@ -23,6 +23,7 @@
//$Id$
+import org.jboss.osgi.blueprint.reflect.ServiceReferenceMetadataImpl;
import org.osgi.framework.BundleContext;
import org.osgi.service.blueprint.reflect.ServiceReferenceMetadata;
@@ -39,11 +40,11 @@
*/
public class ServiceReferenceManager extends AbstractManager
{
- private ServiceReferenceMetadata srefMetadata;
+ private ServiceReferenceMetadataImpl srefMetadata;
- public ServiceReferenceManager(BundleContext context, ServiceReferenceMetadata srefMetadata)
+ public ServiceReferenceManager(BundleContext context, ServiceReferenceMetadata compMetadata)
{
- super(context, srefMetadata);
- this.srefMetadata = srefMetadata;
+ super(context, compMetadata);
+ this.srefMetadata = (ServiceReferenceMetadataImpl)compMetadata;
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TComponent.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TComponent.java 2009-06-18 12:37:06 UTC (rev 90421)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TComponent.java 2009-06-18 12:53:44 UTC (rev 90422)
@@ -26,6 +26,8 @@
import java.util.ArrayList;
import java.util.List;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+
/**
* The Component type is the base type for top-level
* Blueprint components. The <bean> <reference>, <service>, <ref-set>, and <ref-list>
@@ -76,6 +78,9 @@
public int getInitialization()
{
+ if (initialization == 0)
+ initialization = ComponentMetadata.INITIALIZATION_EAGER;
+
return initialization;
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BeanMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BeanMetadataImpl.java 2009-06-18 12:37:06 UTC (rev 90421)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BeanMetadataImpl.java 2009-06-18 12:53:44 UTC (rev 90422)
@@ -31,6 +31,7 @@
import org.osgi.service.blueprint.reflect.BeanArgument;
import org.osgi.service.blueprint.reflect.BeanMetadata;
import org.osgi.service.blueprint.reflect.BeanProperty;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
import org.osgi.service.blueprint.reflect.Target;
/**
@@ -41,14 +42,30 @@
*/
public class BeanMetadataImpl extends ComponentMetadataImpl implements BeanMetadata
{
+ private ComponentMetadata parent;
private TBean tBean;
public BeanMetadataImpl(BundleContext context, TBean tBean)
{
+ this(context, null, tBean);
+ }
+
+ public BeanMetadataImpl(BundleContext context, ComponentMetadata parent, TBean tBean)
+ {
super(context, tBean);
+ this.parent = parent;
this.tBean = tBean;
}
+ public String getKey()
+ {
+ String key = super.getId();
+ if (key == null && parent != null)
+ key = parent.getId() + "#anonymousBean";
+
+ return key;
+ }
+
public List<BeanArgument> getArguments()
{
throw new NotImplementedException();
@@ -93,4 +110,9 @@
{
return tBean.getScope();
}
+
+ public String toString()
+ {
+ return "Bean[key=" + getKey() + "]";
+ }
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintMetadata.java 2009-06-18 12:37:06 UTC (rev 90421)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintMetadata.java 2009-06-18 12:53:44 UTC (rev 90422)
@@ -29,11 +29,8 @@
import java.util.List;
import java.util.Map;
-import org.jboss.osgi.blueprint.parser.xb.TBean;
import org.jboss.osgi.blueprint.parser.xb.TBlueprint;
import org.jboss.osgi.blueprint.parser.xb.TComponent;
-import org.jboss.osgi.blueprint.parser.xb.TService;
-import org.jboss.osgi.blueprint.parser.xb.TServiceReference;
import org.jboss.osgi.spi.NotImplementedException;
import org.osgi.framework.BundleContext;
import org.osgi.service.blueprint.reflect.ComponentMetadata;
@@ -66,10 +63,18 @@
public void initialize()
{
+ ComponentFactory factory = new ComponentFactory(context);
for (TComponent tComp : tBlueprint.getComponents())
{
- ComponentMetadata comp = createComponent(tComp);
- components.put(comp.getId(), comp);
+ ComponentMetadata comp = factory.createComponent(tComp);
+ String key = comp.getId();
+
+ // All top level components share a single namespace.
+ // That is, it is an error if the same id is used multiple times.
+ if (components.get(key) != null)
+ throw new IllegalStateException("Duplicate top-level component: " + key);
+
+ components.put(key, comp);
}
}
@@ -87,26 +92,4 @@
throw new NotImplementedException("Blueprint metadata merge not yet implemented");
}
-
- private ComponentMetadata createComponent(TComponent tComp)
- {
- ComponentMetadata comp = null;
-
- if (tComp.getId() == null)
- tComp.setId(".anonymousId#" + (components.size() + 1));
-
- if (tComp instanceof TBean)
- comp = new BeanMetadataImpl(context, (TBean)tComp);
-
- else if (tComp instanceof TService)
- comp = new ServiceMetadataImpl(context, (TService)tComp);
-
- else if (tComp instanceof TServiceReference)
- comp = new ServiceReferenceMetadataImpl(context, (TServiceReference)tComp);
-
- if (comp == null)
- throw new IllegalArgumentException("Unsupported component type: " + tComp);
-
- return comp;
- }
}
Added: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentFactory.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentFactory.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentFactory.java 2009-06-18 12:53:44 UTC (rev 90422)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.reflect;
+
+// $Id$
+
+import org.jboss.osgi.blueprint.parser.xb.TBean;
+import org.jboss.osgi.blueprint.parser.xb.TComponent;
+import org.jboss.osgi.blueprint.parser.xb.TService;
+import org.jboss.osgi.blueprint.parser.xb.TServiceReference;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+
+/**
+ * A factory for component metadata.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 13-May-2009
+ */
+public class ComponentFactory
+{
+ private BundleContext context;
+ private int anonymousId;
+
+ public ComponentFactory(BundleContext context)
+ {
+ this.context = context;
+ }
+
+ public ComponentMetadata createComponent(TComponent tComp)
+ {
+ return createComponent(null, tComp, false);
+ }
+
+ public ComponentMetadata createComponent(ComponentMetadata parent, TComponent tComp, boolean anonymous)
+ {
+ ComponentMetadata comp = null;
+
+ if (anonymous == false && tComp.getId() == null)
+ tComp.setId(".anonymousId#" + (++anonymousId));
+
+ if (tComp instanceof TBean)
+ comp = new BeanMetadataImpl(context, parent, (TBean)tComp);
+
+ else if (tComp instanceof TService)
+ comp = new ServiceMetadataImpl(context, (TService)tComp);
+
+ else if (tComp instanceof TServiceReference)
+ comp = new ServiceReferenceMetadataImpl(context, (TServiceReference)tComp);
+
+ if (comp == null)
+ throw new IllegalArgumentException("Unsupported component type: " + tComp);
+
+ return comp;
+ }
+}
Property changes on: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentMetadataImpl.java 2009-06-18 12:37:06 UTC (rev 90421)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentMetadataImpl.java 2009-06-18 12:53:44 UTC (rev 90422)
@@ -37,10 +37,12 @@
*/
public class ComponentMetadataImpl implements ComponentMetadata
{
+ protected BundleContext context;
protected TComponent tComp;
public ComponentMetadataImpl(BundleContext context, TComponent tComp)
{
+ this.context = context;
this.tComp = tComp;
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java 2009-06-18 12:37:06 UTC (rev 90421)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java 2009-06-18 12:53:44 UTC (rev 90422)
@@ -30,6 +30,7 @@
import org.jboss.osgi.blueprint.parser.xb.TService;
import org.jboss.osgi.spi.NotImplementedException;
import org.osgi.framework.BundleContext;
+import org.osgi.service.blueprint.reflect.BeanMetadata;
import org.osgi.service.blueprint.reflect.MapEntry;
import org.osgi.service.blueprint.reflect.RegistrationListener;
import org.osgi.service.blueprint.reflect.ServiceMetadata;
@@ -44,6 +45,7 @@
public class ServiceMetadataImpl extends ComponentMetadataImpl implements ServiceMetadata
{
private TService tService;
+ private BeanMetadata beanMetadata;
public ServiceMetadataImpl(BundleContext context, TService tService)
{
@@ -90,4 +92,19 @@
{
throw new NotImplementedException();
}
+
+ public BeanMetadata getBeanMetadata()
+ {
+ if (beanMetadata == null && tService.getBean() != null)
+ {
+ ComponentFactory factory = new ComponentFactory(context);
+ beanMetadata = (BeanMetadata)factory.createComponent(this, tService.getBean(), true);
+ }
+ return beanMetadata;
+ }
+
+ public String toString()
+ {
+ return "Service[id=" + getId() + "]";
+ }
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java 2009-06-18 12:37:06 UTC (rev 90421)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java 2009-06-18 12:53:44 UTC (rev 90422)
@@ -82,4 +82,9 @@
{
throw new NotImplementedException();
}
+
+ public String toString()
+ {
+ return "Reference[id=" + getId() + "]";
+ }
}
Modified: projects/jboss-osgi/trunk/distribution/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/pom.xml 2009-06-18 12:37:06 UTC (rev 90421)
+++ projects/jboss-osgi/trunk/distribution/pom.xml 2009-06-18 12:53:44 UTC (rev 90422)
@@ -55,18 +55,18 @@
<dependency>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-spi</artifactId>
- <version>${version}</version>
+ <version>${version.jboss.osgi.spi}</version>
</dependency>
<dependency>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-spi</artifactId>
- <version>${version}</version>
+ <version>${version.jboss.osgi.spi}</version>
<classifier>sources</classifier>
</dependency>
<dependency>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-spi</artifactId>
- <version>${version}</version>
+ <version>${version.jboss.osgi.spi}</version>
<classifier>javadoc</classifier>
</dependency>
<dependency>
Modified: projects/jboss-osgi/trunk/husky/harness/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/husky/harness/pom.xml 2009-06-18 12:37:06 UTC (rev 90421)
+++ projects/jboss-osgi/trunk/husky/harness/pom.xml 2009-06-18 12:53:44 UTC (rev 90422)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-husky</artifactId>
- <version>1.0.0.Beta3</version>
+ <version>1.0.0-SNAPSHOT</version>
</parent>
<!-- Dependencies -->
Modified: projects/jboss-osgi/trunk/husky/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/husky/pom.xml 2009-06-18 12:37:06 UTC (rev 90421)
+++ projects/jboss-osgi/trunk/husky/pom.xml 2009-06-18 12:53:44 UTC (rev 90422)
@@ -22,6 +22,8 @@
<artifactId>jboss-osgi-husky</artifactId>
<packaging>pom</packaging>
+ <version>1.0.0-SNAPSHOT</version>
+
<parent>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi</artifactId>
Modified: projects/jboss-osgi/trunk/husky/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/husky/testsuite/pom.xml 2009-06-18 12:37:06 UTC (rev 90421)
+++ projects/jboss-osgi/trunk/husky/testsuite/pom.xml 2009-06-18 12:53:44 UTC (rev 90422)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-husky</artifactId>
- <version>1.0.0.Beta3</version>
+ <version>1.0.0-SNAPSHOT</version>
</parent>
<!-- Dependencies -->
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-06-18 12:37:06 UTC (rev 90421)
+++ projects/jboss-osgi/trunk/pom.xml 2009-06-18 12:53:44 UTC (rev 90422)
@@ -46,15 +46,17 @@
<version.jboss.osgi.common.core>2.2.11</version.jboss.osgi.common.core>
<version.jboss.osgi.deployers>1.0.0.Beta2</version.jboss.osgi.deployers>
<version.jboss.osgi.hotdeploy>1.0.0-SNAPSHOT</version.jboss.osgi.hotdeploy>
- <version.jboss.osgi.integration.jbossas>1.0.0.Beta2</version.jboss.osgi.integration.jbossas>
+ <version.jboss.osgi.husky>1.0.0-SNAPSHOT</version.jboss.osgi.husky>
+ <version.jboss.osgi.integration.jbossas>1.0.0-SNAPSHOT</version.jboss.osgi.integration.jbossas>
<version.jboss.osgi.jaxb>2.1.10</version.jboss.osgi.jaxb>
<version.jboss.osgi.jmx>1.0.0.Beta2</version.jboss.osgi.jmx>
<version.jboss.osgi.jndi>1.0.0.Beta2</version.jboss.osgi.jndi>
- <version.jboss.osgi.microcontainer>1.0.0.Beta2</version.jboss.osgi.microcontainer>
+ <version.jboss.osgi.microcontainer>1.0.0-SNAPSHOT</version.jboss.osgi.microcontainer>
<version.jboss.osgi.remotelog>1.0.0.Beta2</version.jboss.osgi.remotelog>
<version.jboss.osgi.runtime.equinox>1.0.0.Beta2</version.jboss.osgi.runtime.equinox>
<version.jboss.osgi.runtime.felix>1.0.0.Beta2</version.jboss.osgi.runtime.felix>
<version.jboss.osgi.runtime.knopflerfish>1.0.0.Beta2</version.jboss.osgi.runtime.knopflerfish>
+ <version.jboss.osgi.spi>1.0.0-SNAPSHOT</version.jboss.osgi.spi>
<version.jboss.osgi.webconsole>1.0.0.Beta2</version.jboss.osgi.webconsole>
<version.jboss.osgi.xml.binding>2.0.0</version.jboss.osgi.xml.binding>
<version.junit>4.6</version.junit>
@@ -163,7 +165,7 @@
<dependency>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-husky-harness</artifactId>
- <version>${version}</version>
+ <version>${version.jboss.osgi.husky}</version>
</dependency>
<dependency>
<groupId>org.jboss.osgi</groupId>
@@ -183,7 +185,7 @@
<dependency>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-spi</artifactId>
- <version>${version}</version>
+ <version>${version.jboss.osgi.spi}</version>
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
Modified: projects/jboss-osgi/trunk/spi/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/spi/pom.xml 2009-06-18 12:37:06 UTC (rev 90421)
+++ projects/jboss-osgi/trunk/spi/pom.xml 2009-06-18 12:53:44 UTC (rev 90422)
@@ -8,6 +8,8 @@
<artifactId>jboss-osgi-spi</artifactId>
<packaging>jar</packaging>
+ <version>1.0.0-SNAPSHOT</version>
+
<!-- Parent -->
<parent>
<groupId>org.jboss.osgi</groupId>
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/MicrocontainerService.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/MicrocontainerService.java 2009-06-18 12:37:06 UTC (rev 90421)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/MicrocontainerService.java 2009-06-18 12:53:44 UTC (rev 90422)
@@ -54,13 +54,19 @@
String BEAN_KERNEL = "jboss.kernel:service=Kernel";
/*
- * * Get the list of registered beans.
+ * Get the list of registered beans.
*/
List<String> getRegisteredBeans();
/*
- * * Get a registered bean from the Kernel.
+ * Get a registered bean from the Kernel.
* @return null if there is no bean registered under this name
*/
Object getRegisteredBean(String beanName);
+
+ /*
+ * Get a registered bean from the Kernel.
+ * @return null if there is no bean registered under this name
+ */
+ <T> T getRegisteredBean(Class<T> clazz, String beanName);
}
\ No newline at end of file
15 years
JBoss-OSGI SVN: r90405 - in projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint: extender and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-18 06:11:14 -0400 (Thu, 18 Jun 2009)
New Revision: 90405
Added:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/AbstractManager.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BeanManager.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/ServiceManager.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/ServiceReferenceManager.java
Removed:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentFactory.java
Modified:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintMetadata.java
Log:
Add BP managers
Added: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/AbstractManager.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/AbstractManager.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/AbstractManager.java 2009-06-18 10:11:14 UTC (rev 90405)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.container;
+
+//$Id$
+
+import org.osgi.framework.BundleContext;
+import org.osgi.service.blueprint.reflect.BeanMetadata;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+import org.osgi.service.blueprint.reflect.ServiceMetadata;
+import org.osgi.service.blueprint.reflect.ServiceReferenceMetadata;
+
+/**
+ * For each of the ComponentMetadata objects, the Blueprint Container has a
+ * corresponding component manager. For example, a BeanMetadata object
+ * relates to a Bean Manager. There are the following types of managers:
+ *
+ * • Bean Managers – Can provide general objects that are properly configured
+ * • Service Managers – Can register services
+ * • Service Reference Managers – Provide proxies to one or more services.
+ * • Environment Managers – Holding environment values like the Blueprint Bundle object
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 17-Jun-2009
+ */
+public abstract class AbstractManager
+{
+ protected BundleContext context;
+ private ComponentMetadata component;
+
+ public AbstractManager(BundleContext context, ComponentMetadata component)
+ {
+ this.context = context;
+ this.component = component;
+ }
+
+ public String getId()
+ {
+ return component.getId();
+ }
+
+ public ComponentMetadata getComponentMetadata()
+ {
+ return component;
+ }
+
+ public void activate()
+ {
+ // do nothing
+ }
+
+ public void shutdown()
+ {
+ // do nothing
+ }
+
+ static AbstractManager createManager(BundleContext context, ComponentMetadata comp)
+ {
+ AbstractManager manager = null;
+
+ if (comp instanceof BeanMetadata)
+ manager = new BeanManager(context, (BeanMetadata)comp);
+
+ else if (comp instanceof ServiceMetadata)
+ manager = new ServiceManager(context, (ServiceMetadata)comp);
+
+ else if (comp instanceof ServiceReferenceMetadata)
+ manager = new ServiceReferenceManager(context, (ServiceReferenceMetadata)comp);
+
+ if (manager == null)
+ throw new IllegalArgumentException("Unsupported component type: " + comp);
+
+ return manager;
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/AbstractManager.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BeanManager.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BeanManager.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BeanManager.java 2009-06-18 10:11:14 UTC (rev 90405)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.container;
+
+//$Id$
+
+import org.osgi.framework.BundleContext;
+import org.osgi.service.blueprint.reflect.BeanMetadata;
+
+/**
+ * A bean manager provides regular Java objects as component
+ * instances. It has the following features:
+ *
+ * • Construction via class name, static factory method, or a factory
+ * method on a target. A target is a reference to a top level or inlined,
+ * manager of type bean or service reference, or a referral to a top level
+ * manager.
+ *
+ * • Can have arguments for a constructor or factory method.
+ *
+ * • Has properties that are configured.
+ *
+ * • Manages a singleton or creates objects on demand depending on its scope.
+ *
+ * • Life cycle callbacks for end of initialization and destruction.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 17-Jun-2009
+ */
+public class BeanManager extends AbstractManager
+{
+ private BeanMetadata beanMetadata;
+
+ public BeanManager(BundleContext context, BeanMetadata beanMetadata)
+ {
+ super(context, beanMetadata);
+ this.beanMetadata = beanMetadata;
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BeanManager.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java 2009-06-18 09:51:05 UTC (rev 90404)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java 2009-06-18 10:11:14 UTC (rev 90405)
@@ -23,7 +23,12 @@
//$Id: BlueprintContextImpl.java 90313 2009-06-17 10:37:51Z thomas.diesler(a)jboss.com $
+import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
import java.util.Properties;
import java.util.Set;
@@ -34,6 +39,7 @@
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
import org.osgi.service.blueprint.container.BlueprintContainer;
+import org.osgi.service.blueprint.container.NoSuchComponentException;
import org.osgi.service.blueprint.reflect.ComponentMetadata;
/**
@@ -68,7 +74,7 @@
private BundleContext context;
private Bundle bundle;
- private BlueprintMetadata bpMetadata;
+ private Map<String, AbstractManager> managers = new LinkedHashMap<String, AbstractManager>();
public BlueprintContainerImpl(BundleContext context, Bundle bundle)
{
@@ -78,13 +84,35 @@
public void initialize()
{
- BlueprintParser bpParser = new BlueprintParser(context);
- bpMetadata = bpParser.getBlueprintMetadata(bundle);
- bpMetadata.initialize();
+ // The Blueprint Container parses the definitions into metadata objects.
+ BlueprintMetadata bpMetadata = getBlueprintMetadata();
+ // For each of the ComponentMetadata objects, the Blueprint Container
+ // has a corresponding component manager.
+ createManagers(bpMetadata);
+
+ // If the Blueprint Container has successfully activated the eager managers, it
+ // will register a Blueprint Container service.
registerBlueprintContainerService();
}
+ /*
+ * When the Blueprint Container must be destroyed because the Blueprint
+ * bundle has stopped, there is a failure, or the Blueprint extender is stopped,
+ * then the Blueprint Container service is unregistered and all managers are
+ * deactivated. This will unregister any services and listeners, which release
+ * the component instances. Then all component instances are destroyed in
+ * reverse dependency order. That is, a component instance is destroyed when
+ * no other component instances depends on it.
+ */
+ public void shutdown()
+ {
+ for (AbstractManager manager : managers.values())
+ {
+ manager.shutdown();
+ }
+ }
+
public BundleContext getBundleContext()
{
return bundle.getBundleContext();
@@ -97,17 +125,29 @@
public Set<String> getComponentIds()
{
- return bpMetadata.getComponentIds();
+ return Collections.unmodifiableSet(managers.keySet());
}
public ComponentMetadata getComponentMetadata(String name)
{
- return bpMetadata.getComponentMetadata(name);
+ AbstractManager manager = managers.get(name);
+ if (manager == null)
+ throw new NoSuchComponentException(name);
+
+ return manager.getComponentMetadata();
}
+ @SuppressWarnings("unchecked")
public <T extends ComponentMetadata> Collection<T> getMetadata(Class<T> type)
{
- return bpMetadata.getMetadata(type);
+ List<T> compMetadata = new ArrayList<T>();
+ for (AbstractManager manager : managers.values())
+ {
+ ComponentMetadata comp = manager.getComponentMetadata();
+ if (type.isAssignableFrom(comp.getClass()))
+ compMetadata.add((T)comp);
+ }
+ return Collections.unmodifiableList(compMetadata);
}
public Object getComponentInstance(String id)
@@ -125,4 +165,21 @@
props.setProperty(PROPERTY_BLUEPRINT_BUNDLE_VERSION, version);
context.registerService(BlueprintContainer.class.getName(), this, props);
}
+
+ private void createManagers(BlueprintMetadata bpMetadata)
+ {
+ for (ComponentMetadata comp : bpMetadata.getComponents())
+ {
+ AbstractManager manager = AbstractManager.createManager(context, comp);
+ managers.put(manager.getId(), manager);
+ }
+ }
+
+ private BlueprintMetadata getBlueprintMetadata()
+ {
+ BlueprintParser bpParser = new BlueprintParser(context);
+ BlueprintMetadata bpMetadata = bpParser.getBlueprintMetadata(bundle);
+ bpMetadata.initialize();
+ return bpMetadata;
+ }
}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/ServiceManager.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/ServiceManager.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/ServiceManager.java 2009-06-18 10:11:14 UTC (rev 90405)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.container;
+
+//$Id$
+
+import org.osgi.framework.BundleContext;
+import org.osgi.service.blueprint.reflect.ServiceMetadata;
+
+/**
+ * Service managers maintain the registration of an OSGi service
+ * object. Service managers provide a proxied ServiceRegistration object.
+ *
+ * A service manager is enabled if all the mandatory service references in its
+ * dependencies are satisfied.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 17-Jun-2009
+ */
+public class ServiceManager extends AbstractManager
+{
+ private ServiceMetadata serviceMetadata;
+
+ public ServiceManager(BundleContext context, ServiceMetadata serviceMetadata)
+ {
+ super(context, serviceMetadata);
+ this.serviceMetadata = serviceMetadata;
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/ServiceManager.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/ServiceReferenceManager.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/ServiceReferenceManager.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/ServiceReferenceManager.java 2009-06-18 10:11:14 UTC (rev 90405)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.container;
+
+//$Id$
+
+import org.osgi.framework.BundleContext;
+import org.osgi.service.blueprint.reflect.ServiceReferenceMetadata;
+
+/**
+ * Reference managers track a service in the OSGi service registry.
+ * When activated, they provide a ServiceReference object or a proxy
+ * to a service object.
+ *
+ * A reference is satisfied when its selection matches a service in the
+ * registry.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 17-Jun-2009
+ */
+public class ServiceReferenceManager extends AbstractManager
+{
+ private ServiceReferenceMetadata srefMetadata;
+
+ public ServiceReferenceManager(BundleContext context, ServiceReferenceMetadata srefMetadata)
+ {
+ super(context, srefMetadata);
+ this.srefMetadata = srefMetadata;
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/ServiceReferenceManager.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java 2009-06-18 09:51:05 UTC (rev 90404)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java 2009-06-18 10:11:14 UTC (rev 90405)
@@ -23,12 +23,19 @@
//$Id$
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
import java.util.Enumeration;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
import org.jboss.osgi.blueprint.container.BlueprintContainerImpl;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleEvent;
+import org.osgi.framework.Constants;
import org.osgi.framework.SynchronousBundleListener;
/**
@@ -40,6 +47,7 @@
public class BlueprintExtender implements SynchronousBundleListener
{
private BundleContext context;
+ private Map<String, BlueprintContainerImpl> containers = new LinkedHashMap<String, BlueprintContainerImpl>();
public BlueprintExtender(BundleContext context)
{
@@ -50,27 +58,38 @@
public void bundleChanged(BundleEvent event)
{
Bundle bundle = event.getBundle();
+ String key = getBundleKey(bundle);
+ int eventType = event.getType();
- boolean hasBlueprintMetadata = false;
-
- if (event.getType() == BundleEvent.STARTING)
+ if (eventType == BundleEvent.STARTING)
{
// If a Bundle-Blueprint manifest header is defined, then this header contains a list of paths.
// If this header is not defined, then resources ending in .xml in the bundle’s
// OSGI-INF/blueprint directory must be used. These are the resources that
// would be found by calling the Bundle findEntries("OSGI-INF/blueprint", "*.xml", false) method.
+
+ boolean hasBlueprintMetadata = false;
String descriptorPaths = (String)bundle.getHeaders().get(BlueprintContainerImpl.HEADER_BUNDLE_BLUEPRINT);
hasBlueprintMetadata = (descriptorPaths != null);
Enumeration foundEntries = bundle.findEntries("OSGI-INF/blueprint", "*.xml", false);
hasBlueprintMetadata |= (foundEntries != null);
+
+ if (hasBlueprintMetadata == true)
+ {
+ BlueprintContainerImpl container = new BlueprintContainerImpl(context, bundle);
+ container.initialize();
+
+ containers.put(key, container);
+ }
}
-
- if (hasBlueprintMetadata == true)
+
+ else if (eventType == BundleEvent.STOPPED)
{
- BlueprintContainerImpl bpContainer = new BlueprintContainerImpl(context, bundle);
- bpContainer.initialize();
+ BlueprintContainerImpl container = containers.remove(key);
+ if (container != null)
+ container.shutdown();
}
}
@@ -79,6 +98,18 @@
*/
public void stop()
{
- // currently does nothing
+ Collection<BlueprintContainerImpl> values = containers.values();
+ List<BlueprintContainerImpl> list = new ArrayList<BlueprintContainerImpl>(values);
+ Collections.reverse(list);
+
+ for (BlueprintContainerImpl container : list)
+ container.shutdown();
}
+
+ private String getBundleKey(Bundle bundle)
+ {
+ String symbolicName = bundle.getSymbolicName();
+ String version = (String)bundle.getHeaders().get(Constants.BUNDLE_VERSION);
+ return symbolicName + "-" + version;
+ }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintMetadata.java 2009-06-18 09:51:05 UTC (rev 90404)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintMetadata.java 2009-06-18 10:11:14 UTC (rev 90405)
@@ -24,18 +24,18 @@
// $Id$
import java.util.ArrayList;
-import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import java.util.Set;
+import org.jboss.osgi.blueprint.parser.xb.TBean;
import org.jboss.osgi.blueprint.parser.xb.TBlueprint;
import org.jboss.osgi.blueprint.parser.xb.TComponent;
+import org.jboss.osgi.blueprint.parser.xb.TService;
+import org.jboss.osgi.blueprint.parser.xb.TServiceReference;
import org.jboss.osgi.spi.NotImplementedException;
import org.osgi.framework.BundleContext;
-import org.osgi.service.blueprint.container.NoSuchComponentException;
import org.osgi.service.blueprint.reflect.ComponentMetadata;
/**
@@ -66,40 +66,19 @@
public void initialize()
{
- ComponentFactory factory = new ComponentFactory(context);
for (TComponent tComp : tBlueprint.getComponents())
{
- ComponentMetadata comp = factory.newComponent(tComp);
+ ComponentMetadata comp = createComponent(tComp);
components.put(comp.getId(), comp);
}
}
- public Set<String> getComponentIds()
+ public List<ComponentMetadata> getComponents()
{
- return Collections.unmodifiableSet(components.keySet());
+ ArrayList<ComponentMetadata> list = new ArrayList<ComponentMetadata>(components.values());
+ return Collections.unmodifiableList(list);
}
- public ComponentMetadata getComponentMetadata(String name)
- {
- ComponentMetadata compMetadata = components.get(name);
- if (compMetadata == null)
- throw new NoSuchComponentException(name);
-
- return compMetadata;
- }
-
- @SuppressWarnings("unchecked")
- public <T extends ComponentMetadata> Collection<T> getMetadata(Class<T> type)
- {
- List<T> compMetadata = new ArrayList<T>();
- for (ComponentMetadata comp : components.values())
- {
- if (type.isAssignableFrom(comp.getClass()))
- compMetadata.add((T)comp);
- }
- return Collections.unmodifiableList(compMetadata);
- }
-
// Merge this Blueprint meta data with the given other, which may be null.
public BlueprintMetadata merge(BlueprintMetadata other)
{
@@ -108,4 +87,26 @@
throw new NotImplementedException("Blueprint metadata merge not yet implemented");
}
+
+ private ComponentMetadata createComponent(TComponent tComp)
+ {
+ ComponentMetadata comp = null;
+
+ if (tComp.getId() == null)
+ tComp.setId(".anonymousId#" + (components.size() + 1));
+
+ if (tComp instanceof TBean)
+ comp = new BeanMetadataImpl(context, (TBean)tComp);
+
+ else if (tComp instanceof TService)
+ comp = new ServiceMetadataImpl(context, (TService)tComp);
+
+ else if (tComp instanceof TServiceReference)
+ comp = new ServiceReferenceMetadataImpl(context, (TServiceReference)tComp);
+
+ if (comp == null)
+ throw new IllegalArgumentException("Unsupported component type: " + tComp);
+
+ return comp;
+ }
}
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentFactory.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentFactory.java 2009-06-18 09:51:05 UTC (rev 90404)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentFactory.java 2009-06-18 10:11:14 UTC (rev 90405)
@@ -1,88 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, 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.blueprint.reflect;
-
-// $Id$
-
-import org.jboss.osgi.blueprint.parser.xb.TBean;
-import org.jboss.osgi.blueprint.parser.xb.TComponent;
-import org.jboss.osgi.blueprint.parser.xb.TService;
-import org.jboss.osgi.blueprint.parser.xb.TServiceReference;
-import org.osgi.framework.BundleContext;
-import org.osgi.service.blueprint.reflect.BeanMetadata;
-import org.osgi.service.blueprint.reflect.ComponentMetadata;
-import org.osgi.service.blueprint.reflect.ServiceMetadata;
-import org.osgi.service.blueprint.reflect.ServiceReferenceMetadata;
-
-/**
- * A factory for blueprint metadata objects
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2009
- */
-class ComponentFactory
-{
- private BundleContext context;
- private int anonymousID;
-
- ComponentFactory(BundleContext context)
- {
- this.context = context;
- }
-
- ComponentMetadata newComponent(TComponent tComp)
- {
- ComponentMetadata comp;
-
- if (tComp.getId() == null)
- tComp.setId(".anonymousId#" + (++anonymousID));
-
- if (tComp instanceof TBean)
- comp = newBeanMetadata((TBean)tComp);
-
- else if (tComp instanceof TService)
- comp = newServiceMetadata((TService)tComp);
-
- else if (tComp instanceof TServiceReference)
- comp = newServiceReferenceMetadata((TServiceReference)tComp);
-
- else
- throw new IllegalArgumentException("Unsupported component type: " + tComp);
-
- return comp;
- }
-
- private BeanMetadata newBeanMetadata(TBean tComp)
- {
- return new BeanMetadataImpl(context, tComp);
- }
-
- private ServiceMetadata newServiceMetadata(TService tComp)
- {
- return new ServiceMetadataImpl(context, tComp);
- }
-
- private ServiceReferenceMetadata newServiceReferenceMetadata(TServiceReference tComp)
- {
- return new ServiceReferenceMetadataImpl(context, tComp);
- }
-}
15 years
JBoss-OSGI SVN: r90375 - in projects/jboss-osgi/trunk: blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser and 6 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-18 02:51:00 -0400 (Thu, 18 Jun 2009)
New Revision: 90375
Added:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/JBossXBParser.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TAutoExportModes.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TAvailability.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TBean.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TBlueprint.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TComparator.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TComponent.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TRef.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TRefCollection.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TReference.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TReferenceListener.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TRegistrationListener.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TService.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TServicePropertyEntry.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TServiceReference.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TTypeConverters.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Targument.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tcollection.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tkey.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tmap.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TmapEntry.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tnull.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tprop.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tproperty.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tprops.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TserviceProperties.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TtypedCollection.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tvalue.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentFactory.java
Removed:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/AutoExportModes.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Availability.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComparatorImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RefCollectionImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RefImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ReferenceListenerImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ReferenceMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RegistrationListenerImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServicePropertyEntry.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Targument.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tcollection.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tkey.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tmap.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TmapEntry.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tnull.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tprop.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tproperty.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tprops.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TserviceProperties.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TtypedCollection.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tvalue.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TypeConverters.java
Modified:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/BlueprintParser.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BeanMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintMetadata.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/BlueprintContainerTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicRootParserTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/main/java/org/jboss/osgi/trailblazer/web/MainServlet.java
Log:
Decouple jbossxb model from BP reflect model - ok
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -23,28 +23,18 @@
//$Id: BlueprintContextImpl.java 90313 2009-06-17 10:37:51Z thomas.diesler(a)jboss.com $
-import java.net.URL;
-import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
import java.util.Properties;
import java.util.Set;
import org.jboss.osgi.blueprint.parser.BlueprintParser;
import org.jboss.osgi.blueprint.reflect.BlueprintMetadata;
-import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.osgi.spi.NotImplementedException;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
import org.osgi.service.blueprint.container.BlueprintContainer;
-import org.osgi.service.blueprint.container.NoSuchComponentException;
import org.osgi.service.blueprint.reflect.ComponentMetadata;
-import org.osgi.service.log.LogService;
/**
* When a Blueprint extender bundle detects that a Blueprint bundle is
@@ -75,22 +65,23 @@
public static final String PROPERTY_BLUEPRINT_BUNDLE_SYMBOLIC_NAME = "osgi.blueprint.container.symbolicname";
public static final String PROPERTY_BLUEPRINT_BUNDLE_VERSION = "osgi.blueprint.container.version";
- private LogService log;
-
private BundleContext context;
private Bundle bundle;
- private Map<String, ComponentMetadata> components = new HashMap<String, ComponentMetadata>();
+ private BlueprintMetadata bpMetadata;
+
public BlueprintContainerImpl(BundleContext context, Bundle bundle)
{
- this.log = new LogServiceTracker(context);
this.context = context;
this.bundle = bundle;
}
public void initialize()
{
- BlueprintMetadata bpMetadata = getBlueprintMetadata();
+ BlueprintParser bpParser = new BlueprintParser(context);
+ bpMetadata = bpParser.getBlueprintMetadata(bundle);
+ bpMetadata.initialize();
+
registerBlueprintContainerService();
}
@@ -99,15 +90,6 @@
return bundle.getBundleContext();
}
- public ComponentMetadata getComponentMetadata(String name)
- {
- ComponentMetadata compMetadata = components.get(name);
- if (compMetadata == null)
- throw new NoSuchComponentException(name);
-
- return compMetadata;
- }
-
public int getCompliance()
{
return COMPLIANCE_STRICT;
@@ -115,19 +97,17 @@
public Set<String> getComponentIds()
{
- return Collections.unmodifiableSet(components.keySet());
+ return bpMetadata.getComponentIds();
}
- @SuppressWarnings("unchecked")
+ public ComponentMetadata getComponentMetadata(String name)
+ {
+ return bpMetadata.getComponentMetadata(name);
+ }
+
public <T extends ComponentMetadata> Collection<T> getMetadata(Class<T> type)
{
- List<T> compMetadata = new ArrayList<T>();
- for (ComponentMetadata comp : components.values())
- {
- if (type.isAssignableFrom(comp.getClass()))
- compMetadata.add((T)comp);
- }
- return Collections.unmodifiableList(compMetadata);
+ return bpMetadata.getMetadata(type);
}
public Object getComponentInstance(String id)
@@ -135,58 +115,6 @@
throw new NotImplementedException();
}
- @SuppressWarnings("unchecked")
- private BlueprintMetadata getBlueprintMetadata()
- {
- BlueprintMetadata bpMetadata = null;
-
- // If a Bundle-Blueprint manifest header is defined, then this header contains a list of paths.
- // If this header is not defined, then resources ending in .xml in the bundle’s
- // OSGI-INF/blueprint directory must be used. These are the resources that
- // would be found by calling the Bundle findEntries("OSGI-INF/blueprint", "*.xml", false) method.
-
- String descriptorPaths = (String)bundle.getHeaders().get(HEADER_BUNDLE_BLUEPRINT);
- if (descriptorPaths != null)
- {
- log.log(LogService.LOG_INFO, HEADER_BUNDLE_BLUEPRINT + ": " + descriptorPaths + " in bundle: " + bundle);
- String[] descritors = descriptorPaths.split(", ");
-
- for (String descriptor : descritors)
- {
- BlueprintMetadata aux = processDescriptor(bundle, descriptor);
- bpMetadata = aux.merge(bpMetadata);
- }
- }
-
- Enumeration<URL> foundEntries = bundle.findEntries("OSGI-INF/blueprint", "*.xml", false);
- if (foundEntries != null)
- {
- while (foundEntries.hasMoreElements())
- {
- URL nextEntry = foundEntries.nextElement();
- BlueprintMetadata aux = processDescriptor(bundle, nextEntry);
- bpMetadata = aux.merge(bpMetadata);
- }
- }
-
- if (bpMetadata == null)
- throw new IllegalStateException("Cannot obtain blueprint metadata");
-
- return bpMetadata;
- }
-
- private BlueprintMetadata processDescriptor(Bundle bundle, String descriptor)
- {
- URL descriptorURL = bundle.getResource(descriptor);
- return processDescriptor(bundle, descriptorURL);
- }
-
- private BlueprintMetadata processDescriptor(Bundle bundle, URL descriptorURL)
- {
- BlueprintMetadata blueprint = new BlueprintParser().parse(descriptorURL);
- return blueprint;
- }
-
private void registerBlueprintContainerService()
{
String symbolicName = bundle.getSymbolicName();
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/BlueprintParser.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/BlueprintParser.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/BlueprintParser.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -21,19 +21,21 @@
*/
package org.jboss.osgi.blueprint.parser;
-//$Id$
+import static org.jboss.osgi.blueprint.container.BlueprintContainerImpl.HEADER_BUNDLE_BLUEPRINT;
import java.net.URL;
+import java.util.Enumeration;
-import org.apache.xerces.dom.DOMXSImplementationSourceImpl;
-import org.jboss.osgi.blueprint.BlueprintException;
+import org.jboss.osgi.blueprint.parser.xb.JBossXBParser;
+import org.jboss.osgi.blueprint.parser.xb.TBlueprint;
import org.jboss.osgi.blueprint.reflect.BlueprintMetadata;
-import org.jboss.xb.binding.JBossXBException;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
-import org.jboss.xb.binding.sunday.unmarshalling.XsdBinder;
+import org.jboss.osgi.common.log.LogServiceTracker;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.log.LogService;
+//$Id$
+
/**
* The Blueprint descriptor parser.
*
@@ -42,73 +44,64 @@
*/
public class BlueprintParser
{
- private static SchemaBinding schemaBinding;
-
- public BlueprintParser()
+ private LogService log;
+ private BundleContext context;
+
+ public BlueprintParser(BundleContext context)
{
- if (schemaBinding == null)
- {
- // https://jira.jboss.org/jira/browse/JBXB-202
- // Inconsistent initialization of XSImplementation
- //
- // Please provide an JBossXB initialization entry point that is public and does not make an assumption on the availability of the TCCL
- //
- ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
- try
- {
- ClassLoader bundleCL = getClass().getClassLoader();
- Thread.currentThread().setContextClassLoader(bundleCL);
+ this.log = new LogServiceTracker(context);
+ this.context = context;
+ }
+
+ @SuppressWarnings("unchecked")
+ public BlueprintMetadata getBlueprintMetadata(Bundle bundle)
+ {
+ TBlueprint tBlueprint = null;
- // Make sure we import and can load the XSImplementation
- // This is the code that is used in JBossXB Util.getXSImplementation()
- bundleCL.loadClass(DOMXSImplementationSourceImpl.class.getName());
+ // If a Bundle-Blueprint manifest header is defined, then this header contains a list of paths.
+ // If this header is not defined, then resources ending in .xml in the bundle’s
+ // OSGI-INF/blueprint directory must be used. These are the resources that
+ // would be found by calling the Bundle findEntries("OSGI-INF/blueprint", "*.xml", false) method.
- ClassLoader resourceLoader = getClass().getClassLoader();
- URL schemaXSD = resourceLoader.getResource("schema/blueprint-jbxb.xsd");
- if (schemaXSD == null)
- throw new BlueprintException("Cannot get blueprint schema from: " + resourceLoader);
-
- schemaBinding = XsdBinder.bind(schemaXSD.toExternalForm());
- }
- catch (ClassNotFoundException ex)
+ String descriptorPaths = (String)bundle.getHeaders().get(HEADER_BUNDLE_BLUEPRINT);
+ if (descriptorPaths != null)
+ {
+ log.log(LogService.LOG_INFO, HEADER_BUNDLE_BLUEPRINT + ": " + descriptorPaths + " in bundle: " + bundle);
+ String[] descritors = descriptorPaths.split(", ");
+
+ for (String descriptor : descritors)
{
- throw new IllegalStateException("Cannot load: " + DOMXSImplementationSourceImpl.class.getName());
+ TBlueprint aux = processDescriptor(bundle, descriptor);
+ tBlueprint = aux.merge(tBlueprint);
}
- finally
+ }
+
+ Enumeration<URL> foundEntries = bundle.findEntries("OSGI-INF/blueprint", "*.xml", false);
+ if (foundEntries != null)
+ {
+ while (foundEntries.hasMoreElements())
{
- Thread.currentThread().setContextClassLoader(ctxLoader);
+ URL nextEntry = foundEntries.nextElement();
+ TBlueprint aux = processDescriptor(nextEntry);
+ tBlueprint = aux.merge(tBlueprint);
}
}
+
+ if (tBlueprint == null)
+ throw new IllegalStateException("Cannot obtain blueprint metadata");
+
+ return new BlueprintMetadata(context, tBlueprint);
}
-
- /*
- * * Parse a blueprint descriptor
- */
- public BlueprintMetadata parse(URL xmlURL)
+
+ private TBlueprint processDescriptor(Bundle bundle, String descriptor)
{
- if (xmlURL == null)
- throw new IllegalArgumentException("Cannot parse null descriptor URL");
+ URL descriptorURL = bundle.getResource(descriptor);
+ return processDescriptor(descriptorURL);
+ }
- ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
- try
- {
- ClassLoader bundleCL = getClass().getClassLoader();
- Thread.currentThread().setContextClassLoader(bundleCL);
-
- Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- BlueprintMetadata bpMetadata = (BlueprintMetadata)unmarshaller.unmarshal(xmlURL.toExternalForm(), schemaBinding);
-
- bpMetadata.initialize();
-
- return bpMetadata;
- }
- catch (JBossXBException ex)
- {
- throw new BlueprintException("Cannot parse blueprint descriptor: " + xmlURL, ex);
- }
- finally
- {
- Thread.currentThread().setContextClassLoader(ctxLoader);
- }
+ private TBlueprint processDescriptor(URL descriptorURL)
+ {
+ TBlueprint blueprint = new JBossXBParser().parse(descriptorURL);
+ return blueprint;
}
}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/JBossXBParser.java (from rev 90336, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/BlueprintParser.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/JBossXBParser.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/JBossXBParser.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -0,0 +1,111 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.parser.xb;
+
+//$Id$
+
+import java.net.URL;
+
+import org.apache.xerces.dom.DOMXSImplementationSourceImpl;
+import org.jboss.osgi.blueprint.BlueprintException;
+import org.jboss.xb.binding.JBossXBException;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.XsdBinder;
+
+/**
+ * The Blueprint descriptor parser.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 13-May-2009
+ */
+public class JBossXBParser
+{
+ private static SchemaBinding schemaBinding;
+
+ public JBossXBParser()
+ {
+ if (schemaBinding == null)
+ {
+ // https://jira.jboss.org/jira/browse/JBXB-202
+ // Inconsistent initialization of XSImplementation
+ //
+ // Please provide an JBossXB initialization entry point that is public and does not make an assumption on the availability of the TCCL
+ //
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ ClassLoader bundleCL = getClass().getClassLoader();
+ Thread.currentThread().setContextClassLoader(bundleCL);
+
+ // Make sure we import and can load the XSImplementation
+ // This is the code that is used in JBossXB Util.getXSImplementation()
+ bundleCL.loadClass(DOMXSImplementationSourceImpl.class.getName());
+
+ ClassLoader resourceLoader = getClass().getClassLoader();
+ URL schemaXSD = resourceLoader.getResource("schema/blueprint-jbxb.xsd");
+ if (schemaXSD == null)
+ throw new BlueprintException("Cannot get blueprint schema from: " + resourceLoader);
+
+ schemaBinding = XsdBinder.bind(schemaXSD.toExternalForm());
+ }
+ catch (ClassNotFoundException ex)
+ {
+ throw new IllegalStateException("Cannot load: " + DOMXSImplementationSourceImpl.class.getName());
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(ctxLoader);
+ }
+ }
+ }
+
+ /*
+ * Parse a blueprint descriptor
+ */
+ public TBlueprint parse(URL xmlURL)
+ {
+ if (xmlURL == null)
+ throw new IllegalArgumentException("Cannot parse null descriptor URL");
+
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ ClassLoader bundleCL = getClass().getClassLoader();
+ Thread.currentThread().setContextClassLoader(bundleCL);
+
+ Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ TBlueprint tBlueprint = (TBlueprint)unmarshaller.unmarshal(xmlURL.toExternalForm(), schemaBinding);
+
+ return tBlueprint;
+ }
+ catch (JBossXBException ex)
+ {
+ throw new BlueprintException("Cannot parse blueprint descriptor: " + xmlURL, ex);
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(ctxLoader);
+ }
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TAutoExportModes.java (from rev 90336, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/AutoExportModes.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TAutoExportModes.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TAutoExportModes.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.parser.xb;
+
+// $Id$
+
+/**
+ * Java class for TautoExportModes.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 13-May-2009
+ */
+public enum TAutoExportModes
+{
+
+ DISABLED("disabled"),
+ INTERFACES("interfaces"),
+ CLASS_HIERARCHY("class-hierarchy"),
+ ALL_CLASSES("all-classes");
+
+ private final String value;
+
+ TAutoExportModes(String v)
+ {
+ value = v;
+ }
+
+ public String value()
+ {
+ return value;
+ }
+
+ public static TAutoExportModes fromValue(String v)
+ {
+ for (TAutoExportModes c : TAutoExportModes.values())
+ {
+ if (c.value.equals(v))
+ {
+ return c;
+ }
+ }
+ throw new IllegalArgumentException(v);
+ }
+
+}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TAvailability.java (from rev 90336, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Availability.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TAvailability.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TAvailability.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.parser.xb;
+
+/**
+ * Defines an availability attribute type. This is used in this
+ * schema by the <blueprint> default-availability attribute and the
+ * <reference>, <ref-set>, and <ref-list> availability attribute.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 13-May-2009
+ */
+public enum TAvailability
+{
+ MANDATORY("mandatory"),
+ OPTIONAL("optional");
+
+ private final String value;
+
+ TAvailability(String v)
+ {
+ value = v;
+ }
+
+ public String value()
+ {
+ return value;
+ }
+
+ public static TAvailability fromValue(String v)
+ {
+ for (TAvailability c : TAvailability.values())
+ {
+ if (c.value.equals(v))
+ {
+ return c;
+ }
+ }
+ throw new IllegalArgumentException(v);
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TBean.java (from rev 90358, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BeanMetadataImpl.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TBean.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TBean.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -0,0 +1,259 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.parser.xb;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.namespace.QName;
+
+
+/**
+ * The type defintion for a <bean> component.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 13-May-2009
+ */
+public class TBean extends TComponent
+{
+ protected String description;
+ protected List<Object> argumentOrPropertyOrAny;
+ protected String className;
+ protected String initMethod;
+ protected String destroyMethod;
+ protected String factoryMethod;
+ protected String factoryComponent;
+ protected String scope;
+ protected Boolean lazyInit;
+ private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+ /**
+ * Gets the value of the description property.
+ */
+ public String getDescription()
+ {
+ return description;
+ }
+
+ /**
+ * Sets the value of the description property.
+ */
+ public void setDescription(String value)
+ {
+ this.description = value;
+ }
+
+ /**
+ * Gets the value of the argumentOrPropertyOrAny property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the
+ * JAXB object. This is why there is not a <CODE>set</CODE> method for the argumentOrPropertyOrAny property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ *
+ * <pre>
+ * getArgumentOrPropertyOrAny().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list {@link Object } {@link JAXBElement }{@code <}{@link Targument }{@code >} {@link JAXBElement }{@code <}
+ * {@link Tproperty }{@code >}
+ *
+ *
+ */
+ public List<Object> getArgumentOrPropertyOrAny()
+ {
+ if (argumentOrPropertyOrAny == null)
+ {
+ argumentOrPropertyOrAny = new ArrayList<Object>();
+ }
+ return this.argumentOrPropertyOrAny;
+ }
+
+ /**
+ * Gets the value of the class property.
+ */
+ public String getClassName()
+ {
+ return className;
+ }
+
+ /**
+ * Sets the value of the class property.
+ */
+ public void setClassName(String value)
+ {
+ this.className = value;
+ }
+
+ /**
+ * Gets the value of the initMethod property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getInitMethod()
+ {
+ return initMethod;
+ }
+
+ /**
+ * Sets the value of the initMethod property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setInitMethod(String value)
+ {
+ this.initMethod = value;
+ }
+
+ /**
+ * Gets the value of the destroyMethod property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getDestroyMethod()
+ {
+ return destroyMethod;
+ }
+
+ /**
+ * Sets the value of the destroyMethod property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setDestroyMethod(String value)
+ {
+ this.destroyMethod = value;
+ }
+
+ /**
+ * Gets the value of the factoryMethod property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getFactoryMethod()
+ {
+ return factoryMethod;
+ }
+
+ /**
+ * Sets the value of the factoryMethod property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setFactoryMethod(String value)
+ {
+ this.factoryMethod = value;
+ }
+
+ /**
+ * Gets the value of the factoryComponent property.
+ *
+ */
+ public String getFactoryComponentId()
+ {
+ return factoryComponent;
+ }
+
+ /**
+ * Sets the value of the factoryComponent property.
+ *
+ */
+ public void setFactoryComponentId(String value)
+ {
+ this.factoryComponent = value;
+ }
+
+ /**
+ * Gets the value of the scope property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getScope()
+ {
+ return scope;
+ }
+
+ /**
+ * Sets the value of the scope property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setScope(String value)
+ {
+ this.scope = value;
+ }
+
+ /**
+ * Gets the value of the lazyInit property.
+ *
+ * @return possible object is {@link Boolean }
+ *
+ */
+ public boolean isLazyInit()
+ {
+ return lazyInit;
+ }
+
+ /**
+ * Sets the value of the lazyInit property.
+ *
+ * @param value allowed object is {@link Boolean }
+ *
+ */
+ public void setLazyInit(boolean value)
+ {
+ this.lazyInit = value;
+ }
+
+ /**
+ * Gets a map that contains attributes that aren't bound to any typed property on this class.
+ *
+ * <p>
+ * the map is keyed by the name of the attribute and the value is the string value of the attribute.
+ *
+ * the map returned by this method is live, and you can add new attribute by updating the map directly. Because of this design, there's no setter.
+ *
+ *
+ * @return always non-null
+ */
+ public Map<QName, String> getOtherAttributes()
+ {
+ return otherAttributes;
+ }
+}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TBlueprint.java (from rev 90358, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintMetadata.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TBlueprint.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TBlueprint.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -0,0 +1,295 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.parser.xb;
+
+// $Id$
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.osgi.spi.NotImplementedException;
+import org.osgi.service.blueprint.container.NoSuchComponentException;
+
+/**
+ * The blueprint element is the top element.
+ *
+ * The definitions consist of two sections:
+ * the type-converter section and the components section.
+ *
+ * blueprint ::= <type-converters> component
+ * component ::= <bean> | <service> | service-reference
+ * service-reference ::= <reference> | <ref-list> | <ref-set>
+ * type-converter ::= <bean> | <ref>
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 13-May-2009
+ */
+public class TBlueprint
+{
+ protected String description;
+ protected TTypeConverters typeConverters;
+ protected List<TComponent> components;
+ protected Boolean defaultLazyInit;
+ protected String defaultInitMethod;
+ protected String defaultDestroyMethod;
+ protected BigInteger defaultTimeout;
+ protected TAvailability defaultAvailability;
+ private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+ /**
+ * Gets the value of the description property.
+ *
+ */
+ public String getDescription()
+ {
+ return description;
+ }
+
+ /**
+ * Sets the value of the description property.
+ *
+ */
+ public void setDescription(String value)
+ {
+ this.description = value;
+ }
+
+ /**
+ * Gets the value of the typeConverters property.
+ *
+ * @return possible object is {@link TTypeConverters }
+ *
+ */
+ public TTypeConverters getTypeConverters()
+ {
+ return typeConverters;
+ }
+
+ /**
+ * Sets the value of the typeConverters property.
+ *
+ * @param value allowed object is {@link TTypeConverters }
+ *
+ */
+ public void setTypeConverters(TTypeConverters value)
+ {
+ this.typeConverters = value;
+ }
+
+ /**
+ * Gets the value of components
+ */
+ public List<TComponent> getComponents()
+ {
+ if (components == null)
+ components = new ArrayList<TComponent>();
+
+ return components;
+ }
+
+ public Set<String> getComponentIds()
+ {
+ Set<String> compIds = new LinkedHashSet<String>();
+ for (TComponent comp : getComponents())
+ {
+ compIds.add(comp.getId());
+ }
+ return Collections.unmodifiableSet(compIds);
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T extends TComponent> Collection<T> getMetadata(Class<T> type)
+ {
+ List<T> compMetadata = new ArrayList<T>();
+ for (TComponent comp : getComponents())
+ {
+ if (type.isAssignableFrom(comp.getClass()))
+ compMetadata.add((T)comp);
+ }
+ return Collections.unmodifiableList(compMetadata);
+ }
+
+ public TComponent getComponentMetadata(String name)
+ {
+ if (name == null)
+ throw new IllegalArgumentException("Cannot get metadata for id: null");
+
+ TComponent compMetadata = null;
+ for (TComponent comp : getComponents())
+ {
+ if (name.equals(comp.getId()))
+ {
+ compMetadata = comp;
+ break;
+ }
+ }
+
+ if (compMetadata == null)
+ throw new NoSuchComponentException(name);
+
+ return compMetadata;
+ }
+
+ /**
+ * Gets the value of the defaultLazyInit property.
+ *
+ * @return possible object is {@link Boolean }
+ *
+ */
+ public Boolean isDefaultLazyInit()
+ {
+ return defaultLazyInit;
+ }
+
+ /**
+ * Sets the value of the defaultLazyInit property.
+ *
+ * @param value allowed object is {@link Boolean }
+ *
+ */
+ public void setDefaultLazyInit(Boolean value)
+ {
+ this.defaultLazyInit = value;
+ }
+
+ /**
+ * Gets the value of the defaultInitMethod property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getDefaultInitMethod()
+ {
+ return defaultInitMethod;
+ }
+
+ /**
+ * Sets the value of the defaultInitMethod property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setDefaultInitMethod(String value)
+ {
+ this.defaultInitMethod = value;
+ }
+
+ /**
+ * Gets the value of the defaultDestroyMethod property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getDefaultDestroyMethod()
+ {
+ return defaultDestroyMethod;
+ }
+
+ /**
+ * Sets the value of the defaultDestroyMethod property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setDefaultDestroyMethod(String value)
+ {
+ this.defaultDestroyMethod = value;
+ }
+
+ /**
+ * Gets the value of the defaultTimeout property.
+ */
+ public BigInteger getDefaultTimeout()
+ {
+ if (defaultTimeout == null)
+ defaultTimeout = new BigInteger("300000");
+
+ return defaultTimeout;
+ }
+
+ /**
+ * Sets the value of the defaultTimeout property.
+ */
+ public void setDefaultTimeout(BigInteger value)
+ {
+ this.defaultTimeout = value;
+ }
+
+ /**
+ * Gets the value of the defaultAvailability property.
+ *
+ * @return possible object is {@link Tavailability }
+ *
+ */
+ public TAvailability getDefaultAvailability()
+ {
+ if (defaultAvailability == null)
+ defaultAvailability = TAvailability.MANDATORY;
+
+ return defaultAvailability;
+ }
+
+ /**
+ * Sets the value of the defaultAvailability property.
+ *
+ * @param value allowed object is {@link Tavailability }
+ *
+ */
+ public void setDefaultAvailability(TAvailability value)
+ {
+ this.defaultAvailability = value;
+ }
+
+ /**
+ * Gets a map that contains attributes that aren't bound to any typed property on this class.
+ *
+ * <p>
+ * the map is keyed by the name of the attribute and the value is the string value of the attribute.
+ *
+ * the map returned by this method is live, and you can add new attribute by updating the map directly. Because of this design, there's no setter.
+ *
+ *
+ * @return always non-null
+ */
+ public Map<QName, String> getOtherAttributes()
+ {
+ return otherAttributes;
+ }
+
+ // Merge this Blueprint meta data with the given other, which may be null.
+ public TBlueprint merge(TBlueprint other)
+ {
+ if (other == null)
+ return this;
+
+ throw new NotImplementedException("Blueprint metadata merge not yet implemented");
+ }
+}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TComparator.java (from rev 90358, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComparatorImpl.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TComparator.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TComparator.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -0,0 +1,93 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.parser.xb;
+
+//$Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * <p>
+ * Java class for Tcomparator complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Tcomparator">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <group ref="{http://www.osgi.org/xmlns/blueprint/v1.0.0}targetComponent&quo...
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+public class TComparator
+{
+ protected List<TComponent> components;
+ protected List<Object> any;
+
+ public List<TComponent> getComponents()
+ {
+ return components;
+ }
+
+ public void setComponents(List<TComponent> components)
+ {
+ this.components = components;
+ }
+
+ /**
+ * Gets the value of the any property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the
+ * JAXB object. This is why there is not a <CODE>set</CODE> method for the any property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ *
+ * <pre>
+ * getAny().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list {@link Object }
+ *
+ *
+ */
+ public List<Object> getAny()
+ {
+ if (any == null)
+ {
+ any = new ArrayList<Object>();
+ }
+ return this.any;
+ }
+
+}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TComponent.java (from rev 90358, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentMetadataImpl.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TComponent.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TComponent.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.parser.xb;
+
+//$Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * The Component type is the base type for top-level
+ * Blueprint components. The <bean> <reference>, <service>, <ref-set>, and <ref-list>
+ * elements are all derived from the Component type.
+ *
+ * This type defines an id attributre that is used create references between different components.
+ * Component elements can also be inlined within other component definitions.
+ *
+ * The id attribute is not valid when inliine.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 13-May-2009
+ */
+public abstract class TComponent
+{
+ protected String id;
+ protected List<String> dependsOn;
+ protected int initialization;
+
+ /**
+ * Gets the value of the id property.
+ */
+ public String getId()
+ {
+ return id;
+ }
+
+ /**
+ * Sets the value of the id property.
+ */
+ public void setId(String value)
+ {
+ this.id = value;
+ }
+
+ public List<String> getDependsOn()
+ {
+ if (dependsOn == null)
+ dependsOn = new ArrayList<String>();
+
+ return dependsOn;
+ }
+
+ public void setDependsOn(List<String> dependsOn)
+ {
+ this.dependsOn = dependsOn;
+ }
+
+ public int getInitialization()
+ {
+ return initialization;
+ }
+
+ public void setInitialization(int initialization)
+ {
+ this.initialization = initialization;
+ }
+}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TRef.java (from rev 90336, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RefImpl.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TRef.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TRef.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.parser.xb;
+
+//$Id$
+
+/**
+ *
+ *
+ * Tref is the type used for <ref> elements. This specifies a required component id for the reference component.
+ *
+ *
+ *
+ * <p>
+ * Java class for Tref complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Tref">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="component" use="required" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tidref" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+public class TRef
+{
+ protected String component;
+
+ /**
+ * Gets the value of the component property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getComponent()
+ {
+ return component;
+ }
+
+ /**
+ * Sets the value of the component property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setComponent(String value)
+ {
+ this.component = value;
+ }
+
+}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TRefCollection.java (from rev 90336, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RefCollectionImpl.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TRefCollection.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TRefCollection.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -0,0 +1,166 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.parser.xb;
+
+
+//$Id$
+
+/**
+ *
+ *
+ * The Tref-collection builds in the characteristics of the TserviceReference type to define characteristics of the <ref-set> and <ref-list> elements. This adds in the
+ * characteristics that only apply to collections of references (e.g., sorting).
+ *
+ * <p>
+ * Java class for Tref-collection complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Tref-collection">
+ * <complexContent>
+ * <extension base="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TserviceReference&...
+ * <sequence>
+ * <element name="comparator" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tcomparator" minOccurs="0"/>
+ * </sequence>
+ * <attribute name="comparator-ref" type="{http://www.w3.org/2001/XMLSchema}token" />
+ * <attribute name="member-type">
+ * <simpleType>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
+ * <enumeration value="service-instance"/>
+ * <enumeration value="service-reference"/>
+ * </restriction>
+ * </simpleType>
+ * </attribute>
+ * <attribute name="ordering-basis">
+ * <simpleType>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
+ * <enumeration value="service"/>
+ * <enumeration value="service-reference"/>
+ * </restriction>
+ * </simpleType>
+ * </attribute>
+ * <anyAttribute processContents='lax' namespace='##other'/>
+ * </extension>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+public class TRefCollection extends TServiceReference
+{
+ protected TComparator comparator;
+ protected String comparatorRef;
+ protected String memberType;
+ protected String orderingBasis;
+
+ /**
+ * Gets the value of the comparator property.
+ *
+ * @return possible object is {@link TComparator }
+ *
+ */
+ public TComparator getComparator()
+ {
+ return comparator;
+ }
+
+ /**
+ * Sets the value of the comparator property.
+ *
+ * @param value allowed object is {@link TComparator }
+ *
+ */
+ public void setComparator(TComparator value)
+ {
+ this.comparator = value;
+ }
+
+ /**
+ * Gets the value of the comparatorRef property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getComparatorRef()
+ {
+ return comparatorRef;
+ }
+
+ /**
+ * Sets the value of the comparatorRef property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setComparatorRef(String value)
+ {
+ this.comparatorRef = value;
+ }
+
+ /**
+ * Gets the value of the memberType property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getMemberType()
+ {
+ return memberType;
+ }
+
+ /**
+ * Sets the value of the memberType property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setMemberType(String value)
+ {
+ this.memberType = value;
+ }
+
+ /**
+ * Gets the value of the orderingBasis property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getOrderingBasis()
+ {
+ return orderingBasis;
+ }
+
+ /**
+ * Sets the value of the orderingBasis property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setOrderingBasis(String value)
+ {
+ this.orderingBasis = value;
+ }
+
+}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TReference.java (from rev 90358, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ReferenceMetadataImpl.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TReference.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TReference.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.parser.xb;
+
+// $Id$
+
+import java.math.BigInteger;
+
+
+/**
+ *
+ *
+ * The Treference type defines the <reference> element. These
+ * are instances of the TserviceReference type, with the addition
+ * of a timeout attribute. If the timeout is not specified,
+ * the default-timeout value is inherited from the encapsulating
+ * <blueprint> definition.
+ *
+ *
+ *
+ * <p>Java class for Treference complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Treference">
+ * <complexContent>
+ * <extension base="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TserviceReference">
+ * <attribute name="timeout" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Ttimeout" />
+ * <anyAttribute processContents='lax' namespace='##other'/>
+ * </extension>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+public class TReference extends TServiceReference
+{
+ protected BigInteger timeout;
+
+ /*
+ * Gets the value of the timeout property.
+ * @return possible object is {@link BigInteger }
+ */
+ public long getTimeout()
+ {
+ return timeout.longValue();
+ }
+
+ /*
+ * Sets the value of the timeout property.
+ * @param value allowed object is {@link BigInteger }
+ */
+ public void setTimeout(BigInteger value)
+ {
+ this.timeout = value;
+ }
+
+}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TReferenceListener.java (from rev 90336, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ReferenceListenerImpl.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TReferenceListener.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TReferenceListener.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -0,0 +1,230 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.parser.xb;
+
+//$Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ *
+ *
+ * TReferenceListener defines a reference listener that is attached to a <reference>, <ref-set>, or <ref-list> element. The listener object can be specified as a <ref>
+ * or as an inline <bean> or <reference> component. Listener events are mapped to the indicated bind or unbind methods.
+ *
+ *
+ *
+ * <p>
+ * Java class for TReferenceListener complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="TReferenceListener">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <group ref="{http://www.osgi.org/xmlns/blueprint/v1.0.0}targetComponent&quo...
+ * <attribute name="ref" type="{http://www.w3.org/2001/XMLSchema}token" />
+ * <attribute name="bind-method" use="required" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tmethod" />
+ * <attribute name="unbind-method" use="required" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tmethod" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+public class TReferenceListener
+{
+ protected TBean bean;
+ protected TReference reference;
+ protected TRef refFIXME;
+ protected List<Object> any;
+ protected String ref;
+ protected String bindMethod;
+ protected String unbindMethod;
+
+ /**
+ * Gets the value of the bean property.
+ *
+ * @return possible object is {@link TBean }
+ *
+ */
+ public TBean getBean()
+ {
+ return bean;
+ }
+
+ /**
+ * Sets the value of the bean property.
+ *
+ * @param value allowed object is {@link TBean }
+ *
+ */
+ public void setBean(TBean value)
+ {
+ this.bean = value;
+ }
+
+ /**
+ * Gets the value of the reference property.
+ *
+ * @return possible object is {@link TReference }
+ *
+ */
+ public TReference getReference()
+ {
+ return reference;
+ }
+
+ /**
+ * Sets the value of the reference property.
+ *
+ * @param value allowed object is {@link TReference }
+ *
+ */
+ public void setReference(TReference value)
+ {
+ this.reference = value;
+ }
+
+ /**
+ * Gets the value of the refFIXME property.
+ *
+ * @return possible object is {@link TRef }
+ *
+ */
+ public TRef getRefFIXME()
+ {
+ return refFIXME;
+ }
+
+ /**
+ * Sets the value of the refFIXME property.
+ *
+ * @param value allowed object is {@link TRef }
+ *
+ */
+ public void setRefFIXME(TRef value)
+ {
+ this.refFIXME = value;
+ }
+
+ /**
+ * Gets the value of the any property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the
+ * JAXB object. This is why there is not a <CODE>set</CODE> method for the any property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ *
+ * <pre>
+ * getAny().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list {@link Object }
+ *
+ *
+ */
+ public List<Object> getAny()
+ {
+ if (any == null)
+ {
+ any = new ArrayList<Object>();
+ }
+ return this.any;
+ }
+
+ /**
+ * Gets the value of the ref property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getRef()
+ {
+ return ref;
+ }
+
+ /**
+ * Sets the value of the ref property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setRef(String value)
+ {
+ this.ref = value;
+ }
+
+ /**
+ * Gets the value of the bindMethod property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getBindMethod()
+ {
+ return bindMethod;
+ }
+
+ /**
+ * Sets the value of the bindMethod property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setBindMethod(String value)
+ {
+ this.bindMethod = value;
+ }
+
+ /**
+ * Gets the value of the unbindMethod property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getUnbindMethod()
+ {
+ return unbindMethod;
+ }
+
+ /**
+ * Sets the value of the unbindMethod property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setUnbindMethod(String value)
+ {
+ this.unbindMethod = value;
+ }
+
+}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TRegistrationListener.java (from rev 90358, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RegistrationListenerImpl.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TRegistrationListener.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TRegistrationListener.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -0,0 +1,231 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.parser.xb;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ *
+ *
+ * A registration listener definition. The target registration listener can be either a <ref> to a <bean> or <service> component, or an inline <bean> or <service>
+ * component definition. The registration-method and unregistration-method attributes define the methods that will be called for the respective events.
+ *
+ * For the very common case of using a <ref> to a listener component, the ref attribute may also be used as a shortcut.
+ *
+ *
+ *
+ * <p>
+ * Java class for TregistrationListener complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="TregistrationListener">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <group ref="{http://www.osgi.org/xmlns/blueprint/v1.0.0}targetComponent&quo...
+ * <attribute name="ref" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tidref" />
+ * <attribute name="registration-method" use="required" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tmethod" />
+ * <attribute name="unregistration-method" use="required" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tmethod" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+public class TRegistrationListener
+{
+ protected TBean bean;
+ protected TReference reference;
+ protected TRef refFIXME;
+ protected List<Object> any;
+ protected String ref;
+ protected String registrationMethod;
+ protected String unregistrationMethod;
+
+ /**
+ * Gets the value of the bean property.
+ *
+ * @return possible object is {@link TBean }
+ *
+ */
+ public TBean getBean()
+ {
+ return bean;
+ }
+
+ /**
+ * Sets the value of the bean property.
+ *
+ * @param value allowed object is {@link TBean }
+ *
+ */
+ public void setBean(TBean value)
+ {
+ this.bean = value;
+ }
+
+ /**
+ * Gets the value of the reference property.
+ *
+ * @return possible object is {@link TReference }
+ *
+ */
+ public TReference getReference()
+ {
+ return reference;
+ }
+
+ /**
+ * Sets the value of the reference property.
+ *
+ * @param value allowed object is {@link TReference }
+ *
+ */
+ public void setReference(TReference value)
+ {
+ this.reference = value;
+ }
+
+ /**
+ * Gets the value of the refFIXME property.
+ *
+ * @return possible object is {@link TRef }
+ *
+ */
+ public TRef getRefFIXME()
+ {
+ return refFIXME;
+ }
+
+ /**
+ * Sets the value of the refFIXME property.
+ *
+ * @param value allowed object is {@link TRef }
+ *
+ */
+ public void setRefFIXME(TRef value)
+ {
+ this.refFIXME = value;
+ }
+
+ /**
+ * Gets the value of the any property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the
+ * JAXB object. This is why there is not a <CODE>set</CODE> method for the any property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ *
+ * <pre>
+ * getAny().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list {@link Object }
+ *
+ *
+ */
+ public List<Object> getAny()
+ {
+ if (any == null)
+ {
+ any = new ArrayList<Object>();
+ }
+ return this.any;
+ }
+
+ /**
+ * Gets the value of the ref property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getRef()
+ {
+ return ref;
+ }
+
+ /**
+ * Sets the value of the ref property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setRef(String value)
+ {
+ this.ref = value;
+ }
+
+ /**
+ * Gets the value of the registrationMethod property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getRegistrationMethod()
+ {
+ return registrationMethod;
+ }
+
+ /**
+ * Sets the value of the registrationMethod property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setRegistrationMethod(String value)
+ {
+ this.registrationMethod = value;
+ }
+
+ /**
+ * Gets the value of the unregistrationMethod property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getUnregistrationMethod()
+ {
+ return unregistrationMethod;
+ }
+
+ /**
+ * Sets the value of the unregistrationMethod property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setUnregistrationMethod(String value)
+ {
+ this.unregistrationMethod = value;
+ }
+}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TService.java (from rev 90359, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TService.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TService.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -0,0 +1,226 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.parser.xb;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+
+/**
+ * Tservice is the type for services exported by this blueprint bundle. Services are sourced by either a <ref> to a <bean> component or an <inline> bean component.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 13-May-2009
+ */
+public class TService extends TComponent
+{
+ protected String description;
+ protected List<String> interfaceNames;
+ protected List<TServicePropertyEntry> serviceProperties;
+ protected Collection<TRegistrationListener> registrationListener;
+ protected TBean bean;
+ protected List<Object> any;
+ protected String ref;
+ protected TAutoExportModes autoExportMode;
+ protected int ranking;
+ private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+ /**
+ * Gets the value of the description property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getDescription()
+ {
+ return description;
+ }
+
+ /**
+ * Sets the value of the description property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setDescription(String value)
+ {
+ this.description = value;
+ }
+
+ /**
+ * Gets the value of the interfaces property.
+ */
+ public List<String> getInterfaceNames()
+ {
+ if (interfaceNames == null)
+ interfaceNames = new ArrayList<String>();
+
+ return interfaceNames;
+ }
+
+ public void setInterfaceNames(List<String> interfaces)
+ {
+ this.interfaceNames = interfaces;
+ }
+
+ /**
+ * Gets the value of the serviceProperties property.
+ */
+ public List<TServicePropertyEntry> getServiceProperties()
+ {
+ if (serviceProperties == null)
+ serviceProperties = new ArrayList<TServicePropertyEntry>();
+
+ return serviceProperties;
+ }
+
+ public void setServiceProperties(List<TServicePropertyEntry> serviceProperties)
+ {
+ this.serviceProperties = serviceProperties;
+ }
+
+ /**
+ * Gets the value of the registrationListener property.
+ */
+ public Collection<TRegistrationListener> getRegistrationListeners()
+ {
+ if (registrationListener == null)
+ registrationListener = new ArrayList<TRegistrationListener>();
+
+ return registrationListener;
+ }
+
+ public void setRegistrationListeners(Collection<TRegistrationListener> registrationListener)
+ {
+ this.registrationListener = registrationListener;
+ }
+
+ /**
+ * Gets the value of the bean property.
+ *
+ * @return possible object is {@link TBean }
+ *
+ */
+ public TBean getBean()
+ {
+ return bean;
+ }
+
+ /**
+ * Sets the value of the bean property.
+ *
+ * @param value allowed object is {@link TBean }
+ *
+ */
+ public void setBean(TBean value)
+ {
+ this.bean = value;
+ }
+
+ /**
+ * Gets the value of the any property.
+ */
+ public List<Object> getAny()
+ {
+ if (any == null)
+ {
+ any = new ArrayList<Object>();
+ }
+ return this.any;
+ }
+
+ /**
+ * Gets the value of the ref property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getRef()
+ {
+ return ref;
+ }
+
+ /**
+ * Sets the value of the ref property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setRef(String value)
+ {
+ this.ref = value;
+ }
+
+ /**
+ * Gets the value of the autoExport property.
+ *
+ * @return possible object is {@link TAutoExportModes }
+ */
+ public TAutoExportModes getAutoExportMode()
+ {
+ if (autoExportMode == null)
+ autoExportMode = TAutoExportModes.DISABLED;
+
+ return autoExportMode;
+ }
+
+ /**
+ * Sets the value of the autoExport property.
+ *
+ * @param value allowed object is {@link TAutoExportModes }
+ */
+ public void setAutoExportMode(TAutoExportModes value)
+ {
+ this.autoExportMode = value;
+ }
+
+ /**
+ * Gets the value of the ranking property.
+ */
+ public int getRanking()
+ {
+ return ranking;
+ }
+
+ /**
+ * Sets the value of the ranking property.
+ */
+ public void setRanking(int value)
+ {
+ this.ranking = value;
+ }
+
+ /**
+ * Gets a map that contains attributes that aren't bound to any typed property on this class.
+ */
+ public Map<QName, String> getOtherAttributes()
+ {
+ return otherAttributes;
+ }
+}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TServicePropertyEntry.java (from rev 90358, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServicePropertyEntry.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TServicePropertyEntry.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TServicePropertyEntry.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.parser.xb;
+
+// $Id$
+
+/**
+ * TservicePropertyEntry is an entry value used for the <service-properties> element. This does not allow a child <key> element and there are no key-ref or value-ref
+ * attributes.
+ *
+ */
+public class TServicePropertyEntry
+{
+ protected String key;
+ protected String value;
+
+ public String getKey()
+ {
+ return key;
+ }
+
+ public void setKey(String key)
+ {
+ this.key = key;
+ }
+
+ public String getValue()
+ {
+ return value;
+ }
+
+ public void setValue(String value)
+ {
+ this.value = value;
+ }
+
+}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TServiceReference.java (from rev 90359, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TServiceReference.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TServiceReference.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -0,0 +1,220 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.parser.xb;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+
+/**
+ * TserviceReference is the base element type used for <reference>, <ref-set>, and <ref-list> elements. This type defines all of the characteristics common to both
+ * sorts of references.
+ *
+ * <p>
+ * Java class for TserviceReference complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="TserviceReference">
+ * <complexContent>
+ * <extension base="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tcomponent">
+ * <sequence>
+ * <element name="description" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}String" minOccurs="0"/>
+ * <element name="interfaces" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tinterfaces" minOccurs="0"/>
+ * <element name="listener" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TReferenceListener... maxOccurs="unbounded" minOccurs="0"/>
+ * <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * <attribute name="interface" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tclass" />
+ * <attribute name="filter" type="{http://www.w3.org/2001/XMLSchema}normalizedString" />
+ * <attribute name="component-name" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tidref" />
+ * <attribute name="availability" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tavailability" />
+ * <anyAttribute processContents='lax' namespace='##other'/>
+ * </extension>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+public class TServiceReference extends TComponent
+{
+ protected String description;
+ protected List<String> interfaceNames;
+ protected List<TReferenceListener> listener;
+ protected List<Object> any;
+ protected String filter;
+ protected String componentName;
+ protected TAvailability availability;
+ private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+ /**
+ * Gets the value of the description property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getDescription()
+ {
+ return description;
+ }
+
+ /**
+ * Sets the value of the description property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setDescription(String value)
+ {
+ this.description = value;
+ }
+
+ /**
+ * Gets the value of the interfaces property.
+ *
+ */
+ public List<String> getInterfaceNames()
+ {
+ if (interfaceNames == null)
+ interfaceNames = new ArrayList<String>();
+
+ return interfaceNames;
+ }
+
+ public void setInterfaceNames(List<String> interfaces)
+ {
+ this.interfaceNames = interfaces;
+ }
+
+ /**
+ * Gets the value of the listener property.
+ */
+ public List<TReferenceListener> getReferenceListeners()
+ {
+ if (listener == null)
+ listener = new ArrayList<TReferenceListener>();
+
+ return this.listener;
+ }
+
+ public void setReferenceListeners(List<TReferenceListener> listener)
+ {
+ this.listener = listener;
+ }
+
+ /**
+ * Gets the value of the any property.
+ */
+ public List<Object> getAny()
+ {
+ if (any == null)
+ {
+ any = new ArrayList<Object>();
+ }
+ return this.any;
+ }
+
+ /**
+ * Gets the value of the filter property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getFilter()
+ {
+ return filter;
+ }
+
+ /**
+ * Sets the value of the filter property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setFilter(String value)
+ {
+ this.filter = value;
+ }
+
+ /**
+ * Gets the value of the componentName property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getComponentName()
+ {
+ return componentName;
+ }
+
+ /**
+ * Sets the value of the componentName property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setComponentName(String value)
+ {
+ this.componentName = value;
+ }
+
+ /**
+ * Gets the value of the availability property.
+ *
+ * @return possible object is {@link Tavailability }
+ *
+ */
+ public TAvailability getAvailability()
+ {
+ if (availability == null)
+ availability = TAvailability.OPTIONAL;
+
+ return availability;
+ }
+
+ /**
+ * Sets the value of the availability property.
+ *
+ * @param value allowed object is {@link Tavailability }
+ *
+ */
+ public void setAvailability(TAvailability value)
+ {
+ this.availability = value;
+ }
+
+ /**
+ * Gets a map that contains attributes that aren't bound to any typed property on this class.
+ */
+ public Map<QName, String> getOtherAttributes()
+ {
+ return otherAttributes;
+ }
+}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TTypeConverters.java (from rev 90358, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TypeConverters.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TTypeConverters.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TTypeConverters.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -0,0 +1,89 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.parser.xb;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ *
+ *
+ * The type used for the <type-converters> element. The <type-converters> section is a set of <bean>, <ref>, or <reference> elements that identify the type convert
+ * components that will ference components.
+ *
+ *
+ *
+ * <p>
+ * Java class for Ttype-converters complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Ttype-converters">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <choice maxOccurs="unbounded" minOccurs="0">
+ * <group ref="{http://www.osgi.org/xmlns/blueprint/v1.0.0}targetComponent&quo...
+ * </choice>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+public class TTypeConverters
+{
+ protected List<Object> components;
+
+ public List<Object> getComponents()
+ {
+ if (components == null)
+ components = new ArrayList<Object>();
+
+ return components;
+ }
+
+ public void setComponents(List<Object> converters)
+ {
+ this.components = converters;
+ }
+
+ public void resolveRefs(TBlueprint tBlueprint)
+ {
+ for (int i = 0; i < getComponents().size(); i++)
+ {
+ Object comp = components.get(i);
+ if (comp instanceof TRef)
+ {
+ TRef ref = (TRef)comp;
+ String compName = ref.getComponent();
+ comp = tBlueprint.getComponentMetadata(compName);
+ components.set(i, comp);
+ }
+ }
+ }
+}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Targument.java (from rev 90336, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Targument.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Targument.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Targument.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -0,0 +1,536 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.parser.xb;
+
+// $Id$
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ *
+ * An argument used to create an object defined by a <bean> component. The <argument> elements are the arguments for the bean class constructor or passed to the bean
+ * factory method.
+ *
+ * The type, if specified, is used to disambiguate the constructor or method signature. Arguments may also be matched up with arguments by explicitly specifying the
+ * index position. If the index is used, then all <argument> elements for the bean must also specify the index.
+ *
+ * The value and ref attributes are convenience shortcuts to make the <argument> tag easier to code. A fuller set of injected values and types can be specified using
+ * one of the "value" type elements.
+ *
+ * <p>
+ * Java class for Targument complex type.
+ * <p>
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Targument">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="description" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}String" minOccurs="0"/>
+ * <group ref="{http://www.osgi.org/xmlns/blueprint/v1.0.0}value"/>
+ * </sequence>
+ * <attribute name="index" type="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger" />
+ * <attribute name="type" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tclass" />
+ * <attribute name="ref" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tidref" />
+ * <attribute name="valueFIXME" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TstringValue" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+public class Targument
+{
+ protected String description;
+ protected TService service;
+ protected TRefCollection refList;
+ protected TRefCollection refSet;
+ protected TBean bean;
+ protected TReference reference;
+ protected TRef refFIXME;
+ protected List<Object> any;
+ protected TRef idref;
+ protected Tvalue value;
+ protected Tcollection list;
+ protected Tcollection set;
+ protected Tmap map;
+ protected Tcollection array;
+ protected Tprops props;
+ protected Tnull _null;
+ protected BigInteger index;
+ protected String type;
+ protected String ref;
+ protected String valueFIXME;
+
+ /**
+ * Gets the value of the description property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getDescription()
+ {
+ return description;
+ }
+
+ /**
+ * Sets the value of the description property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setDescription(String value)
+ {
+ this.description = value;
+ }
+
+ /**
+ * Gets the value of the service property.
+ *
+ * @return possible object is {@link TService }
+ *
+ */
+ public TService getService()
+ {
+ return service;
+ }
+
+ /**
+ * Sets the value of the service property.
+ *
+ * @param value allowed object is {@link TService }
+ *
+ */
+ public void setService(TService value)
+ {
+ this.service = value;
+ }
+
+ /**
+ * Gets the value of the refList property.
+ *
+ * @return possible object is {@link TRefCollection }
+ *
+ */
+ public TRefCollection getRefList()
+ {
+ return refList;
+ }
+
+ /**
+ * Sets the value of the refList property.
+ *
+ * @param value allowed object is {@link TRefCollection }
+ *
+ */
+ public void setRefList(TRefCollection value)
+ {
+ this.refList = value;
+ }
+
+ /**
+ * Gets the value of the refSet property.
+ *
+ * @return possible object is {@link TRefCollection }
+ *
+ */
+ public TRefCollection getRefSet()
+ {
+ return refSet;
+ }
+
+ /**
+ * Sets the value of the refSet property.
+ *
+ * @param value allowed object is {@link TRefCollection }
+ *
+ */
+ public void setRefSet(TRefCollection value)
+ {
+ this.refSet = value;
+ }
+
+ /**
+ * Gets the value of the bean property.
+ *
+ * @return possible object is {@link TBean }
+ *
+ */
+ public TBean getBean()
+ {
+ return bean;
+ }
+
+ /**
+ * Sets the value of the bean property.
+ *
+ * @param value allowed object is {@link TBean }
+ *
+ */
+ public void setBean(TBean value)
+ {
+ this.bean = value;
+ }
+
+ /**
+ * Gets the value of the reference property.
+ *
+ * @return possible object is {@link TReference }
+ *
+ */
+ public TReference getReference()
+ {
+ return reference;
+ }
+
+ /**
+ * Sets the value of the reference property.
+ *
+ * @param value allowed object is {@link TReference }
+ *
+ */
+ public void setReference(TReference value)
+ {
+ this.reference = value;
+ }
+
+ /**
+ * Gets the value of the refFIXME property.
+ *
+ * @return possible object is {@link TRef }
+ *
+ */
+ public TRef getRefFIXME()
+ {
+ return refFIXME;
+ }
+
+ /**
+ * Sets the value of the refFIXME property.
+ *
+ * @param value allowed object is {@link TRef }
+ *
+ */
+ public void setRefFIXME(TRef value)
+ {
+ this.refFIXME = value;
+ }
+
+ /**
+ * Gets the value of the any property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the
+ * JAXB object. This is why there is not a <CODE>set</CODE> method for the any property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ *
+ * <pre>
+ * getAny().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list {@link Object }
+ *
+ *
+ */
+ public List<Object> getAny()
+ {
+ if (any == null)
+ {
+ any = new ArrayList<Object>();
+ }
+ return this.any;
+ }
+
+ /**
+ * Gets the value of the idref property.
+ *
+ * @return possible object is {@link TRef }
+ *
+ */
+ public TRef getIdref()
+ {
+ return idref;
+ }
+
+ /**
+ * Sets the value of the idref property.
+ *
+ * @param value allowed object is {@link TRef }
+ *
+ */
+ public void setIdref(TRef value)
+ {
+ this.idref = value;
+ }
+
+ /**
+ * Gets the value of the value property.
+ *
+ * @return possible object is {@link Tvalue }
+ *
+ */
+ public Tvalue getValue()
+ {
+ return value;
+ }
+
+ /**
+ * Sets the value of the value property.
+ *
+ * @param value allowed object is {@link Tvalue }
+ *
+ */
+ public void setValue(Tvalue value)
+ {
+ this.value = value;
+ }
+
+ /**
+ * Gets the value of the list property.
+ *
+ * @return possible object is {@link Tcollection }
+ *
+ */
+ public Tcollection getList()
+ {
+ return list;
+ }
+
+ /**
+ * Sets the value of the list property.
+ *
+ * @param value allowed object is {@link Tcollection }
+ *
+ */
+ public void setList(Tcollection value)
+ {
+ this.list = value;
+ }
+
+ /**
+ * Gets the value of the set property.
+ *
+ * @return possible object is {@link Tcollection }
+ *
+ */
+ public Tcollection getSet()
+ {
+ return set;
+ }
+
+ /**
+ * Sets the value of the set property.
+ *
+ * @param value allowed object is {@link Tcollection }
+ *
+ */
+ public void setSet(Tcollection value)
+ {
+ this.set = value;
+ }
+
+ /**
+ * Gets the value of the map property.
+ *
+ * @return possible object is {@link Tmap }
+ *
+ */
+ public Tmap getMap()
+ {
+ return map;
+ }
+
+ /**
+ * Sets the value of the map property.
+ *
+ * @param value allowed object is {@link Tmap }
+ *
+ */
+ public void setMap(Tmap value)
+ {
+ this.map = value;
+ }
+
+ /**
+ * Gets the value of the array property.
+ *
+ * @return possible object is {@link Tcollection }
+ *
+ */
+ public Tcollection getArray()
+ {
+ return array;
+ }
+
+ /**
+ * Sets the value of the array property.
+ *
+ * @param value allowed object is {@link Tcollection }
+ *
+ */
+ public void setArray(Tcollection value)
+ {
+ this.array = value;
+ }
+
+ /**
+ * Gets the value of the props property.
+ *
+ * @return possible object is {@link Tprops }
+ *
+ */
+ public Tprops getProps()
+ {
+ return props;
+ }
+
+ /**
+ * Sets the value of the props property.
+ *
+ * @param value allowed object is {@link Tprops }
+ *
+ */
+ public void setProps(Tprops value)
+ {
+ this.props = value;
+ }
+
+ /**
+ * Gets the value of the null property.
+ *
+ * @return possible object is {@link Tnull }
+ *
+ */
+ public Tnull getNull()
+ {
+ return _null;
+ }
+
+ /**
+ * Sets the value of the null property.
+ *
+ * @param value allowed object is {@link Tnull }
+ *
+ */
+ public void setNull(Tnull value)
+ {
+ this._null = value;
+ }
+
+ /**
+ * Gets the value of the index property.
+ *
+ * @return possible object is {@link BigInteger }
+ *
+ */
+ public BigInteger getIndex()
+ {
+ return index;
+ }
+
+ /**
+ * Sets the value of the index property.
+ *
+ * @param value allowed object is {@link BigInteger }
+ *
+ */
+ public void setIndex(BigInteger value)
+ {
+ this.index = value;
+ }
+
+ /**
+ * Gets the value of the type property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getType()
+ {
+ return type;
+ }
+
+ /**
+ * Sets the value of the type property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setType(String value)
+ {
+ this.type = value;
+ }
+
+ /**
+ * Gets the value of the ref property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getRef()
+ {
+ return ref;
+ }
+
+ /**
+ * Sets the value of the ref property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setRef(String value)
+ {
+ this.ref = value;
+ }
+
+ /**
+ * Gets the value of the valueFIXME property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getValueFIXME()
+ {
+ return valueFIXME;
+ }
+
+ /**
+ * Sets the value of the valueFIXME property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setValueFIXME(String value)
+ {
+ this.valueFIXME = value;
+ }
+
+}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tcollection.java (from rev 90336, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tcollection.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tcollection.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tcollection.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -0,0 +1,93 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.parser.xb;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ *
+ *
+ * Tcollection is the base schema type for different ordered collection types. This is shared between the <array>, <list>, and <set> elements.
+ *
+ *
+ *
+ * <p>
+ * Java class for Tcollection complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Tcollection">
+ * <complexContent>
+ * <extension base="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TtypedCollection&q...
+ * <group ref="{http://www.osgi.org/xmlns/blueprint/v1.0.0}value" maxOccurs="unbounded" minOccurs="0"/>
+ * </extension>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+public class Tcollection extends TtypedCollection
+{
+ protected List<Object> value;
+
+ /**
+ * Gets the value of the value property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the
+ * JAXB object. This is why there is not a <CODE>set</CODE> method for the value property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ *
+ * <pre>
+ * getValue().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list {@link JAXBElement }{@code <}{@link Tvalue }{@code >} {@link JAXBElement }{@code <}{@link TService }{@code >}
+ * {@link JAXBElement }{@code <}{@link TRef }{@code >} {@link JAXBElement }{@code <}{@link TReference }{@code >} {@link JAXBElement }{@code <}{@link TRef }{@code >}
+ * {@link JAXBElement }{@code <}{@link Tmap }{@code >} {@link JAXBElement }{@code <}{@link TBean }{@code >} {@link JAXBElement }{@code <}{@link Tnull }{@code >}
+ * {@link JAXBElement }{@code <}{@link TRefCollection }{@code >} {@link JAXBElement }{@code <}{@link TRefCollection }{@code >} {@link JAXBElement }{@code <}
+ * {@link Tcollection }{@code >} {@link Object } {@link JAXBElement }{@code <}{@link Tcollection }{@code >} {@link JAXBElement }{@code <}{@link Tcollection }{@code >}
+ * {@link JAXBElement }{@code <}{@link Tprops }{@code >}
+ *
+ *
+ */
+ public List<Object> getValue()
+ {
+ if (value == null)
+ {
+ value = new ArrayList<Object>();
+ }
+ return this.value;
+ }
+
+}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tkey.java (from rev 90336, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tkey.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tkey.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tkey.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -0,0 +1,384 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.parser.xb;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * The Tkey type defines the element types that are permitted for Map key situations. These can be any of the "value" types other than the <null> element.
+ *
+ * <p>
+ * Java class for Tkey complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Tkey">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <group ref="{http://www.osgi.org/xmlns/blueprint/v1.0.0}nonNullValue"/...
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+public class Tkey
+{
+
+ protected TService service;
+ protected TRefCollection refList;
+ protected TRefCollection refSet;
+ protected TBean bean;
+ protected TReference reference;
+ protected TRef refFIXME;
+ protected List<Object> any;
+ protected TRef idref;
+ protected Tvalue value;
+ protected Tcollection list;
+ protected Tcollection set;
+ protected Tmap map;
+ protected Tcollection array;
+ protected Tprops props;
+
+ /**
+ * Gets the value of the service property.
+ *
+ * @return possible object is {@link TService }
+ *
+ */
+ public TService getService()
+ {
+ return service;
+ }
+
+ /**
+ * Sets the value of the service property.
+ *
+ * @param value allowed object is {@link TService }
+ *
+ */
+ public void setService(TService value)
+ {
+ this.service = value;
+ }
+
+ /**
+ * Gets the value of the refList property.
+ *
+ * @return possible object is {@link TRefCollection }
+ *
+ */
+ public TRefCollection getRefList()
+ {
+ return refList;
+ }
+
+ /**
+ * Sets the value of the refList property.
+ *
+ * @param value allowed object is {@link TRefCollection }
+ *
+ */
+ public void setRefList(TRefCollection value)
+ {
+ this.refList = value;
+ }
+
+ /**
+ * Gets the value of the refSet property.
+ *
+ * @return possible object is {@link TRefCollection }
+ *
+ */
+ public TRefCollection getRefSet()
+ {
+ return refSet;
+ }
+
+ /**
+ * Sets the value of the refSet property.
+ *
+ * @param value allowed object is {@link TRefCollection }
+ *
+ */
+ public void setRefSet(TRefCollection value)
+ {
+ this.refSet = value;
+ }
+
+ /**
+ * Gets the value of the bean property.
+ *
+ * @return possible object is {@link TBean }
+ *
+ */
+ public TBean getBean()
+ {
+ return bean;
+ }
+
+ /**
+ * Sets the value of the bean property.
+ *
+ * @param value allowed object is {@link TBean }
+ *
+ */
+ public void setBean(TBean value)
+ {
+ this.bean = value;
+ }
+
+ /**
+ * Gets the value of the reference property.
+ *
+ * @return possible object is {@link TReference }
+ *
+ */
+ public TReference getReference()
+ {
+ return reference;
+ }
+
+ /**
+ * Sets the value of the reference property.
+ *
+ * @param value allowed object is {@link TReference }
+ *
+ */
+ public void setReference(TReference value)
+ {
+ this.reference = value;
+ }
+
+ /**
+ * Gets the value of the refFIXME property.
+ *
+ * @return possible object is {@link TRef }
+ *
+ */
+ public TRef getRefFIXME()
+ {
+ return refFIXME;
+ }
+
+ /**
+ * Sets the value of the refFIXME property.
+ *
+ * @param value allowed object is {@link TRef }
+ *
+ */
+ public void setRefFIXME(TRef value)
+ {
+ this.refFIXME = value;
+ }
+
+ /**
+ * Gets the value of the any property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the
+ * JAXB object. This is why there is not a <CODE>set</CODE> method for the any property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ *
+ * <pre>
+ * getAny().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list {@link Object }
+ *
+ *
+ */
+ public List<Object> getAny()
+ {
+ if (any == null)
+ {
+ any = new ArrayList<Object>();
+ }
+ return this.any;
+ }
+
+ /**
+ * Gets the value of the idref property.
+ *
+ * @return possible object is {@link TRef }
+ *
+ */
+ public TRef getIdref()
+ {
+ return idref;
+ }
+
+ /**
+ * Sets the value of the idref property.
+ *
+ * @param value allowed object is {@link TRef }
+ *
+ */
+ public void setIdref(TRef value)
+ {
+ this.idref = value;
+ }
+
+ /**
+ * Gets the value of the value property.
+ *
+ * @return possible object is {@link Tvalue }
+ *
+ */
+ public Tvalue getValue()
+ {
+ return value;
+ }
+
+ /**
+ * Sets the value of the value property.
+ *
+ * @param value allowed object is {@link Tvalue }
+ *
+ */
+ public void setValue(Tvalue value)
+ {
+ this.value = value;
+ }
+
+ /**
+ * Gets the value of the list property.
+ *
+ * @return possible object is {@link Tcollection }
+ *
+ */
+ public Tcollection getList()
+ {
+ return list;
+ }
+
+ /**
+ * Sets the value of the list property.
+ *
+ * @param value allowed object is {@link Tcollection }
+ *
+ */
+ public void setList(Tcollection value)
+ {
+ this.list = value;
+ }
+
+ /**
+ * Gets the value of the set property.
+ *
+ * @return possible object is {@link Tcollection }
+ *
+ */
+ public Tcollection getSet()
+ {
+ return set;
+ }
+
+ /**
+ * Sets the value of the set property.
+ *
+ * @param value allowed object is {@link Tcollection }
+ *
+ */
+ public void setSet(Tcollection value)
+ {
+ this.set = value;
+ }
+
+ /**
+ * Gets the value of the map property.
+ *
+ * @return possible object is {@link Tmap }
+ *
+ */
+ public Tmap getMap()
+ {
+ return map;
+ }
+
+ /**
+ * Sets the value of the map property.
+ *
+ * @param value allowed object is {@link Tmap }
+ *
+ */
+ public void setMap(Tmap value)
+ {
+ this.map = value;
+ }
+
+ /**
+ * Gets the value of the array property.
+ *
+ * @return possible object is {@link Tcollection }
+ *
+ */
+ public Tcollection getArray()
+ {
+ return array;
+ }
+
+ /**
+ * Sets the value of the array property.
+ *
+ * @param value allowed object is {@link Tcollection }
+ *
+ */
+ public void setArray(Tcollection value)
+ {
+ this.array = value;
+ }
+
+ /**
+ * Gets the value of the props property.
+ *
+ * @return possible object is {@link Tprops }
+ *
+ */
+ public Tprops getProps()
+ {
+ return props;
+ }
+
+ /**
+ * Sets the value of the props property.
+ *
+ * @param value allowed object is {@link Tprops }
+ *
+ */
+ public void setProps(Tprops value)
+ {
+ this.props = value;
+ }
+
+}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tmap.java (from rev 90336, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tmap.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tmap.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tmap.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -0,0 +1,116 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.parser.xb;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ *
+ *
+ * Tmap is the base type used for <map> elements. A map may have a default value type specified, so it inherits from the TtypeCollection type. A key type can also be
+ * specified, and the map members are created from the entry elements, which require a key/value pair.
+ *
+ *
+ *
+ * <p>
+ * Java class for Tmap complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Tmap">
+ * <complexContent>
+ * <extension base="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TtypedCollection&q...
+ * <sequence>
+ * <element name="entry" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TmapEntry" maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * <attribute name="key-type" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tclass" />
+ * </extension>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+public class Tmap extends TtypedCollection
+{
+
+ protected List<TmapEntry> entry;
+ protected String keyType;
+
+ /**
+ * Gets the value of the entry property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the
+ * JAXB object. This is why there is not a <CODE>set</CODE> method for the entry property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ *
+ * <pre>
+ * getEntry().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list {@link TmapEntry }
+ *
+ *
+ */
+ public List<TmapEntry> getEntry()
+ {
+ if (entry == null)
+ {
+ entry = new ArrayList<TmapEntry>();
+ }
+ return this.entry;
+ }
+
+ /**
+ * Gets the value of the keyType property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getKeyType()
+ {
+ return keyType;
+ }
+
+ /**
+ * Sets the value of the keyType property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setKeyType(String value)
+ {
+ this.keyType = value;
+ }
+
+}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TmapEntry.java (from rev 90336, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TmapEntry.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TmapEntry.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TmapEntry.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -0,0 +1,535 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.parser.xb;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ *
+ *
+ * TmapEntry is used for <entry> elements nested inside of a <map> element. Each <entry> instance defines a key/value pair that will be added to the Map. Both the keys
+ * and values may be arbitrary types. Keys must not be <null> but <null> is permitted for entry values. A default type can be specified for both the keys and the
+ * values, but individual keys or values can override the default.
+ *
+ *
+ *
+ * <p>
+ * Java class for TmapEntry complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="TmapEntry">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="keyFIXME" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tkey" minOccurs="0"/>
+ * <group ref="{http://www.osgi.org/xmlns/blueprint/v1.0.0}value"/>
+ * </sequence>
+ * <attribute name="key" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TstringValue" />
+ * <attribute name="key-ref" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tidref" />
+ * <attribute name="valueFIXME" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TstringValue" />
+ * <attribute name="value-ref" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tidref" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+public class TmapEntry
+{
+
+ protected Tkey keyFIXME;
+ protected TService service;
+ protected TRefCollection refList;
+ protected TRefCollection refSet;
+ protected TBean bean;
+ protected TReference reference;
+ protected TRef refFIXME;
+ protected List<Object> any;
+ protected TRef idref;
+ protected Tvalue value;
+ protected Tcollection list;
+ protected Tcollection set;
+ protected Tmap map;
+ protected Tcollection array;
+ protected Tprops props;
+ protected Tnull _null;
+ protected String key;
+ protected String keyRef;
+ protected String valueFIXME;
+ protected String valueRef;
+
+ /**
+ * Gets the value of the keyFIXME property.
+ *
+ * @return possible object is {@link Tkey }
+ *
+ */
+ public Tkey getKeyFIXME()
+ {
+ return keyFIXME;
+ }
+
+ /**
+ * Sets the value of the keyFIXME property.
+ *
+ * @param value allowed object is {@link Tkey }
+ *
+ */
+ public void setKeyFIXME(Tkey value)
+ {
+ this.keyFIXME = value;
+ }
+
+ /**
+ * Gets the value of the service property.
+ *
+ * @return possible object is {@link TService }
+ *
+ */
+ public TService getService()
+ {
+ return service;
+ }
+
+ /**
+ * Sets the value of the service property.
+ *
+ * @param value allowed object is {@link TService }
+ *
+ */
+ public void setService(TService value)
+ {
+ this.service = value;
+ }
+
+ /**
+ * Gets the value of the refList property.
+ *
+ * @return possible object is {@link TRefCollection }
+ *
+ */
+ public TRefCollection getRefList()
+ {
+ return refList;
+ }
+
+ /**
+ * Sets the value of the refList property.
+ *
+ * @param value allowed object is {@link TRefCollection }
+ *
+ */
+ public void setRefList(TRefCollection value)
+ {
+ this.refList = value;
+ }
+
+ /**
+ * Gets the value of the refSet property.
+ *
+ * @return possible object is {@link TRefCollection }
+ *
+ */
+ public TRefCollection getRefSet()
+ {
+ return refSet;
+ }
+
+ /**
+ * Sets the value of the refSet property.
+ *
+ * @param value allowed object is {@link TRefCollection }
+ *
+ */
+ public void setRefSet(TRefCollection value)
+ {
+ this.refSet = value;
+ }
+
+ /**
+ * Gets the value of the bean property.
+ *
+ * @return possible object is {@link TBean }
+ *
+ */
+ public TBean getBean()
+ {
+ return bean;
+ }
+
+ /**
+ * Sets the value of the bean property.
+ *
+ * @param value allowed object is {@link TBean }
+ *
+ */
+ public void setBean(TBean value)
+ {
+ this.bean = value;
+ }
+
+ /**
+ * Gets the value of the reference property.
+ *
+ * @return possible object is {@link TReference }
+ *
+ */
+ public TReference getReference()
+ {
+ return reference;
+ }
+
+ /**
+ * Sets the value of the reference property.
+ *
+ * @param value allowed object is {@link TReference }
+ *
+ */
+ public void setReference(TReference value)
+ {
+ this.reference = value;
+ }
+
+ /**
+ * Gets the value of the refFIXME property.
+ *
+ * @return possible object is {@link TRef }
+ *
+ */
+ public TRef getRefFIXME()
+ {
+ return refFIXME;
+ }
+
+ /**
+ * Sets the value of the refFIXME property.
+ *
+ * @param value allowed object is {@link TRef }
+ *
+ */
+ public void setRefFIXME(TRef value)
+ {
+ this.refFIXME = value;
+ }
+
+ /**
+ * Gets the value of the any property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the
+ * JAXB object. This is why there is not a <CODE>set</CODE> method for the any property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ *
+ * <pre>
+ * getAny().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list {@link Object }
+ *
+ *
+ */
+ public List<Object> getAny()
+ {
+ if (any == null)
+ {
+ any = new ArrayList<Object>();
+ }
+ return this.any;
+ }
+
+ /**
+ * Gets the value of the idref property.
+ *
+ * @return possible object is {@link TRef }
+ *
+ */
+ public TRef getIdref()
+ {
+ return idref;
+ }
+
+ /**
+ * Sets the value of the idref property.
+ *
+ * @param value allowed object is {@link TRef }
+ *
+ */
+ public void setIdref(TRef value)
+ {
+ this.idref = value;
+ }
+
+ /**
+ * Gets the value of the value property.
+ *
+ * @return possible object is {@link Tvalue }
+ *
+ */
+ public Tvalue getValue()
+ {
+ return value;
+ }
+
+ /**
+ * Sets the value of the value property.
+ *
+ * @param value allowed object is {@link Tvalue }
+ *
+ */
+ public void setValue(Tvalue value)
+ {
+ this.value = value;
+ }
+
+ /**
+ * Gets the value of the list property.
+ *
+ * @return possible object is {@link Tcollection }
+ *
+ */
+ public Tcollection getList()
+ {
+ return list;
+ }
+
+ /**
+ * Sets the value of the list property.
+ *
+ * @param value allowed object is {@link Tcollection }
+ *
+ */
+ public void setList(Tcollection value)
+ {
+ this.list = value;
+ }
+
+ /**
+ * Gets the value of the set property.
+ *
+ * @return possible object is {@link Tcollection }
+ *
+ */
+ public Tcollection getSet()
+ {
+ return set;
+ }
+
+ /**
+ * Sets the value of the set property.
+ *
+ * @param value allowed object is {@link Tcollection }
+ *
+ */
+ public void setSet(Tcollection value)
+ {
+ this.set = value;
+ }
+
+ /**
+ * Gets the value of the map property.
+ *
+ * @return possible object is {@link Tmap }
+ *
+ */
+ public Tmap getMap()
+ {
+ return map;
+ }
+
+ /**
+ * Sets the value of the map property.
+ *
+ * @param value allowed object is {@link Tmap }
+ *
+ */
+ public void setMap(Tmap value)
+ {
+ this.map = value;
+ }
+
+ /**
+ * Gets the value of the array property.
+ *
+ * @return possible object is {@link Tcollection }
+ *
+ */
+ public Tcollection getArray()
+ {
+ return array;
+ }
+
+ /**
+ * Sets the value of the array property.
+ *
+ * @param value allowed object is {@link Tcollection }
+ *
+ */
+ public void setArray(Tcollection value)
+ {
+ this.array = value;
+ }
+
+ /**
+ * Gets the value of the props property.
+ *
+ * @return possible object is {@link Tprops }
+ *
+ */
+ public Tprops getProps()
+ {
+ return props;
+ }
+
+ /**
+ * Sets the value of the props property.
+ *
+ * @param value allowed object is {@link Tprops }
+ *
+ */
+ public void setProps(Tprops value)
+ {
+ this.props = value;
+ }
+
+ /**
+ * Gets the value of the null property.
+ *
+ * @return possible object is {@link Tnull }
+ *
+ */
+ public Tnull getNull()
+ {
+ return _null;
+ }
+
+ /**
+ * Sets the value of the null property.
+ *
+ * @param value allowed object is {@link Tnull }
+ *
+ */
+ public void setNull(Tnull value)
+ {
+ this._null = value;
+ }
+
+ /**
+ * Gets the value of the key property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getKey()
+ {
+ return key;
+ }
+
+ /**
+ * Sets the value of the key property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setKey(String value)
+ {
+ this.key = value;
+ }
+
+ /**
+ * Gets the value of the keyRef property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getKeyRef()
+ {
+ return keyRef;
+ }
+
+ /**
+ * Sets the value of the keyRef property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setKeyRef(String value)
+ {
+ this.keyRef = value;
+ }
+
+ /**
+ * Gets the value of the valueFIXME property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getValueFIXME()
+ {
+ return valueFIXME;
+ }
+
+ /**
+ * Sets the value of the valueFIXME property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setValueFIXME(String value)
+ {
+ this.valueFIXME = value;
+ }
+
+ /**
+ * Gets the value of the valueRef property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getValueRef()
+ {
+ return valueRef;
+ }
+
+ /**
+ * Sets the value of the valueRef property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setValueRef(String value)
+ {
+ this.valueRef = value;
+ }
+
+}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tnull.java (from rev 90336, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tnull.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tnull.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tnull.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.parser.xb;
+
+// $Id$
+
+/**
+ *
+ *
+ * The definition for a <null> value type.
+ *
+ *
+ *
+ * <p>
+ * Java class for Tnull complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Tnull">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+public class Tnull
+{
+
+}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tprop.java (from rev 90336, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tprop.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tprop.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tprop.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -0,0 +1,123 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.parser.xb;
+
+// $Id$
+
+/**
+ * Tprop is a single property element for a <props> value type. The property value can be specified using either the attribute, or as value data for the property
+ * element.
+ * <p>
+ * Java class for Tprop complex type.
+ * <p>
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Tprop">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="key" use="required" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TstringValue" />
+ * <attribute name="value" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TstringValue" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ */
+public class Tprop
+{
+ protected String content;
+ protected String key;
+ protected String value;
+
+ /**
+ *
+ *
+ * Tprop is a single property element for a <props> value type. The property value can be specified using either the attribute, or as value data for the property
+ * element.
+ *
+ *
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getContent()
+ {
+ return content;
+ }
+
+ /**
+ * Sets the value of the content property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setContent(String value)
+ {
+ this.content = value;
+ }
+
+ /**
+ * Gets the value of the key property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getKey()
+ {
+ return key;
+ }
+
+ /**
+ * Sets the value of the key property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setKey(String value)
+ {
+ this.key = value;
+ }
+
+ /**
+ * Gets the value of the value property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getValue()
+ {
+ return value;
+ }
+
+ /**
+ * Sets the value of the value property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setValue(String value)
+ {
+ this.value = value;
+ }
+
+}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tproperty.java (from rev 90336, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tproperty.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tproperty.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tproperty.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -0,0 +1,550 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.parser.xb;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+
+/**
+ *
+ *
+ * A property that will be injected into a created <bean>
+ * component. The <property> elements correspond to named
+ * JavaBean setting methods for a created bean object.
+ *
+ * The value and ref attributes are convenience shortcuts to make
+ * the <argument> tag easier to code. A fuller set of injected
+ * values and types can be specified using one of the "value"
+ * type elements.
+ *
+ *
+ *
+ * <p>Java class for Tproperty complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Tproperty">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="description" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}String" minOccurs="0"/>
+ * <group ref="{http://www.osgi.org/xmlns/blueprint/v1.0.0}value"/>
+ * </sequence>
+ * <attribute name="name" use="required" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tmethod" />
+ * <attribute name="ref" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tidref" />
+ * <attribute name="valueFIXME" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TstringValue" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+public class Tproperty {
+
+ protected String description;
+ protected TService service;
+ protected TRefCollection refList;
+ protected TRefCollection refSet;
+ protected TBean bean;
+ protected TReference reference;
+ protected TRef refFIXME;
+ protected List<Object> any;
+ protected TRef idref;
+ protected Tvalue value;
+ protected Tcollection list;
+ protected Tcollection set;
+ protected Tmap map;
+ protected Tcollection array;
+ protected Tprops props;
+ protected Tnull _null;
+ protected String name;
+ protected String ref;
+ protected String valueFIXME;
+
+ /**
+ * Gets the value of the description property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * Sets the value of the description property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDescription(String value) {
+ this.description = value;
+ }
+
+ /**
+ * Gets the value of the service property.
+ *
+ * @return
+ * possible object is
+ * {@link TService }
+ *
+ */
+ public TService getService() {
+ return service;
+ }
+
+ /**
+ * Sets the value of the service property.
+ *
+ * @param value
+ * allowed object is
+ * {@link TService }
+ *
+ */
+ public void setService(TService value) {
+ this.service = value;
+ }
+
+ /**
+ * Gets the value of the refList property.
+ *
+ * @return
+ * possible object is
+ * {@link TRefCollection }
+ *
+ */
+ public TRefCollection getRefList() {
+ return refList;
+ }
+
+ /**
+ * Sets the value of the refList property.
+ *
+ * @param value
+ * allowed object is
+ * {@link TRefCollection }
+ *
+ */
+ public void setRefList(TRefCollection value) {
+ this.refList = value;
+ }
+
+ /**
+ * Gets the value of the refSet property.
+ *
+ * @return
+ * possible object is
+ * {@link TRefCollection }
+ *
+ */
+ public TRefCollection getRefSet() {
+ return refSet;
+ }
+
+ /**
+ * Sets the value of the refSet property.
+ *
+ * @param value
+ * allowed object is
+ * {@link TRefCollection }
+ *
+ */
+ public void setRefSet(TRefCollection value) {
+ this.refSet = value;
+ }
+
+ /**
+ * Gets the value of the bean property.
+ *
+ * @return
+ * possible object is
+ * {@link TBean }
+ *
+ */
+ public TBean getBean() {
+ return bean;
+ }
+
+ /**
+ * Sets the value of the bean property.
+ *
+ * @param value
+ * allowed object is
+ * {@link TBean }
+ *
+ */
+ public void setBean(TBean value) {
+ this.bean = value;
+ }
+
+ /**
+ * Gets the value of the reference property.
+ *
+ * @return
+ * possible object is
+ * {@link TReference }
+ *
+ */
+ public TReference getReference() {
+ return reference;
+ }
+
+ /**
+ * Sets the value of the reference property.
+ *
+ * @param value
+ * allowed object is
+ * {@link TReference }
+ *
+ */
+ public void setReference(TReference value) {
+ this.reference = value;
+ }
+
+ /**
+ * Gets the value of the refFIXME property.
+ *
+ * @return
+ * possible object is
+ * {@link TRef }
+ *
+ */
+ public TRef getRefFIXME() {
+ return refFIXME;
+ }
+
+ /**
+ * Sets the value of the refFIXME property.
+ *
+ * @param value
+ * allowed object is
+ * {@link TRef }
+ *
+ */
+ public void setRefFIXME(TRef value) {
+ this.refFIXME = value;
+ }
+
+ /**
+ * Gets the value of the any property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the any property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getAny().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link Object }
+ *
+ *
+ */
+ public List<Object> getAny() {
+ if (any == null) {
+ any = new ArrayList<Object>();
+ }
+ return this.any;
+ }
+
+ /**
+ * Gets the value of the idref property.
+ *
+ * @return
+ * possible object is
+ * {@link TRef }
+ *
+ */
+ public TRef getIdref() {
+ return idref;
+ }
+
+ /**
+ * Sets the value of the idref property.
+ *
+ * @param value
+ * allowed object is
+ * {@link TRef }
+ *
+ */
+ public void setIdref(TRef value) {
+ this.idref = value;
+ }
+
+ /**
+ * Gets the value of the value property.
+ *
+ * @return
+ * possible object is
+ * {@link Tvalue }
+ *
+ */
+ public Tvalue getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value of the value property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Tvalue }
+ *
+ */
+ public void setValue(Tvalue value) {
+ this.value = value;
+ }
+
+ /**
+ * Gets the value of the list property.
+ *
+ * @return
+ * possible object is
+ * {@link Tcollection }
+ *
+ */
+ public Tcollection getList() {
+ return list;
+ }
+
+ /**
+ * Sets the value of the list property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Tcollection }
+ *
+ */
+ public void setList(Tcollection value) {
+ this.list = value;
+ }
+
+ /**
+ * Gets the value of the set property.
+ *
+ * @return
+ * possible object is
+ * {@link Tcollection }
+ *
+ */
+ public Tcollection getSet() {
+ return set;
+ }
+
+ /**
+ * Sets the value of the set property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Tcollection }
+ *
+ */
+ public void setSet(Tcollection value) {
+ this.set = value;
+ }
+
+ /**
+ * Gets the value of the map property.
+ *
+ * @return
+ * possible object is
+ * {@link Tmap }
+ *
+ */
+ public Tmap getMap() {
+ return map;
+ }
+
+ /**
+ * Sets the value of the map property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Tmap }
+ *
+ */
+ public void setMap(Tmap value) {
+ this.map = value;
+ }
+
+ /**
+ * Gets the value of the array property.
+ *
+ * @return
+ * possible object is
+ * {@link Tcollection }
+ *
+ */
+ public Tcollection getArray() {
+ return array;
+ }
+
+ /**
+ * Sets the value of the array property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Tcollection }
+ *
+ */
+ public void setArray(Tcollection value) {
+ this.array = value;
+ }
+
+ /**
+ * Gets the value of the props property.
+ *
+ * @return
+ * possible object is
+ * {@link Tprops }
+ *
+ */
+ public Tprops getProps() {
+ return props;
+ }
+
+ /**
+ * Sets the value of the props property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Tprops }
+ *
+ */
+ public void setProps(Tprops value) {
+ this.props = value;
+ }
+
+ /**
+ * Gets the value of the null property.
+ *
+ * @return
+ * possible object is
+ * {@link Tnull }
+ *
+ */
+ public Tnull getNull() {
+ return _null;
+ }
+
+ /**
+ * Sets the value of the null property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Tnull }
+ *
+ */
+ public void setNull(Tnull value) {
+ this._null = value;
+ }
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+ /**
+ * Gets the value of the ref property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getRef() {
+ return ref;
+ }
+
+ /**
+ * Sets the value of the ref property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setRef(String value) {
+ this.ref = value;
+ }
+
+ /**
+ * Gets the value of the valueFIXME property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getValueFIXME() {
+ return valueFIXME;
+ }
+
+ /**
+ * Sets the value of the valueFIXME property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setValueFIXME(String value) {
+ this.valueFIXME = value;
+ }
+
+}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tprops.java (from rev 90336, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tprops.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tprops.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tprops.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -0,0 +1,90 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.parser.xb;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ *
+ *
+ * Tprops is the type used by the <props> value element. The prop elements are pairs of string-valued keys and values.
+ *
+ *
+ *
+ * <p>
+ * Java class for Tprops complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Tprops">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="prop" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tprop" maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+public class Tprops
+{
+
+ protected List<Tprop> prop;
+
+ /**
+ * Gets the value of the prop property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the
+ * JAXB object. This is why there is not a <CODE>set</CODE> method for the prop property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ *
+ * <pre>
+ * getProp().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list {@link Tprop }
+ *
+ *
+ */
+ public List<Tprop> getProp()
+ {
+ if (prop == null)
+ {
+ prop = new ArrayList<Tprop>();
+ }
+ return this.prop;
+ }
+
+}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TserviceProperties.java (from rev 90336, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TserviceProperties.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TserviceProperties.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TserviceProperties.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.parser.xb;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ *
+ *
+ * TserviceProperty is used for <service-properties> elements.
+ * The syntax is similar to what is defined for <map>, but keys must be
+ * string values and there are no type defaults that can be specified.
+ * created from the entry elements, which require a key/value pair.
+ *
+ *
+ *
+ * <p>Java class for TserviceProperties complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="TserviceProperties">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="entry" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TservicePropertyEntry" maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+public class TserviceProperties {
+
+ protected List<TServicePropertyEntry> entry;
+
+ /**
+ * Gets the value of the entry property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the entry property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getEntry().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link TServicePropertyEntry }
+ *
+ *
+ */
+ public List<TServicePropertyEntry> getEntry() {
+ if (entry == null) {
+ entry = new ArrayList<TServicePropertyEntry>();
+ }
+ return this.entry;
+ }
+
+}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TtypedCollection.java (from rev 90336, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TtypedCollection.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TtypedCollection.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TtypedCollection.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.parser.xb;
+
+// $Id$
+
+/**
+ * TtypeCollection defines comment attributes shared among different collection types that allow a default value type to be specified.
+ *
+ * <p>
+ * Java class for TtypedCollection complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="TtypedCollection">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="value-type" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tclass" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+public class TtypedCollection
+{
+
+ protected String valueType;
+
+ /**
+ * Gets the value of the valueType property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getValueType()
+ {
+ return valueType;
+ }
+
+ /**
+ * Sets the value of the valueType property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setValueType(String value)
+ {
+ this.valueType = value;
+ }
+
+}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tvalue.java (from rev 90336, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tvalue.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tvalue.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/Tvalue.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -0,0 +1,103 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.parser.xb;
+
+// $Id$
+
+/**
+ * Tvalue is the type used for <value> elements. The <value> element is used for types that can be created from a single string value. The string value is the data
+ * value for the element. The optional type attribute allows a target conversion value to be explicitly specified.
+ *
+ * <p>
+ * Java class for Tvalue complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Tvalue">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="type" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tclass" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+public class Tvalue
+{
+
+ protected String content;
+ protected String type;
+
+ /**
+ *
+ *
+ * Tvalue is the type used for <value> elements. The <value> element is used for types that can be created from a single string value. The string value is the data
+ * value for the element. The optional type attribute allows a target conversion value to be explicitly specified.
+ *
+ *
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getContent()
+ {
+ return content;
+ }
+
+ /**
+ * Sets the value of the content property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setContent(String value)
+ {
+ this.content = value;
+ }
+
+ /**
+ * Gets the value of the type property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getType()
+ {
+ return type;
+ }
+
+ /**
+ * Sets the value of the type property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setType(String value)
+ {
+ this.type = value;
+ }
+
+}
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/AutoExportModes.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/AutoExportModes.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/AutoExportModes.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -1,64 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, 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.blueprint.reflect;
-
-// $Id$
-
-/**
- * Java class for TautoExportModes.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 13-May-2009
- */
-public enum AutoExportModes
-{
-
- DISABLED("disabled"),
- INTERFACES("interfaces"),
- CLASS_HIERARCHY("class-hierarchy"),
- ALL_CLASSES("all-classes");
-
- private final String value;
-
- AutoExportModes(String v)
- {
- value = v;
- }
-
- public String value()
- {
- return value;
- }
-
- public static AutoExportModes fromValue(String v)
- {
- for (AutoExportModes c : AutoExportModes.values())
- {
- if (c.value.equals(v))
- {
- return c;
- }
- }
- throw new IllegalArgumentException(v);
- }
-
-}
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Availability.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Availability.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Availability.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -1,60 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, 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.blueprint.reflect;
-
-/**
- * Defines an availability attribute type. This is used in this
- * schema by the <blueprint> default-availability attribute and the
- * <reference>, <ref-set>, and <ref-list> availability attribute.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 13-May-2009
- */
-public enum Availability
-{
- MANDATORY("mandatory"),
- OPTIONAL("optional");
-
- private final String value;
-
- Availability(String v)
- {
- value = v;
- }
-
- public String value()
- {
- return value;
- }
-
- public static Availability fromValue(String v)
- {
- for (Availability c : Availability.values())
- {
- if (c.value.equals(v))
- {
- return c;
- }
- }
- throw new IllegalArgumentException(v);
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BeanMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BeanMetadataImpl.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BeanMetadataImpl.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -23,236 +23,74 @@
// $Id$
-import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
-import javax.xml.bind.JAXBElement;
-import javax.xml.namespace.QName;
+import org.jboss.osgi.blueprint.parser.xb.TBean;
+import org.jboss.osgi.spi.NotImplementedException;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.blueprint.reflect.BeanArgument;
+import org.osgi.service.blueprint.reflect.BeanMetadata;
+import org.osgi.service.blueprint.reflect.BeanProperty;
+import org.osgi.service.blueprint.reflect.Target;
/**
- * The type defintion for a <bean> component.
+ * Metadata for a Bean Component.
*
* @author thomas.diesler(a)jboss.com
* @since 13-May-2009
*/
-public class BeanMetadataImpl extends ComponentMetadataImpl
+public class BeanMetadataImpl extends ComponentMetadataImpl implements BeanMetadata
{
- protected String description;
- protected List<Object> argumentOrPropertyOrAny;
- protected String className;
- protected String initMethod;
- protected String destroyMethod;
- protected String factoryMethod;
- protected String factoryComponent;
- protected String scope;
- protected Boolean lazyInit;
- private Map<QName, String> otherAttributes = new HashMap<QName, String>();
-
- /**
- * Gets the value of the description property.
- */
- public String getDescription()
+ private TBean tBean;
+
+ public BeanMetadataImpl(BundleContext context, TBean tBean)
{
- return description;
+ super(context, tBean);
+ this.tBean = tBean;
}
- /**
- * Sets the value of the description property.
- */
- public void setDescription(String value)
+ public List<BeanArgument> getArguments()
{
- this.description = value;
+ throw new NotImplementedException();
}
- /**
- * Gets the value of the argumentOrPropertyOrAny property.
- *
- * <p>
- * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the
- * JAXB object. This is why there is not a <CODE>set</CODE> method for the argumentOrPropertyOrAny property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getArgumentOrPropertyOrAny().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list {@link Object } {@link JAXBElement }{@code <}{@link Targument }{@code >} {@link JAXBElement }{@code <}
- * {@link Tproperty }{@code >}
- *
- *
- */
- public List<Object> getArgumentOrPropertyOrAny()
- {
- if (argumentOrPropertyOrAny == null)
- {
- argumentOrPropertyOrAny = new ArrayList<Object>();
- }
- return this.argumentOrPropertyOrAny;
- }
-
- /**
- * Gets the value of the class property.
- */
public String getClassName()
{
- return className;
+ return tBean.getClassName();
}
- /**
- * Sets the value of the class property.
- */
- public void setClassName(String value)
- {
- this.className = value;
- }
-
- /**
- * Gets the value of the initMethod property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getInitMethod()
- {
- return initMethod;
- }
-
- /**
- * Sets the value of the initMethod property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setInitMethod(String value)
- {
- this.initMethod = value;
- }
-
- /**
- * Gets the value of the destroyMethod property.
- *
- * @return possible object is {@link String }
- *
- */
public String getDestroyMethod()
{
- return destroyMethod;
+ return tBean.getDestroyMethod();
}
- /**
- * Sets the value of the destroyMethod property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setDestroyMethod(String value)
+ public Target getFactoryComponent()
{
- this.destroyMethod = value;
+ throw new NotImplementedException();
}
- /**
- * Gets the value of the factoryMethod property.
- *
- * @return possible object is {@link String }
- *
- */
public String getFactoryMethod()
{
- return factoryMethod;
+ return tBean.getFactoryMethod();
}
- /**
- * Sets the value of the factoryMethod property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setFactoryMethod(String value)
+ public String getInitMethod()
{
- this.factoryMethod = value;
+ return tBean.getInitMethod();
}
- /**
- * Gets the value of the factoryComponent property.
- *
- */
- public String getFactoryComponentId()
+ public List<BeanProperty> getProperties()
{
- return factoryComponent;
+ throw new NotImplementedException();
}
- /**
- * Sets the value of the factoryComponent property.
- *
- */
- public void setFactoryComponentId(String value)
+ public Class<?> getRuntimeClass()
{
- this.factoryComponent = value;
+ throw new NotImplementedException();
}
- /**
- * Gets the value of the scope property.
- *
- * @return possible object is {@link String }
- *
- */
public String getScope()
{
- return scope;
+ return tBean.getScope();
}
-
- /**
- * Sets the value of the scope property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setScope(String value)
- {
- this.scope = value;
- }
-
- /**
- * Gets the value of the lazyInit property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public boolean isLazyInit()
- {
- return lazyInit;
- }
-
- /**
- * Sets the value of the lazyInit property.
- *
- * @param value allowed object is {@link Boolean }
- *
- */
- public void setLazyInit(boolean value)
- {
- this.lazyInit = value;
- }
-
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- *
- * <p>
- * the map is keyed by the name of the attribute and the value is the string value of the attribute.
- *
- * the map returned by this method is live, and you can add new attribute by updating the map directly. Because of this design, there's no setter.
- *
- *
- * @return always non-null
- */
- public Map<QName, String> getOtherAttributes()
- {
- return otherAttributes;
- }
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintMetadata.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintMetadata.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -23,106 +23,76 @@
// $Id$
-import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import java.util.Set;
-import javax.xml.namespace.QName;
-
+import org.jboss.osgi.blueprint.parser.xb.TBlueprint;
+import org.jboss.osgi.blueprint.parser.xb.TComponent;
import org.jboss.osgi.spi.NotImplementedException;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.blueprint.container.NoSuchComponentException;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
/**
* The blueprint element is the top element.
- *
- * The definitions consist of two sections:
- * the type-converter section and the components section.
*
+ * The definitions consist of two sections: the type-converter section and the components section.
+ *
* blueprint ::= <type-converters> component
* component ::= <bean> | <service> | service-reference
* service-reference ::= <reference> | <ref-list> | <ref-set>
- * type-converter ::= <bean> | <ref>
+ * type-converter ::= <bean> | <ref>
*
* @author thomas.diesler(a)jboss.com
* @since 13-May-2009
*/
public class BlueprintMetadata
{
- protected String description;
- protected TypeConverters typeConverters;
- protected List<ComponentMetadataImpl> components;
- protected Boolean defaultLazyInit;
- protected String defaultInitMethod;
- protected String defaultDestroyMethod;
- protected BigInteger defaultTimeout;
- protected Availability defaultAvailability;
- private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+ private BundleContext context;
- public void initialize()
- {
- if (typeConverters != null)
- typeConverters.resolveRefs(this);
- }
-
- /**
- * Gets the value of the description property.
- *
- */
- public String getDescription()
- {
- return description;
- }
+ private TBlueprint tBlueprint;
+ private Map<String, ComponentMetadata> components = new LinkedHashMap<String, ComponentMetadata>();
- /**
- * Sets the value of the description property.
- *
- */
- public void setDescription(String value)
+ public BlueprintMetadata(BundleContext context, TBlueprint tBlueprint)
{
- this.description = value;
+ this.context = context;
+ this.tBlueprint = tBlueprint;
}
- /**
- * Gets the value of the typeConverters property.
- *
- * @return possible object is {@link TypeConverters }
- *
- */
- public TypeConverters getTypeConverters()
+ public void initialize()
{
- return typeConverters;
+ ComponentFactory factory = new ComponentFactory(context);
+ for (TComponent tComp : tBlueprint.getComponents())
+ {
+ ComponentMetadata comp = factory.newComponent(tComp);
+ components.put(comp.getId(), comp);
+ }
}
- /**
- * Sets the value of the typeConverters property.
- *
- * @param value allowed object is {@link TypeConverters }
- *
- */
- public void setTypeConverters(TypeConverters value)
+ public Set<String> getComponentIds()
{
- this.typeConverters = value;
+ return Collections.unmodifiableSet(components.keySet());
}
- /**
- * Gets the value of components
- */
- public List<ComponentMetadataImpl> getComponents()
+ public ComponentMetadata getComponentMetadata(String name)
{
- if (components == null)
- components = new ArrayList<ComponentMetadataImpl>();
+ ComponentMetadata compMetadata = components.get(name);
+ if (compMetadata == null)
+ throw new NoSuchComponentException(name);
- return this.components;
+ return compMetadata;
}
@SuppressWarnings("unchecked")
- public <T extends ComponentMetadataImpl> Collection<T> getMetadata(Class<T> type)
+ public <T extends ComponentMetadata> Collection<T> getMetadata(Class<T> type)
{
List<T> compMetadata = new ArrayList<T>();
- for (ComponentMetadataImpl comp : components)
+ for (ComponentMetadata comp : components.values())
{
if (type.isAssignableFrom(comp.getClass()))
compMetadata.add((T)comp);
@@ -130,132 +100,6 @@
return Collections.unmodifiableList(compMetadata);
}
- /**
- * Gets the value of the defaultLazyInit property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isDefaultLazyInit()
- {
- return defaultLazyInit;
- }
-
- /**
- * Sets the value of the defaultLazyInit property.
- *
- * @param value allowed object is {@link Boolean }
- *
- */
- public void setDefaultLazyInit(Boolean value)
- {
- this.defaultLazyInit = value;
- }
-
- /**
- * Gets the value of the defaultInitMethod property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getDefaultInitMethod()
- {
- return defaultInitMethod;
- }
-
- /**
- * Sets the value of the defaultInitMethod property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setDefaultInitMethod(String value)
- {
- this.defaultInitMethod = value;
- }
-
- /**
- * Gets the value of the defaultDestroyMethod property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getDefaultDestroyMethod()
- {
- return defaultDestroyMethod;
- }
-
- /**
- * Sets the value of the defaultDestroyMethod property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setDefaultDestroyMethod(String value)
- {
- this.defaultDestroyMethod = value;
- }
-
- /**
- * Gets the value of the defaultTimeout property.
- */
- public BigInteger getDefaultTimeout()
- {
- if (defaultTimeout == null)
- defaultTimeout = new BigInteger("300000");
-
- return defaultTimeout;
- }
-
- /**
- * Sets the value of the defaultTimeout property.
- */
- public void setDefaultTimeout(BigInteger value)
- {
- this.defaultTimeout = value;
- }
-
- /**
- * Gets the value of the defaultAvailability property.
- *
- * @return possible object is {@link Tavailability }
- *
- */
- public Availability getDefaultAvailability()
- {
- if (defaultAvailability == null)
- defaultAvailability = Availability.MANDATORY;
-
- return defaultAvailability;
- }
-
- /**
- * Sets the value of the defaultAvailability property.
- *
- * @param value allowed object is {@link Tavailability }
- *
- */
- public void setDefaultAvailability(Availability value)
- {
- this.defaultAvailability = value;
- }
-
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- *
- * <p>
- * the map is keyed by the name of the attribute and the value is the string value of the attribute.
- *
- * the map returned by this method is live, and you can add new attribute by updating the map directly. Because of this design, there's no setter.
- *
- *
- * @return always non-null
- */
- public Map<QName, String> getOtherAttributes()
- {
- return otherAttributes;
- }
-
// Merge this Blueprint meta data with the given other, which may be null.
public BlueprintMetadata merge(BlueprintMetadata other)
{
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComparatorImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComparatorImpl.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComparatorImpl.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -1,92 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, 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.blueprint.reflect;
-
-//$Id$
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * <p>
- * Java class for Tcomparator complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="Tcomparator">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <group ref="{http://www.osgi.org/xmlns/blueprint/v1.0.0}targetComponent&quo...
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-public class ComparatorImpl
-{
- protected List<ComponentMetadataImpl> components;
- protected List<Object> any;
-
- public List<ComponentMetadataImpl> getComponents()
- {
- return components;
- }
-
- public void setComponents(List<ComponentMetadataImpl> components)
- {
- this.components = components;
- }
-
- /**
- * Gets the value of the any property.
- *
- * <p>
- * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the
- * JAXB object. This is why there is not a <CODE>set</CODE> method for the any property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getAny().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list {@link Object }
- *
- *
- */
- public List<Object> getAny()
- {
- if (any == null)
- {
- any = new ArrayList<Object>();
- }
- return this.any;
- }
-
-}
Added: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentFactory.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentFactory.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentFactory.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.reflect;
+
+// $Id$
+
+import org.jboss.osgi.blueprint.parser.xb.TBean;
+import org.jboss.osgi.blueprint.parser.xb.TComponent;
+import org.jboss.osgi.blueprint.parser.xb.TService;
+import org.jboss.osgi.blueprint.parser.xb.TServiceReference;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.blueprint.reflect.BeanMetadata;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+import org.osgi.service.blueprint.reflect.ServiceMetadata;
+import org.osgi.service.blueprint.reflect.ServiceReferenceMetadata;
+
+/**
+ * A factory for blueprint metadata objects
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2009
+ */
+class ComponentFactory
+{
+ private BundleContext context;
+ private int anonymousID;
+
+ ComponentFactory(BundleContext context)
+ {
+ this.context = context;
+ }
+
+ ComponentMetadata newComponent(TComponent tComp)
+ {
+ ComponentMetadata comp;
+
+ if (tComp.getId() == null)
+ tComp.setId(".anonymousId#" + (++anonymousID));
+
+ if (tComp instanceof TBean)
+ comp = newBeanMetadata((TBean)tComp);
+
+ else if (tComp instanceof TService)
+ comp = newServiceMetadata((TService)tComp);
+
+ else if (tComp instanceof TServiceReference)
+ comp = newServiceReferenceMetadata((TServiceReference)tComp);
+
+ else
+ throw new IllegalArgumentException("Unsupported component type: " + tComp);
+
+ return comp;
+ }
+
+ private BeanMetadata newBeanMetadata(TBean tComp)
+ {
+ return new BeanMetadataImpl(context, tComp);
+ }
+
+ private ServiceMetadata newServiceMetadata(TService tComp)
+ {
+ return new ServiceMetadataImpl(context, tComp);
+ }
+
+ private ServiceReferenceMetadata newServiceReferenceMetadata(TServiceReference tComp)
+ {
+ return new ServiceReferenceMetadataImpl(context, tComp);
+ }
+}
Property changes on: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentMetadataImpl.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentMetadataImpl.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -21,66 +21,41 @@
*/
package org.jboss.osgi.blueprint.reflect;
-//$Id$
+// $Id$
-import java.util.ArrayList;
import java.util.List;
+import org.jboss.osgi.blueprint.parser.xb.TComponent;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+
/**
- * The Component type is the base type for top-level
- * Blueprint components. The <bean> <reference>, <service>, <ref-set>, and <ref-list>
- * elements are all derived from the Component type.
+ * Base class for all components.
*
- * This type defines an id attributre that is used create references between different components.
- * Component elements can also be inlined within other component definitions.
- *
- * The id attribute is not valid when inliine.
- *
* @author thomas.diesler(a)jboss.com
* @since 13-May-2009
*/
-public abstract class ComponentMetadataImpl
+public class ComponentMetadataImpl implements ComponentMetadata
{
- protected String id;
- protected List<String> dependsOn;
- protected int initialization;
+ protected TComponent tComp;
- /**
- * Gets the value of the id property.
- */
- public String getId()
+ public ComponentMetadataImpl(BundleContext context, TComponent tComp)
{
- return id;
+ this.tComp = tComp;
}
- /**
- * Sets the value of the id property.
- */
- public void setId(String value)
- {
- this.id = value;
- }
-
public List<String> getDependsOn()
{
- if (dependsOn == null)
- dependsOn = new ArrayList<String>();
-
- return dependsOn;
+ return tComp.getDependsOn();
}
- public void setDependsOn(List<String> dependsOn)
+ public String getId()
{
- this.dependsOn = dependsOn;
+ return tComp.getId();
}
public int getInitialization()
{
- return initialization;
+ return tComp.getInitialization();
}
-
- public void setInitialization(int initialization)
- {
- this.initialization = initialization;
- }
}
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RefCollectionImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RefCollectionImpl.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RefCollectionImpl.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -1,165 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, 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.blueprint.reflect;
-
-//$Id$
-
-/**
- *
- *
- * The Tref-collection builds in the characteristics of the TserviceReference type to define characteristics of the <ref-set> and <ref-list> elements. This adds in the
- * characteristics that only apply to collections of references (e.g., sorting).
- *
- * <p>
- * Java class for Tref-collection complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="Tref-collection">
- * <complexContent>
- * <extension base="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TserviceReference&...
- * <sequence>
- * <element name="comparator" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tcomparator" minOccurs="0"/>
- * </sequence>
- * <attribute name="comparator-ref" type="{http://www.w3.org/2001/XMLSchema}token" />
- * <attribute name="member-type">
- * <simpleType>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
- * <enumeration value="service-instance"/>
- * <enumeration value="service-reference"/>
- * </restriction>
- * </simpleType>
- * </attribute>
- * <attribute name="ordering-basis">
- * <simpleType>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
- * <enumeration value="service"/>
- * <enumeration value="service-reference"/>
- * </restriction>
- * </simpleType>
- * </attribute>
- * <anyAttribute processContents='lax' namespace='##other'/>
- * </extension>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-public class RefCollectionImpl extends ServiceReferenceMetadataImpl
-{
- protected ComparatorImpl comparator;
- protected String comparatorRef;
- protected String memberType;
- protected String orderingBasis;
-
- /**
- * Gets the value of the comparator property.
- *
- * @return possible object is {@link ComparatorImpl }
- *
- */
- public ComparatorImpl getComparator()
- {
- return comparator;
- }
-
- /**
- * Sets the value of the comparator property.
- *
- * @param value allowed object is {@link ComparatorImpl }
- *
- */
- public void setComparator(ComparatorImpl value)
- {
- this.comparator = value;
- }
-
- /**
- * Gets the value of the comparatorRef property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getComparatorRef()
- {
- return comparatorRef;
- }
-
- /**
- * Sets the value of the comparatorRef property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setComparatorRef(String value)
- {
- this.comparatorRef = value;
- }
-
- /**
- * Gets the value of the memberType property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getMemberType()
- {
- return memberType;
- }
-
- /**
- * Sets the value of the memberType property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setMemberType(String value)
- {
- this.memberType = value;
- }
-
- /**
- * Gets the value of the orderingBasis property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getOrderingBasis()
- {
- return orderingBasis;
- }
-
- /**
- * Sets the value of the orderingBasis property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setOrderingBasis(String value)
- {
- this.orderingBasis = value;
- }
-
-}
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RefImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RefImpl.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RefImpl.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -1,77 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, 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.blueprint.reflect;
-
-//$Id$
-
-/**
- *
- *
- * Tref is the type used for <ref> elements. This specifies a required component id for the reference component.
- *
- *
- *
- * <p>
- * Java class for Tref complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="Tref">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <attribute name="component" use="required" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tidref" />
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-public class RefImpl
-{
- protected String component;
-
- /**
- * Gets the value of the component property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getComponent()
- {
- return component;
- }
-
- /**
- * Sets the value of the component property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setComponent(String value)
- {
- this.component = value;
- }
-
-}
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ReferenceListenerImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ReferenceListenerImpl.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ReferenceListenerImpl.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -1,229 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, 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.blueprint.reflect;
-
-//$Id$
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- *
- *
- * TReferenceListener defines a reference listener that is attached to a <reference>, <ref-set>, or <ref-list> element. The listener object can be specified as a <ref>
- * or as an inline <bean> or <reference> component. Listener events are mapped to the indicated bind or unbind methods.
- *
- *
- *
- * <p>
- * Java class for TReferenceListener complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="TReferenceListener">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <group ref="{http://www.osgi.org/xmlns/blueprint/v1.0.0}targetComponent&quo...
- * <attribute name="ref" type="{http://www.w3.org/2001/XMLSchema}token" />
- * <attribute name="bind-method" use="required" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tmethod" />
- * <attribute name="unbind-method" use="required" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tmethod" />
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-public class ReferenceListenerImpl
-{
- protected BeanMetadataImpl bean;
- protected ReferenceMetadataImpl reference;
- protected RefImpl refFIXME;
- protected List<Object> any;
- protected String ref;
- protected String bindMethod;
- protected String unbindMethod;
-
- /**
- * Gets the value of the bean property.
- *
- * @return possible object is {@link BeanMetadataImpl }
- *
- */
- public BeanMetadataImpl getBean()
- {
- return bean;
- }
-
- /**
- * Sets the value of the bean property.
- *
- * @param value allowed object is {@link BeanMetadataImpl }
- *
- */
- public void setBean(BeanMetadataImpl value)
- {
- this.bean = value;
- }
-
- /**
- * Gets the value of the reference property.
- *
- * @return possible object is {@link ReferenceMetadataImpl }
- *
- */
- public ReferenceMetadataImpl getReference()
- {
- return reference;
- }
-
- /**
- * Sets the value of the reference property.
- *
- * @param value allowed object is {@link ReferenceMetadataImpl }
- *
- */
- public void setReference(ReferenceMetadataImpl value)
- {
- this.reference = value;
- }
-
- /**
- * Gets the value of the refFIXME property.
- *
- * @return possible object is {@link RefImpl }
- *
- */
- public RefImpl getRefFIXME()
- {
- return refFIXME;
- }
-
- /**
- * Sets the value of the refFIXME property.
- *
- * @param value allowed object is {@link RefImpl }
- *
- */
- public void setRefFIXME(RefImpl value)
- {
- this.refFIXME = value;
- }
-
- /**
- * Gets the value of the any property.
- *
- * <p>
- * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the
- * JAXB object. This is why there is not a <CODE>set</CODE> method for the any property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getAny().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list {@link Object }
- *
- *
- */
- public List<Object> getAny()
- {
- if (any == null)
- {
- any = new ArrayList<Object>();
- }
- return this.any;
- }
-
- /**
- * Gets the value of the ref property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getRef()
- {
- return ref;
- }
-
- /**
- * Sets the value of the ref property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setRef(String value)
- {
- this.ref = value;
- }
-
- /**
- * Gets the value of the bindMethod property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getBindMethod()
- {
- return bindMethod;
- }
-
- /**
- * Sets the value of the bindMethod property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setBindMethod(String value)
- {
- this.bindMethod = value;
- }
-
- /**
- * Gets the value of the unbindMethod property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getUnbindMethod()
- {
- return unbindMethod;
- }
-
- /**
- * Sets the value of the unbindMethod property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setUnbindMethod(String value)
- {
- this.unbindMethod = value;
- }
-
-}
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ReferenceMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ReferenceMetadataImpl.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ReferenceMetadataImpl.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -1,78 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, 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.blueprint.reflect;
-
-// $Id$
-
-import java.math.BigInteger;
-
-/**
- *
- *
- * The Treference type defines the <reference> element. These
- * are instances of the TserviceReference type, with the addition
- * of a timeout attribute. If the timeout is not specified,
- * the default-timeout value is inherited from the encapsulating
- * <blueprint> definition.
- *
- *
- *
- * <p>Java class for Treference complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="Treference">
- * <complexContent>
- * <extension base="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TserviceReference">
- * <attribute name="timeout" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Ttimeout" />
- * <anyAttribute processContents='lax' namespace='##other'/>
- * </extension>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-public class ReferenceMetadataImpl extends ServiceReferenceMetadataImpl
-{
- protected BigInteger timeout;
-
- /*
- * Gets the value of the timeout property.
- * @return possible object is {@link BigInteger }
- */
- public long getTimeout()
- {
- return timeout.longValue();
- }
-
- /*
- * Sets the value of the timeout property.
- * @param value allowed object is {@link BigInteger }
- */
- public void setTimeout(BigInteger value)
- {
- this.timeout = value;
- }
-
-}
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RegistrationListenerImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RegistrationListenerImpl.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RegistrationListenerImpl.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -1,230 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, 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.blueprint.reflect;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- *
- *
- * A registration listener definition. The target registration listener can be either a <ref> to a <bean> or <service> component, or an inline <bean> or <service>
- * component definition. The registration-method and unregistration-method attributes define the methods that will be called for the respective events.
- *
- * For the very common case of using a <ref> to a listener component, the ref attribute may also be used as a shortcut.
- *
- *
- *
- * <p>
- * Java class for TregistrationListener complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="TregistrationListener">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <group ref="{http://www.osgi.org/xmlns/blueprint/v1.0.0}targetComponent&quo...
- * <attribute name="ref" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tidref" />
- * <attribute name="registration-method" use="required" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tmethod" />
- * <attribute name="unregistration-method" use="required" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tmethod" />
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-public class RegistrationListenerImpl
-{
- protected BeanMetadataImpl bean;
- protected ReferenceMetadataImpl reference;
- protected RefImpl refFIXME;
- protected List<Object> any;
- protected String ref;
- protected String registrationMethod;
- protected String unregistrationMethod;
-
- /**
- * Gets the value of the bean property.
- *
- * @return possible object is {@link BeanMetadataImpl }
- *
- */
- public BeanMetadataImpl getBean()
- {
- return bean;
- }
-
- /**
- * Sets the value of the bean property.
- *
- * @param value allowed object is {@link BeanMetadataImpl }
- *
- */
- public void setBean(BeanMetadataImpl value)
- {
- this.bean = value;
- }
-
- /**
- * Gets the value of the reference property.
- *
- * @return possible object is {@link ReferenceMetadataImpl }
- *
- */
- public ReferenceMetadataImpl getReference()
- {
- return reference;
- }
-
- /**
- * Sets the value of the reference property.
- *
- * @param value allowed object is {@link ReferenceMetadataImpl }
- *
- */
- public void setReference(ReferenceMetadataImpl value)
- {
- this.reference = value;
- }
-
- /**
- * Gets the value of the refFIXME property.
- *
- * @return possible object is {@link RefImpl }
- *
- */
- public RefImpl getRefFIXME()
- {
- return refFIXME;
- }
-
- /**
- * Sets the value of the refFIXME property.
- *
- * @param value allowed object is {@link RefImpl }
- *
- */
- public void setRefFIXME(RefImpl value)
- {
- this.refFIXME = value;
- }
-
- /**
- * Gets the value of the any property.
- *
- * <p>
- * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the
- * JAXB object. This is why there is not a <CODE>set</CODE> method for the any property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getAny().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list {@link Object }
- *
- *
- */
- public List<Object> getAny()
- {
- if (any == null)
- {
- any = new ArrayList<Object>();
- }
- return this.any;
- }
-
- /**
- * Gets the value of the ref property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getRef()
- {
- return ref;
- }
-
- /**
- * Sets the value of the ref property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setRef(String value)
- {
- this.ref = value;
- }
-
- /**
- * Gets the value of the registrationMethod property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getRegistrationMethod()
- {
- return registrationMethod;
- }
-
- /**
- * Sets the value of the registrationMethod property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setRegistrationMethod(String value)
- {
- this.registrationMethod = value;
- }
-
- /**
- * Gets the value of the unregistrationMethod property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getUnregistrationMethod()
- {
- return unregistrationMethod;
- }
-
- /**
- * Sets the value of the unregistrationMethod property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setUnregistrationMethod(String value)
- {
- this.unregistrationMethod = value;
- }
-}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -23,220 +23,71 @@
// $Id$
-import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
-import javax.xml.namespace.QName;
+import org.jboss.osgi.blueprint.parser.xb.TAutoExportModes;
+import org.jboss.osgi.blueprint.parser.xb.TService;
+import org.jboss.osgi.spi.NotImplementedException;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.blueprint.reflect.MapEntry;
+import org.osgi.service.blueprint.reflect.RegistrationListener;
+import org.osgi.service.blueprint.reflect.ServiceMetadata;
+import org.osgi.service.blueprint.reflect.Target;
/**
- * Tservice is the type for services exported by this blueprint bundle. Services are sourced by either a <ref> to a <bean> component or an <inline> bean component.
+ * Metadata representing a service to be exported by a module context.
*
* @author thomas.diesler(a)jboss.com
* @since 13-May-2009
*/
-public class ServiceMetadataImpl extends ComponentMetadataImpl
+public class ServiceMetadataImpl extends ComponentMetadataImpl implements ServiceMetadata
{
- protected String description;
- protected List<String> interfaceNames;
- protected List<ServicePropertyEntry> serviceProperties;
- protected Collection<RegistrationListenerImpl> registrationListener;
- protected BeanMetadataImpl bean;
- protected List<Object> any;
- protected String ref;
- protected AutoExportModes autoExportMode;
- protected int ranking;
- private Map<QName, String> otherAttributes = new HashMap<QName, String>();
-
- /**
- * Gets the value of the description property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getDescription()
+ private TService tService;
+
+ public ServiceMetadataImpl(BundleContext context, TService tService)
{
- return description;
+ super(context, tService);
+ this.tService = tService;
}
- /**
- * Sets the value of the description property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setDescription(String value)
- {
- this.description = value;
- }
-
- /**
- * Gets the value of the interfaces property.
- */
- public List<String> getInterfaceNames()
- {
- if (interfaceNames == null)
- interfaceNames = new ArrayList<String>();
-
- return interfaceNames;
- }
-
- public void setInterfaceNames(List<String> interfaces)
- {
- this.interfaceNames = interfaces;
- }
-
- /**
- * Gets the value of the serviceProperties property.
- */
- public List<ServicePropertyEntry> getServiceProperties()
- {
- if (serviceProperties == null)
- serviceProperties = new ArrayList<ServicePropertyEntry>();
-
- return serviceProperties;
- }
-
- public void setServiceProperties(List<ServicePropertyEntry> serviceProperties)
- {
- this.serviceProperties = serviceProperties;
- }
-
- /**
- * Gets the value of the registrationListener property.
- */
- public Collection<RegistrationListenerImpl> getRegistrationListeners()
- {
- if (registrationListener == null)
- registrationListener = new ArrayList<RegistrationListenerImpl>();
-
- return registrationListener;
- }
-
- public void setRegistrationListeners(Collection<RegistrationListenerImpl> registrationListener)
- {
- this.registrationListener = registrationListener;
- }
-
- /**
- * Gets the value of the bean property.
- *
- * @return possible object is {@link BeanMetadataImpl }
- *
- */
- public BeanMetadataImpl getBean()
- {
- return bean;
- }
-
- /**
- * Sets the value of the bean property.
- *
- * @param value allowed object is {@link BeanMetadataImpl }
- *
- */
- public void setBean(BeanMetadataImpl value)
- {
- this.bean = value;
- }
-
- /**
- * Gets the value of the any property.
- */
- public List<Object> getAny()
- {
- if (any == null)
- {
- any = new ArrayList<Object>();
- }
- return this.any;
- }
-
- /**
- * Gets the value of the ref property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getRef()
- {
- return ref;
- }
-
- /**
- * Sets the value of the ref property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setRef(String value)
- {
- this.ref = value;
- }
-
- /**
- * Gets the value of the autoExport property.
- *
- * @return possible object is {@link AutoExportModes }
- */
- public AutoExportModes getAutoExportMode()
- {
- if (autoExportMode == null)
- autoExportMode = AutoExportModes.DISABLED;
-
- return autoExportMode;
- }
-
- /**
- * Sets the value of the autoExport property.
- *
- * @param value allowed object is {@link AutoExportModes }
- */
- public void setAutoExportMode(AutoExportModes value)
- {
- this.autoExportMode = value;
- }
-
- /*
public int getAutoExport()
{
int modeValue = AUTO_EXPORT_DISABLED;
+ TAutoExportModes mode = tService.getAutoExportMode();
- AutoExportModes mode = getAutoExportMode();
- if (mode == AutoExportModes.ALL_CLASSES)
+ if (mode == TAutoExportModes.ALL_CLASSES)
modeValue = AUTO_EXPORT_ALL_CLASSES;
- else if (mode == AutoExportModes.CLASS_HIERARCHY)
+ else if (mode == TAutoExportModes.CLASS_HIERARCHY)
modeValue = AUTO_EXPORT_CLASS_HIERARCHY;
- else if (mode == AutoExportModes.INTERFACES)
+ else if (mode == TAutoExportModes.INTERFACES)
modeValue = AUTO_EXPORT_INTERFACES;
return modeValue;
}
- */
- /**
- * Gets the value of the ranking property.
- */
+ public List<String> getInterfaces()
+ {
+ return tService.getInterfaceNames();
+ }
+
public int getRanking()
{
- return ranking;
+ return tService.getRanking();
}
- /**
- * Sets the value of the ranking property.
- */
- public void setRanking(int value)
+ public Collection<RegistrationListener> getRegistrationListeners()
{
- this.ranking = value;
+ throw new NotImplementedException();
}
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- */
- public Map<QName, String> getOtherAttributes()
+ public Target getServiceComponent()
{
- return otherAttributes;
+ throw new NotImplementedException();
}
+
+ public List<MapEntry> getServiceProperties()
+ {
+ throw new NotImplementedException();
+ }
}
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServicePropertyEntry.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServicePropertyEntry.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServicePropertyEntry.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -1,40 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-793
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.05.13 at 02:16:52 PM CEST
-//
-
-package org.jboss.osgi.blueprint.reflect;
-
-/**
- * TservicePropertyEntry is an entry value used for the <service-properties> element. This does not allow a child <key> element and there are no key-ref or value-ref
- * attributes.
- *
- */
-public class ServicePropertyEntry
-{
- protected String key;
- protected String value;
-
- public String getKey()
- {
- return key;
- }
-
- public void setKey(String key)
- {
- this.key = key;
- }
-
- public String getValue()
- {
- return value;
- }
-
- public void setValue(String value)
- {
- this.value = value;
- }
-
-}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -23,206 +23,63 @@
// $Id$
-import java.util.ArrayList;
-import java.util.HashMap;
+import java.util.Collection;
import java.util.List;
-import java.util.Map;
-import javax.xml.namespace.QName;
+import org.jboss.osgi.blueprint.parser.xb.TAvailability;
+import org.jboss.osgi.blueprint.parser.xb.TServiceReference;
+import org.jboss.osgi.spi.NotImplementedException;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.blueprint.reflect.ReferenceListener;
+import org.osgi.service.blueprint.reflect.ServiceReferenceMetadata;
/**
- * TserviceReference is the base element type used for <reference>, <ref-set>, and <ref-list> elements. This type defines all of the characteristics common to both
- * sorts of references.
+ * Metadata representing a service to be exported by a module context.
*
- * <p>
- * Java class for TserviceReference complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="TserviceReference">
- * <complexContent>
- * <extension base="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tcomponent">
- * <sequence>
- * <element name="description" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}String" minOccurs="0"/>
- * <element name="interfaces" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tinterfaces" minOccurs="0"/>
- * <element name="listener" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TReferenceListener... maxOccurs="unbounded" minOccurs="0"/>
- * <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- * </sequence>
- * <attribute name="interface" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tclass" />
- * <attribute name="filter" type="{http://www.w3.org/2001/XMLSchema}normalizedString" />
- * <attribute name="component-name" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tidref" />
- * <attribute name="availability" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tavailability" />
- * <anyAttribute processContents='lax' namespace='##other'/>
- * </extension>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
+ * @author thomas.diesler(a)jboss.com
+ * @since 13-May-2009
*/
-public class ServiceReferenceMetadataImpl extends ComponentMetadataImpl
+public class ServiceReferenceMetadataImpl extends ComponentMetadataImpl implements ServiceReferenceMetadata
{
- protected String description;
- protected List<String> interfaceNames;
- protected List<ReferenceListenerImpl> listener;
- protected List<Object> any;
- protected String filter;
- protected String componentName;
- protected Availability availability;
- private Map<QName, String> otherAttributes = new HashMap<QName, String>();
-
- /**
- * Gets the value of the description property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getDescription()
+ private TServiceReference tService;
+
+ public ServiceReferenceMetadataImpl(BundleContext context, TServiceReference tService)
{
- return description;
+ super(context, tService);
+ this.tService = tService;
}
- /**
- * Sets the value of the description property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setDescription(String value)
+ public int getAvailability()
{
- this.description = value;
- }
-
- /**
- * Gets the value of the interfaces property.
- *
- */
- public List<String> getInterfaceNames()
- {
- if (interfaceNames == null)
- interfaceNames = new ArrayList<String>();
+ int availability = AVAILABILITY_OPTIONAL;
- return interfaceNames;
- }
-
- public void setInterfaceNames(List<String> interfaces)
- {
- this.interfaceNames = interfaces;
- }
-
- public String getInterface()
- {
- List<String> interfaces = getInterfaceNames();
- if (interfaces.size() == 0)
- throw new IllegalStateException("Empty list of interfaces");
-
- return interfaces.get(0);
- }
-
- /**
- * Gets the value of the listener property.
- */
- public List<ReferenceListenerImpl> getReferenceListeners()
- {
- if (listener == null)
- listener = new ArrayList<ReferenceListenerImpl>();
+ if (tService.getAvailability() == TAvailability.MANDATORY)
+ availability = AVAILABILITY_MANDATORY;
- return this.listener;
+ return availability;
}
- public void setReferenceListeners(List<ReferenceListenerImpl> listener)
+ public String getComponentName()
{
- this.listener = listener;
+ return tService.getComponentName();
}
- /**
- * Gets the value of the any property.
- */
- public List<Object> getAny()
- {
- if (any == null)
- {
- any = new ArrayList<Object>();
- }
- return this.any;
- }
-
- /**
- * Gets the value of the filter property.
- *
- * @return possible object is {@link String }
- *
- */
public String getFilter()
{
- return filter;
+ return tService.getFilter();
}
- /**
- * Sets the value of the filter property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setFilter(String value)
+ public String getInterface()
{
- this.filter = value;
- }
-
- /**
- * Gets the value of the componentName property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getComponentName()
- {
- return componentName;
- }
-
- /**
- * Sets the value of the componentName property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setComponentName(String value)
- {
- this.componentName = value;
- }
-
- /**
- * Gets the value of the availability property.
- *
- * @return possible object is {@link Tavailability }
- *
- */
- public Availability getAvailability()
- {
- if (availability == null)
- availability = Availability.OPTIONAL;
+ List<String> interfaceNames = tService.getInterfaceNames();
+ if (interfaceNames.size() == 0)
+ throw new IllegalStateException("Empty list of interfaces");
- return availability;
+ return interfaceNames.get(0);
}
- /**
- * Sets the value of the availability property.
- *
- * @param value allowed object is {@link Tavailability }
- *
- */
- public void setAvailability(Availability value)
+ public Collection<ReferenceListener> getReferenceListeners()
{
- this.availability = value;
+ throw new NotImplementedException();
}
-
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- */
- public Map<QName, String> getOtherAttributes()
- {
- return otherAttributes;
- }
}
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Targument.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Targument.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Targument.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -1,567 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-793
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.05.13 at 02:16:52 PM CEST
-//
-
-
-package org.jboss.osgi.blueprint.reflect;
-
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- *
- *
- * An argument used to create an object defined by a <bean>
- * component. The <argument> elements are the arguments for the
- * bean class constructor or passed to the bean factory method.
- *
- * The type, if specified, is used to disambiguate the constructor
- * or method signature. Arguments may also be matched up with
- * arguments by explicitly specifying the index position. If the
- * index is used, then all <argument> elements for the bean must
- * also specify the index.
- *
- * The value and ref attributes are convenience shortcuts to make
- * the <argument> tag easier to code. A fuller set of injected
- * values and types can be specified using one of the "value"
- * type elements.
- *
- *
- *
- * <p>Java class for Targument complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="Targument">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="description" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}String" minOccurs="0"/>
- * <group ref="{http://www.osgi.org/xmlns/blueprint/v1.0.0}value"/>
- * </sequence>
- * <attribute name="index" type="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger" />
- * <attribute name="type" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tclass" />
- * <attribute name="ref" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tidref" />
- * <attribute name="valueFIXME" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TstringValue" />
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-public class Targument {
-
- protected String description;
- protected ServiceMetadataImpl service;
- protected RefCollectionImpl refList;
- protected RefCollectionImpl refSet;
- protected BeanMetadataImpl bean;
- protected ReferenceMetadataImpl reference;
- protected RefImpl refFIXME;
- protected List<Object> any;
- protected RefImpl idref;
- protected Tvalue value;
- protected Tcollection list;
- protected Tcollection set;
- protected Tmap map;
- protected Tcollection array;
- protected Tprops props;
- protected Tnull _null;
- protected BigInteger index;
- protected String type;
- protected String ref;
- protected String valueFIXME;
-
- /**
- * Gets the value of the description property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * Sets the value of the description property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setDescription(String value) {
- this.description = value;
- }
-
- /**
- * Gets the value of the service property.
- *
- * @return
- * possible object is
- * {@link ServiceMetadataImpl }
- *
- */
- public ServiceMetadataImpl getService() {
- return service;
- }
-
- /**
- * Sets the value of the service property.
- *
- * @param value
- * allowed object is
- * {@link ServiceMetadataImpl }
- *
- */
- public void setService(ServiceMetadataImpl value) {
- this.service = value;
- }
-
- /**
- * Gets the value of the refList property.
- *
- * @return
- * possible object is
- * {@link RefCollectionImpl }
- *
- */
- public RefCollectionImpl getRefList() {
- return refList;
- }
-
- /**
- * Sets the value of the refList property.
- *
- * @param value
- * allowed object is
- * {@link RefCollectionImpl }
- *
- */
- public void setRefList(RefCollectionImpl value) {
- this.refList = value;
- }
-
- /**
- * Gets the value of the refSet property.
- *
- * @return
- * possible object is
- * {@link RefCollectionImpl }
- *
- */
- public RefCollectionImpl getRefSet() {
- return refSet;
- }
-
- /**
- * Sets the value of the refSet property.
- *
- * @param value
- * allowed object is
- * {@link RefCollectionImpl }
- *
- */
- public void setRefSet(RefCollectionImpl value) {
- this.refSet = value;
- }
-
- /**
- * Gets the value of the bean property.
- *
- * @return
- * possible object is
- * {@link BeanMetadataImpl }
- *
- */
- public BeanMetadataImpl getBean() {
- return bean;
- }
-
- /**
- * Sets the value of the bean property.
- *
- * @param value
- * allowed object is
- * {@link BeanMetadataImpl }
- *
- */
- public void setBean(BeanMetadataImpl value) {
- this.bean = value;
- }
-
- /**
- * Gets the value of the reference property.
- *
- * @return
- * possible object is
- * {@link ReferenceMetadataImpl }
- *
- */
- public ReferenceMetadataImpl getReference() {
- return reference;
- }
-
- /**
- * Sets the value of the reference property.
- *
- * @param value
- * allowed object is
- * {@link ReferenceMetadataImpl }
- *
- */
- public void setReference(ReferenceMetadataImpl value) {
- this.reference = value;
- }
-
- /**
- * Gets the value of the refFIXME property.
- *
- * @return
- * possible object is
- * {@link RefImpl }
- *
- */
- public RefImpl getRefFIXME() {
- return refFIXME;
- }
-
- /**
- * Sets the value of the refFIXME property.
- *
- * @param value
- * allowed object is
- * {@link RefImpl }
- *
- */
- public void setRefFIXME(RefImpl value) {
- this.refFIXME = value;
- }
-
- /**
- * Gets the value of the any property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the any property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getAny().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Object }
- *
- *
- */
- public List<Object> getAny() {
- if (any == null) {
- any = new ArrayList<Object>();
- }
- return this.any;
- }
-
- /**
- * Gets the value of the idref property.
- *
- * @return
- * possible object is
- * {@link RefImpl }
- *
- */
- public RefImpl getIdref() {
- return idref;
- }
-
- /**
- * Sets the value of the idref property.
- *
- * @param value
- * allowed object is
- * {@link RefImpl }
- *
- */
- public void setIdref(RefImpl value) {
- this.idref = value;
- }
-
- /**
- * Gets the value of the value property.
- *
- * @return
- * possible object is
- * {@link Tvalue }
- *
- */
- public Tvalue getValue() {
- return value;
- }
-
- /**
- * Sets the value of the value property.
- *
- * @param value
- * allowed object is
- * {@link Tvalue }
- *
- */
- public void setValue(Tvalue value) {
- this.value = value;
- }
-
- /**
- * Gets the value of the list property.
- *
- * @return
- * possible object is
- * {@link Tcollection }
- *
- */
- public Tcollection getList() {
- return list;
- }
-
- /**
- * Sets the value of the list property.
- *
- * @param value
- * allowed object is
- * {@link Tcollection }
- *
- */
- public void setList(Tcollection value) {
- this.list = value;
- }
-
- /**
- * Gets the value of the set property.
- *
- * @return
- * possible object is
- * {@link Tcollection }
- *
- */
- public Tcollection getSet() {
- return set;
- }
-
- /**
- * Sets the value of the set property.
- *
- * @param value
- * allowed object is
- * {@link Tcollection }
- *
- */
- public void setSet(Tcollection value) {
- this.set = value;
- }
-
- /**
- * Gets the value of the map property.
- *
- * @return
- * possible object is
- * {@link Tmap }
- *
- */
- public Tmap getMap() {
- return map;
- }
-
- /**
- * Sets the value of the map property.
- *
- * @param value
- * allowed object is
- * {@link Tmap }
- *
- */
- public void setMap(Tmap value) {
- this.map = value;
- }
-
- /**
- * Gets the value of the array property.
- *
- * @return
- * possible object is
- * {@link Tcollection }
- *
- */
- public Tcollection getArray() {
- return array;
- }
-
- /**
- * Sets the value of the array property.
- *
- * @param value
- * allowed object is
- * {@link Tcollection }
- *
- */
- public void setArray(Tcollection value) {
- this.array = value;
- }
-
- /**
- * Gets the value of the props property.
- *
- * @return
- * possible object is
- * {@link Tprops }
- *
- */
- public Tprops getProps() {
- return props;
- }
-
- /**
- * Sets the value of the props property.
- *
- * @param value
- * allowed object is
- * {@link Tprops }
- *
- */
- public void setProps(Tprops value) {
- this.props = value;
- }
-
- /**
- * Gets the value of the null property.
- *
- * @return
- * possible object is
- * {@link Tnull }
- *
- */
- public Tnull getNull() {
- return _null;
- }
-
- /**
- * Sets the value of the null property.
- *
- * @param value
- * allowed object is
- * {@link Tnull }
- *
- */
- public void setNull(Tnull value) {
- this._null = value;
- }
-
- /**
- * Gets the value of the index property.
- *
- * @return
- * possible object is
- * {@link BigInteger }
- *
- */
- public BigInteger getIndex() {
- return index;
- }
-
- /**
- * Sets the value of the index property.
- *
- * @param value
- * allowed object is
- * {@link BigInteger }
- *
- */
- public void setIndex(BigInteger value) {
- this.index = value;
- }
-
- /**
- * Gets the value of the type property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getType() {
- return type;
- }
-
- /**
- * Sets the value of the type property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setType(String value) {
- this.type = value;
- }
-
- /**
- * Gets the value of the ref property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getRef() {
- return ref;
- }
-
- /**
- * Sets the value of the ref property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setRef(String value) {
- this.ref = value;
- }
-
- /**
- * Gets the value of the valueFIXME property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getValueFIXME() {
- return valueFIXME;
- }
-
- /**
- * Sets the value of the valueFIXME property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setValueFIXME(String value) {
- this.valueFIXME = value;
- }
-
-}
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tcollection.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tcollection.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tcollection.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -1,87 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-793
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.05.13 at 02:16:52 PM CEST
-//
-
-
-package org.jboss.osgi.blueprint.reflect;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- *
- *
- * Tcollection is the base schema type for different ordered collection
- * types. This is shared between the <array>, <list>, and <set> elements.
- *
- *
- *
- * <p>Java class for Tcollection complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="Tcollection">
- * <complexContent>
- * <extension base="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TtypedCollection">
- * <group ref="{http://www.osgi.org/xmlns/blueprint/v1.0.0}value" maxOccurs="unbounded" minOccurs="0"/>
- * </extension>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-public class Tcollection
- extends TtypedCollection
-{
- protected List<Object> value;
-
- /**
- * Gets the value of the value property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the value property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getValue().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link JAXBElement }{@code <}{@link Tvalue }{@code >}
- * {@link JAXBElement }{@code <}{@link ServiceMetadataImpl }{@code >}
- * {@link JAXBElement }{@code <}{@link RefImpl }{@code >}
- * {@link JAXBElement }{@code <}{@link ReferenceMetadataImpl }{@code >}
- * {@link JAXBElement }{@code <}{@link RefImpl }{@code >}
- * {@link JAXBElement }{@code <}{@link Tmap }{@code >}
- * {@link JAXBElement }{@code <}{@link BeanMetadataImpl }{@code >}
- * {@link JAXBElement }{@code <}{@link Tnull }{@code >}
- * {@link JAXBElement }{@code <}{@link RefCollectionImpl }{@code >}
- * {@link JAXBElement }{@code <}{@link RefCollectionImpl }{@code >}
- * {@link JAXBElement }{@code <}{@link Tcollection }{@code >}
- * {@link Object }
- * {@link JAXBElement }{@code <}{@link Tcollection }{@code >}
- * {@link JAXBElement }{@code <}{@link Tcollection }{@code >}
- * {@link JAXBElement }{@code <}{@link Tprops }{@code >}
- *
- *
- */
- public List<Object> getValue() {
- if (value == null) {
- value = new ArrayList<Object>();
- }
- return this.value;
- }
-
-}
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tkey.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tkey.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tkey.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -1,398 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-793
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.05.13 at 02:16:52 PM CEST
-//
-
-
-package org.jboss.osgi.blueprint.reflect;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- *
- *
- * The Tkey type defines the element types that are permitted
- * for Map key situations. These can be any of the "value"
- * types other than the <null> element.
- *
- *
- *
- * <p>Java class for Tkey complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="Tkey">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <group ref="{http://www.osgi.org/xmlns/blueprint/v1.0.0}nonNullValue"/>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-public class Tkey {
-
- protected ServiceMetadataImpl service;
- protected RefCollectionImpl refList;
- protected RefCollectionImpl refSet;
- protected BeanMetadataImpl bean;
- protected ReferenceMetadataImpl reference;
- protected RefImpl refFIXME;
- protected List<Object> any;
- protected RefImpl idref;
- protected Tvalue value;
- protected Tcollection list;
- protected Tcollection set;
- protected Tmap map;
- protected Tcollection array;
- protected Tprops props;
-
- /**
- * Gets the value of the service property.
- *
- * @return
- * possible object is
- * {@link ServiceMetadataImpl }
- *
- */
- public ServiceMetadataImpl getService() {
- return service;
- }
-
- /**
- * Sets the value of the service property.
- *
- * @param value
- * allowed object is
- * {@link ServiceMetadataImpl }
- *
- */
- public void setService(ServiceMetadataImpl value) {
- this.service = value;
- }
-
- /**
- * Gets the value of the refList property.
- *
- * @return
- * possible object is
- * {@link RefCollectionImpl }
- *
- */
- public RefCollectionImpl getRefList() {
- return refList;
- }
-
- /**
- * Sets the value of the refList property.
- *
- * @param value
- * allowed object is
- * {@link RefCollectionImpl }
- *
- */
- public void setRefList(RefCollectionImpl value) {
- this.refList = value;
- }
-
- /**
- * Gets the value of the refSet property.
- *
- * @return
- * possible object is
- * {@link RefCollectionImpl }
- *
- */
- public RefCollectionImpl getRefSet() {
- return refSet;
- }
-
- /**
- * Sets the value of the refSet property.
- *
- * @param value
- * allowed object is
- * {@link RefCollectionImpl }
- *
- */
- public void setRefSet(RefCollectionImpl value) {
- this.refSet = value;
- }
-
- /**
- * Gets the value of the bean property.
- *
- * @return
- * possible object is
- * {@link BeanMetadataImpl }
- *
- */
- public BeanMetadataImpl getBean() {
- return bean;
- }
-
- /**
- * Sets the value of the bean property.
- *
- * @param value
- * allowed object is
- * {@link BeanMetadataImpl }
- *
- */
- public void setBean(BeanMetadataImpl value) {
- this.bean = value;
- }
-
- /**
- * Gets the value of the reference property.
- *
- * @return
- * possible object is
- * {@link ReferenceMetadataImpl }
- *
- */
- public ReferenceMetadataImpl getReference() {
- return reference;
- }
-
- /**
- * Sets the value of the reference property.
- *
- * @param value
- * allowed object is
- * {@link ReferenceMetadataImpl }
- *
- */
- public void setReference(ReferenceMetadataImpl value) {
- this.reference = value;
- }
-
- /**
- * Gets the value of the refFIXME property.
- *
- * @return
- * possible object is
- * {@link RefImpl }
- *
- */
- public RefImpl getRefFIXME() {
- return refFIXME;
- }
-
- /**
- * Sets the value of the refFIXME property.
- *
- * @param value
- * allowed object is
- * {@link RefImpl }
- *
- */
- public void setRefFIXME(RefImpl value) {
- this.refFIXME = value;
- }
-
- /**
- * Gets the value of the any property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the any property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getAny().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Object }
- *
- *
- */
- public List<Object> getAny() {
- if (any == null) {
- any = new ArrayList<Object>();
- }
- return this.any;
- }
-
- /**
- * Gets the value of the idref property.
- *
- * @return
- * possible object is
- * {@link RefImpl }
- *
- */
- public RefImpl getIdref() {
- return idref;
- }
-
- /**
- * Sets the value of the idref property.
- *
- * @param value
- * allowed object is
- * {@link RefImpl }
- *
- */
- public void setIdref(RefImpl value) {
- this.idref = value;
- }
-
- /**
- * Gets the value of the value property.
- *
- * @return
- * possible object is
- * {@link Tvalue }
- *
- */
- public Tvalue getValue() {
- return value;
- }
-
- /**
- * Sets the value of the value property.
- *
- * @param value
- * allowed object is
- * {@link Tvalue }
- *
- */
- public void setValue(Tvalue value) {
- this.value = value;
- }
-
- /**
- * Gets the value of the list property.
- *
- * @return
- * possible object is
- * {@link Tcollection }
- *
- */
- public Tcollection getList() {
- return list;
- }
-
- /**
- * Sets the value of the list property.
- *
- * @param value
- * allowed object is
- * {@link Tcollection }
- *
- */
- public void setList(Tcollection value) {
- this.list = value;
- }
-
- /**
- * Gets the value of the set property.
- *
- * @return
- * possible object is
- * {@link Tcollection }
- *
- */
- public Tcollection getSet() {
- return set;
- }
-
- /**
- * Sets the value of the set property.
- *
- * @param value
- * allowed object is
- * {@link Tcollection }
- *
- */
- public void setSet(Tcollection value) {
- this.set = value;
- }
-
- /**
- * Gets the value of the map property.
- *
- * @return
- * possible object is
- * {@link Tmap }
- *
- */
- public Tmap getMap() {
- return map;
- }
-
- /**
- * Sets the value of the map property.
- *
- * @param value
- * allowed object is
- * {@link Tmap }
- *
- */
- public void setMap(Tmap value) {
- this.map = value;
- }
-
- /**
- * Gets the value of the array property.
- *
- * @return
- * possible object is
- * {@link Tcollection }
- *
- */
- public Tcollection getArray() {
- return array;
- }
-
- /**
- * Sets the value of the array property.
- *
- * @param value
- * allowed object is
- * {@link Tcollection }
- *
- */
- public void setArray(Tcollection value) {
- this.array = value;
- }
-
- /**
- * Gets the value of the props property.
- *
- * @return
- * possible object is
- * {@link Tprops }
- *
- */
- public Tprops getProps() {
- return props;
- }
-
- /**
- * Sets the value of the props property.
- *
- * @param value
- * allowed object is
- * {@link Tprops }
- *
- */
- public void setProps(Tprops value) {
- this.props = value;
- }
-
-}
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tmap.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tmap.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tmap.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -1,104 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-793
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.05.13 at 02:16:52 PM CEST
-//
-
-
-package org.jboss.osgi.blueprint.reflect;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- *
- *
- * Tmap is the base type used for <map> elements. A map may have a
- * default value type specified, so it inherits from the TtypeCollection
- * type. A key type can also be specified, and the map members are
- * created from the entry elements, which require a key/value pair.
- *
- *
- *
- * <p>Java class for Tmap complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="Tmap">
- * <complexContent>
- * <extension base="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TtypedCollection">
- * <sequence>
- * <element name="entry" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TmapEntry" maxOccurs="unbounded" minOccurs="0"/>
- * </sequence>
- * <attribute name="key-type" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tclass" />
- * </extension>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-public class Tmap
- extends TtypedCollection
-{
-
- protected List<TmapEntry> entry;
- protected String keyType;
-
- /**
- * Gets the value of the entry property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the entry property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getEntry().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link TmapEntry }
- *
- *
- */
- public List<TmapEntry> getEntry() {
- if (entry == null) {
- entry = new ArrayList<TmapEntry>();
- }
- return this.entry;
- }
-
- /**
- * Gets the value of the keyType property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getKeyType() {
- return keyType;
- }
-
- /**
- * Sets the value of the keyType property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setKeyType(String value) {
- this.keyType = value;
- }
-
-}
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TmapEntry.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TmapEntry.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TmapEntry.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -1,558 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-793
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.05.13 at 02:16:52 PM CEST
-//
-
-
-package org.jboss.osgi.blueprint.reflect;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- *
- *
- * TmapEntry is used for <entry> elements nested inside of a <map> element.
- * Each <entry> instance defines a key/value pair that will be added to the
- * Map. Both the keys and values may be arbitrary types. Keys must not
- * be <null> but <null> is permitted for entry values. A default type
- * can be specified for both the keys and the values, but individual keys
- * or values can override the default.
- *
- *
- *
- * <p>Java class for TmapEntry complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="TmapEntry">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="keyFIXME" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tkey" minOccurs="0"/>
- * <group ref="{http://www.osgi.org/xmlns/blueprint/v1.0.0}value"/>
- * </sequence>
- * <attribute name="key" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TstringValue" />
- * <attribute name="key-ref" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tidref" />
- * <attribute name="valueFIXME" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TstringValue" />
- * <attribute name="value-ref" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tidref" />
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-public class TmapEntry {
-
- protected Tkey keyFIXME;
- protected ServiceMetadataImpl service;
- protected RefCollectionImpl refList;
- protected RefCollectionImpl refSet;
- protected BeanMetadataImpl bean;
- protected ReferenceMetadataImpl reference;
- protected RefImpl refFIXME;
- protected List<Object> any;
- protected RefImpl idref;
- protected Tvalue value;
- protected Tcollection list;
- protected Tcollection set;
- protected Tmap map;
- protected Tcollection array;
- protected Tprops props;
- protected Tnull _null;
- protected String key;
- protected String keyRef;
- protected String valueFIXME;
- protected String valueRef;
-
- /**
- * Gets the value of the keyFIXME property.
- *
- * @return
- * possible object is
- * {@link Tkey }
- *
- */
- public Tkey getKeyFIXME() {
- return keyFIXME;
- }
-
- /**
- * Sets the value of the keyFIXME property.
- *
- * @param value
- * allowed object is
- * {@link Tkey }
- *
- */
- public void setKeyFIXME(Tkey value) {
- this.keyFIXME = value;
- }
-
- /**
- * Gets the value of the service property.
- *
- * @return
- * possible object is
- * {@link ServiceMetadataImpl }
- *
- */
- public ServiceMetadataImpl getService() {
- return service;
- }
-
- /**
- * Sets the value of the service property.
- *
- * @param value
- * allowed object is
- * {@link ServiceMetadataImpl }
- *
- */
- public void setService(ServiceMetadataImpl value) {
- this.service = value;
- }
-
- /**
- * Gets the value of the refList property.
- *
- * @return
- * possible object is
- * {@link RefCollectionImpl }
- *
- */
- public RefCollectionImpl getRefList() {
- return refList;
- }
-
- /**
- * Sets the value of the refList property.
- *
- * @param value
- * allowed object is
- * {@link RefCollectionImpl }
- *
- */
- public void setRefList(RefCollectionImpl value) {
- this.refList = value;
- }
-
- /**
- * Gets the value of the refSet property.
- *
- * @return
- * possible object is
- * {@link RefCollectionImpl }
- *
- */
- public RefCollectionImpl getRefSet() {
- return refSet;
- }
-
- /**
- * Sets the value of the refSet property.
- *
- * @param value
- * allowed object is
- * {@link RefCollectionImpl }
- *
- */
- public void setRefSet(RefCollectionImpl value) {
- this.refSet = value;
- }
-
- /**
- * Gets the value of the bean property.
- *
- * @return
- * possible object is
- * {@link BeanMetadataImpl }
- *
- */
- public BeanMetadataImpl getBean() {
- return bean;
- }
-
- /**
- * Sets the value of the bean property.
- *
- * @param value
- * allowed object is
- * {@link BeanMetadataImpl }
- *
- */
- public void setBean(BeanMetadataImpl value) {
- this.bean = value;
- }
-
- /**
- * Gets the value of the reference property.
- *
- * @return
- * possible object is
- * {@link ReferenceMetadataImpl }
- *
- */
- public ReferenceMetadataImpl getReference() {
- return reference;
- }
-
- /**
- * Sets the value of the reference property.
- *
- * @param value
- * allowed object is
- * {@link ReferenceMetadataImpl }
- *
- */
- public void setReference(ReferenceMetadataImpl value) {
- this.reference = value;
- }
-
- /**
- * Gets the value of the refFIXME property.
- *
- * @return
- * possible object is
- * {@link RefImpl }
- *
- */
- public RefImpl getRefFIXME() {
- return refFIXME;
- }
-
- /**
- * Sets the value of the refFIXME property.
- *
- * @param value
- * allowed object is
- * {@link RefImpl }
- *
- */
- public void setRefFIXME(RefImpl value) {
- this.refFIXME = value;
- }
-
- /**
- * Gets the value of the any property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the any property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getAny().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Object }
- *
- *
- */
- public List<Object> getAny() {
- if (any == null) {
- any = new ArrayList<Object>();
- }
- return this.any;
- }
-
- /**
- * Gets the value of the idref property.
- *
- * @return
- * possible object is
- * {@link RefImpl }
- *
- */
- public RefImpl getIdref() {
- return idref;
- }
-
- /**
- * Sets the value of the idref property.
- *
- * @param value
- * allowed object is
- * {@link RefImpl }
- *
- */
- public void setIdref(RefImpl value) {
- this.idref = value;
- }
-
- /**
- * Gets the value of the value property.
- *
- * @return
- * possible object is
- * {@link Tvalue }
- *
- */
- public Tvalue getValue() {
- return value;
- }
-
- /**
- * Sets the value of the value property.
- *
- * @param value
- * allowed object is
- * {@link Tvalue }
- *
- */
- public void setValue(Tvalue value) {
- this.value = value;
- }
-
- /**
- * Gets the value of the list property.
- *
- * @return
- * possible object is
- * {@link Tcollection }
- *
- */
- public Tcollection getList() {
- return list;
- }
-
- /**
- * Sets the value of the list property.
- *
- * @param value
- * allowed object is
- * {@link Tcollection }
- *
- */
- public void setList(Tcollection value) {
- this.list = value;
- }
-
- /**
- * Gets the value of the set property.
- *
- * @return
- * possible object is
- * {@link Tcollection }
- *
- */
- public Tcollection getSet() {
- return set;
- }
-
- /**
- * Sets the value of the set property.
- *
- * @param value
- * allowed object is
- * {@link Tcollection }
- *
- */
- public void setSet(Tcollection value) {
- this.set = value;
- }
-
- /**
- * Gets the value of the map property.
- *
- * @return
- * possible object is
- * {@link Tmap }
- *
- */
- public Tmap getMap() {
- return map;
- }
-
- /**
- * Sets the value of the map property.
- *
- * @param value
- * allowed object is
- * {@link Tmap }
- *
- */
- public void setMap(Tmap value) {
- this.map = value;
- }
-
- /**
- * Gets the value of the array property.
- *
- * @return
- * possible object is
- * {@link Tcollection }
- *
- */
- public Tcollection getArray() {
- return array;
- }
-
- /**
- * Sets the value of the array property.
- *
- * @param value
- * allowed object is
- * {@link Tcollection }
- *
- */
- public void setArray(Tcollection value) {
- this.array = value;
- }
-
- /**
- * Gets the value of the props property.
- *
- * @return
- * possible object is
- * {@link Tprops }
- *
- */
- public Tprops getProps() {
- return props;
- }
-
- /**
- * Sets the value of the props property.
- *
- * @param value
- * allowed object is
- * {@link Tprops }
- *
- */
- public void setProps(Tprops value) {
- this.props = value;
- }
-
- /**
- * Gets the value of the null property.
- *
- * @return
- * possible object is
- * {@link Tnull }
- *
- */
- public Tnull getNull() {
- return _null;
- }
-
- /**
- * Sets the value of the null property.
- *
- * @param value
- * allowed object is
- * {@link Tnull }
- *
- */
- public void setNull(Tnull value) {
- this._null = value;
- }
-
- /**
- * Gets the value of the key property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getKey() {
- return key;
- }
-
- /**
- * Sets the value of the key property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setKey(String value) {
- this.key = value;
- }
-
- /**
- * Gets the value of the keyRef property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getKeyRef() {
- return keyRef;
- }
-
- /**
- * Sets the value of the keyRef property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setKeyRef(String value) {
- this.keyRef = value;
- }
-
- /**
- * Gets the value of the valueFIXME property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getValueFIXME() {
- return valueFIXME;
- }
-
- /**
- * Sets the value of the valueFIXME property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setValueFIXME(String value) {
- this.valueFIXME = value;
- }
-
- /**
- * Gets the value of the valueRef property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getValueRef() {
- return valueRef;
- }
-
- /**
- * Sets the value of the valueRef property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setValueRef(String value) {
- this.valueRef = value;
- }
-
-}
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tnull.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tnull.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tnull.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -1,37 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-793
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.05.13 at 02:16:52 PM CEST
-//
-
-
-package org.jboss.osgi.blueprint.reflect;
-
-
-/**
- *
- *
- * The definition for a <null> value type.
- *
- *
- *
- * <p>Java class for Tnull complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="Tnull">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-public class Tnull {
-
-
-}
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tprop.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tprop.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tprop.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -1,121 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-793
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.05.13 at 02:16:52 PM CEST
-//
-
-
-package org.jboss.osgi.blueprint.reflect;
-
-/**
- *
- *
- * Tprop is a single property element for a <props> value type. The property
- * value can be specified using either the attribute, or as value data for
- * the property element.
- *
- *
- *
- * <p>Java class for Tprop complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="Tprop">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <attribute name="key" use="required" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TstringValue" />
- * <attribute name="value" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TstringValue" />
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-public class Tprop {
-
- protected String content;
- protected String key;
- protected String value;
-
- /**
- *
- *
- * Tprop is a single property element for a <props> value type. The property
- * value can be specified using either the attribute, or as value data for
- * the property element.
- *
- *
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getContent() {
- return content;
- }
-
- /**
- * Sets the value of the content property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setContent(String value) {
- this.content = value;
- }
-
- /**
- * Gets the value of the key property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getKey() {
- return key;
- }
-
- /**
- * Sets the value of the key property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setKey(String value) {
- this.key = value;
- }
-
- /**
- * Gets the value of the value property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Sets the value of the value property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setValue(String value) {
- this.value = value;
- }
-
-}
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tproperty.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tproperty.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tproperty.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -1,534 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-793
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.05.13 at 02:16:52 PM CEST
-//
-
-
-package org.jboss.osgi.blueprint.reflect;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- *
- *
- * A property that will be injected into a created <bean>
- * component. The <property> elements correspond to named
- * JavaBean setting methods for a created bean object.
- *
- * The value and ref attributes are convenience shortcuts to make
- * the <argument> tag easier to code. A fuller set of injected
- * values and types can be specified using one of the "value"
- * type elements.
- *
- *
- *
- * <p>Java class for Tproperty complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="Tproperty">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="description" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}String" minOccurs="0"/>
- * <group ref="{http://www.osgi.org/xmlns/blueprint/v1.0.0}value"/>
- * </sequence>
- * <attribute name="name" use="required" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tmethod" />
- * <attribute name="ref" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tidref" />
- * <attribute name="valueFIXME" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TstringValue" />
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-public class Tproperty {
-
- protected String description;
- protected ServiceMetadataImpl service;
- protected RefCollectionImpl refList;
- protected RefCollectionImpl refSet;
- protected BeanMetadataImpl bean;
- protected ReferenceMetadataImpl reference;
- protected RefImpl refFIXME;
- protected List<Object> any;
- protected RefImpl idref;
- protected Tvalue value;
- protected Tcollection list;
- protected Tcollection set;
- protected Tmap map;
- protected Tcollection array;
- protected Tprops props;
- protected Tnull _null;
- protected String name;
- protected String ref;
- protected String valueFIXME;
-
- /**
- * Gets the value of the description property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * Sets the value of the description property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setDescription(String value) {
- this.description = value;
- }
-
- /**
- * Gets the value of the service property.
- *
- * @return
- * possible object is
- * {@link ServiceMetadataImpl }
- *
- */
- public ServiceMetadataImpl getService() {
- return service;
- }
-
- /**
- * Sets the value of the service property.
- *
- * @param value
- * allowed object is
- * {@link ServiceMetadataImpl }
- *
- */
- public void setService(ServiceMetadataImpl value) {
- this.service = value;
- }
-
- /**
- * Gets the value of the refList property.
- *
- * @return
- * possible object is
- * {@link RefCollectionImpl }
- *
- */
- public RefCollectionImpl getRefList() {
- return refList;
- }
-
- /**
- * Sets the value of the refList property.
- *
- * @param value
- * allowed object is
- * {@link RefCollectionImpl }
- *
- */
- public void setRefList(RefCollectionImpl value) {
- this.refList = value;
- }
-
- /**
- * Gets the value of the refSet property.
- *
- * @return
- * possible object is
- * {@link RefCollectionImpl }
- *
- */
- public RefCollectionImpl getRefSet() {
- return refSet;
- }
-
- /**
- * Sets the value of the refSet property.
- *
- * @param value
- * allowed object is
- * {@link RefCollectionImpl }
- *
- */
- public void setRefSet(RefCollectionImpl value) {
- this.refSet = value;
- }
-
- /**
- * Gets the value of the bean property.
- *
- * @return
- * possible object is
- * {@link BeanMetadataImpl }
- *
- */
- public BeanMetadataImpl getBean() {
- return bean;
- }
-
- /**
- * Sets the value of the bean property.
- *
- * @param value
- * allowed object is
- * {@link BeanMetadataImpl }
- *
- */
- public void setBean(BeanMetadataImpl value) {
- this.bean = value;
- }
-
- /**
- * Gets the value of the reference property.
- *
- * @return
- * possible object is
- * {@link ReferenceMetadataImpl }
- *
- */
- public ReferenceMetadataImpl getReference() {
- return reference;
- }
-
- /**
- * Sets the value of the reference property.
- *
- * @param value
- * allowed object is
- * {@link ReferenceMetadataImpl }
- *
- */
- public void setReference(ReferenceMetadataImpl value) {
- this.reference = value;
- }
-
- /**
- * Gets the value of the refFIXME property.
- *
- * @return
- * possible object is
- * {@link RefImpl }
- *
- */
- public RefImpl getRefFIXME() {
- return refFIXME;
- }
-
- /**
- * Sets the value of the refFIXME property.
- *
- * @param value
- * allowed object is
- * {@link RefImpl }
- *
- */
- public void setRefFIXME(RefImpl value) {
- this.refFIXME = value;
- }
-
- /**
- * Gets the value of the any property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the any property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getAny().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Object }
- *
- *
- */
- public List<Object> getAny() {
- if (any == null) {
- any = new ArrayList<Object>();
- }
- return this.any;
- }
-
- /**
- * Gets the value of the idref property.
- *
- * @return
- * possible object is
- * {@link RefImpl }
- *
- */
- public RefImpl getIdref() {
- return idref;
- }
-
- /**
- * Sets the value of the idref property.
- *
- * @param value
- * allowed object is
- * {@link RefImpl }
- *
- */
- public void setIdref(RefImpl value) {
- this.idref = value;
- }
-
- /**
- * Gets the value of the value property.
- *
- * @return
- * possible object is
- * {@link Tvalue }
- *
- */
- public Tvalue getValue() {
- return value;
- }
-
- /**
- * Sets the value of the value property.
- *
- * @param value
- * allowed object is
- * {@link Tvalue }
- *
- */
- public void setValue(Tvalue value) {
- this.value = value;
- }
-
- /**
- * Gets the value of the list property.
- *
- * @return
- * possible object is
- * {@link Tcollection }
- *
- */
- public Tcollection getList() {
- return list;
- }
-
- /**
- * Sets the value of the list property.
- *
- * @param value
- * allowed object is
- * {@link Tcollection }
- *
- */
- public void setList(Tcollection value) {
- this.list = value;
- }
-
- /**
- * Gets the value of the set property.
- *
- * @return
- * possible object is
- * {@link Tcollection }
- *
- */
- public Tcollection getSet() {
- return set;
- }
-
- /**
- * Sets the value of the set property.
- *
- * @param value
- * allowed object is
- * {@link Tcollection }
- *
- */
- public void setSet(Tcollection value) {
- this.set = value;
- }
-
- /**
- * Gets the value of the map property.
- *
- * @return
- * possible object is
- * {@link Tmap }
- *
- */
- public Tmap getMap() {
- return map;
- }
-
- /**
- * Sets the value of the map property.
- *
- * @param value
- * allowed object is
- * {@link Tmap }
- *
- */
- public void setMap(Tmap value) {
- this.map = value;
- }
-
- /**
- * Gets the value of the array property.
- *
- * @return
- * possible object is
- * {@link Tcollection }
- *
- */
- public Tcollection getArray() {
- return array;
- }
-
- /**
- * Sets the value of the array property.
- *
- * @param value
- * allowed object is
- * {@link Tcollection }
- *
- */
- public void setArray(Tcollection value) {
- this.array = value;
- }
-
- /**
- * Gets the value of the props property.
- *
- * @return
- * possible object is
- * {@link Tprops }
- *
- */
- public Tprops getProps() {
- return props;
- }
-
- /**
- * Sets the value of the props property.
- *
- * @param value
- * allowed object is
- * {@link Tprops }
- *
- */
- public void setProps(Tprops value) {
- this.props = value;
- }
-
- /**
- * Gets the value of the null property.
- *
- * @return
- * possible object is
- * {@link Tnull }
- *
- */
- public Tnull getNull() {
- return _null;
- }
-
- /**
- * Sets the value of the null property.
- *
- * @param value
- * allowed object is
- * {@link Tnull }
- *
- */
- public void setNull(Tnull value) {
- this._null = value;
- }
-
- /**
- * Gets the value of the name property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getName() {
- return name;
- }
-
- /**
- * Sets the value of the name property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setName(String value) {
- this.name = value;
- }
-
- /**
- * Gets the value of the ref property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getRef() {
- return ref;
- }
-
- /**
- * Sets the value of the ref property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setRef(String value) {
- this.ref = value;
- }
-
- /**
- * Gets the value of the valueFIXME property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getValueFIXME() {
- return valueFIXME;
- }
-
- /**
- * Sets the value of the valueFIXME property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setValueFIXME(String value) {
- this.valueFIXME = value;
- }
-
-}
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tprops.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tprops.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tprops.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -1,74 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-793
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.05.13 at 02:16:52 PM CEST
-//
-
-
-package org.jboss.osgi.blueprint.reflect;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- *
- *
- * Tprops is the type used by the <props> value element. The prop elements
- * are pairs of string-valued keys and values.
- *
- *
- *
- * <p>Java class for Tprops complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="Tprops">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="prop" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tprop" maxOccurs="unbounded" minOccurs="0"/>
- * </sequence>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-public class Tprops {
-
- protected List<Tprop> prop;
-
- /**
- * Gets the value of the prop property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the prop property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getProp().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Tprop }
- *
- *
- */
- public List<Tprop> getProp() {
- if (prop == null) {
- prop = new ArrayList<Tprop>();
- }
- return this.prop;
- }
-
-}
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TserviceProperties.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TserviceProperties.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TserviceProperties.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -1,75 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-793
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.05.13 at 02:16:52 PM CEST
-//
-
-
-package org.jboss.osgi.blueprint.reflect;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- *
- *
- * TserviceProperty is used for <service-properties> elements.
- * The syntax is similar to what is defined for <map>, but keys must be
- * string values and there are no type defaults that can be specified.
- * created from the entry elements, which require a key/value pair.
- *
- *
- *
- * <p>Java class for TserviceProperties complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="TserviceProperties">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="entry" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TservicePropertyEntry" maxOccurs="unbounded" minOccurs="0"/>
- * </sequence>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-public class TserviceProperties {
-
- protected List<ServicePropertyEntry> entry;
-
- /**
- * Gets the value of the entry property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the entry property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getEntry().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link ServicePropertyEntry }
- *
- *
- */
- public List<ServicePropertyEntry> getEntry() {
- if (entry == null) {
- entry = new ArrayList<ServicePropertyEntry>();
- }
- return this.entry;
- }
-
-}
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TtypedCollection.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TtypedCollection.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TtypedCollection.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -1,65 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-793
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.05.13 at 02:16:52 PM CEST
-//
-
-
-package org.jboss.osgi.blueprint.reflect;
-
-
-
-/**
- *
- *
- * TtypeCollection defines comment attributes shared among different
- * collection types that allow a default value type to be specified.
- *
- *
- *
- * <p>Java class for TtypedCollection complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="TtypedCollection">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <attribute name="value-type" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tclass" />
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-public class TtypedCollection {
-
- protected String valueType;
-
- /**
- * Gets the value of the valueType property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getValueType() {
- return valueType;
- }
-
- /**
- * Sets the value of the valueType property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setValueType(String value) {
- this.valueType = value;
- }
-
-}
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tvalue.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tvalue.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tvalue.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -1,99 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-793
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.05.13 at 02:16:52 PM CEST
-//
-
-
-package org.jboss.osgi.blueprint.reflect;
-
-/**
- *
- *
- * Tvalue is the type used for <value> elements. The <value> element
- * is used for types that can be created from a single string value.
- * The string value is the data value for the element. The optional
- * type attribute allows a target conversion value to be explicitly
- * specified.
- *
- *
- *
- * <p>Java class for Tvalue complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="Tvalue">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <attribute name="type" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tclass" />
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-public class Tvalue {
-
- protected String content;
- protected String type;
-
- /**
- *
- *
- * Tvalue is the type used for <value> elements. The <value> element
- * is used for types that can be created from a single string value.
- * The string value is the data value for the element. The optional
- * type attribute allows a target conversion value to be explicitly
- * specified.
- *
- *
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getContent() {
- return content;
- }
-
- /**
- * Sets the value of the content property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setContent(String value) {
- this.content = value;
- }
-
- /**
- * Gets the value of the type property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getType() {
- return type;
- }
-
- /**
- * Sets the value of the type property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setType(String value) {
- this.type = value;
- }
-
-}
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TypeConverters.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TypeConverters.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TypeConverters.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -1,88 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, 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.blueprint.reflect;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- *
- *
- * The type used for the <type-converters> element. The <type-converters> section is a set of <bean>, <ref>, or <reference> elements that identify the type convert
- * components that will ference components.
- *
- *
- *
- * <p>
- * Java class for Ttype-converters complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="Ttype-converters">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <choice maxOccurs="unbounded" minOccurs="0">
- * <group ref="{http://www.osgi.org/xmlns/blueprint/v1.0.0}targetComponent&quo...
- * </choice>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-public class TypeConverters
-{
- protected List<Object> components;
-
- public List<Object> getComponents()
- {
- if (components == null)
- components = new ArrayList<Object>();
-
- return components;
- }
-
- public void setComponents(List<Object> converters)
- {
- this.components = converters;
- }
-
- void resolveRefs(BlueprintMetadata bpMetadata)
- {
- for (int i = 0; i < getComponents().size(); i++)
- {
- Object comp = components.get(i);
- if (comp instanceof RefImpl)
- {
- RefImpl ref = (RefImpl)comp;
- String compName = ref.getComponent();
- //comp = bpMetadata.getComponentMetadata(compName);
- components.set(i, comp);
- }
- }
- }
-}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd 2009-06-18 06:51:00 UTC (rev 90375)
@@ -85,7 +85,7 @@
<xsd:complexType name="Tblueprint">
<xsd:annotation>
<xsd:appinfo>
- <jbxb:class impl="org.jboss.osgi.blueprint.reflect.BlueprintMetadata"></jbxb:class>
+ <jbxb:class impl="org.jboss.osgi.blueprint.parser.xb.TBlueprint"></jbxb:class>
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
@@ -174,7 +174,7 @@
<xsd:complexType name="Ttype-converters">
<xsd:annotation>
<xsd:appinfo>
- <jbxb:class impl="org.jboss.osgi.blueprint.reflect.TypeConverters"></jbxb:class>
+ <jbxb:class impl="org.jboss.osgi.blueprint.parser.xb.TTypeConverters"></jbxb:class>
</xsd:appinfo>
<xsd:documentation>
<![CDATA[
@@ -292,7 +292,7 @@
<xsd:complexType name="Tbean">
<xsd:annotation>
<xsd:appinfo>
- <jbxb:class impl="org.jboss.osgi.blueprint.reflect.BeanMetadataImpl"></jbxb:class>
+ <jbxb:class impl="org.jboss.osgi.blueprint.parser.xb.TBean"></jbxb:class>
</xsd:appinfo>
<xsd:documentation>
<![CDATA[
@@ -426,7 +426,7 @@
<xsd:complexType name="Treference">
<xsd:annotation>
<xsd:appinfo>
- <jbxb:class impl="org.jboss.osgi.blueprint.reflect.ReferenceMetadataImpl"></jbxb:class>
+ <jbxb:class impl="org.jboss.osgi.blueprint.parser.xb.TReference"></jbxb:class>
</xsd:appinfo>
<xsd:documentation>
<![CDATA[
@@ -449,7 +449,7 @@
<xsd:complexType name="Tref-collection">
<xsd:annotation>
<xsd:appinfo>
- <jbxb:class impl="org.jboss.osgi.blueprint.reflect.RefCollectionImpl"></jbxb:class>
+ <jbxb:class impl="org.jboss.osgi.blueprint.parser.xb.TRefCollection"></jbxb:class>
</xsd:appinfo>
<xsd:documentation>
<![CDATA[
@@ -628,7 +628,7 @@
<xsd:complexType name="TReferenceListener">
<xsd:annotation>
<xsd:appinfo>
- <jbxb:class impl="org.jboss.osgi.blueprint.reflect.ReferenceListenerImpl"></jbxb:class>
+ <jbxb:class impl="org.jboss.osgi.blueprint.parser.xb.TReferenceListener"></jbxb:class>
</xsd:appinfo>
<xsd:documentation>
<![CDATA[
@@ -662,7 +662,7 @@
<xsd:simpleType name="Tavailability">
<xsd:annotation>
<xsd:appinfo>
- <jbxb:class impl="org.jboss.osgi.blueprint.reflect.Availability"></jbxb:class>
+ <jbxb:class impl="org.jboss.osgi.blueprint.parser.xb.TAvailability"></jbxb:class>
</xsd:appinfo>
<xsd:documentation>
<![CDATA[
@@ -681,7 +681,7 @@
<xsd:complexType name="Tcomparator">
<xsd:annotation>
<xsd:appinfo>
- <jbxb:class impl="org.jboss.osgi.blueprint.reflect.ComparatorImpl"></jbxb:class>
+ <jbxb:class impl="org.jboss.osgi.blueprint.parser.xb.TComparator"></jbxb:class>
</xsd:appinfo>
</xsd:annotation>
<xsd:group ref="targetComponent" />
@@ -692,7 +692,7 @@
<xsd:complexType name="Tservice">
<xsd:annotation>
<xsd:appinfo>
- <jbxb:class impl="org.jboss.osgi.blueprint.reflect.ServiceMetadataImpl"></jbxb:class>
+ <jbxb:class impl="org.jboss.osgi.blueprint.parser.xb.TService"></jbxb:class>
</xsd:appinfo>
<xsd:documentation>
<![CDATA[
@@ -826,7 +826,7 @@
<xsd:complexType name="TregistrationListener">
<xsd:annotation>
<xsd:appinfo>
- <jbxb:class impl="org.jboss.osgi.blueprint.reflect.RegistrationListenerImpl"></jbxb:class>
+ <jbxb:class impl="org.jboss.osgi.blueprint.parser.xb.TRegistrationListener"></jbxb:class>
</xsd:appinfo>
<xsd:documentation>
<![CDATA[
@@ -914,7 +914,7 @@
<xsd:complexType name="Tref">
<xsd:annotation>
<xsd:appinfo>
- <jbxb:class impl="org.jboss.osgi.blueprint.reflect.RefImpl"></jbxb:class>
+ <jbxb:class impl="org.jboss.osgi.blueprint.parser.xb.TRef"></jbxb:class>
</xsd:appinfo>
<xsd:documentation>
<![CDATA[
@@ -1069,7 +1069,7 @@
<xsd:complexType name="TservicePropertyEntry">
<xsd:annotation>
<xsd:appinfo>
- <jbxb:class impl="org.jboss.osgi.blueprint.reflect.ServicePropertyEntry"></jbxb:class>
+ <jbxb:class impl="org.jboss.osgi.blueprint.parser.xb.TMapEntry"></jbxb:class>
</xsd:appinfo>
<xsd:documentation>
<![CDATA[
@@ -1201,7 +1201,7 @@
<xsd:simpleType name="TautoExportModes">
<xsd:annotation>
<xsd:appinfo>
- <jbxb:class impl="org.jboss.osgi.blueprint.reflect.AutoExportModes"></jbxb:class>
+ <jbxb:class impl="org.jboss.osgi.blueprint.parser.xb.TAutoExportModes"></jbxb:class>
</xsd:appinfo>
<xsd:documentation>
<![CDATA[
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/BlueprintContainerTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/BlueprintContainerTestCase.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/BlueprintContainerTestCase.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -66,7 +66,6 @@
* @author thomas.diesler(a)jboss.com
* @since 13-May-2009
*/
-@Ignore
public class BlueprintContainerTestCase
{
@ProvideContext
@@ -112,38 +111,18 @@
}
@Test
- public void testBlueprintContextAvailable() throws Exception
+ public void testBlueprintContainerAvailable() throws Exception
{
if (context == null)
huskyBridge.run();
assumeNotNull(context);
- BlueprintContainer bpContext = getBlueprintContainer();
- assertNotNull("BlueprintContainer available", bpContext);
+ BlueprintContainer bpContainer = getBlueprintContainer();
+ assertNotNull("BlueprintContainer available", bpContainer);
}
-
@Test
- public void getBeanComponentsMetadata() throws Exception
- {
- if (context == null)
- huskyBridge.run();
-
- assumeNotNull(context);
-
- BlueprintContainer bpContext = getBlueprintContainer();
- Collection<BeanMetadata> bcMetadata = bpContext.getMetadata(BeanMetadata.class);
-
- assertNotNull("BeanComponentsMetadata not null", bcMetadata);
- assertEquals("BeanComponentsMetadata size", 1, bcMetadata.size());
-
- BeanMetadata bmd = bcMetadata.iterator().next();
- assertEquals("beanA", bmd.getId());
- assertEquals(BeanA.class.getName(), bmd.getClassName());
- }
-
- @Test
public void getBundleContext() throws Exception
{
if (context == null)
@@ -151,14 +130,13 @@
assumeNotNull(context);
- BlueprintContainer bpContext = getBlueprintContainer();
- BundleContext bndContext = bpContext.getBundleContext();
+ BlueprintContainer bpContainer = getBlueprintContainer();
+ BundleContext bndContext = bpContainer.getBundleContext();
assertNotNull("BundleContext not null", bndContext);
assertEquals("BundleContext equals", context, bndContext);
}
-
@Test
@Ignore
public void getComponent() throws Exception
@@ -168,35 +146,35 @@
assumeNotNull(context);
- BlueprintContainer bpContext = getBlueprintContainer();
- bpContext.getComponentInstance("beanA");
+ BlueprintContainer bpContainer = getBlueprintContainer();
+ bpContainer.getComponentInstance("beanA");
}
@Test
- public void getComponentMetadata() throws Exception
+ public void testComponentMetadataByName() throws Exception
{
if (context == null)
huskyBridge.run();
assumeNotNull(context);
- BlueprintContainer bpContext = getBlueprintContainer();
- ComponentMetadata compMetadata = bpContext.getComponentMetadata("beanA");
+ BlueprintContainer bpContainer = getBlueprintContainer();
+ ComponentMetadata compMetadata = bpContainer.getComponentMetadata("beanA");
assertNotNull("ComponentMetadata not null", compMetadata);
assertEquals("beanA", compMetadata.getId());
}
@Test
- public void getComponentNames() throws Exception
+ public void getComponentIds() throws Exception
{
if (context == null)
huskyBridge.run();
assumeNotNull(context);
- BlueprintContainer bpContext = getBlueprintContainer();
- Set<String> compNames = bpContext.getComponentIds();
+ BlueprintContainer bpContainer = getBlueprintContainer();
+ Set<String> compNames = bpContainer.getComponentIds();
assertNotNull("ComponentNames not null", compNames);
assertEquals("ComponentNames size", 4, compNames.size());
@@ -207,16 +185,35 @@
}
@Test
- public void getExportedServicesMetadata() throws Exception
+ public void testBeanMetadata() throws Exception
{
if (context == null)
huskyBridge.run();
assumeNotNull(context);
- BlueprintContainer bpContext = getBlueprintContainer();
- Collection<ServiceMetadata> servicesMetadata = bpContext.getMetadata(ServiceMetadata.class);
+ BlueprintContainer bpContainer = getBlueprintContainer();
+ Collection<BeanMetadata> bcMetadata = bpContainer.getMetadata(BeanMetadata.class);
+
+ assertNotNull("BeanComponentsMetadata not null", bcMetadata);
+ assertEquals("BeanComponentsMetadata size", 1, bcMetadata.size());
+
+ BeanMetadata bmd = bcMetadata.iterator().next();
+ assertEquals("beanA", bmd.getId());
+ assertEquals(BeanA.class.getName(), bmd.getClassName());
+ }
+ @Test
+ public void testServiceMetadata() throws Exception
+ {
+ if (context == null)
+ huskyBridge.run();
+
+ assumeNotNull(context);
+
+ BlueprintContainer bpContainer = getBlueprintContainer();
+ Collection<ServiceMetadata> servicesMetadata = bpContainer.getMetadata(ServiceMetadata.class);
+
assertNotNull("ServiceMetadata not null", servicesMetadata);
assertEquals("ServiceMetadata size", 2, servicesMetadata.size());
@@ -239,15 +236,15 @@
}
@Test
- public void getReferencedServicesMetadata() throws Exception
+ public void testServiceReferenceMetadata() throws Exception
{
if (context == null)
huskyBridge.run();
assumeNotNull(context);
- BlueprintContainer bpContext = getBlueprintContainer();
- Collection<ServiceReferenceMetadata> srefsMetadata = bpContext.getMetadata(ServiceReferenceMetadata.class);
+ BlueprintContainer bpContainer = getBlueprintContainer();
+ Collection<ServiceReferenceMetadata> srefsMetadata = bpContainer.getMetadata(ServiceReferenceMetadata.class);
assertNotNull("ServiceReferenceMetadata not null", srefsMetadata);
assertEquals("ServiceReferenceMetadata size", 1, srefsMetadata.size());
@@ -265,7 +262,7 @@
ServiceReference sref = context.getServiceReference(BlueprintContainer.class.getName());
assertNotNull("BlueprintContainer service not null", sref);
- BlueprintContainer bpContext = (BlueprintContainer)context.getService(sref);
- return bpContext;
+ BlueprintContainer bpContainer = (BlueprintContainer)context.getService(sref);
+ return bpContainer;
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -30,15 +30,15 @@
import java.util.Collection;
import java.util.List;
-import org.jboss.osgi.blueprint.parser.BlueprintParser;
-import org.jboss.osgi.blueprint.reflect.Availability;
-import org.jboss.osgi.blueprint.reflect.BeanMetadataImpl;
-import org.jboss.osgi.blueprint.reflect.BlueprintMetadata;
-import org.jboss.osgi.blueprint.reflect.RefImpl;
-import org.jboss.osgi.blueprint.reflect.ReferenceMetadataImpl;
-import org.jboss.osgi.blueprint.reflect.ServiceMetadataImpl;
-import org.jboss.osgi.blueprint.reflect.ServiceReferenceMetadataImpl;
-import org.jboss.osgi.blueprint.reflect.TypeConverters;
+import org.jboss.osgi.blueprint.parser.xb.JBossXBParser;
+import org.jboss.osgi.blueprint.parser.xb.TAvailability;
+import org.jboss.osgi.blueprint.parser.xb.TBean;
+import org.jboss.osgi.blueprint.parser.xb.TBlueprint;
+import org.jboss.osgi.blueprint.parser.xb.TRef;
+import org.jboss.osgi.blueprint.parser.xb.TReference;
+import org.jboss.osgi.blueprint.parser.xb.TService;
+import org.jboss.osgi.blueprint.parser.xb.TServiceReference;
+import org.jboss.osgi.blueprint.parser.xb.TTypeConverters;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -51,20 +51,20 @@
*/
public class AllElementsParserTestCase
{
- private static BlueprintMetadata blueprint;
+ private static TBlueprint blueprint;
@BeforeClass
public static void beforeClass()
{
URL xmlURL = new OSGiTestHelper().getResourceURL("parser/blueprint-all-elements.xml");
- blueprint = new BlueprintParser().parse(xmlURL);
+ blueprint = new JBossXBParser().parse(xmlURL);
}
@Test
public void testRootAttributes() throws Exception
{
- Availability defaultAvailability = blueprint.getDefaultAvailability();
- assertEquals(Availability.MANDATORY, defaultAvailability);
+ TAvailability defaultAvailability = blueprint.getDefaultAvailability();
+ assertEquals(TAvailability.MANDATORY, defaultAvailability);
String defaultDestroyMethod = blueprint.getDefaultDestroyMethod();
assertEquals("defaultDestroyMethod", defaultDestroyMethod);
@@ -89,32 +89,32 @@
@Test
public void getTypeConverters() throws Exception
{
- TypeConverters typeConverters = blueprint.getTypeConverters();
+ TTypeConverters typeConverters = blueprint.getTypeConverters();
assertNotNull("TypeConverters not null", typeConverters);
List<Object> converters = typeConverters.getComponents();
assertEquals("TypeConverters size", 5, converters.size());
- BeanMetadataImpl conv1 = (BeanMetadataImpl)converters.get(0);
+ TBean conv1 = (TBean)converters.get(0);
assertNotNull("Converter not null", conv1);
- ReferenceMetadataImpl conv2 = (ReferenceMetadataImpl)converters.get(1);
+ TReference conv2 = (TReference)converters.get(1);
assertNotNull("Converter not null", conv2);
- ReferenceMetadataImpl conv3 = (ReferenceMetadataImpl)converters.get(2);
+ TReference conv3 = (TReference)converters.get(2);
assertNotNull("Converter not null", conv3);
- RefImpl conv4 = (RefImpl)converters.get(3);
+ TRef conv4 = (TRef)converters.get(3);
assertNotNull("Converter not null", conv4);
- RefImpl conv5 = (RefImpl)converters.get(4);
+ TRef conv5 = (TRef)converters.get(4);
assertNotNull("Converter not null", conv5);
}
@Test
public void getExportedServicesMetadata() throws Exception
{
- Collection<ServiceMetadataImpl> services = blueprint.getMetadata(ServiceMetadataImpl.class);
+ Collection<TService> services = blueprint.getMetadata(TService.class);
assertNotNull("ServiceMetadata not null", services);
assertEquals("ServiceMetadata size", 2, services.size());
}
@@ -122,7 +122,7 @@
@Test
public void getReferencedServicesMetadata() throws Exception
{
- Collection<ServiceReferenceMetadataImpl> serviceRefs = blueprint.getMetadata(ServiceReferenceMetadataImpl.class);
+ Collection<TServiceReference> serviceRefs = blueprint.getMetadata(TServiceReference.class);
assertNotNull("ServiceReferenceMetadata not null", serviceRefs);
assertEquals("ServiceReferenceMetadata size", 3, serviceRefs.size());
}
@@ -130,7 +130,7 @@
@Test
public void getBeanComponentsMetadata() throws Exception
{
- Collection<BeanMetadataImpl> beans = blueprint.getMetadata(BeanMetadataImpl.class);
+ Collection<TBean> beans = blueprint.getMetadata(TBean.class);
assertNotNull("BeanMetadata not null", beans);
assertEquals("BeanMetadata size", 3, beans.size());
}
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -29,10 +29,10 @@
import java.net.URL;
import java.util.List;
-import org.jboss.osgi.blueprint.parser.BlueprintParser;
-import org.jboss.osgi.blueprint.reflect.BeanMetadataImpl;
-import org.jboss.osgi.blueprint.reflect.BlueprintMetadata;
-import org.jboss.osgi.blueprint.reflect.ComponentMetadataImpl;
+import org.jboss.osgi.blueprint.parser.xb.JBossXBParser;
+import org.jboss.osgi.blueprint.parser.xb.TBean;
+import org.jboss.osgi.blueprint.parser.xb.TBlueprint;
+import org.jboss.osgi.blueprint.parser.xb.TComponent;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.jboss.test.osgi.blueprint.parser.comp.BeanA;
import org.jboss.test.osgi.blueprint.parser.comp.BeanB;
@@ -50,16 +50,16 @@
public void testBasicBeans() throws Exception
{
URL xmlURL = getResourceURL("parser/blueprint-basic-beans.xml");
- BlueprintMetadata blueprint = new BlueprintParser().parse(xmlURL);
+ TBlueprint blueprint = new JBossXBParser().parse(xmlURL);
- List<ComponentMetadataImpl> compList = blueprint.getComponents();
+ List<TComponent> compList = blueprint.getComponents();
assertTrue(compList.size() > 0);
- BeanMetadataImpl beanA = (BeanMetadataImpl)compList.get(0);
+ TBean beanA = (TBean)compList.get(0);
assertEquals(BeanA.class.getName(), beanA.getClassName());
assertEquals("beanA", beanA.getId());
- BeanMetadataImpl beanB = (BeanMetadataImpl)compList.get(1);
+ TBean beanB = (TBean)compList.get(1);
assertEquals(BeanB.class.getName(), beanB.getClassName());
assertEquals("beanB", beanB.getId());
}
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicRootParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicRootParserTestCase.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicRootParserTestCase.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -29,9 +29,9 @@
import java.math.BigInteger;
import java.net.URL;
-import org.jboss.osgi.blueprint.parser.BlueprintParser;
-import org.jboss.osgi.blueprint.reflect.Availability;
-import org.jboss.osgi.blueprint.reflect.BlueprintMetadata;
+import org.jboss.osgi.blueprint.parser.xb.JBossXBParser;
+import org.jboss.osgi.blueprint.parser.xb.TAvailability;
+import org.jboss.osgi.blueprint.parser.xb.TBlueprint;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.junit.Test;
@@ -47,10 +47,10 @@
public void testBlueprintDefaultAttributes() throws Exception
{
URL xmlURL = getResourceURL("parser/blueprint-basic-root.xml");
- BlueprintMetadata blueprint = new BlueprintParser().parse(xmlURL);
+ TBlueprint blueprint = new JBossXBParser().parse(xmlURL);
// assert default attributes
- assertEquals(Availability.MANDATORY, blueprint.getDefaultAvailability());
+ assertEquals(TAvailability.MANDATORY, blueprint.getDefaultAvailability());
assertEquals(new BigInteger("300000"), blueprint.getDefaultTimeout());
assertEquals(Boolean.FALSE, blueprint.isDefaultLazyInit());
assertNull(blueprint.getDefaultInitMethod());
@@ -61,7 +61,7 @@
public void testBlueprintDescription() throws Exception
{
URL xmlURL = getResourceURL("parser/blueprint-basic-root.xml");
- BlueprintMetadata blueprint = new BlueprintParser().parse(xmlURL);
+ TBlueprint blueprint = new JBossXBParser().parse(xmlURL);
// assert description
assertEquals("some text", blueprint.getDescription());
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -29,11 +29,11 @@
import java.net.URL;
import java.util.List;
-import org.jboss.osgi.blueprint.parser.BlueprintParser;
-import org.jboss.osgi.blueprint.reflect.BeanMetadataImpl;
-import org.jboss.osgi.blueprint.reflect.BlueprintMetadata;
-import org.jboss.osgi.blueprint.reflect.ComponentMetadataImpl;
-import org.jboss.osgi.blueprint.reflect.ServiceMetadataImpl;
+import org.jboss.osgi.blueprint.parser.xb.JBossXBParser;
+import org.jboss.osgi.blueprint.parser.xb.TBean;
+import org.jboss.osgi.blueprint.parser.xb.TBlueprint;
+import org.jboss.osgi.blueprint.parser.xb.TComponent;
+import org.jboss.osgi.blueprint.parser.xb.TService;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.jboss.test.osgi.blueprint.parser.comp.BeanA;
import org.jboss.test.osgi.blueprint.parser.comp.ServiceA;
@@ -52,23 +52,23 @@
public void testBasicBeans() throws Exception
{
URL xmlURL = getResourceURL("parser/blueprint-basic-service.xml");
- BlueprintMetadata blueprint = new BlueprintParser().parse(xmlURL);
+ TBlueprint blueprint = new JBossXBParser().parse(xmlURL);
- List<ComponentMetadataImpl> compList = blueprint.getComponents();
+ List<TComponent> compList = blueprint.getComponents();
assertTrue(compList.size() > 0);
- BeanMetadataImpl beanA = (BeanMetadataImpl)compList.get(0);
+ TBean beanA = (TBean)compList.get(0);
assertEquals(BeanA.class.getName(), beanA.getClassName());
assertEquals("beanA", beanA.getId());
- ServiceMetadataImpl serviceA = (ServiceMetadataImpl)compList.get(1);
+ TService serviceA = (TService)compList.get(1);
assertEquals("serviceA", serviceA.getId());
List<String> intfsA = serviceA.getInterfaceNames();
assertTrue(intfsA.size() > 0);
assertEquals(ServiceA.class.getName(), intfsA.get(0));
- ServiceMetadataImpl serviceB = (ServiceMetadataImpl)compList.get(2);
+ TService serviceB = (TService)compList.get(2);
assertEquals("serviceB", serviceB.getId());
List<String> intfsB = serviceB.getInterfaceNames();
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/main/java/org/jboss/osgi/trailblazer/web/MainServlet.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/main/java/org/jboss/osgi/trailblazer/web/MainServlet.java 2009-06-18 06:24:16 UTC (rev 90374)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/main/java/org/jboss/osgi/trailblazer/web/MainServlet.java 2009-06-18 06:51:00 UTC (rev 90375)
@@ -34,10 +34,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.jboss.osgi.common.log.LogServiceTracker;
import org.osgi.framework.BundleContext;
import org.osgi.service.http.HttpService;
-import org.osgi.service.log.LogService;
/**
@@ -50,15 +48,11 @@
@SuppressWarnings("serial")
public class MainServlet extends HttpServlet
{
- private LogService log;
-
private BundleContext context;
public MainServlet(BundleContext context)
{
- this.log = new LogServiceTracker(context);
this.context = context;
-
}
@Override
15 years
JBoss-OSGI SVN: r90359 - in projects/jboss-osgi/trunk/blueprint: impl/src/main/resources/schema and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-17 17:13:29 -0400 (Wed, 17 Jun 2009)
New Revision: 90359
Modified:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml
Log:
Use interfaceNames
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java 2009-06-17 20:49:25 UTC (rev 90358)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java 2009-06-17 21:13:29 UTC (rev 90359)
@@ -40,7 +40,7 @@
public class ServiceMetadataImpl extends ComponentMetadataImpl
{
protected String description;
- protected List<String> interfaces;
+ protected List<String> interfaceNames;
protected List<ServicePropertyEntry> serviceProperties;
protected Collection<RegistrationListenerImpl> registrationListener;
protected BeanMetadataImpl bean;
@@ -75,17 +75,17 @@
/**
* Gets the value of the interfaces property.
*/
- public List<String> getInterfaces()
+ public List<String> getInterfaceNames()
{
- if (interfaces == null)
- interfaces = new ArrayList<String>();
+ if (interfaceNames == null)
+ interfaceNames = new ArrayList<String>();
- return interfaces;
+ return interfaceNames;
}
- public void setInterfaces(List<String> interfaces)
+ public void setInterfaceNames(List<String> interfaces)
{
- this.interfaces = interfaces;
+ this.interfaceNames = interfaces;
}
/**
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java 2009-06-17 20:49:25 UTC (rev 90358)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java 2009-06-17 21:13:29 UTC (rev 90359)
@@ -65,7 +65,7 @@
public class ServiceReferenceMetadataImpl extends ComponentMetadataImpl
{
protected String description;
- protected List<String> interfaces;
+ protected List<String> interfaceNames;
protected List<ReferenceListenerImpl> listener;
protected List<Object> any;
protected String filter;
@@ -99,22 +99,22 @@
* Gets the value of the interfaces property.
*
*/
- public List<String> getInterfaces()
+ public List<String> getInterfaceNames()
{
- if (interfaces == null)
- interfaces = new ArrayList<String>();
+ if (interfaceNames == null)
+ interfaceNames = new ArrayList<String>();
- return interfaces;
+ return interfaceNames;
}
- public void setInterfaces(List<String> interfaces)
+ public void setInterfaceNames(List<String> interfaces)
{
- this.interfaces = interfaces;
+ this.interfaceNames = interfaces;
}
public String getInterface()
{
- List<String> interfaces = getInterfaces();
+ List<String> interfaces = getInterfaceNames();
if (interfaces.size() == 0)
throw new IllegalStateException("Empty list of interfaces");
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd 2009-06-17 20:49:25 UTC (rev 90358)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd 2009-06-17 21:13:29 UTC (rev 90359)
@@ -579,7 +579,7 @@
<xsd:attribute name="interface" use="optional" type="Tclass" >
<xsd:annotation>
<xsd:appinfo>
- <jbxb:property name="interfaces"/>
+ <jbxb:property name="interfaceNames"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:attribute>
@@ -712,7 +712,7 @@
<xsd:attribute name="interface" type="Tclass" use="optional" >
<xsd:annotation>
<xsd:appinfo>
- <jbxb:property name="interfaces"/>
+ <jbxb:property name="interfaceNames"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:attribute>
@@ -1113,7 +1113,7 @@
<xsd:element name="value" type="TinterfaceValue" >
<xsd:annotation>
<xsd:appinfo>
- <jbxb:property name="interfaces"/>
+ <jbxb:property name="interfaceNames"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java 2009-06-17 20:49:25 UTC (rev 90358)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java 2009-06-17 21:13:29 UTC (rev 90359)
@@ -64,14 +64,14 @@
ServiceMetadataImpl serviceA = (ServiceMetadataImpl)compList.get(1);
assertEquals("serviceA", serviceA.getId());
- List<String> intfsA = serviceA.getInterfaces();
+ List<String> intfsA = serviceA.getInterfaceNames();
assertTrue(intfsA.size() > 0);
assertEquals(ServiceA.class.getName(), intfsA.get(0));
ServiceMetadataImpl serviceB = (ServiceMetadataImpl)compList.get(2);
assertEquals("serviceB", serviceB.getId());
- List<String> intfsB = serviceB.getInterfaces();
+ List<String> intfsB = serviceB.getInterfaceNames();
assertTrue(intfsB.size() > 0);
assertEquals(ServiceB.class.getName(), intfsB.get(0));
}
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml 2009-06-17 20:49:25 UTC (rev 90358)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml 2009-06-17 21:13:29 UTC (rev 90359)
@@ -18,12 +18,10 @@
<service id="idServiceA" auto-export="disabled" depends-on="someServiceDependency" interface="foo.ServiceInterface" ranking="0">
<description>service description</description>
- <!--
<interfaces>
<value>foo.ServiceInterfA</value>
<value>foo.ServiceInterfB</value>
</interfaces>
- -->
<service-properties>
<entry key="keyA" value="valueA" />
<entry key="keyB" value="valueB" />
@@ -51,12 +49,10 @@
<reference component-name="referenceCompName" interface="foo.referenceInterf" filter="referenceFilter" availablitity="optional">
<description>reference description</description>
- <!--
<interfaces>
<value>foo.ReferenceInterfA</value>
<value>foo.ReferenceInterfB</value>
</interfaces>
- -->
<listener ref="referenceListenerA" bind-method="bindMethod" unbind-method="unbindMethod" />
<listener ref="referenceListenerB" />
</reference>
15 years
JBoss-OSGI SVN: r90358 - in projects/jboss-osgi/trunk/blueprint: impl/src/main/java/org/jboss/osgi/blueprint/reflect and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-17 16:49:25 -0400 (Wed, 17 Jun 2009)
New Revision: 90358
Modified:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BeanMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintMetadata.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComparatorImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ReferenceMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RegistrationListenerImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServicePropertyEntry.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TypeConverters.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/BlueprintContainerTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java
Log:
Decouple jbossxb model from BP reflect model
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java 2009-06-17 20:11:23 UTC (rev 90357)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java 2009-06-17 20:49:25 UTC (rev 90358)
@@ -24,8 +24,13 @@
//$Id: BlueprintContextImpl.java 90313 2009-06-17 10:37:51Z thomas.diesler(a)jboss.com $
import java.net.URL;
+import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import java.util.Properties;
import java.util.Set;
@@ -37,6 +42,7 @@
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
import org.osgi.service.blueprint.container.BlueprintContainer;
+import org.osgi.service.blueprint.container.NoSuchComponentException;
import org.osgi.service.blueprint.reflect.ComponentMetadata;
import org.osgi.service.log.LogService;
@@ -73,9 +79,8 @@
private BundleContext context;
private Bundle bundle;
+ private Map<String, ComponentMetadata> components = new HashMap<String, ComponentMetadata>();
- private BlueprintMetadata bpMetadata;
-
public BlueprintContainerImpl(BundleContext context, Bundle bundle)
{
this.log = new LogServiceTracker(context);
@@ -85,7 +90,7 @@
public void initialize()
{
- bpMetadata = getBlueprintMetadata();
+ BlueprintMetadata bpMetadata = getBlueprintMetadata();
registerBlueprintContainerService();
}
@@ -96,7 +101,11 @@
public ComponentMetadata getComponentMetadata(String name)
{
- return bpMetadata.getComponentMetadata(name);
+ ComponentMetadata compMetadata = components.get(name);
+ if (compMetadata == null)
+ throw new NoSuchComponentException(name);
+
+ return compMetadata;
}
public int getCompliance()
@@ -106,12 +115,19 @@
public Set<String> getComponentIds()
{
- return bpMetadata.getComponentNames();
+ return Collections.unmodifiableSet(components.keySet());
}
+ @SuppressWarnings("unchecked")
public <T extends ComponentMetadata> Collection<T> getMetadata(Class<T> type)
{
- return bpMetadata.getMetadata(type);
+ List<T> compMetadata = new ArrayList<T>();
+ for (ComponentMetadata comp : components.values())
+ {
+ if (type.isAssignableFrom(comp.getClass()))
+ compMetadata.add((T)comp);
+ }
+ return Collections.unmodifiableList(compMetadata);
}
public Object getComponentInstance(String id)
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BeanMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BeanMetadataImpl.java 2009-06-17 20:11:23 UTC (rev 90357)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BeanMetadataImpl.java 2009-06-17 20:49:25 UTC (rev 90358)
@@ -31,19 +31,13 @@
import javax.xml.bind.JAXBElement;
import javax.xml.namespace.QName;
-import org.jboss.osgi.spi.NotImplementedException;
-import org.osgi.service.blueprint.reflect.BeanArgument;
-import org.osgi.service.blueprint.reflect.BeanMetadata;
-import org.osgi.service.blueprint.reflect.BeanProperty;
-import org.osgi.service.blueprint.reflect.Target;
-
/**
* The type defintion for a <bean> component.
*
* @author thomas.diesler(a)jboss.com
* @since 13-May-2009
*/
-public class BeanMetadataImpl extends ComponentMetadataImpl implements BeanMetadata
+public class BeanMetadataImpl extends ComponentMetadataImpl
{
protected String description;
protected List<Object> argumentOrPropertyOrAny;
@@ -261,48 +255,4 @@
{
return otherAttributes;
}
-
-
- // **********************************************************************
-
-
- public List<BeanArgument> getArguments()
- {
- throw new NotImplementedException();
- }
-
- public String getDestroyMethodName()
- {
- throw new NotImplementedException();
- }
-
- public List<String> getExplicitDependencies()
- {
- throw new NotImplementedException();
- }
-
- public String getFactoryMethodName()
- {
- throw new NotImplementedException();
- }
-
- public String getInitMethodName()
- {
- throw new NotImplementedException();
- }
-
- public List<BeanProperty> getProperties()
- {
- throw new NotImplementedException();
- }
-
- public Class<?> getRuntimeClass()
- {
- throw new NotImplementedException();
- }
-
- public Target getFactoryComponent()
- {
- throw new NotImplementedException();
- }
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintMetadata.java 2009-06-17 20:11:23 UTC (rev 90357)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintMetadata.java 2009-06-17 20:49:25 UTC (rev 90358)
@@ -28,16 +28,12 @@
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
-import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import javax.xml.namespace.QName;
import org.jboss.osgi.spi.NotImplementedException;
-import org.osgi.service.blueprint.container.NoSuchComponentException;
-import org.osgi.service.blueprint.reflect.ComponentMetadata;
/**
* The blueprint element is the top element.
@@ -57,7 +53,7 @@
{
protected String description;
protected TypeConverters typeConverters;
- protected List<ComponentMetadata> components;
+ protected List<ComponentMetadataImpl> components;
protected Boolean defaultLazyInit;
protected String defaultInitMethod;
protected String defaultDestroyMethod;
@@ -114,60 +110,26 @@
/**
* Gets the value of components
*/
- public List<ComponentMetadata> getComponents()
+ public List<ComponentMetadataImpl> getComponents()
{
if (components == null)
- components = new ArrayList<ComponentMetadata>();
+ components = new ArrayList<ComponentMetadataImpl>();
return this.components;
}
- public Set<String> getComponentNames()
- {
- Set<String> compNames = new LinkedHashSet<String>();
- for (ComponentMetadata comp : getComponents())
- compNames.add(comp.getId());
-
- return Collections.unmodifiableSet(compNames);
- }
-
- /**
- * Get ComponentMetadata by name
- * @throws NoSuchComponentException if not found
- */
- public ComponentMetadata getComponentMetadata(String name)
- {
- if (name == null)
- throw new IllegalArgumentException("Cannot get component metadata for 'null' name");
-
- ComponentMetadata compMetadata = null;
- for (ComponentMetadata aux : getComponents())
- {
- if (name.equals(aux.getId()))
- {
- compMetadata = aux;
- break;
- }
- }
-
- if (compMetadata == null)
- throw new NoSuchComponentException(name);
-
- return compMetadata;
- }
-
@SuppressWarnings("unchecked")
- public <T extends ComponentMetadata> Collection<T> getMetadata(Class<T> type)
+ public <T extends ComponentMetadataImpl> Collection<T> getMetadata(Class<T> type)
{
List<T> compMetadata = new ArrayList<T>();
- for (ComponentMetadata comp : getComponents())
+ for (ComponentMetadataImpl comp : components)
{
if (type.isAssignableFrom(comp.getClass()))
compMetadata.add((T)comp);
}
return Collections.unmodifiableList(compMetadata);
}
-
+
/**
* Gets the value of the defaultLazyInit property.
*
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComparatorImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComparatorImpl.java 2009-06-17 20:11:23 UTC (rev 90357)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComparatorImpl.java 2009-06-17 20:49:25 UTC (rev 90358)
@@ -26,8 +26,6 @@
import java.util.ArrayList;
import java.util.List;
-import org.osgi.service.blueprint.reflect.ComponentMetadata;
-
/**
* <p>
* Java class for Tcomparator complex type.
@@ -49,15 +47,15 @@
*/
public class ComparatorImpl
{
- protected List<ComponentMetadata> components;
+ protected List<ComponentMetadataImpl> components;
protected List<Object> any;
- public List<ComponentMetadata> getComponents()
+ public List<ComponentMetadataImpl> getComponents()
{
return components;
}
- public void setComponents(List<ComponentMetadata> components)
+ public void setComponents(List<ComponentMetadataImpl> components)
{
this.components = components;
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentMetadataImpl.java 2009-06-17 20:11:23 UTC (rev 90357)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentMetadataImpl.java 2009-06-17 20:49:25 UTC (rev 90358)
@@ -26,8 +26,6 @@
import java.util.ArrayList;
import java.util.List;
-import org.osgi.service.blueprint.reflect.ComponentMetadata;
-
/**
* The Component type is the base type for top-level
* Blueprint components. The <bean> <reference>, <service>, <ref-set>, and <ref-list>
@@ -41,7 +39,7 @@
* @author thomas.diesler(a)jboss.com
* @since 13-May-2009
*/
-public abstract class ComponentMetadataImpl implements ComponentMetadata
+public abstract class ComponentMetadataImpl
{
protected String id;
protected List<String> dependsOn;
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ReferenceMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ReferenceMetadataImpl.java 2009-06-17 20:11:23 UTC (rev 90357)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ReferenceMetadataImpl.java 2009-06-17 20:49:25 UTC (rev 90358)
@@ -25,8 +25,6 @@
import java.math.BigInteger;
-import org.osgi.service.blueprint.reflect.ReferenceMetadata;
-
/**
*
*
@@ -55,7 +53,7 @@
*
*
*/
-public class ReferenceMetadataImpl extends ServiceReferenceMetadataImpl implements ReferenceMetadata
+public class ReferenceMetadataImpl extends ServiceReferenceMetadataImpl
{
protected BigInteger timeout;
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RegistrationListenerImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RegistrationListenerImpl.java 2009-06-17 20:11:23 UTC (rev 90357)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RegistrationListenerImpl.java 2009-06-17 20:49:25 UTC (rev 90358)
@@ -26,10 +26,6 @@
import java.util.ArrayList;
import java.util.List;
-import org.jboss.osgi.spi.NotImplementedException;
-import org.osgi.service.blueprint.reflect.RegistrationListener;
-import org.osgi.service.blueprint.reflect.Target;
-
/**
*
*
@@ -61,7 +57,7 @@
*
*
*/
-public class RegistrationListenerImpl implements RegistrationListener
+public class RegistrationListenerImpl
{
protected BeanMetadataImpl bean;
protected ReferenceMetadataImpl reference;
@@ -231,19 +227,4 @@
{
this.unregistrationMethod = value;
}
-
- public Target getListenerComponent()
- {
- throw new NotImplementedException();
- }
-
- public String getRegistrationMethodName()
- {
- throw new NotImplementedException();
- }
-
- public String getUnregistrationMethodName()
- {
- throw new NotImplementedException();
- }
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java 2009-06-17 20:11:23 UTC (rev 90357)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java 2009-06-17 20:49:25 UTC (rev 90358)
@@ -31,24 +31,18 @@
import javax.xml.namespace.QName;
-import org.jboss.osgi.spi.NotImplementedException;
-import org.osgi.service.blueprint.reflect.MapEntry;
-import org.osgi.service.blueprint.reflect.RegistrationListener;
-import org.osgi.service.blueprint.reflect.ServiceMetadata;
-import org.osgi.service.blueprint.reflect.Target;
-
/**
* Tservice is the type for services exported by this blueprint bundle. Services are sourced by either a <ref> to a <bean> component or an <inline> bean component.
*
* @author thomas.diesler(a)jboss.com
* @since 13-May-2009
*/
-public class ServiceMetadataImpl extends ComponentMetadataImpl implements ServiceMetadata
+public class ServiceMetadataImpl extends ComponentMetadataImpl
{
protected String description;
protected List<String> interfaces;
- protected List<MapEntry> serviceProperties;
- protected Collection<RegistrationListener> registrationListener;
+ protected List<ServicePropertyEntry> serviceProperties;
+ protected Collection<RegistrationListenerImpl> registrationListener;
protected BeanMetadataImpl bean;
protected List<Object> any;
protected String ref;
@@ -97,15 +91,15 @@
/**
* Gets the value of the serviceProperties property.
*/
- public List<MapEntry> getServiceProperties()
+ public List<ServicePropertyEntry> getServiceProperties()
{
if (serviceProperties == null)
- serviceProperties = new ArrayList<MapEntry>();
+ serviceProperties = new ArrayList<ServicePropertyEntry>();
return serviceProperties;
}
- public void setServiceProperties(List<MapEntry> serviceProperties)
+ public void setServiceProperties(List<ServicePropertyEntry> serviceProperties)
{
this.serviceProperties = serviceProperties;
}
@@ -113,15 +107,15 @@
/**
* Gets the value of the registrationListener property.
*/
- public Collection<RegistrationListener> getRegistrationListeners()
+ public Collection<RegistrationListenerImpl> getRegistrationListeners()
{
if (registrationListener == null)
- registrationListener = new ArrayList<RegistrationListener>();
+ registrationListener = new ArrayList<RegistrationListenerImpl>();
return registrationListener;
}
- public void setRegistrationListeners(Collection<RegistrationListener> registrationListener)
+ public void setRegistrationListeners(Collection<RegistrationListenerImpl> registrationListener)
{
this.registrationListener = registrationListener;
}
@@ -205,6 +199,7 @@
this.autoExportMode = value;
}
+ /*
public int getAutoExport()
{
int modeValue = AUTO_EXPORT_DISABLED;
@@ -219,6 +214,7 @@
return modeValue;
}
+ */
/**
* Gets the value of the ranking property.
@@ -243,11 +239,4 @@
{
return otherAttributes;
}
-
- // **********************************************************************
-
- public Target getServiceComponent()
- {
- throw new NotImplementedException();
- }
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServicePropertyEntry.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServicePropertyEntry.java 2009-06-17 20:11:23 UTC (rev 90357)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServicePropertyEntry.java 2009-06-17 20:49:25 UTC (rev 90358)
@@ -7,14 +7,12 @@
package org.jboss.osgi.blueprint.reflect;
-import org.osgi.service.blueprint.reflect.MapEntry;
-
/**
* TservicePropertyEntry is an entry value used for the <service-properties> element. This does not allow a child <key> element and there are no key-ref or value-ref
* attributes.
*
*/
-public class ServicePropertyEntry implements MapEntry
+public class ServicePropertyEntry
{
protected String key;
protected String value;
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java 2009-06-17 20:11:23 UTC (rev 90357)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java 2009-06-17 20:49:25 UTC (rev 90358)
@@ -30,9 +30,6 @@
import javax.xml.namespace.QName;
-import org.osgi.service.blueprint.reflect.ReferenceListener;
-import org.osgi.service.blueprint.reflect.ServiceReferenceMetadata;
-
/**
* TserviceReference is the base element type used for <reference>, <ref-set>, and <ref-list> elements. This type defines all of the characteristics common to both
* sorts of references.
@@ -65,11 +62,11 @@
*
*
*/
-public class ServiceReferenceMetadataImpl extends ComponentMetadataImpl implements ServiceReferenceMetadata
+public class ServiceReferenceMetadataImpl extends ComponentMetadataImpl
{
protected String description;
protected List<String> interfaces;
- protected List<ReferenceListener> listener;
+ protected List<ReferenceListenerImpl> listener;
protected List<Object> any;
protected String filter;
protected String componentName;
@@ -127,15 +124,15 @@
/**
* Gets the value of the listener property.
*/
- public List<ReferenceListener> getReferenceListeners()
+ public List<ReferenceListenerImpl> getReferenceListeners()
{
if (listener == null)
- listener = new ArrayList<ReferenceListener>();
+ listener = new ArrayList<ReferenceListenerImpl>();
return this.listener;
}
- public void setReferenceListeners(List<ReferenceListener> listener)
+ public void setReferenceListeners(List<ReferenceListenerImpl> listener)
{
this.listener = listener;
}
@@ -202,12 +199,12 @@
* @return possible object is {@link Tavailability }
*
*/
- public int getAvailability()
+ public Availability getAvailability()
{
- if (availability == Availability.MANDATORY)
- return AVAILABILITY_MANDATORY;
- else
- return AVAILABILITY_OPTIONAL;
+ if (availability == null)
+ availability = Availability.OPTIONAL;
+
+ return availability;
}
/**
@@ -216,9 +213,9 @@
* @param value allowed object is {@link Tavailability }
*
*/
- public void setAvailability(String value)
+ public void setAvailability(Availability value)
{
- this.availability = Availability.valueOf(value);
+ this.availability = value;
}
/**
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TypeConverters.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TypeConverters.java 2009-06-17 20:11:23 UTC (rev 90357)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TypeConverters.java 2009-06-17 20:49:25 UTC (rev 90358)
@@ -80,7 +80,7 @@
{
RefImpl ref = (RefImpl)comp;
String compName = ref.getComponent();
- comp = bpMetadata.getComponentMetadata(compName);
+ //comp = bpMetadata.getComponentMetadata(compName);
components.set(i, comp);
}
}
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/BlueprintContainerTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/BlueprintContainerTestCase.java 2009-06-17 20:11:23 UTC (rev 90357)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/BlueprintContainerTestCase.java 2009-06-17 20:49:25 UTC (rev 90358)
@@ -66,6 +66,7 @@
* @author thomas.diesler(a)jboss.com
* @since 13-May-2009
*/
+@Ignore
public class BlueprintContainerTestCase
{
@ProvideContext
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java 2009-06-17 20:11:23 UTC (rev 90357)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java 2009-06-17 20:49:25 UTC (rev 90358)
@@ -32,15 +32,16 @@
import org.jboss.osgi.blueprint.parser.BlueprintParser;
import org.jboss.osgi.blueprint.reflect.Availability;
+import org.jboss.osgi.blueprint.reflect.BeanMetadataImpl;
import org.jboss.osgi.blueprint.reflect.BlueprintMetadata;
+import org.jboss.osgi.blueprint.reflect.RefImpl;
+import org.jboss.osgi.blueprint.reflect.ReferenceMetadataImpl;
+import org.jboss.osgi.blueprint.reflect.ServiceMetadataImpl;
+import org.jboss.osgi.blueprint.reflect.ServiceReferenceMetadataImpl;
import org.jboss.osgi.blueprint.reflect.TypeConverters;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.osgi.service.blueprint.reflect.BeanMetadata;
-import org.osgi.service.blueprint.reflect.ReferenceMetadata;
-import org.osgi.service.blueprint.reflect.ServiceMetadata;
-import org.osgi.service.blueprint.reflect.ServiceReferenceMetadata;
/**
* Blueprint parser tests
@@ -94,26 +95,26 @@
List<Object> converters = typeConverters.getComponents();
assertEquals("TypeConverters size", 5, converters.size());
- BeanMetadata conv1 = (BeanMetadata)converters.get(0);
+ BeanMetadataImpl conv1 = (BeanMetadataImpl)converters.get(0);
assertNotNull("Converter not null", conv1);
- ReferenceMetadata conv2 = (ReferenceMetadata)converters.get(1);
+ ReferenceMetadataImpl conv2 = (ReferenceMetadataImpl)converters.get(1);
assertNotNull("Converter not null", conv2);
- ReferenceMetadata conv3 = (ReferenceMetadata)converters.get(2);
+ ReferenceMetadataImpl conv3 = (ReferenceMetadataImpl)converters.get(2);
assertNotNull("Converter not null", conv3);
- BeanMetadata conv4 = (BeanMetadata)converters.get(3);
+ RefImpl conv4 = (RefImpl)converters.get(3);
assertNotNull("Converter not null", conv4);
- BeanMetadata conv5 = (BeanMetadata)converters.get(4);
+ RefImpl conv5 = (RefImpl)converters.get(4);
assertNotNull("Converter not null", conv5);
}
@Test
public void getExportedServicesMetadata() throws Exception
{
- Collection<ServiceMetadata> services = blueprint.getMetadata(ServiceMetadata.class);
+ Collection<ServiceMetadataImpl> services = blueprint.getMetadata(ServiceMetadataImpl.class);
assertNotNull("ServiceMetadata not null", services);
assertEquals("ServiceMetadata size", 2, services.size());
}
@@ -121,7 +122,7 @@
@Test
public void getReferencedServicesMetadata() throws Exception
{
- Collection<ServiceReferenceMetadata> serviceRefs = blueprint.getMetadata(ServiceReferenceMetadata.class);
+ Collection<ServiceReferenceMetadataImpl> serviceRefs = blueprint.getMetadata(ServiceReferenceMetadataImpl.class);
assertNotNull("ServiceReferenceMetadata not null", serviceRefs);
assertEquals("ServiceReferenceMetadata size", 3, serviceRefs.size());
}
@@ -129,7 +130,7 @@
@Test
public void getBeanComponentsMetadata() throws Exception
{
- Collection<BeanMetadata> beans = blueprint.getMetadata(BeanMetadata.class);
+ Collection<BeanMetadataImpl> beans = blueprint.getMetadata(BeanMetadataImpl.class);
assertNotNull("BeanMetadata not null", beans);
assertEquals("BeanMetadata size", 3, beans.size());
}
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java 2009-06-17 20:11:23 UTC (rev 90357)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java 2009-06-17 20:49:25 UTC (rev 90358)
@@ -30,13 +30,13 @@
import java.util.List;
import org.jboss.osgi.blueprint.parser.BlueprintParser;
+import org.jboss.osgi.blueprint.reflect.BeanMetadataImpl;
import org.jboss.osgi.blueprint.reflect.BlueprintMetadata;
+import org.jboss.osgi.blueprint.reflect.ComponentMetadataImpl;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.jboss.test.osgi.blueprint.parser.comp.BeanA;
import org.jboss.test.osgi.blueprint.parser.comp.BeanB;
import org.junit.Test;
-import org.osgi.service.blueprint.reflect.BeanMetadata;
-import org.osgi.service.blueprint.reflect.ComponentMetadata;
/**
* Blueprint parser tests
@@ -52,14 +52,14 @@
URL xmlURL = getResourceURL("parser/blueprint-basic-beans.xml");
BlueprintMetadata blueprint = new BlueprintParser().parse(xmlURL);
- List<ComponentMetadata> compList = blueprint.getComponents();
+ List<ComponentMetadataImpl> compList = blueprint.getComponents();
assertTrue(compList.size() > 0);
- BeanMetadata beanA = (BeanMetadata)compList.get(0);
+ BeanMetadataImpl beanA = (BeanMetadataImpl)compList.get(0);
assertEquals(BeanA.class.getName(), beanA.getClassName());
assertEquals("beanA", beanA.getId());
- BeanMetadata beanB = (BeanMetadata)compList.get(1);
+ BeanMetadataImpl beanB = (BeanMetadataImpl)compList.get(1);
assertEquals(BeanB.class.getName(), beanB.getClassName());
assertEquals("beanB", beanB.getId());
}
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java 2009-06-17 20:11:23 UTC (rev 90357)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java 2009-06-17 20:49:25 UTC (rev 90358)
@@ -30,15 +30,15 @@
import java.util.List;
import org.jboss.osgi.blueprint.parser.BlueprintParser;
+import org.jboss.osgi.blueprint.reflect.BeanMetadataImpl;
import org.jboss.osgi.blueprint.reflect.BlueprintMetadata;
+import org.jboss.osgi.blueprint.reflect.ComponentMetadataImpl;
+import org.jboss.osgi.blueprint.reflect.ServiceMetadataImpl;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.jboss.test.osgi.blueprint.parser.comp.BeanA;
import org.jboss.test.osgi.blueprint.parser.comp.ServiceA;
import org.jboss.test.osgi.blueprint.parser.comp.ServiceB;
import org.junit.Test;
-import org.osgi.service.blueprint.reflect.BeanMetadata;
-import org.osgi.service.blueprint.reflect.ComponentMetadata;
-import org.osgi.service.blueprint.reflect.ServiceMetadata;
/**
* Blueprint parser tests
@@ -54,21 +54,21 @@
URL xmlURL = getResourceURL("parser/blueprint-basic-service.xml");
BlueprintMetadata blueprint = new BlueprintParser().parse(xmlURL);
- List<ComponentMetadata> compList = blueprint.getComponents();
+ List<ComponentMetadataImpl> compList = blueprint.getComponents();
assertTrue(compList.size() > 0);
- BeanMetadata beanA = (BeanMetadata)compList.get(0);
+ BeanMetadataImpl beanA = (BeanMetadataImpl)compList.get(0);
assertEquals(BeanA.class.getName(), beanA.getClassName());
assertEquals("beanA", beanA.getId());
- ServiceMetadata serviceA = (ServiceMetadata)compList.get(1);
+ ServiceMetadataImpl serviceA = (ServiceMetadataImpl)compList.get(1);
assertEquals("serviceA", serviceA.getId());
List<String> intfsA = serviceA.getInterfaces();
assertTrue(intfsA.size() > 0);
assertEquals(ServiceA.class.getName(), intfsA.get(0));
- ServiceMetadata serviceB = (ServiceMetadata)compList.get(2);
+ ServiceMetadataImpl serviceB = (ServiceMetadataImpl)compList.get(2);
assertEquals("serviceB", serviceB.getId());
List<String> intfsB = serviceB.getInterfaces();
15 years
JBoss-OSGI SVN: r90336 - in projects/jboss-osgi/trunk/blueprint: impl/src/main/java/org/jboss/osgi/blueprint/reflect and 10 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-17 11:22:08 -0400 (Wed, 17 Jun 2009)
New Revision: 90336
Added:
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/BlueprintContainerTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/bundle/
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/container/
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/container/container-basic.bnd
Removed:
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/bundle/
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/container/context-basic.bnd
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/
Modified:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd
projects/jboss-osgi/trunk/blueprint/testsuite/scripts/antrun-test-jars.xml
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/bundle/BeanA.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/bundle/BeanB.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/bundle/ServiceA.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/bundle/ServiceB.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/container/OSGI-INF/blueprint/basic-service.xml
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml
Log:
Refactor after BP API update
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java 2009-06-17 15:10:06 UTC (rev 90335)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java 2009-06-17 15:22:08 UTC (rev 90336)
@@ -26,6 +26,7 @@
import java.net.URL;
import java.util.Collection;
import java.util.Enumeration;
+import java.util.Properties;
import java.util.Set;
import org.jboss.osgi.blueprint.parser.BlueprintParser;
@@ -34,6 +35,7 @@
import org.jboss.osgi.spi.NotImplementedException;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
import org.osgi.service.blueprint.container.BlueprintContainer;
import org.osgi.service.blueprint.reflect.ComponentMetadata;
import org.osgi.service.log.LogService;
@@ -64,6 +66,8 @@
public class BlueprintContainerImpl implements BlueprintContainer
{
public static final String HEADER_BUNDLE_BLUEPRINT = "Bundle-Blueprint";
+ public static final String PROPERTY_BLUEPRINT_BUNDLE_SYMBOLIC_NAME = "osgi.blueprint.container.symbolicname";
+ public static final String PROPERTY_BLUEPRINT_BUNDLE_VERSION = "osgi.blueprint.container.version";
private LogService log;
@@ -81,9 +85,10 @@
public void initialize()
{
- bpMetadata = getBlueprintMetadata(bundle);
+ bpMetadata = getBlueprintMetadata();
+ registerBlueprintContainerService();
}
-
+
public BundleContext getBundleContext()
{
return bundle.getBundleContext();
@@ -115,7 +120,7 @@
}
@SuppressWarnings("unchecked")
- private BlueprintMetadata getBlueprintMetadata(Bundle bundle)
+ private BlueprintMetadata getBlueprintMetadata()
{
BlueprintMetadata bpMetadata = null;
@@ -165,4 +170,15 @@
BlueprintMetadata blueprint = new BlueprintParser().parse(descriptorURL);
return blueprint;
}
+
+ private void registerBlueprintContainerService()
+ {
+ String symbolicName = bundle.getSymbolicName();
+ String version = (String)bundle.getHeaders().get(Constants.BUNDLE_VERSION);
+
+ Properties props = new Properties();
+ props.setProperty(PROPERTY_BLUEPRINT_BUNDLE_SYMBOLIC_NAME, symbolicName);
+ props.setProperty(PROPERTY_BLUEPRINT_BUNDLE_VERSION, version);
+ context.registerService(BlueprintContainer.class.getName(), this, props);
+ }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java 2009-06-17 15:10:06 UTC (rev 90335)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java 2009-06-17 15:22:08 UTC (rev 90336)
@@ -36,7 +36,6 @@
import org.osgi.service.blueprint.reflect.RegistrationListener;
import org.osgi.service.blueprint.reflect.ServiceMetadata;
import org.osgi.service.blueprint.reflect.Target;
-import org.w3c.dom.Element;
/**
* Tservice is the type for services exported by this blueprint bundle. Services are sourced by either a <ref> to a <bean> component or an <inline> bean component.
@@ -51,10 +50,9 @@
protected List<MapEntry> serviceProperties;
protected Collection<RegistrationListener> registrationListener;
protected BeanMetadataImpl bean;
- protected RefImpl refFIXME;
protected List<Object> any;
protected String ref;
- protected int autoExport;
+ protected AutoExportModes autoExportMode;
protected int ranking;
private Map<QName, String> otherAttributes = new HashMap<QName, String>();
@@ -91,6 +89,11 @@
return interfaces;
}
+ public void setInterfaces(List<String> interfaces)
+ {
+ this.interfaces = interfaces;
+ }
+
/**
* Gets the value of the serviceProperties property.
*/
@@ -146,46 +149,7 @@
}
/**
- * Gets the value of the refFIXME property.
- *
- * @return possible object is {@link RefImpl }
- *
- */
- public RefImpl getRefFIXME()
- {
- return refFIXME;
- }
-
- /**
- * Sets the value of the refFIXME property.
- *
- * @param value allowed object is {@link RefImpl }
- *
- */
- public void setRefFIXME(RefImpl value)
- {
- this.refFIXME = value;
- }
-
- /**
* Gets the value of the any property.
- *
- * <p>
- * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the
- * JAXB object. This is why there is not a <CODE>set</CODE> method for the any property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getAny().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list {@link Object } {@link Element }
- *
- *
*/
public List<Object> getAny()
{
@@ -223,12 +187,12 @@
*
* @return possible object is {@link AutoExportModes }
*/
- public int getAutoExport()
+ public AutoExportModes getAutoExportMode()
{
- if (autoExport == 0)
- autoExport = AUTO_EXPORT_DISABLED;
+ if (autoExportMode == null)
+ autoExportMode = AutoExportModes.DISABLED;
- return autoExport;
+ return autoExportMode;
}
/**
@@ -236,11 +200,26 @@
*
* @param value allowed object is {@link AutoExportModes }
*/
- public void setAutoExport(int value)
+ public void setAutoExportMode(AutoExportModes value)
{
- this.autoExport = value;
+ this.autoExportMode = value;
}
+ public int getAutoExport()
+ {
+ int modeValue = AUTO_EXPORT_DISABLED;
+
+ AutoExportModes mode = getAutoExportMode();
+ if (mode == AutoExportModes.ALL_CLASSES)
+ modeValue = AUTO_EXPORT_ALL_CLASSES;
+ else if (mode == AutoExportModes.CLASS_HIERARCHY)
+ modeValue = AUTO_EXPORT_CLASS_HIERARCHY;
+ else if (mode == AutoExportModes.INTERFACES)
+ modeValue = AUTO_EXPORT_INTERFACES;
+
+ return modeValue;
+ }
+
/**
* Gets the value of the ranking property.
*/
@@ -259,14 +238,6 @@
/**
* Gets a map that contains attributes that aren't bound to any typed property on this class.
- *
- * <p>
- * the map is keyed by the name of the attribute and the value is the string value of the attribute.
- *
- * the map returned by this method is live, and you can add new attribute by updating the map directly. Because of this design, there's no setter.
- *
- *
- * @return always non-null
*/
public Map<QName, String> getOtherAttributes()
{
@@ -275,16 +246,6 @@
// **********************************************************************
- public int getAutoExportMode()
- {
- throw new NotImplementedException();
- }
-
- public List<String> getExplicitDependencies()
- {
- throw new NotImplementedException();
- }
-
public Target getServiceComponent()
{
throw new NotImplementedException();
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java 2009-06-17 15:10:06 UTC (rev 90335)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java 2009-06-17 15:22:08 UTC (rev 90336)
@@ -30,7 +30,6 @@
import javax.xml.namespace.QName;
-import org.jboss.osgi.spi.NotImplementedException;
import org.osgi.service.blueprint.reflect.ReferenceListener;
import org.osgi.service.blueprint.reflect.ServiceReferenceMetadata;
@@ -111,6 +110,20 @@
return interfaces;
}
+ public void setInterfaces(List<String> interfaces)
+ {
+ this.interfaces = interfaces;
+ }
+
+ public String getInterface()
+ {
+ List<String> interfaces = getInterfaces();
+ if (interfaces.size() == 0)
+ throw new IllegalStateException("Empty list of interfaces");
+
+ return interfaces.get(0);
+ }
+
/**
* Gets the value of the listener property.
*/
@@ -210,22 +223,9 @@
/**
* Gets a map that contains attributes that aren't bound to any typed property on this class.
- *
- * <p>
- * the map is keyed by the name of the attribute and the value is the string value of the attribute.
- *
- * the map returned by this method is live, and you can add new attribute by updating the map directly. Because of this design, there's no setter.
- *
- *
- * @return always non-null
*/
public Map<QName, String> getOtherAttributes()
{
return otherAttributes;
}
-
- public String getInterface()
- {
- throw new NotImplementedException();
- }
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd 2009-06-17 15:10:06 UTC (rev 90335)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd 2009-06-17 15:22:08 UTC (rev 90336)
@@ -579,7 +579,7 @@
<xsd:attribute name="interface" use="optional" type="Tclass" >
<xsd:annotation>
<xsd:appinfo>
- <jbxb:property name="interfaceNames"/>
+ <jbxb:property name="interfaces"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:attribute>
@@ -712,7 +712,7 @@
<xsd:attribute name="interface" type="Tclass" use="optional" >
<xsd:annotation>
<xsd:appinfo>
- <jbxb:property name="interfaceNames"/>
+ <jbxb:property name="interfaces"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:attribute>
@@ -732,7 +732,13 @@
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
- <xsd:attribute name="auto-export" type="TautoExportModes" default="disabled" />
+ <xsd:attribute name="auto-export" type="TautoExportModes" default="disabled" >
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:property name="autoExportMode"/>
+ </xsd:appinfo>
+ </xsd:annotation>
+ </xsd:attribute>
<xsd:attribute name="ranking" type="xsd:int" default="0">
<xsd:annotation>
<xsd:documentation>
@@ -1107,7 +1113,7 @@
<xsd:element name="value" type="TinterfaceValue" >
<xsd:annotation>
<xsd:appinfo>
- <jbxb:property name="interfaceNames"/>
+ <jbxb:property name="interfaces"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/scripts/antrun-test-jars.xml 2009-06-17 15:10:06 UTC (rev 90335)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/scripts/antrun-test-jars.xml 2009-06-17 15:22:08 UTC (rev 90336)
@@ -43,7 +43,7 @@
<!-- Please add alphabetically -->
<!-- context -->
- <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/context-basic.jar" files="${tests.resources.dir}/context/context-basic.bnd" />
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/container-basic.jar" files="${tests.resources.dir}/container/container-basic.bnd" />
<!-- Please add alphabetically -->
Copied: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/BlueprintContainerTestCase.java (from rev 90334, projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/BlueprintContainerTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/BlueprintContainerTestCase.java 2009-06-17 15:22:08 UTC (rev 90336)
@@ -0,0 +1,270 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.test.osgi.blueprint.container;
+
+//$Id$
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeNotNull;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import javax.management.MBeanServer;
+
+import org.jboss.osgi.husky.Bridge;
+import org.jboss.osgi.husky.BridgeFactory;
+import org.jboss.osgi.husky.annotation.ProvideContext;
+import org.jboss.osgi.spi.capability.BlueprintCapability;
+import org.jboss.osgi.spi.capability.HuskyCapability;
+import org.jboss.osgi.spi.capability.MicrocontainerCapability;
+import org.jboss.osgi.spi.testing.OSGiBundle;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.jboss.test.osgi.blueprint.container.bundle.BeanA;
+import org.jboss.test.osgi.blueprint.container.bundle.ServiceA;
+import org.jboss.test.osgi.blueprint.container.bundle.ServiceB;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.blueprint.container.BlueprintContainer;
+import org.osgi.service.blueprint.reflect.BeanMetadata;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+import org.osgi.service.blueprint.reflect.ServiceMetadata;
+import org.osgi.service.blueprint.reflect.ServiceReferenceMetadata;
+
+/**
+ * BlueprintContainer API tests
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 13-May-2009
+ */
+public class BlueprintContainerTestCase
+{
+ @ProvideContext
+ public static BundleContext context;
+
+ private static OSGiRuntime runtime;
+ private static Bridge huskyBridge;
+
+ @BeforeClass
+ public static void beforeClass() throws Exception
+ {
+ if (context == null)
+ {
+ runtime = new OSGiTestHelper().getDefaultRuntime();
+ runtime.addCapability(new HuskyCapability());
+ runtime.addCapability(new MicrocontainerCapability());
+ runtime.addCapability(new BlueprintCapability());
+
+ huskyBridge = BridgeFactory.getBridge();
+
+ OSGiBundle bundle = runtime.installBundle("container-basic.jar");
+ bundle.start();
+ }
+ }
+
+ @AfterClass
+ public static void afterClass() throws Exception
+ {
+ if (context == null)
+ runtime.shutdown();
+ }
+
+ @Test
+ public void testBlueprintBundleInstall() throws Exception
+ {
+ if (context == null)
+ huskyBridge.run();
+
+ assumeNotNull(context);
+
+ Bundle bundle = context.getBundle();
+ assertEquals("container-basic", bundle.getSymbolicName());
+ }
+
+ @Test
+ public void testBlueprintContextAvailable() throws Exception
+ {
+ if (context == null)
+ huskyBridge.run();
+
+ assumeNotNull(context);
+
+ BlueprintContainer bpContext = getBlueprintContainer();
+ assertNotNull("BlueprintContainer available", bpContext);
+ }
+
+
+ @Test
+ public void getBeanComponentsMetadata() throws Exception
+ {
+ if (context == null)
+ huskyBridge.run();
+
+ assumeNotNull(context);
+
+ BlueprintContainer bpContext = getBlueprintContainer();
+ Collection<BeanMetadata> bcMetadata = bpContext.getMetadata(BeanMetadata.class);
+
+ assertNotNull("BeanComponentsMetadata not null", bcMetadata);
+ assertEquals("BeanComponentsMetadata size", 1, bcMetadata.size());
+
+ BeanMetadata bmd = bcMetadata.iterator().next();
+ assertEquals("beanA", bmd.getId());
+ assertEquals(BeanA.class.getName(), bmd.getClassName());
+ }
+
+ @Test
+ public void getBundleContext() throws Exception
+ {
+ if (context == null)
+ huskyBridge.run();
+
+ assumeNotNull(context);
+
+ BlueprintContainer bpContext = getBlueprintContainer();
+ BundleContext bndContext = bpContext.getBundleContext();
+
+ assertNotNull("BundleContext not null", bndContext);
+ assertEquals("BundleContext equals", context, bndContext);
+ }
+
+
+ @Test
+ @Ignore
+ public void getComponent() throws Exception
+ {
+ if (context == null)
+ huskyBridge.run();
+
+ assumeNotNull(context);
+
+ BlueprintContainer bpContext = getBlueprintContainer();
+ bpContext.getComponentInstance("beanA");
+ }
+
+ @Test
+ public void getComponentMetadata() throws Exception
+ {
+ if (context == null)
+ huskyBridge.run();
+
+ assumeNotNull(context);
+
+ BlueprintContainer bpContext = getBlueprintContainer();
+ ComponentMetadata compMetadata = bpContext.getComponentMetadata("beanA");
+
+ assertNotNull("ComponentMetadata not null", compMetadata);
+ assertEquals("beanA", compMetadata.getId());
+ }
+
+ @Test
+ public void getComponentNames() throws Exception
+ {
+ if (context == null)
+ huskyBridge.run();
+
+ assumeNotNull(context);
+
+ BlueprintContainer bpContext = getBlueprintContainer();
+ Set<String> compNames = bpContext.getComponentIds();
+
+ assertNotNull("ComponentNames not null", compNames);
+ assertEquals("ComponentNames size", 4, compNames.size());
+ assertTrue("ComponentNames contains beanA", compNames.contains("beanA"));
+ assertTrue("ComponentNames contains serviceA", compNames.contains("serviceA"));
+ assertTrue("ComponentNames contains serviceB", compNames.contains("serviceB"));
+ assertTrue("ComponentNames contains mbeanService", compNames.contains("mbeanService"));
+ }
+
+ @Test
+ public void getExportedServicesMetadata() throws Exception
+ {
+ if (context == null)
+ huskyBridge.run();
+
+ assumeNotNull(context);
+
+ BlueprintContainer bpContext = getBlueprintContainer();
+ Collection<ServiceMetadata> servicesMetadata = bpContext.getMetadata(ServiceMetadata.class);
+
+ assertNotNull("ServiceMetadata not null", servicesMetadata);
+ assertEquals("ServiceMetadata size", 2, servicesMetadata.size());
+
+ Iterator<ServiceMetadata> itServices = servicesMetadata.iterator();
+ ServiceMetadata serviceA = itServices.next();
+ assertEquals("serviceA", serviceA.getId());
+
+ List<String> interfaceNamesA = serviceA.getInterfaces();
+ assertNotNull("InterfaceNames not null", interfaceNamesA);
+ assertEquals("InterfaceNames size", 1, interfaceNamesA.size());
+ assertEquals("InterfaceName", ServiceA.class.getName(), interfaceNamesA.get(0));
+
+ ServiceMetadata serviceB = itServices.next();
+ assertEquals("serviceB", serviceB.getId());
+
+ List<String> interfaceNamesB = serviceB.getInterfaces();
+ assertNotNull("InterfaceNames not null", interfaceNamesB);
+ assertEquals("InterfaceNames size", 1, interfaceNamesB.size());
+ assertEquals("InterfaceName", ServiceB.class.getName(), interfaceNamesB.get(0));
+ }
+
+ @Test
+ public void getReferencedServicesMetadata() throws Exception
+ {
+ if (context == null)
+ huskyBridge.run();
+
+ assumeNotNull(context);
+
+ BlueprintContainer bpContext = getBlueprintContainer();
+ Collection<ServiceReferenceMetadata> srefsMetadata = bpContext.getMetadata(ServiceReferenceMetadata.class);
+
+ assertNotNull("ServiceReferenceMetadata not null", srefsMetadata);
+ assertEquals("ServiceReferenceMetadata size", 1, srefsMetadata.size());
+
+ ServiceReferenceMetadata srefMetadata = srefsMetadata.iterator().next();
+ assertEquals("mbeanService", srefMetadata.getId());
+
+ String interfaceName = srefMetadata.getInterface();
+ assertNotNull("InterfaceName not null", interfaceName);
+ assertEquals("InterfaceName", MBeanServer.class.getName(), interfaceName);
+ }
+
+ private BlueprintContainer getBlueprintContainer()
+ {
+ ServiceReference sref = context.getServiceReference(BlueprintContainer.class.getName());
+ assertNotNull("BlueprintContainer service not null", sref);
+
+ BlueprintContainer bpContext = (BlueprintContainer)context.getService(sref);
+ return bpContext;
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/bundle (from rev 90334, projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/bundle)
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/bundle/BeanA.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/bundle/BeanA.java 2009-06-17 14:36:03 UTC (rev 90334)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/bundle/BeanA.java 2009-06-17 15:22:08 UTC (rev 90336)
@@ -19,7 +19,7 @@
* 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.test.osgi.blueprint.context.bundle;
+package org.jboss.test.osgi.blueprint.container.bundle;
import javax.management.MBeanServer;
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/bundle/BeanB.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/bundle/BeanB.java 2009-06-17 14:36:03 UTC (rev 90334)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/bundle/BeanB.java 2009-06-17 15:22:08 UTC (rev 90336)
@@ -19,7 +19,7 @@
* 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.test.osgi.blueprint.context.bundle;
+package org.jboss.test.osgi.blueprint.container.bundle;
//$Id$
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/bundle/ServiceA.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/bundle/ServiceA.java 2009-06-17 14:36:03 UTC (rev 90334)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/bundle/ServiceA.java 2009-06-17 15:22:08 UTC (rev 90336)
@@ -19,7 +19,7 @@
* 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.test.osgi.blueprint.context.bundle;
+package org.jboss.test.osgi.blueprint.container.bundle;
//$Id$
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/bundle/ServiceB.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/bundle/ServiceB.java 2009-06-17 14:36:03 UTC (rev 90334)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/container/bundle/ServiceB.java 2009-06-17 15:22:08 UTC (rev 90336)
@@ -19,7 +19,7 @@
* 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.test.osgi.blueprint.context.bundle;
+package org.jboss.test.osgi.blueprint.container.bundle;
//$Id$
Deleted: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java 2009-06-17 15:10:06 UTC (rev 90335)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java 2009-06-17 15:22:08 UTC (rev 90336)
@@ -1,268 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, 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.test.osgi.blueprint.context;
-
-//$Id$
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assume.assumeNotNull;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import javax.management.MBeanServer;
-
-import org.jboss.osgi.husky.Bridge;
-import org.jboss.osgi.husky.BridgeFactory;
-import org.jboss.osgi.husky.annotation.ProvideContext;
-import org.jboss.osgi.spi.capability.BlueprintCapability;
-import org.jboss.osgi.spi.capability.HuskyCapability;
-import org.jboss.osgi.spi.capability.MicrocontainerCapability;
-import org.jboss.osgi.spi.testing.OSGiBundle;
-import org.jboss.osgi.spi.testing.OSGiRuntime;
-import org.jboss.osgi.spi.testing.OSGiTestHelper;
-import org.jboss.test.osgi.blueprint.context.bundle.BeanA;
-import org.jboss.test.osgi.blueprint.context.bundle.ServiceA;
-import org.jboss.test.osgi.blueprint.context.bundle.ServiceB;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.blueprint.container.BlueprintContainer;
-import org.osgi.service.blueprint.reflect.BeanMetadata;
-import org.osgi.service.blueprint.reflect.ComponentMetadata;
-import org.osgi.service.blueprint.reflect.ServiceMetadata;
-import org.osgi.service.blueprint.reflect.ServiceReferenceMetadata;
-
-/**
- * BlueprintContainer API tests
- *
- * @author thomas.diesler(a)jboss.com
- * @since 13-May-2009
- */
-public class BlueprintContextTestCase
-{
- @ProvideContext
- public static BundleContext context;
-
- private static OSGiRuntime runtime;
- private static Bridge huskyBridge;
-
- @BeforeClass
- public static void beforeClass() throws Exception
- {
- if (context == null)
- {
- runtime = new OSGiTestHelper().getDefaultRuntime();
- runtime.addCapability(new HuskyCapability());
- runtime.addCapability(new MicrocontainerCapability());
- runtime.addCapability(new BlueprintCapability());
-
- huskyBridge = BridgeFactory.getBridge();
-
- OSGiBundle bundle = runtime.installBundle("context-basic.jar");
- bundle.start();
- }
- }
-
- @AfterClass
- public static void afterClass() throws Exception
- {
- if (context == null)
- runtime.shutdown();
- }
-
- @Test
- public void testBlueprintBundleInstall() throws Exception
- {
- if (context == null)
- huskyBridge.run();
-
- assumeNotNull(context);
-
- Bundle bundle = context.getBundle();
- assertEquals("context-basic", bundle.getSymbolicName());
- }
-
- @Test
- public void testBlueprintContextAvailable() throws Exception
- {
- if (context == null)
- huskyBridge.run();
-
- assumeNotNull(context);
-
- BlueprintContainer bpContext = getBlueprintContext();
- assertNotNull("BlueprintContainer available", bpContext);
- }
-
-
- @Test
- public void getBeanComponentsMetadata() throws Exception
- {
- if (context == null)
- huskyBridge.run();
-
- assumeNotNull(context);
-
- BlueprintContainer bpContext = getBlueprintContext();
- Collection<BeanMetadata> bcMetadata = bpContext.getMetadata(BeanMetadata.class);
-
- assertNotNull("BeanComponentsMetadata not null", bcMetadata);
- assertEquals("BeanComponentsMetadata size", 1, bcMetadata.size());
-
- BeanMetadata bmd = bcMetadata.iterator().next();
- assertEquals("beanA", bmd.getId());
- assertEquals(BeanA.class.getName(), bmd.getClassName());
- }
-
- @Test
- public void getBundleContext() throws Exception
- {
- if (context == null)
- huskyBridge.run();
-
- assumeNotNull(context);
-
- BlueprintContainer bpContext = getBlueprintContext();
- BundleContext bndContext = bpContext.getBundleContext();
-
- assertNotNull("BundleContext not null", bndContext);
- assertEquals("BundleContext equals", context, bndContext);
- }
-
-
- @Test
- @Ignore
- public void getComponent() throws Exception
- {
- if (context == null)
- huskyBridge.run();
-
- assumeNotNull(context);
-
- BlueprintContainer bpContext = getBlueprintContext();
- bpContext.getComponentInstance("beanA");
- }
-
- @Test
- public void getComponentMetadata() throws Exception
- {
- if (context == null)
- huskyBridge.run();
-
- assumeNotNull(context);
-
- BlueprintContainer bpContext = getBlueprintContext();
- ComponentMetadata compMetadata = bpContext.getComponentMetadata("beanA");
-
- assertNotNull("ComponentMetadata not null", compMetadata);
- assertEquals("beanA", compMetadata.getId());
- }
-
- @Test
- public void getComponentNames() throws Exception
- {
- if (context == null)
- huskyBridge.run();
-
- assumeNotNull(context);
-
- BlueprintContainer bpContext = getBlueprintContext();
- Set<String> compNames = bpContext.getComponentIds();
-
- assertNotNull("ComponentNames not null", compNames);
- assertEquals("ComponentNames size", 4, compNames.size());
- assertTrue("ComponentNames contains beanA", compNames.contains("beanA"));
- assertTrue("ComponentNames contains serviceA", compNames.contains("serviceA"));
- assertTrue("ComponentNames contains serviceB", compNames.contains("serviceB"));
- assertTrue("ComponentNames contains mbeanService", compNames.contains("mbeanService"));
- }
-
- @Test
- public void getExportedServicesMetadata() throws Exception
- {
- if (context == null)
- huskyBridge.run();
-
- assumeNotNull(context);
-
- BlueprintContainer bpContext = getBlueprintContext();
- Collection<ServiceMetadata> servicesMetadata = bpContext.getMetadata(ServiceMetadata.class);
-
- assertNotNull("ServiceMetadata not null", servicesMetadata);
- assertEquals("ServiceMetadata size", 2, servicesMetadata.size());
-
- Iterator<ServiceMetadata> itServices = servicesMetadata.iterator();
- ServiceMetadata serviceA = itServices.next();
- assertEquals("serviceA", serviceA.getId());
-
- List<String> interfaceNamesA = serviceA.getInterfaces();
- assertNotNull("InterfaceNames not null", interfaceNamesA);
- assertEquals("InterfaceNames size", 1, interfaceNamesA.size());
- assertEquals("InterfaceName", ServiceA.class.getName(), interfaceNamesA.get(0));
-
- ServiceMetadata serviceB = itServices.next();
- assertEquals("serviceB", serviceB.getId());
-
- List<String> interfaceNamesB = serviceB.getInterfaces();
- assertNotNull("InterfaceNames not null", interfaceNamesB);
- assertEquals("InterfaceNames size", 1, interfaceNamesB.size());
- assertEquals("InterfaceName", ServiceB.class.getName(), interfaceNamesB.get(0));
- }
-
- @Test
- public void getReferencedServicesMetadata() throws Exception
- {
- if (context == null)
- huskyBridge.run();
-
- assumeNotNull(context);
-
- BlueprintContainer bpContext = getBlueprintContext();
- Collection<ServiceReferenceMetadata> srefsMetadata = bpContext.getMetadata(ServiceReferenceMetadata.class);
-
- assertNotNull("ServiceReferenceMetadata not null", srefsMetadata);
- assertEquals("ServiceReferenceMetadata size", 1, srefsMetadata.size());
-
- ServiceReferenceMetadata srefMetadata = srefsMetadata.iterator().next();
- assertEquals("mbeanService", srefMetadata.getId());
-
- String interfaceName = srefMetadata.getInterface();
- assertNotNull("InterfaceName not null", interfaceName);
- assertEquals("InterfaceName", MBeanServer.class.getName(), interfaceName);
- }
-
- private BlueprintContainer getBlueprintContext()
- {
- ServiceReference sref = context.getServiceReference(BlueprintContainer.class.getName());
- BlueprintContainer bpContext = (BlueprintContainer)context.getService(sref);
- return bpContext;
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/container (from rev 90334, projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context)
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/container/OSGI-INF/blueprint/basic-service.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/OSGI-INF/blueprint/basic-service.xml 2009-06-17 14:36:03 UTC (rev 90334)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/container/OSGI-INF/blueprint/basic-service.xml 2009-06-17 15:22:08 UTC (rev 90336)
@@ -1,15 +1,15 @@
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd schema/blueprint.xsd">
- <bean id="beanA" class="org.jboss.test.osgi.blueprint.context.bundle.BeanA">
+ <bean id="beanA" class="org.jboss.test.osgi.blueprint.container.bundle.BeanA">
<property name="mbeanServer" ref="mbeanService"/>
</bean>
- <service id="serviceA" ref="beanA" interface="org.jboss.test.osgi.blueprint.context.bundle.ServiceA">
+ <service id="serviceA" ref="beanA" interface="org.jboss.test.osgi.blueprint.container.bundle.ServiceA">
</service>
- <service id="serviceB" interface="org.jboss.test.osgi.blueprint.context.bundle.ServiceB">
- <bean class="org.jboss.test.osgi.blueprint.context.bundle.BeanB"/>
+ <service id="serviceB" interface="org.jboss.test.osgi.blueprint.container.bundle.ServiceB">
+ <bean class="org.jboss.test.osgi.blueprint.container.bundle.BeanB"/>
</service>
<reference id="mbeanService" interface="javax.management.MBeanServer"/>
Copied: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/container/container-basic.bnd (from rev 90334, projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/context-basic.bnd)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/container/container-basic.bnd (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/container/container-basic.bnd 2009-06-17 15:22:08 UTC (rev 90336)
@@ -0,0 +1,24 @@
+# bnd build -classpath target/test-classes -output target/test-libs/container-basic.jar src/test/resources/container/container-basic.bnd
+
+Bundle-SymbolicName: container-basic
+
+Export-Package: org.jboss.test.osgi.blueprint.container
+
+Private-Package: org.jboss.test.osgi.blueprint.container.bundle
+
+Import-Package: \
+ javax.management, \
+ org.jboss.osgi.husky, \
+ org.jboss.osgi.husky.annotation, \
+ org.jboss.osgi.spi.capability, \
+ org.jboss.osgi.spi.testing, \
+ org.junit, \
+ org.osgi.framework, \
+ org.osgi.service.blueprint.*
+
+Include-Resource: \
+ OSGI-INF/blueprint=OSGI-INF/blueprint
+
+Test-Package: org.jboss.test.osgi.blueprint.container
+
+-removeheaders: Include-Resource
Deleted: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/container/context-basic.bnd
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/context-basic.bnd 2009-06-17 14:36:03 UTC (rev 90334)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/container/context-basic.bnd 2009-06-17 15:22:08 UTC (rev 90336)
@@ -1,24 +0,0 @@
-# bnd build -classpath target/test-classes -output target/test-libs/context-basic.jar src/test/resources/context/context-basic.bnd
-
-Bundle-SymbolicName: context-basic
-
-Export-Package: org.jboss.test.osgi.blueprint.context
-
-Private-Package: org.jboss.test.osgi.blueprint.context.bundle
-
-Import-Package: \
- javax.management, \
- org.jboss.osgi.husky, \
- org.jboss.osgi.husky.annotation, \
- org.jboss.osgi.spi.capability, \
- org.jboss.osgi.spi.testing, \
- org.junit, \
- org.osgi.framework, \
- org.osgi.service.blueprint.*
-
-Include-Resource: \
- OSGI-INF/blueprint=OSGI-INF/blueprint
-
-Test-Package: org.jboss.test.osgi.blueprint.context
-
--removeheaders: Include-Resource
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml 2009-06-17 15:10:06 UTC (rev 90335)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml 2009-06-17 15:22:08 UTC (rev 90336)
@@ -18,10 +18,12 @@
<service id="idServiceA" auto-export="disabled" depends-on="someServiceDependency" interface="foo.ServiceInterface" ranking="0">
<description>service description</description>
+ <!--
<interfaces>
<value>foo.ServiceInterfA</value>
<value>foo.ServiceInterfB</value>
</interfaces>
+ -->
<service-properties>
<entry key="keyA" value="valueA" />
<entry key="keyB" value="valueB" />
@@ -49,10 +51,12 @@
<reference component-name="referenceCompName" interface="foo.referenceInterf" filter="referenceFilter" availablitity="optional">
<description>reference description</description>
+ <!--
<interfaces>
<value>foo.ReferenceInterfA</value>
<value>foo.ReferenceInterfB</value>
</interfaces>
+ -->
<listener ref="referenceListenerA" bind-method="bindMethod" unbind-method="unbindMethod" />
<listener ref="referenceListenerB" />
</reference>
15 years
JBoss-OSGI SVN: r90329 - in projects/jboss-osgi/trunk/blueprint: impl/src/main/java/org/jboss/osgi/blueprint/container and 9 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-17 09:32:50 -0400 (Wed, 17 Jun 2009)
New Revision: 90329
Added:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/framework/
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/framework/ServiceException.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/BlueprintContainer.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/BlueprintEvent.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/BlueprintListener.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/ComponentDefinitionException.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/Converter.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/EventConstants.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/NoSuchComponentException.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/ServiceUnavailableException.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/package.html
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/packageinfo
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/RefListMetadata.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/ReferenceListener.java
Removed:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/context/
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/context/
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/convert/
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/namespace/
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/Listener.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/RefCollectionMetadata.java
Modified:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BeanMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintMetadata.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServicePropertyEntry.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/BeanMetadata.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/CollectionMetadata.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/ComponentMetadata.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/IdRefMetadata.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/MapEntry.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/MapMetadata.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/NullMetadata.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/PropsMetadata.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/RefMetadata.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/ReferenceMetadata.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/RegistrationListener.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/ServiceMetadata.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/ServiceReferenceMetadata.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/ValueMetadata.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/package.html
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java
Log:
Update BP API - WIP
Added: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -0,0 +1,168 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.blueprint.container;
+
+//$Id: BlueprintContextImpl.java 90313 2009-06-17 10:37:51Z thomas.diesler(a)jboss.com $
+
+import java.net.URL;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.Set;
+
+import org.jboss.osgi.blueprint.parser.BlueprintParser;
+import org.jboss.osgi.blueprint.reflect.BlueprintMetadata;
+import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.spi.NotImplementedException;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.blueprint.container.BlueprintContainer;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+import org.osgi.service.log.LogService;
+
+/**
+ * When a Blueprint extender bundle detects that a Blueprint bundle is
+ * ready, it creates a Blueprint Container to manage that Blueprint Bundle.
+ *
+ * The Blueprint Container then parses the definitions into metadata objects.
+ * All top-level elements in the definitions are ComponentMetadata objects
+ * and are registered in the Blueprint Container by their id.
+ *
+ * For each of the ComponentMetadata objects, the Blueprint Container has a
+ * corresponding component manager. For example, a BeanMetadata object
+ * relates to a Bean Manager. There are the following types of managers:
+ *
+ * - Bean Managers – Can provide general objects that are properly configured
+ * - Service Managers – Can register services
+ * - Service Reference Managers – Provide proxies to one or more services. There are two sub-types: ref-list and reference.
+ * - Environment Managers – Holding environment values like the Blueprint Bundle object
+ *
+ * After creation, all managers are not yet activated. A manager is activated
+ * when it has to provide a component instance for the first time.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 17-Jun-2009
+ */
+public class BlueprintContainerImpl implements BlueprintContainer
+{
+ public static final String HEADER_BUNDLE_BLUEPRINT = "Bundle-Blueprint";
+
+ private LogService log;
+
+ private BundleContext context;
+ private Bundle bundle;
+
+ private BlueprintMetadata bpMetadata;
+
+ public BlueprintContainerImpl(BundleContext context, Bundle bundle)
+ {
+ this.log = new LogServiceTracker(context);
+ this.context = context;
+ this.bundle = bundle;
+ }
+
+ public void initialize()
+ {
+ bpMetadata = getBlueprintMetadata(bundle);
+ }
+
+ public BundleContext getBundleContext()
+ {
+ return bundle.getBundleContext();
+ }
+
+ public ComponentMetadata getComponentMetadata(String name)
+ {
+ return bpMetadata.getComponentMetadata(name);
+ }
+
+ public int getCompliance()
+ {
+ return COMPLIANCE_STRICT;
+ }
+
+ public Set<String> getComponentIds()
+ {
+ return bpMetadata.getComponentNames();
+ }
+
+ public <T extends ComponentMetadata> Collection<T> getMetadata(Class<T> type)
+ {
+ return bpMetadata.getMetadata(type);
+ }
+
+ public Object getComponentInstance(String id)
+ {
+ throw new NotImplementedException();
+ }
+
+ @SuppressWarnings("unchecked")
+ private BlueprintMetadata getBlueprintMetadata(Bundle bundle)
+ {
+ BlueprintMetadata bpMetadata = null;
+
+ // If a Bundle-Blueprint manifest header is defined, then this header contains a list of paths.
+ // If this header is not defined, then resources ending in .xml in the bundle’s
+ // OSGI-INF/blueprint directory must be used. These are the resources that
+ // would be found by calling the Bundle findEntries("OSGI-INF/blueprint", "*.xml", false) method.
+
+ String descriptorPaths = (String)bundle.getHeaders().get(HEADER_BUNDLE_BLUEPRINT);
+ if (descriptorPaths != null)
+ {
+ log.log(LogService.LOG_INFO, HEADER_BUNDLE_BLUEPRINT + ": " + descriptorPaths + " in bundle: " + bundle);
+ String[] descritors = descriptorPaths.split(", ");
+
+ for (String descriptor : descritors)
+ {
+ BlueprintMetadata aux = processDescriptor(bundle, descriptor);
+ bpMetadata = aux.merge(bpMetadata);
+ }
+ }
+
+ Enumeration<URL> foundEntries = bundle.findEntries("OSGI-INF/blueprint", "*.xml", false);
+ if (foundEntries != null)
+ {
+ while (foundEntries.hasMoreElements())
+ {
+ URL nextEntry = foundEntries.nextElement();
+ BlueprintMetadata aux = processDescriptor(bundle, nextEntry);
+ bpMetadata = aux.merge(bpMetadata);
+ }
+ }
+
+ if (bpMetadata == null)
+ throw new IllegalStateException("Cannot obtain blueprint metadata");
+
+ return bpMetadata;
+ }
+
+ private BlueprintMetadata processDescriptor(Bundle bundle, String descriptor)
+ {
+ URL descriptorURL = bundle.getResource(descriptor);
+ return processDescriptor(bundle, descriptorURL);
+ }
+
+ private BlueprintMetadata processDescriptor(Bundle bundle, URL descriptorURL)
+ {
+ BlueprintMetadata blueprint = new BlueprintParser().parse(descriptorURL);
+ return blueprint;
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java 2009-06-17 13:27:35 UTC (rev 90328)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -23,19 +23,13 @@
//$Id$
-import java.net.URL;
import java.util.Enumeration;
-import org.jboss.osgi.blueprint.context.BlueprintContextImpl;
-import org.jboss.osgi.blueprint.parser.BlueprintParser;
-import org.jboss.osgi.blueprint.reflect.BlueprintMetadata;
-import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.blueprint.container.BlueprintContainerImpl;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleEvent;
import org.osgi.framework.SynchronousBundleListener;
-import org.osgi.service.blueprint.context.BlueprintContext;
-import org.osgi.service.log.LogService;
/**
* The Blueprint extender
@@ -45,14 +39,10 @@
*/
public class BlueprintExtender implements SynchronousBundleListener
{
- private static final String HEADER_BUNDLE_BLUEPRINT = "Bundle-Blueprint";
-
- private LogService log;
private BundleContext context;
public BlueprintExtender(BundleContext context)
{
- this.log = new LogServiceTracker(context);
this.context = context;
}
@@ -61,7 +51,7 @@
{
Bundle bundle = event.getBundle();
- BlueprintMetadata bpMetadata = null;
+ boolean hasBlueprintMetadata = false;
if (event.getType() == BundleEvent.STARTING)
{
@@ -70,36 +60,17 @@
// OSGI-INF/blueprint directory must be used. These are the resources that
// would be found by calling the Bundle findEntries("OSGI-INF/blueprint", "*.xml", false) method.
- String descriptorPaths = (String)bundle.getHeaders().get(HEADER_BUNDLE_BLUEPRINT);
- if (descriptorPaths != null)
- {
- log.log(LogService.LOG_INFO, HEADER_BUNDLE_BLUEPRINT + ": " + descriptorPaths + " in bundle: " + bundle);
- String[] descritors = descriptorPaths.split(", ");
-
- for (String descriptor : descritors)
- {
- BlueprintMetadata aux = processDescriptor(bundle, descriptor);
- bpMetadata = aux.merge(bpMetadata);
- }
- }
+ String descriptorPaths = (String)bundle.getHeaders().get(BlueprintContainerImpl.HEADER_BUNDLE_BLUEPRINT);
+ hasBlueprintMetadata = (descriptorPaths != null);
Enumeration foundEntries = bundle.findEntries("OSGI-INF/blueprint", "*.xml", false);
- if (foundEntries != null)
- {
- while (foundEntries.hasMoreElements())
- {
- URL nextEntry = (URL)foundEntries.nextElement();
- BlueprintMetadata aux = processDescriptor(bundle, nextEntry);
- bpMetadata = aux.merge(bpMetadata);
- }
- }
+ hasBlueprintMetadata |= (foundEntries != null);
}
-
- // Register the BlueprintContext
- if (bpMetadata != null)
+
+ if (hasBlueprintMetadata == true)
{
- BlueprintContext bpContext = new BlueprintContextImpl(bundle, bpMetadata);
- context.registerService(BlueprintContext.class.getName(), bpContext, null);
+ BlueprintContainerImpl bpContainer = new BlueprintContainerImpl(context, bundle);
+ bpContainer.initialize();
}
}
@@ -110,16 +81,4 @@
{
// currently does nothing
}
-
- private BlueprintMetadata processDescriptor(Bundle bundle, String descriptor)
- {
- URL descriptorURL = bundle.getResource(descriptor);
- return processDescriptor(bundle, descriptorURL);
- }
-
- private BlueprintMetadata processDescriptor(Bundle bundle, URL descriptorURL)
- {
- BlueprintMetadata blueprint = new BlueprintParser().parse(descriptorURL);
- return blueprint;
- }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BeanMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BeanMetadataImpl.java 2009-06-17 13:27:35 UTC (rev 90328)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BeanMetadataImpl.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -48,7 +48,6 @@
protected String description;
protected List<Object> argumentOrPropertyOrAny;
protected String className;
- protected String dependsOn;
protected String initMethod;
protected String destroyMethod;
protected String factoryMethod;
@@ -120,28 +119,6 @@
}
/**
- * Gets the value of the dependsOn property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getDependsOn()
- {
- return dependsOn;
- }
-
- /**
- * Sets the value of the dependsOn property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setDependsOn(String value)
- {
- this.dependsOn = value;
- }
-
- /**
* Gets the value of the initMethod property.
*
* @return possible object is {@link String }
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintMetadata.java 2009-06-17 13:27:35 UTC (rev 90328)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintMetadata.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -36,11 +36,8 @@
import javax.xml.namespace.QName;
import org.jboss.osgi.spi.NotImplementedException;
-import org.osgi.service.blueprint.context.NoSuchComponentException;
-import org.osgi.service.blueprint.reflect.BeanMetadata;
+import org.osgi.service.blueprint.container.NoSuchComponentException;
import org.osgi.service.blueprint.reflect.ComponentMetadata;
-import org.osgi.service.blueprint.reflect.ServiceMetadata;
-import org.osgi.service.blueprint.reflect.ServiceReferenceMetadata;
/**
* The blueprint element is the top element.
@@ -159,39 +156,18 @@
return compMetadata;
}
- public Collection<BeanMetadata> getBeanComponentsMetadata()
+ @SuppressWarnings("unchecked")
+ public <T extends ComponentMetadata> Collection<T> getMetadata(Class<T> type)
{
- List<BeanMetadata> beanMetadata = new ArrayList<BeanMetadata>();
+ List<T> compMetadata = new ArrayList<T>();
for (ComponentMetadata comp : getComponents())
{
- if (comp instanceof BeanMetadata)
- beanMetadata.add((BeanMetadata)comp);
+ if (type.isAssignableFrom(comp.getClass()))
+ compMetadata.add((T)comp);
}
- return Collections.unmodifiableList(beanMetadata);
+ return Collections.unmodifiableList(compMetadata);
}
-
- public Collection<ServiceMetadata> getExportedServicesMetadata()
- {
- List<ServiceMetadata> servMetadata = new ArrayList<ServiceMetadata>();
- for (ComponentMetadata comp : getComponents())
- {
- if (comp instanceof ServiceMetadata)
- servMetadata.add((ServiceMetadata)comp);
- }
- return Collections.unmodifiableList(servMetadata);
- }
- public Collection<ServiceReferenceMetadata> getReferencedServicesMetadata()
- {
- List<ServiceReferenceMetadata> srefMetadata = new ArrayList<ServiceReferenceMetadata>();
- for (ComponentMetadata comp : getComponents())
- {
- if (comp instanceof ServiceReferenceMetadata)
- srefMetadata.add((ServiceReferenceMetadata)comp);
- }
- return Collections.unmodifiableList(srefMetadata);
- }
-
/**
* Gets the value of the defaultLazyInit property.
*
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentMetadataImpl.java 2009-06-17 13:27:35 UTC (rev 90328)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentMetadataImpl.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -23,6 +23,9 @@
//$Id$
+import java.util.ArrayList;
+import java.util.List;
+
import org.osgi.service.blueprint.reflect.ComponentMetadata;
/**
@@ -41,6 +44,8 @@
public abstract class ComponentMetadataImpl implements ComponentMetadata
{
protected String id;
+ protected List<String> dependsOn;
+ protected int initialization;
/**
* Gets the value of the id property.
@@ -58,4 +63,26 @@
this.id = value;
}
+ public List<String> getDependsOn()
+ {
+ if (dependsOn == null)
+ dependsOn = new ArrayList<String>();
+
+ return dependsOn;
+ }
+
+ public void setDependsOn(List<String> dependsOn)
+ {
+ this.dependsOn = dependsOn;
+ }
+
+ public int getInitialization()
+ {
+ return initialization;
+ }
+
+ public void setInitialization(int initialization)
+ {
+ this.initialization = initialization;
+ }
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java 2009-06-17 13:27:35 UTC (rev 90328)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -32,6 +32,7 @@
import javax.xml.namespace.QName;
import org.jboss.osgi.spi.NotImplementedException;
+import org.osgi.service.blueprint.reflect.MapEntry;
import org.osgi.service.blueprint.reflect.RegistrationListener;
import org.osgi.service.blueprint.reflect.ServiceMetadata;
import org.osgi.service.blueprint.reflect.Target;
@@ -47,14 +48,13 @@
{
protected String description;
protected List<String> interfaces;
- protected List<ServicePropertyEntry> serviceProperties;
+ protected List<MapEntry> serviceProperties;
protected Collection<RegistrationListener> registrationListener;
protected BeanMetadataImpl bean;
protected RefImpl refFIXME;
protected List<Object> any;
protected String ref;
- protected String dependsOn;
- protected AutoExportModes autoExport;
+ protected int autoExport;
protected int ranking;
private Map<QName, String> otherAttributes = new HashMap<QName, String>();
@@ -83,7 +83,7 @@
/**
* Gets the value of the interfaces property.
*/
- public List<String> getInterfaceNames()
+ public List<String> getInterfaces()
{
if (interfaces == null)
interfaces = new ArrayList<String>();
@@ -94,15 +94,15 @@
/**
* Gets the value of the serviceProperties property.
*/
- public List<ServicePropertyEntry> getServiceProperties()
+ public List<MapEntry> getServiceProperties()
{
if (serviceProperties == null)
- serviceProperties = new ArrayList<ServicePropertyEntry>();
+ serviceProperties = new ArrayList<MapEntry>();
return serviceProperties;
}
- public void setServiceProperties(List<ServicePropertyEntry> serviceProperties)
+ public void setServiceProperties(List<MapEntry> serviceProperties)
{
this.serviceProperties = serviceProperties;
}
@@ -219,52 +219,24 @@
}
/**
- * Gets the value of the dependsOn property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getDependsOn()
- {
- return dependsOn;
- }
-
- /**
- * Sets the value of the dependsOn property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setDependsOn(String value)
- {
- this.dependsOn = value;
- }
-
- /**
* Gets the value of the autoExport property.
*
* @return possible object is {@link AutoExportModes }
- *
*/
- public AutoExportModes getAutoExport()
+ public int getAutoExport()
{
- if (autoExport == null)
- {
- return AutoExportModes.DISABLED;
- }
- else
- {
- return autoExport;
- }
+ if (autoExport == 0)
+ autoExport = AUTO_EXPORT_DISABLED;
+
+ return autoExport;
}
/**
* Sets the value of the autoExport property.
*
* @param value allowed object is {@link AutoExportModes }
- *
*/
- public void setAutoExport(AutoExportModes value)
+ public void setAutoExport(int value)
{
this.autoExport = value;
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServicePropertyEntry.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServicePropertyEntry.java 2009-06-17 13:27:35 UTC (rev 90328)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServicePropertyEntry.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -7,12 +7,14 @@
package org.jboss.osgi.blueprint.reflect;
+import org.osgi.service.blueprint.reflect.MapEntry;
+
/**
* TservicePropertyEntry is an entry value used for the <service-properties> element. This does not allow a child <key> element and there are no key-ref or value-ref
* attributes.
*
*/
-public class ServicePropertyEntry
+public class ServicePropertyEntry implements MapEntry
{
protected String key;
protected String value;
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java 2009-06-17 13:27:35 UTC (rev 90328)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -24,7 +24,6 @@
// $Id$
import java.util.ArrayList;
-import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -32,9 +31,8 @@
import javax.xml.namespace.QName;
import org.jboss.osgi.spi.NotImplementedException;
-import org.osgi.service.blueprint.reflect.Listener;
+import org.osgi.service.blueprint.reflect.ReferenceListener;
import org.osgi.service.blueprint.reflect.ServiceReferenceMetadata;
-import org.w3c.dom.Element;
/**
* TserviceReference is the base element type used for <reference>, <ref-set>, and <ref-list> elements. This type defines all of the characteristics common to both
@@ -72,7 +70,7 @@
{
protected String description;
protected List<String> interfaces;
- protected List<ReferenceListenerImpl> listener;
+ protected List<ReferenceListener> listener;
protected List<Object> any;
protected String filter;
protected String componentName;
@@ -105,7 +103,7 @@
* Gets the value of the interfaces property.
*
*/
- public List<String> getInterfaceNames()
+ public List<String> getInterfaces()
{
if (interfaces == null)
interfaces = new ArrayList<String>();
@@ -115,56 +113,22 @@
/**
* Gets the value of the listener property.
- *
- * <p>
- * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the
- * JAXB object. This is why there is not a <CODE>set</CODE> method for the listener property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getListener().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list {@link ReferenceListenerImpl }
- *
- *
*/
- public List<ReferenceListenerImpl> getListener()
+ public List<ReferenceListener> getReferenceListeners()
{
if (listener == null)
- listener = new ArrayList<ReferenceListenerImpl>();
+ listener = new ArrayList<ReferenceListener>();
return this.listener;
}
- public void setListener(List<ReferenceListenerImpl> listener)
+ public void setReferenceListeners(List<ReferenceListener> listener)
{
this.listener = listener;
}
/**
* Gets the value of the any property.
- *
- * <p>
- * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the
- * JAXB object. This is why there is not a <CODE>set</CODE> method for the any property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getAny().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list {@link Object } {@link Element }
- *
- *
*/
public List<Object> getAny()
{
@@ -260,7 +224,7 @@
return otherAttributes;
}
- public Collection<Listener> getServiceListeners()
+ public String getInterface()
{
throw new NotImplementedException();
}
Added: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/framework/ServiceException.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/framework/ServiceException.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/framework/ServiceException.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) OSGi Alliance (2007, 2009). All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.osgi.framework;
+
+/**
+ * A service exception used to indicate that a service problem occurred.
+ *
+ * <p>
+ * A <code>ServiceException</code> object is created by the Framework or
+ * service implementation to denote an exception condition in the service. A
+ * type code is used to identify the exception type for future extendability.
+ * Service implementations may also create subclasses of
+ * <code>ServiceException</code>. When subclassing, the subclass should set
+ * the type to {@link #SUBCLASSED} to indicate that
+ * <code>ServiceException</code> has been subclassed.
+ *
+ * <p>
+ * This exception conforms to the general purpose exception chaining mechanism.
+ *
+ * @version $Revision$
+ * @since 1.5
+ */
+
+public class ServiceException extends RuntimeException {
+ static final long serialVersionUID = 3038963223712959631L;
+
+ /**
+ * Type of service exception.
+ */
+ private final int type;
+
+ /**
+ * No exception type is unspecified.
+ */
+ public static final int UNSPECIFIED = 0;
+ /**
+ * The service has been unregistered.
+ */
+ public static final int UNREGISTERED = 1;
+ /**
+ * The service factory produced an invalid service object.
+ */
+ public static final int FACTORY_ERROR = 2;
+ /**
+ * The service factory threw an exception.
+ */
+ public static final int FACTORY_EXCEPTION = 3;
+ /**
+ * The exception is a subclass of ServiceException. The subclass should be
+ * examined for the type of the exception.
+ */
+ public static final int SUBCLASSED = 4;
+ /**
+ * An error occurred invoking a remote service.
+ */
+ public static final int REMOTE = 5;
+
+ /**
+ * Creates a <code>ServiceException</code> with the specified message and
+ * exception cause.
+ *
+ * @param msg The associated message.
+ * @param cause The cause of this exception.
+ */
+ public ServiceException(String msg, Throwable cause) {
+ this(msg, UNSPECIFIED, cause);
+ }
+
+ /**
+ * Creates a <code>ServiceException</code> with the specified message.
+ *
+ * @param msg The message.
+ */
+ public ServiceException(String msg) {
+ this(msg, UNSPECIFIED);
+ }
+
+ /**
+ * Creates a <code>ServiceException</code> with the specified message,
+ * type and exception cause.
+ *
+ * @param msg The associated message.
+ * @param type The type for this exception.
+ * @param cause The cause of this exception.
+ */
+ public ServiceException(String msg, int type, Throwable cause) {
+ super(msg, cause);
+ this.type = type;
+ }
+
+ /**
+ * Creates a <code>ServiceException</code> with the specified message and
+ * type.
+ *
+ * @param msg The message.
+ * @param type The type for this exception.
+ */
+ public ServiceException(String msg, int type) {
+ super(msg);
+ this.type = type;
+ }
+
+ /**
+ * Returns the type for this exception or <code>UNSPECIFIED</code> if the
+ * type was unspecified or unknown.
+ *
+ * @return The type of this exception.
+ */
+ public int getType() {
+ return type;
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/framework/ServiceException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/BlueprintContainer.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/BlueprintContainer.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/BlueprintContainer.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) OSGi Alliance (2008, 2009). All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.osgi.service.blueprint.container;
+
+import java.util.Collection;
+import java.util.Set;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+
+/**
+ * BlueprintContainer providing access to the components, service exports, and
+ * service references of a bundle using blueprint services. Only bundles in the
+ * ACTIVE state may have an associated BlueprintContainer. A given BundleContext
+ * has at most one associated BlueprintContainer.
+ *
+ * An instance of BlueprintContainer may be obtained from within a blueprint context by
+ * injecting the predefined "blueprintContainer" component.
+ * Alternatively you can look up BlueprintContainer services in the service registry.
+ * The Constants.BUNDLE_SYMBOLICNAME and Constants.BUNDLE_VERSION service
+ * properties can be used to determine which bundle the published BlueprintContainer
+ * service is associated with.
+ *
+ * A BlueprintContainer implementation must support safe concurrent access. It is
+ * legal for the set of named components and component metadata to change
+ * between invocations on the same thread if another thread is concurrently
+ * modifying the same mutable BlueprintContainer implementation object.
+ *
+ * @see org.osgi.framework.Constants
+ *
+ */
+public interface BlueprintContainer {
+
+ /**
+ * The container will apply strict compliance rules
+ */
+ static final int COMPLIANCE_STRICT = 1;
+
+ /**
+ * The container will use loose compliance rules
+ */
+ static final int COMPLIANCE_LOOSE = 2;
+
+ /**
+ * The set of component names recognized by the blueprint context.
+ *
+ * @return an immutable set (of Strings) containing the names of all of the components within the
+ * context.
+ */
+ Set<String> getComponentIds();
+
+ /**
+ * Get the component instance for a given named component. If the component has
+ * not yet been instantiated, calling this operation will cause the component instance
+ * to be created and initialized. If the component
+ * has a prototype scope then each call to getComponent will return a new
+ * component instance. If the component has a bundle scope then the component
+ * instance returned will be the instance for the caller's bundle (and that
+ * instance will be instantiated if it has not already been created).
+ *
+ * Note: calling getComponent from logic executing during the instantiation and
+ * configuration of a component, before the init method (if specified) has returned,
+ * may trigger a circular dependency (for a trivial example, consider a component
+ * that looks itself up by name during its init method). Implementations of the
+ * Blueprint Service are not required to support cycles in the dependency graph
+ * and may throw an exception if a cycle is detected. Implementations that can
+ * support certain kinds of cycles are free to do so.
+ *
+ * @param id the name of the component for which the instance is to be
+ * retrieved.
+ *
+ * @return the component instance, the type of the returned object is
+ * dependent on the component definition, and may be determined by
+ * introspecting the component metadata.
+ *
+ * @throws NoSuchComponentException if the name specified is not the
+ * name of a component within the context.
+ */
+ Object getComponentInstance(String id);
+
+ /**
+ * Get the component metadata for a given named component.
+ *
+ * @param id the name of the component for which the metadata is to be
+ * retrieved.
+ *
+ * @return the component metadata for the component.
+ *
+ * @throws NoSuchComponentException if the name specified is not the
+ * name of a component within the context.
+ */
+ ComponentMetadata getComponentMetadata(String id);
+
+ /**
+ * Returns all ComponentMetadata instances of the given type. The supported
+ * metadata types are ComponentMetadata (which returns the metadata for all defined
+ * component types), BeanMetadata, ServiceReferenceMetadata (which returns both
+ * ReferenceMetadata and RefListMetadata instances), ReferenceMetadata,
+ * RefListMetadata, and ServiceMetadata. The collection will include all
+ * metadata instances of the requested type, including components that are declared
+ * as inline values.
+ *
+ * @return an immutable collection of ComponentMetadata objects of the matching type.
+ */
+ <T extends ComponentMetadata> Collection<T> getMetadata(Class<T> type);
+
+ /**
+ * Get the bundle context of the bundle this blueprint context is associated
+ * with.
+ *
+ * @return the blueprint context's bundle context
+ */
+ BundleContext getBundleContext();
+
+
+ /**
+ * Returns the compliance rule in effect for the target
+ * BlueprintContainer. COMPLIANCE_LOOSE is returned if
+ * any configuration file for the container specifies
+ * loose compliance.
+ *
+ * @return The value COMPLIANCE_STRICT if strict compliance (the
+ * default) is used for all configuration files, or the
+ * value COMPLIANCE_LOOSE if loose complance is specified
+ * in any of the configuration files.
+ */
+ int getCompliance();
+}
Property changes on: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/BlueprintContainer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/BlueprintEvent.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/BlueprintEvent.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/BlueprintEvent.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -0,0 +1,316 @@
+/*
+ * Copyright (c) OSGi Alliance (2008, 2009). All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.osgi.service.blueprint.container;
+
+import org.osgi.framework.Bundle;
+
+/**
+ * A Blueprint Event.
+ *
+ * <p>
+ * <code>BlueprintEvent</code> objects are delivered to all registered <code>BlueprintListener</code>
+ * service objects. BlueprintEvents must be asynchronously delivered in chronological order
+ * with respect to each listener.
+ *
+ * <p>
+ * In addition, when a listener is registered, the blueprint extender
+ * will synchronously send to this listener the last event for each blueprint bundle managed
+ * by this extender. This replay of events is designed so that the new listener can
+ * be informed of the state of each managed bundle. Events sent during this replay will
+ * have the {@link #replay} flag set. The blueprint extender must ensure that this replay phase
+ * does not interfere with new events so that the chronological order of all events received
+ * by the listener is preserved. If the last event for a given blueprint bundle is DESTROYED,
+ * the extender must not send it during this replay phase.
+ *
+ * <p>
+ * A type code is used to identify the type of event. The following event types are defined:
+ * <ul>
+ * <li>{@link #CREATING}
+ * <li>{@link #CREATED}
+ * <li>{@link #DESTROYING}
+ * <li>{@link #DESTROYED}
+ * <li>{@link #FAILURE}
+ * <li>{@link #GRACE_PERIOD}
+ * <li>{@link #WAITING}
+ * </ul>
+ *
+ * <p>
+ * <h2>Blueprint Events and EventAdmin</h2>
+ * In addition to calling the registered {@link BlueprintListener}s, the blueprint extender
+ * must also send those events to the EventAdmin service, if it is available. <br/>
+ * See {@link EventConstants} for more informations.
+ *
+ * @see BlueprintListener
+ * @see EventConstants
+ */
+public class BlueprintEvent {
+
+ /**
+ * The Blueprint extender has started creating a Blueprint Container for the bundle.
+ */
+ public static final int CREATING = 1;
+ /**
+ * The Blueprint extender has creating a Blueprint Container for the bundle.
+ * This event is sent after the BlueprintContainer service has been registered.
+ */
+ public static final int CREATED = 2;
+ /**
+ * The Blueprint extender has started detroying the Blueprint Container for the bundle.
+ */
+ public static final int DESTROYING = 3;
+ /**
+ * The Blueprint Container for the bundle has been completely destroyed.
+ * This event is sent after the BlueprintContainer service has been unregistered.
+ */
+ public static final int DESTROYED = 4;
+ /**
+ * The Blueprint Container creation for the bundle has failed.
+ * If this event is sent after a timeout in the Grace Period, the {@link #getDependencies()}
+ * method must return an array of missing mandatory dependencies. The event must also contain
+ * the cause of the failure as a <code>Throwable</code> through the {@link #getException()} method.
+ */
+ public static final int FAILURE = 5;
+ /**
+ * The Blueprint Container has entered the Grace Period.
+ * The list of missing dependencies must be made available through the {@link #getDependencies()}
+ * method. During the grace period, a GRACE_PERIOD event is sent each time the set of
+ * unsatisfied dependencies changes.
+ */
+ public static final int GRACE_PERIOD = 6;
+ /**
+ * The Blueprint Extender is waiting on the availability of a service to satisfy an
+ * invocation on a referenced service.
+ * The missing dependency must be made available through the {@link #getDependencies()}
+ * method which will return an array containing one filter object as a String.
+ */
+ public static final int WAITING = 7;
+
+
+ /**
+ * Type of this event.
+ *
+ * @see #getType()
+ */
+ private final int type;
+ /**
+ * The time when the event occured.
+ *
+ * @see #getTimestamp()
+ */
+ private final long timestamp;
+ /**
+ * The blueprint bundle.
+ *
+ * @see #getBundle()
+ */
+ private final Bundle bundle;
+ /**
+ * The blueprint extender bundle.
+ *
+ * @see #getExtenderBundle()
+ */
+ private final Bundle extenderBundle;
+ /**
+ * An array containing filters identifying the missing dependencies.
+ *
+ * @see #getDependencies()
+ */
+ private final String[] dependencies;
+ /**
+ * Cause of the failure.
+ *
+ * @see #getException()
+ */
+ private final Throwable exception;
+ /**
+ * Indicate if this event is a replay event or not.
+ *
+ * @see #isReplay()
+ */
+ private final boolean replay;
+
+
+ /**
+ * Create a simple BlueprintEvent object.
+ *
+ * @param type The type of the event.
+ * @param bundle The managed bundle this event is originating from.
+ * @param extenderBundle
+ * The bundle of the blueprint extender that is generating
+ * the event.
+ */
+ public BlueprintEvent(int type, Bundle bundle, Bundle extenderBundle) {
+ this(type, bundle, extenderBundle, null, null);
+ }
+
+
+ /**
+ * Create a BlueprintEvent object associated with a
+ * set of dependencies.
+ *
+ * @param type The type of the event.
+ * @param bundle The managed bundle this event is originating from.
+ * @param extenderBundle
+ * The bundle of the blueprint extender that is generating
+ * the event.
+ * @param dependencies
+ * An array of String filters for each dependency associated
+ * with this event.
+ */
+ public BlueprintEvent(int type, Bundle bundle, Bundle extenderBundle, String[] dependencies) {
+ this(type, bundle, extenderBundle, dependencies, null);
+ }
+
+
+ /**
+ * Create a BlueprintEvent object associated with a
+ * failure cause.
+ *
+ * @param type The type of the event.
+ * @param bundle The managed bundle this event is originating from.
+ * @param extenderBundle
+ * The bundle of the blueprint extender that is generating
+ * the event.
+ * @param exception A Throwable object describing the root cause of the
+ * event.
+ */
+ public BlueprintEvent(int type, Bundle bundle, Bundle extenderBundle, Throwable exception) {
+ this(type, bundle, extenderBundle, null, exception);
+ }
+
+
+ /**
+ * Create a BlueprintEvent object associated with a
+ * failure cause and related to a set of dependencies.
+ *
+ * @param type The type of the event.
+ * @param bundle The managed bundle this event is originating from.
+ * @param extenderBundle
+ * The bundle of the blueprint extender that is generating
+ * the event.
+ * @param dependencies
+ * An array of String filters for each dependency associated
+ * with this event.
+ * @param exception A Throwable object describing the root cause of the
+ * event.
+ */
+ public BlueprintEvent(int type, Bundle bundle, Bundle extenderBundle, String[] dependencies, Throwable exception) {
+ this.type = type;
+ this.timestamp = System.currentTimeMillis();
+ this.bundle = bundle;
+ this.extenderBundle = extenderBundle;
+ this.dependencies = dependencies;
+ this.exception = exception;
+ this.replay = false;
+ }
+
+ /**
+ * Create a new blueprint event from the given blueprint event.
+ * The timestamp property will be copied from the original event and only the
+ * replay property will be overriden with the given value.
+ *
+ * @param event the original event to copy
+ * @param replay if the copied event should be used as a replay event
+ */
+ public BlueprintEvent(BlueprintEvent event, boolean replay) {
+ this.type = event.type;
+ this.timestamp = event.timestamp;
+ this.bundle = event.bundle;
+ this.extenderBundle = event.extenderBundle;
+ this.dependencies = event.dependencies;
+ this.exception = event.exception;
+ this.replay = replay;
+ }
+
+ /**
+ * Return the type of this event.
+ * <p>
+ * The type values are:
+ * <ul>
+ * <li>{@link #CREATING}
+ * <li>{@link #CREATED}
+ * <li>{@link #DESTROYING}
+ * <li>{@link #DESTROYED}
+ * <li>{@link #FAILURE}
+ * <li>{@link #GRACE_PERIOD}
+ * <li>{@link #WAITING}
+ * </ul>
+ *
+ * @return The type of this event.
+ */
+ public int getType() {
+ return type;
+ }
+
+ /**
+ * Return the time at which this event occured.
+ *
+ * @return The time at which this event occured.
+ */
+ public long getTimestamp() {
+ return timestamp;
+ }
+
+ /**
+ * Return the blueprint bundle.
+ *
+ * @return The blueprint bundle. Never <code>null</code>.
+ */
+ public Bundle getBundle() {
+ return bundle;
+ }
+
+ /**
+ * Return the Bundle of the blueprint extender.
+ *
+ * @return The Bundle of the blueprint extender. Never <code>null</code>.
+ */
+ public Bundle getExtenderBundle() {
+ return extenderBundle;
+ }
+
+ /**
+ * Return the filters identifying the missing dependencies that caused this event.
+ * <p>
+ * This field is only valid for {@link #WAITING},
+ * {@link #GRACE_PERIOD} and {@link #FAILURE}
+ * events.
+ *
+ * @return The missing dependencies informations. May be <code>null</code>.
+ */
+ public String[] getDependencies() {
+ return dependencies;
+ }
+
+ /**
+ * Return the cause for a {@link #FAILURE} event.
+ *
+ * @return The cause of the failure. May be <code>null</code>.
+ */
+ public Throwable getException() {
+ return exception;
+ }
+
+ /**
+ * Return the fact that this event is a replay event or not.
+ *
+ * @return a boolean indicating if this event is a replay event.
+ */
+ public boolean isReplay() {
+ return replay;
+ }
+
+}
Property changes on: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/BlueprintEvent.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/BlueprintListener.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/BlueprintListener.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/BlueprintListener.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) OSGi Alliance (2008, 2009). All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.osgi.service.blueprint.container;
+
+/**
+ * Listener for <code>BlueprintEvent</code>s.
+ *
+ * @see BlueprintEvent
+ */
+public interface BlueprintListener {
+
+ /**
+ * Receives notifications of a blueprint event.
+ *
+ * @param event The <code>BlueprintEvent</code>.
+ */
+ void blueprintEvent(BlueprintEvent event);
+
+}
Property changes on: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/BlueprintListener.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/ComponentDefinitionException.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/ComponentDefinitionException.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/ComponentDefinitionException.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) OSGi Alliance (2008, 2009). All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.osgi.service.blueprint.container;
+
+/**
+ * Exception thrown when a configuration-related error occurs during
+ * creation of a module context.
+ */
+public class ComponentDefinitionException extends RuntimeException {
+
+ private static final long serialVersionUID = 1L;
+
+
+ /**
+ * Creates a <code>ComponentDefinitionException</code> with no message or
+ * exception cause.
+ */
+ public ComponentDefinitionException() {
+ super();
+ }
+
+
+ /**
+ * Creates a <code>ComponentDefinitionException</code> with the specified message
+ *
+ * @param msg The associated message.
+ */
+ public ComponentDefinitionException(String explanation) {
+ super(explanation);
+ }
+
+
+ /**
+ * Creates a <code>ComponentDefinitionException</code> with the specified message and
+ * exception cause.
+ *
+ * @param msg The associated message.
+ * @param cause The cause of this exception.
+ */
+ public ComponentDefinitionException(String explanation, Throwable cause) {
+ super(explanation, cause);
+ }
+
+
+ /**
+ * Creates a <code>ComponentDefinitionException</code> with the
+ * exception cause.
+ *
+ * @param cause The cause of this exception.
+ */
+ public ComponentDefinitionException(Throwable cause) {
+ super(cause);
+ }
+
+}
Property changes on: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/ComponentDefinitionException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/Converter.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/Converter.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/Converter.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) OSGi Alliance (2008, 2009). All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.osgi.service.blueprint.container;
+
+/**
+ * Provides access to the type conversions (both predefined and user registered)
+ * that are defined for the blueprint container.
+ */
+public interface Converter {
+
+ /**
+ * Check if the converter is able to convert the given value to the specified
+ * type.
+ *
+ * @return <code>true</code> if the conversion is possible, <code>false</code> otherwise.
+ */
+ boolean canConvert(Object fromValue, Class<?> toType);
+
+ /**
+ * Convert an object to an instance of the given class, using the built-in and
+ * user-registered type converters as necessary.
+ * @param fromValue the object to be converted
+ * @param toType the type that the instance is to be converted to
+ * @return an instance of the class 'toType'
+ * @throws Exception if the conversion cannot succeed. This exception is
+ * checked because callers should expect that not all source objects
+ * can be successfully converted.
+ */
+ Object convert(Object fromValue, Class<?> toType) throws Exception;
+
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/Converter.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/EventConstants.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/EventConstants.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/EventConstants.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -0,0 +1,178 @@
+/*
+ * Copyright (c) OSGi Alliance (2008, 2009). All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.osgi.service.blueprint.container;
+
+import org.osgi.framework.Bundle;
+
+/**
+ * Event property names used in EventAdmin events published for a
+ * blueprint container.
+ *
+ * Each type of event is sent to a different topic:<br/>
+ * <pre>
+ * org/osgi/service/blueprint/container/<event-type>
+ * </pre>
+ * where <code><event-type></code> can have the values <code>CREATING</code>, <code>CREATED</code>,
+ * <code>DESTROYING</code>, <code>DESTROYED</code>, <code>FAILURE</code>, <code>GRACE_PERIOD</code> or
+ * <code>WAITING</code>. <br/>
+ * Such events have the following properties:<ul>
+ * <li><code>type<code>
+ * <li><code>event<code>
+ * <li><code>timestamp<code>
+ * <li><code>bundle<code>
+ * <li><code>bundle.symbolicName<code>
+ * <li><code>bundle.id<code>
+ * <li><code>bundle.version<code>
+ * <li><code>extender.bundle<code>
+ * <li><code>extender.bundle.symbolicName<code>
+ * <li><code>extender.bundle.id<code>
+ * <li><code>extender.bundle.version<code>
+ * <li><code>dependencies<code>
+ * <li><code>cause<code>
+ * </ul>
+ */
+public interface EventConstants {
+
+ /**
+ * The type of the event that has been issued.
+ * This property is of type {@link java.lang.Integer} and can take one of the values defined in {@link BlueprintEvent}.
+ */
+ public static final String TYPE = "type";
+
+ /**
+ * The <code>BlueprintEvent</code> that caused this event.
+ * This property is of type {@link BlueprintEvent}.
+ */
+ public static final String EVENT = "event";
+
+ /**
+ * The type of the event that has been issued.
+ * This property is of type {@link java.lang.Long}.
+ */
+ public static final String TIMESTAMP = "timestamp";
+
+ /**
+ * The bundle property defining the blueprint bundle for which an event has been issued.
+ * This property is of type {@link org.osgi.framework.Bundle}.
+ *
+ * @see Bundle
+ */
+ public static final String BUNDLE = "bundle";
+
+ /**
+ * The bundle id property defining the id of the blueprint bundle for which an event has been issued.
+ * This property is of type {@link java.lang.Integer}.
+ */
+ public static final String BUNDLE_ID = "bundle.id";
+
+ /**
+ * The bundle symbolic name property defining the symbolic name of
+ * the blueprint bundle for which an event has been issued.
+ * This property is of type {@link java.lang.String}.
+ */
+ public static final String BUNDLE_SYMBOLICNAME = "bundle.symbolicName";
+
+ /**
+ * The bundle id property defining the id of the blueprint bundle for which an event has been issued.
+ * This property is of type {@link java.lang.Integer}.
+ */
+ public static final String BUNDLE_VERSION = "bundle.version";
+
+ /**
+ * The extender bundle property defining the extender bundle processing the
+ * blueprint container for which an event has been issued.
+ * This property is of type {@link org.osgi.framework.Bundle}.
+ *
+ * @see Bundle
+ */
+ public static final String EXTENDER_BUNDLE = "extender.bundle";
+
+ /**
+ * The extender bundle id property defining the id of the extender bundle
+ * processing the blueprint container for which an event has been issued.
+ * This property is of type {@link java.lang.Integer}.
+ */
+ public static final String EXTENDER_BUNDLE_ID = "extender.bundle.id";
+
+ /**
+ * The extender bundle symbolic name property defining the symbolic name of
+ * the extender bundle processing the blueprint container for which an event
+ * has been issued.
+ * This property is of type {@link java.lang.String}.
+ */
+ public static final String EXTENDER_BUNDLE_SYMBOLICNAME = "extender.bundle.symbolicName";
+
+ /**
+ * The extender bundle version property defining the version of the extender bundle
+ * processing the blueprint container for which an event has been issued.
+ * This property is of type {@link java.lang.Integer}.
+ */
+ public static final String EXTENDER_BUNDLE_VERSION = "extender.bundle.version";
+
+ /**
+ * The dependencies property containing an array of filters describing the missing
+ * mandatory dependencies for a FAILED, GRACE_PERIOD or WAITING event.
+ * This property is an array of {@link java.lang.String}.
+ */
+ public static final String DEPENDENCIES = "dependencies";
+
+ /**
+ * The exception property containing the cause for a FAILED event.
+ * This property is of type {@link java.lang.Throwable}.
+ */
+ public static final String EXCEPTION = "exception";
+
+ /**
+ * Topic prefix for all events issued by the Blueprint Service
+ */
+ public static final String TOPIC_BLUEPRINT_EVENTS = "org/osgi/service/blueprint";
+
+ /**
+ * Topic for Blueprint Container CREATING events
+ */
+ public static final String TOPIC_CREATING = TOPIC_BLUEPRINT_EVENTS + "/container/CREATING";
+
+ /**
+ * Topic for Blueprint Container CREATED events
+ */
+ public static final String TOPIC_CREATED = TOPIC_BLUEPRINT_EVENTS + "/container/CREATED";
+
+ /**
+ * Topic for Blueprint Container DESTROYING events
+ */
+ public static final String TOPIC_DESTROYING = TOPIC_BLUEPRINT_EVENTS + "/container/DESTROYING";
+
+ /**
+ * Topic for Blueprint Container DESTROYED events
+ */
+ public static final String TOPIC_DESTROYED = TOPIC_BLUEPRINT_EVENTS + "/container/DESTROYED";
+
+ /**
+ * Topic for Blueprint Container FAILURE events
+ */
+ public static final String TOPIC_FAILURE = TOPIC_BLUEPRINT_EVENTS + "/container/FAILURE";
+
+ /**
+ * Topic for Blueprint Container GRACE_PERIOD events
+ */
+ public static final String TOPIC_GRACE_PERIOD = TOPIC_BLUEPRINT_EVENTS + "/container/GRACE_PERIOD";
+
+ /**
+ * Topic for Blueprint Container WAITING events
+ */
+ public static final String TOPIC_WAITING = TOPIC_BLUEPRINT_EVENTS + "/container/WAITING";
+
+}
Property changes on: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/EventConstants.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/NoSuchComponentException.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/NoSuchComponentException.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/NoSuchComponentException.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) OSGi Alliance (2008, 2009). All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.osgi.service.blueprint.container;
+
+/**
+ * Thrown when an attempt is made to lookup a component by name and no such named
+ * component exists in the blueprint container.
+ */
+public class NoSuchComponentException extends RuntimeException {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * The name of the component request that generated the
+ * exception.
+ */
+ private final String componentName;
+
+ /**
+ * Create an exception for a single component name request.
+ *
+ * @param componentName
+ * The name of the non-existent component.
+ */
+ public NoSuchComponentException(String componentName) {
+ this.componentName = componentName;
+ }
+
+ /**
+ * Returns the component name that generated the exception.
+ *
+ * @return The String name of the component associated with an unresolved
+ * request.
+ */
+ public String getComponentName() {
+ return this.componentName;
+ }
+
+ /**
+ * Returns a human readable message associated with the exception.
+ *
+ * @return The descriptive message for the exception.
+ */
+ public String getMessage() {
+ return "No component named '" +
+ (this.componentName == null ? "<null>" : this.componentName) +
+ "' could be found";
+ }
+}
Property changes on: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/NoSuchComponentException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/ServiceUnavailableException.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/ServiceUnavailableException.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/ServiceUnavailableException.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) OSGi Alliance (2008, 2009). All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.osgi.service.blueprint.container;
+
+import org.osgi.framework.ServiceException;
+
+/**
+ * Thrown when an invocation is made on an OSGi service reference component, and
+ * a backing service is not available.
+ */
+public class ServiceUnavailableException extends ServiceException {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * The filter string associated with the exception.
+ */
+ private final String filter;
+
+
+ /**
+ * Creates a <code>ServiceUnavaiableException</code> with the specified message.
+ *
+ * @param message The associated message.
+ * @param filterExpression
+ * The filter expression used for the service lookup.
+ */
+ public ServiceUnavailableException(String message, String filterExpression) {
+ super(message, UNREGISTERED);
+ this.filter = filterExpression;
+ }
+
+
+ /**
+ * Creates a <code>ServiceUnavaiableException</code> with the specified message and
+ * exception cause.
+ *
+ * @param message The associated message.
+ * @param filterExpression
+ * The filter expression used for the service lookup.
+ * @param cause The cause of this exception.
+ */
+ public ServiceUnavailableException(String message, String filterExpression, Throwable cause) {
+ super(message, UNREGISTERED, cause);
+ this.filter = filterExpression;
+ }
+
+ /**
+ * Returns the filter expression that a service would have needed to satisfy in order
+ * for the invocation to proceed.
+ *
+ * @return The failing filter expression.
+ */
+ public String getFilter() {
+ return this.filter;
+ }
+}
+
Property changes on: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/ServiceUnavailableException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/package.html
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/package.html (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/package.html 2009-06-17 13:32:50 UTC (rev 90329)
@@ -0,0 +1,21 @@
+<!-- $Revision: 5654 $ -->
+<BODY>
+<p>Blueprint Service Container Package Version 1.0.</p>
+<p>Bundles wishing to use this package must list the package
+in the Import-Package header of the bundle's manifest.
+For example:</p>
+<pre>
+Import-Package: org.osgi.service.blueprint.container; version="[1.0,2.0)"
+</pre>
+<p>
+ This package defines the primary interface to a blueprint container,
+ <code>BlueprintContainer</code>. An instance of this type is available
+ inside a blueprint context as an implicitly defined component with name
+ "blueprintContainer".
+</p>
+<p>
+ This package also declares the supporting exception types, listener, and constants for working with a blueprint
+ container.
+</p>
+</BODY>
+
Added: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/packageinfo
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/packageinfo (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/container/packageinfo 2009-06-17 13:32:50 UTC (rev 90329)
@@ -0,0 +1 @@
+version 1.0
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/BeanMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/BeanMetadata.java 2009-06-17 13:27:35 UTC (rev 90328)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/BeanMetadata.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -26,7 +26,6 @@
static final String SCOPE_SINGLETON = "singleton";
static final String SCOPE_PROTOTYPE = "prototype";
- static final String SCOPE_BUNDLE = "bundle";
/**
* The name of the class type specified for this component.
@@ -47,7 +46,7 @@
* @return the method name of the specified init method, or null if no init
* method was specified.
*/
- String getInitMethodName();
+ String getInitMethod();
/**
* The name of the destroy method specified for this component, if any.
@@ -57,7 +56,7 @@
* @return the method name of the specified destroy method, or null if no
* destroy method was specified.
*/
- String getDestroyMethodName();
+ String getDestroyMethod();
/**
* The arguments for the factory method or constructor.
@@ -66,7 +65,7 @@
*
* @return The metadata for the factory method or constructor. Can be empty if no arguments are specified
*/
- List<BeanArgument>getArguments();
+ List<BeanArgument> getArguments();
/**
* The property injection metadata for this component.
@@ -79,29 +78,16 @@
* returned.
*
*/
- List<BeanProperty>getProperties();
+ List<BeanProperty> getProperties();
/**
- * Is this component to be lazily instantiated?
- *
- * ### I assume the default is processed here?
- *
- * This is the <code>lazy-init</code> attribute or the
- * <code>default-lazy-init</code> in the <code>blueprint</code> element
- * if not set. ### I've renamed this from isLazy
- *
- * @return true, iff this component definition specifies lazy instantiation.
- */
- boolean isLazyInit();
-
- /**
* Provides the name of the optional factory method.
*
* This is the <code>factory-method</code> attribute.
*
* @return The name of the factory method or <code>null</code>.
*/
- String getFactoryMethodName();
+ String getFactoryMethod();
/**
* The component instance on which to invoke the factory method (if
@@ -128,7 +114,6 @@
*
* @see #SCOPE_SINGLETON
* @see #SCOPE_PROTOTYPE
- * @see #SCOPE_BUNDLE
*/
String getScope();
@@ -141,13 +126,4 @@
*/
Class<?> getRuntimeClass();
-
- /**
- * The names of any components listed in a "depends-on" attribute for this
- * component.
- *
- * @return an immutable List of component names for components that we have explicitly
- * declared a dependency on, or an empty set if none.
- */
- List<String> getExplicitDependencies();
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/CollectionMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/CollectionMetadata.java 2009-06-17 13:27:35 UTC (rev 90328)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/CollectionMetadata.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -19,7 +19,7 @@
/**
* Metadata for a collection based value. Members of the array are instances of Metadata.
- * The Collection metadata can constrain (### convert) to a specific type.
+ * The Collection metadata can constrain to a specific type.
*/
public interface CollectionMetadata extends NonNullMetadata {
@@ -39,9 +39,8 @@
* The value-type specified for the array
*
* The <code>value-type</code> attribute.
- * ### Shouldnt this also support getRuntimeValueType()?
*/
- String getValueTypeName();
+ String getValueType();
/**
* The of Metadata objects that describe the value.
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/ComponentMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/ComponentMetadata.java 2009-06-17 13:27:35 UTC (rev 90328)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/ComponentMetadata.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -15,6 +15,8 @@
*/
package org.osgi.service.blueprint.reflect;
+import java.util.List;
+
/**
* Base class for all components.
*
@@ -22,11 +24,45 @@
* @see ServiceReferenceMetadata
* @see ServiceMetadata
*/
-public interface ComponentMetadata extends NonNullMetadata
-{
- /*
- * The id of the component. ### renamed to getId
- * @return component id. The component id can be <code>null</code> if this is an anonymously defined inner component.
- */
- String getId();
+public interface ComponentMetadata extends NonNullMetadata {
+
+ /**
+ * The component will be eagerly instanciated
+ */
+ static final int INITIALIZATION_EAGER = 1;
+
+ /**
+ * The component will be lazily instanciated
+ */
+ static final int INITIALIZATION_LAZY = 2;
+
+ /**
+ * The id of the component.
+ *
+ * @return component id. The component id can be <code>null</code> if this is an anonymously
+ * defined inner component.
+ */
+ String getId();
+
+ /**
+ * Is this component to be lazily instantiated?
+ *
+ * This is the <code>initialization</code> attribute or the
+ * <code>default-initialization</code> in the <code>blueprint</code> element
+ * if not set.
+ *
+ * @return the initialization method
+ * @see #INITIALIZATION_EAGER
+ * @see #INITIALIZATION_LAZY
+ */
+ int getInitialization();
+
+ /**
+ * The names of any components listed in a "depends-on" attribute for this
+ * component.
+ *
+ * @return an immutable List of component names for components that we have explicitly
+ * declared a dependency on, or an empty set if none.
+ */
+ List<String> getDependsOn();
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/IdRefMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/IdRefMetadata.java 2009-06-17 13:27:35 UTC (rev 90328)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/IdRefMetadata.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -23,7 +23,7 @@
public interface IdRefMetadata extends NonNullMetadata {
/**
* The name of the referenced component.
- * Defined in the <code>component</code> attribute.
+ * Defined in the <code>component-id</code> attribute.
*
*/
String getComponentId();
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/Listener.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/Listener.java 2009-06-17 13:27:35 UTC (rev 90328)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/Listener.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) OSGi Alliance (2008, 2009). All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.osgi.service.blueprint.reflect;
-
-/**
- * Metadata for a listener interested in service bind and unbind events for a service
- * reference.
- */
-public interface Listener {
-
- /**
- * The component instance that will receive bind and unbind
- * events. The returned value must reference a TargetListenerComponent
- * either directly or indirectly. The return type will be either
- * a RefMetadata instance or an TargetListenerComponent instance.
- *
- * Defined in the <code>ref</code> attribute or inlined component.
- *
- * @return the listener component reference.
- */
- Target getListenerComponent();
-
- /**
- * The name of the method to invoke on the listener component when
- * a matching service is bound to the reference
- *
- * @return the bind callback method name.
- */
- String getBindMethodName();
-
- /**
- * The name of the method to invoke on the listener component when
- * a service is unbound from the reference.
- *
- * @return the unbind callback method name.
- */
- String getUnbindMethodName();
-}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/MapEntry.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/MapEntry.java 2009-06-17 13:27:35 UTC (rev 90328)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/MapEntry.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -31,7 +31,8 @@
*
* @return the metadata for the key
*/
- NonNullMetadata getKey();
+ // [TDI] NonNullMetadata getKey();
+ String getKey();
/**
* Return the metadata for the value.
@@ -40,6 +41,6 @@
*
* @return the metadata for the value
*/
-
- Metadata getValue();
+ // [TDI] Metadata getValue();
+ String getValue();
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/MapMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/MapMetadata.java 2009-06-17 13:27:35 UTC (rev 90328)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/MapMetadata.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -19,28 +19,27 @@
/**
* A map-based value. This represented as a collection of entries (as it is done in the schema).
- *
+ *
* A map is defined in the <code>map</code> element.
- *
+ *
*/
-public interface MapMetadata extends NonNullMetadata
-{
- /**
- * The key-type specified for map keys, or null if none given
- *
- * Defined in the <code>key-type</code> attribute. ### should we have getRuntimeKeyType?
- */
- String getKeyTypeName();
+public interface MapMetadata extends NonNullMetadata {
+ /**
+ * The key-type specified for map keys, or null if none given
+ *
+ * Defined in the <code>key-type</code> attribute.
+ */
+ String getKeyType();
- /**
- * The value-type specified for the array
- *
- * ### should we have getRuntimeValueType? The <code>value-type</code> attribute.
- */
- String getValueTypeName();
+ /**
+ * The value-type specified for the array
+ *
+ * The <code>value-type</code> attribute.
+ */
+ String getValueType();
- /**
- * The of Metadata objects that describe the value.
- */
- List<MapEntry> getEntries();
+ /**
+ * The of Metadata objects that describe the value.
+ */
+ List<MapEntry> getEntries();
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/NullMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/NullMetadata.java 2009-06-17 13:27:35 UTC (rev 90328)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/NullMetadata.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -20,5 +20,8 @@
*/
public interface NullMetadata extends Metadata {
+ /**
+ * Singleton instance of the NULL metadata.
+ */
static final NullMetadata NULL = new NullMetadata() {};
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/PropsMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/PropsMetadata.java 2009-06-17 13:27:35 UTC (rev 90328)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/PropsMetadata.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -21,10 +21,6 @@
* A java.util.Properties based value. The properties are defined as string to
* string. This means that the actual value can be returned.
*
- * ### I do not like it that you loose the original order. And potential errors
- * (like duplicate keys). I think this one should just go away. The
- * CollectionMetadata has a collection type so the instantiation can ensure
- *
* Defined in the <code>props</code> element.
*
*/
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/RefCollectionMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/RefCollectionMetadata.java 2009-06-17 13:27:35 UTC (rev 90328)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/RefCollectionMetadata.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) OSGi Alliance (2008, 2009). All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.osgi.service.blueprint.reflect;
-
-/**
- * Service reference that binds to a collection of matching services from the
- * OSGi service registry. This is the <code>ref-list</code> or
- * <code>ref-set</code> element.
- *
- */
-public interface RefCollectionMetadata extends ServiceReferenceMetadata {
-
- /**
- * Create ordering based on comparison of service objects.
- */
- public static final int ORDERING_BASIS_SERVICE= 1;
-
- /**
- * Create ordering based on comparison of service reference objects.
- */
- public static final int ORDERING_BASIS_SERVICE_REFERENCE = 2;
-
- /**
- * Collection contains service instances
- *
- */
- public static final int MEMBER_TYPE_SERVICE_INSTANCE = 1;
-
- /**
- * Collection contains service references
- */
- public static final int MEMBER_TYPE_SERVICE_REFERENCE = 2;
-
- /**
- * The type of collection to be created.
- *
- * This is implied by the element name: <code>ref-list</code> or <code>ref-set</code>.
- *
- * @return Class object for the specified collection type (List, Set).
- */
- Class<?> getCollectionType();
-
- /**
- * The comparator specified for ordering the collection, or <code>null</code> if no
- * comparator was specified.
- *
- * Defined in the <code>comparator</code> child element or <code>comparator-ref</code>
- * attribute.
- *
- * @return if a comparator was specified then a Value object identifying the
- * comparator (a ComponentValue, ReferenceValue, or
- * ReferenceNameValue) is returned. If no comparator was specified
- * then null will be returned.
- */
- Target getComparator();
-
- /**
- * The basis on which to perform ordering, if specified.
- *
- * Defined in the <code>ordering-basis</code> attribute.
- *
- * @return one of ORDERING_BASIS_SERVICES and ORDERING_BASIS_SERVICE_REFERENCE
- */
- int getOrderingBasis();
-
- /**
- * Whether the collection will contain service instances, or service
- * references
- * Defined in the <code>member-type</code> attribute.
- */
- int getMemberType();
-}
Added: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/RefListMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/RefListMetadata.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/RefListMetadata.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) OSGi Alliance (2008, 2009). All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.osgi.service.blueprint.reflect;
+
+/**
+ * Service reference that binds to a collection of matching services from the
+ * OSGi service registry. This is the <code>ref-list</code> or
+ * <code>ref-set</code> element.
+ *
+ */
+public interface RefListMetadata extends ServiceReferenceMetadata {
+
+ /**
+ * Use the service objects to compare or include in the collection
+ */
+ public static final int USE_SERVICE_OBJECT = 1;
+
+ /**
+ * Use the service references to compare or include in the collection
+ */
+ public static final int USE_SERVICE_REFERENCE = 2;
+
+ /**
+ * Whether the collection will contain service objects, or service
+ * references
+ * Defined in the <code>member-type</code> attribute.
+ *
+ * @return one of USE_SERVICE_OBJECT and USE_SERVICE_REFERENCE
+ * @see #USE_SERVICE_OBJECT
+ * @see #USE_SERVICE_REFERENCE
+ */
+ int getMemberType();
+}
Property changes on: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/RefListMetadata.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/RefMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/RefMetadata.java 2009-06-17 13:27:35 UTC (rev 90328)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/RefMetadata.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -21,7 +21,7 @@
public interface RefMetadata extends Target, NonNullMetadata {
/**
* The name of the referenced component.
- * Defined in the <code>component</code> attribute.
+ * Defined in the <code>component-id</code> attribute.
*
*/
String getComponentId();
Added: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/ReferenceListener.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/ReferenceListener.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/ReferenceListener.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) OSGi Alliance (2008, 2009). All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.osgi.service.blueprint.reflect;
+
+/**
+ * Metadata for a listener interested in service bind and unbind events for a service
+ * reference.
+ */
+public interface ReferenceListener {
+
+ /**
+ * The component instance that will receive bind and unbind
+ * events. The returned value must reference a TargetListenerComponent
+ * either directly or indirectly. The return type will be either
+ * a RefMetadata instance or an TargetListenerComponent instance.
+ *
+ * Defined in the <code>ref</code> attribute or inlined component.
+ *
+ * @return the listener component reference.
+ */
+ Target getListenerComponent();
+
+ /**
+ * The name of the method to invoke on the listener component when
+ * a matching service is bound to the reference
+ *
+ * @return the bind callback method name.
+ */
+ String getBindMethod();
+
+ /**
+ * The name of the method to invoke on the listener component when
+ * a service is unbound from the reference.
+ *
+ * @return the unbind callback method name.
+ */
+ String getUnbindMethod();
+}
Property changes on: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/ReferenceListener.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/ReferenceMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/ReferenceMetadata.java 2009-06-17 13:27:35 UTC (rev 90328)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/ReferenceMetadata.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -23,8 +23,7 @@
* Defines the <code>reference</code> element.
*
*/
-public interface ReferenceMetadata extends ServiceReferenceMetadata,
- Target {
+public interface ReferenceMetadata extends ServiceReferenceMetadata, Target {
/**
* Timeout for service invocations when a matching backing service is
@@ -34,5 +33,4 @@
* @return service invocation timeout in milliseconds
*/
long getTimeout();
-
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/RegistrationListener.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/RegistrationListener.java 2009-06-17 13:27:35 UTC (rev 90328)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/RegistrationListener.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -41,7 +41,7 @@
*
* @return the registration callback method name.
*/
- String getRegistrationMethodName();
+ String getRegistrationMethod();
/**
* The name of the method to invoke on the listener component when
@@ -51,6 +51,6 @@
*
* @return the unregistration callback method name.
*/
- String getUnregistrationMethodName();
+ String getUnregistrationMethod();
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/ServiceMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/ServiceMetadata.java 2009-06-17 13:27:35 UTC (rev 90328)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/ServiceMetadata.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -18,9 +18,7 @@
import java.util.Collection;
import java.util.List;
-import org.jboss.osgi.blueprint.reflect.ServicePropertyEntry;
-
/**
* Metadata representing a service to be exported by a module context.
*
@@ -52,7 +50,7 @@
/**
* The component that is to be exported as a service. Value must refer to a component and
- * therefore be either a RefMetadata or BeanMetadata.
+ * therefore be either a RefMetadata, BeanMetadata, or ReferenceMetadata.
*
* Defined in the <code>registration-method</code> attribute.
*
@@ -68,7 +66,7 @@
*
* @return an immutable set of (String) type names, or an empty set if using auto-export
*/
- List<String> getInterfaceNames();
+ List<String> getInterfaces();
/**
* Return the auto-export mode specified.
@@ -77,7 +75,7 @@
*
* @return One of AUTO_EXPORT_DISABLED, AUTO_EXPORT_INTERFACES, AUTO_EXPORT_CLASS_HIERARCHY, AUTO_EXPORT_ALL_CLASSES
*/
- int getAutoExportMode();
+ int getAutoExport();
/**
* The user declared properties to be advertised with the service.
@@ -87,7 +85,7 @@
* @return Map containing the set of user declared service properties (may be
* empty if no properties were specified).
*/
- List<ServicePropertyEntry> getServiceProperties();
+ List<MapEntry> getServiceProperties();
/**
* The ranking value to use when advertising the service
@@ -107,13 +105,4 @@
* @return an immutable collection of RegistrationListenerMetadata
*/
Collection<RegistrationListener> getRegistrationListeners();
-
- /**
- * The names of any components listed in a "depends-on" attribute for this
- * component.
- *
- * @return an immutable List of component names for components that we have explicitly
- * declared a dependency on, or an empty set if none.
- */
- List<String> getExplicitDependencies();
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/ServiceReferenceMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/ServiceReferenceMetadata.java 2009-06-17 13:27:35 UTC (rev 90328)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/ServiceReferenceMetadata.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -16,7 +16,6 @@
package org.osgi.service.blueprint.reflect;
import java.util.Collection;
-import java.util.List;
/**
@@ -46,19 +45,18 @@
int getAvailability();
/**
- * The interface types that the matching service must support
+ * The interface type that the matching service must support
*
- * Defined in the <code>interface</code> attribute or <code>interfaces</code> element.
- *
- * @return an immutable list of type names
+ * Defined in the <code>interface</code> attribute.
+ * @return the String name of the requested service interface
*/
- List<String> getInterfaceNames();
+ String getInterface();
/**
* The value of the component-name attribute, if specified. This specifies
* the name of a component that is registered in the service registry. This will
* create an automatic filter (appended wit the filter if set) to select this
- * component based on its automatic ###name attribute.
+ * component based on its automatic id attribute.
*
* Defined in the <code>component-name</code> attribute.
*
@@ -81,8 +79,8 @@
*
* Defined in the <code>listener</code> elements.
*
- * @return an immutable collection of registered ListenerMetadata
+ * @return an immutable collection of ReferenceListener objects
*/
- Collection<Listener> getServiceListeners();
+ Collection<ReferenceListener> getReferenceListeners();
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/ValueMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/ValueMetadata.java 2009-06-17 13:27:35 UTC (rev 90328)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/ValueMetadata.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -32,8 +32,7 @@
/**
* The name of the type to which this value should be coerced. May be null.
- *
* Defined in the <code>type</code> attribute.
*/
- String getTypeName();
+ String getType();
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/package.html
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/package.html 2009-06-17 13:27:35 UTC (rev 90328)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/package.html 2009-06-17 13:32:50 UTC (rev 90329)
@@ -13,23 +13,23 @@
<pre>
Configuration Element Corresponding Reflection Type(s)
- component LocalComponentMetadata, ComponentValue
- reference UnaryServiceReferenceComponentMetadata
- ref-set,ref-list CollectionBasedServiceReferenceComponentMetadata
- service ServiceExportComponentMetadata
- constructor-arg ConstructorInjectionMetadata, ParameterSpecification
- property PropertyInjectionMetadata
- listener BindingListenerMetadata
+ bean BeanMetadata
+ reference ReferenceMetadata
+ ref-list RefListMetadata
+ service ServiceMetadata
+ argument BeanArgumentMetadata
+ property BeanPropertyMetadata
+ listener ListenerMetadata
registration-listener RegistrationListenerMetadata
- array< ArrayValue
- ref ReferenceValue
- id-ref ReferenceNameValue
- list ListValue
- map MapValue
- null NullValue
- props PropertiesValue
- set SetValue
- value TypedStringValue
+ array< CollectionMetadata
+ ref RefMetadata
+ id-ref IdrefMetadata
+ list CollectionMetadata
+ map MapMetadata
+ null NullMetadata
+ props PropsMetadata
+ set CollectionMetadata
+ value ValueMetadata
<//pre>
</BODY>
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java 2009-06-17 13:27:35 UTC (rev 90328)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -54,14 +54,14 @@
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.blueprint.context.BlueprintContext;
+import org.osgi.service.blueprint.container.BlueprintContainer;
import org.osgi.service.blueprint.reflect.BeanMetadata;
import org.osgi.service.blueprint.reflect.ComponentMetadata;
import org.osgi.service.blueprint.reflect.ServiceMetadata;
import org.osgi.service.blueprint.reflect.ServiceReferenceMetadata;
/**
- * BlueprintContext API tests
+ * BlueprintContainer API tests
*
* @author thomas.diesler(a)jboss.com
* @since 13-May-2009
@@ -118,8 +118,8 @@
assumeNotNull(context);
- BlueprintContext bpContext = getBlueprintContext();
- assertNotNull("BlueprintContext available", bpContext);
+ BlueprintContainer bpContext = getBlueprintContext();
+ assertNotNull("BlueprintContainer available", bpContext);
}
@@ -131,8 +131,8 @@
assumeNotNull(context);
- BlueprintContext bpContext = getBlueprintContext();
- Collection<BeanMetadata> bcMetadata = bpContext.getBeanComponentsMetadata();
+ BlueprintContainer bpContext = getBlueprintContext();
+ Collection<BeanMetadata> bcMetadata = bpContext.getMetadata(BeanMetadata.class);
assertNotNull("BeanComponentsMetadata not null", bcMetadata);
assertEquals("BeanComponentsMetadata size", 1, bcMetadata.size());
@@ -150,7 +150,7 @@
assumeNotNull(context);
- BlueprintContext bpContext = getBlueprintContext();
+ BlueprintContainer bpContext = getBlueprintContext();
BundleContext bndContext = bpContext.getBundleContext();
assertNotNull("BundleContext not null", bndContext);
@@ -167,8 +167,8 @@
assumeNotNull(context);
- BlueprintContext bpContext = getBlueprintContext();
- bpContext.getComponent("beanA");
+ BlueprintContainer bpContext = getBlueprintContext();
+ bpContext.getComponentInstance("beanA");
}
@Test
@@ -179,7 +179,7 @@
assumeNotNull(context);
- BlueprintContext bpContext = getBlueprintContext();
+ BlueprintContainer bpContext = getBlueprintContext();
ComponentMetadata compMetadata = bpContext.getComponentMetadata("beanA");
assertNotNull("ComponentMetadata not null", compMetadata);
@@ -194,8 +194,8 @@
assumeNotNull(context);
- BlueprintContext bpContext = getBlueprintContext();
- Set<String> compNames = bpContext.getComponentNames();
+ BlueprintContainer bpContext = getBlueprintContext();
+ Set<String> compNames = bpContext.getComponentIds();
assertNotNull("ComponentNames not null", compNames);
assertEquals("ComponentNames size", 4, compNames.size());
@@ -213,8 +213,8 @@
assumeNotNull(context);
- BlueprintContext bpContext = getBlueprintContext();
- Collection<ServiceMetadata> servicesMetadata = bpContext.getExportedServicesMetadata();
+ BlueprintContainer bpContext = getBlueprintContext();
+ Collection<ServiceMetadata> servicesMetadata = bpContext.getMetadata(ServiceMetadata.class);
assertNotNull("ServiceMetadata not null", servicesMetadata);
assertEquals("ServiceMetadata size", 2, servicesMetadata.size());
@@ -223,7 +223,7 @@
ServiceMetadata serviceA = itServices.next();
assertEquals("serviceA", serviceA.getId());
- List<String> interfaceNamesA = serviceA.getInterfaceNames();
+ List<String> interfaceNamesA = serviceA.getInterfaces();
assertNotNull("InterfaceNames not null", interfaceNamesA);
assertEquals("InterfaceNames size", 1, interfaceNamesA.size());
assertEquals("InterfaceName", ServiceA.class.getName(), interfaceNamesA.get(0));
@@ -231,7 +231,7 @@
ServiceMetadata serviceB = itServices.next();
assertEquals("serviceB", serviceB.getId());
- List<String> interfaceNamesB = serviceB.getInterfaceNames();
+ List<String> interfaceNamesB = serviceB.getInterfaces();
assertNotNull("InterfaceNames not null", interfaceNamesB);
assertEquals("InterfaceNames size", 1, interfaceNamesB.size());
assertEquals("InterfaceName", ServiceB.class.getName(), interfaceNamesB.get(0));
@@ -245,8 +245,8 @@
assumeNotNull(context);
- BlueprintContext bpContext = getBlueprintContext();
- Collection<ServiceReferenceMetadata> srefsMetadata = bpContext.getReferencedServicesMetadata();
+ BlueprintContainer bpContext = getBlueprintContext();
+ Collection<ServiceReferenceMetadata> srefsMetadata = bpContext.getMetadata(ServiceReferenceMetadata.class);
assertNotNull("ServiceReferenceMetadata not null", srefsMetadata);
assertEquals("ServiceReferenceMetadata size", 1, srefsMetadata.size());
@@ -254,16 +254,15 @@
ServiceReferenceMetadata srefMetadata = srefsMetadata.iterator().next();
assertEquals("mbeanService", srefMetadata.getId());
- List<String> interfaceNames = srefMetadata.getInterfaceNames();
- assertNotNull("InterfaceNames not null", interfaceNames);
- assertEquals("InterfaceNames size", 1, interfaceNames.size());
- assertEquals("InterfaceName", MBeanServer.class.getName(), interfaceNames.get(0));
+ String interfaceName = srefMetadata.getInterface();
+ assertNotNull("InterfaceName not null", interfaceName);
+ assertEquals("InterfaceName", MBeanServer.class.getName(), interfaceName);
}
- private BlueprintContext getBlueprintContext()
+ private BlueprintContainer getBlueprintContext()
{
- ServiceReference sref = context.getServiceReference(BlueprintContext.class.getName());
- BlueprintContext bpContext = (BlueprintContext)context.getService(sref);
+ ServiceReference sref = context.getServiceReference(BlueprintContainer.class.getName());
+ BlueprintContainer bpContext = (BlueprintContainer)context.getService(sref);
return bpContext;
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java 2009-06-17 13:27:35 UTC (rev 90328)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -113,7 +113,7 @@
@Test
public void getExportedServicesMetadata() throws Exception
{
- Collection<ServiceMetadata> services = blueprint.getExportedServicesMetadata();
+ Collection<ServiceMetadata> services = blueprint.getMetadata(ServiceMetadata.class);
assertNotNull("ServiceMetadata not null", services);
assertEquals("ServiceMetadata size", 2, services.size());
}
@@ -121,7 +121,7 @@
@Test
public void getReferencedServicesMetadata() throws Exception
{
- Collection<ServiceReferenceMetadata> serviceRefs = blueprint.getReferencedServicesMetadata();
+ Collection<ServiceReferenceMetadata> serviceRefs = blueprint.getMetadata(ServiceReferenceMetadata.class);
assertNotNull("ServiceReferenceMetadata not null", serviceRefs);
assertEquals("ServiceReferenceMetadata size", 3, serviceRefs.size());
}
@@ -129,7 +129,7 @@
@Test
public void getBeanComponentsMetadata() throws Exception
{
- Collection<BeanMetadata> beans = blueprint.getBeanComponentsMetadata();
+ Collection<BeanMetadata> beans = blueprint.getMetadata(BeanMetadata.class);
assertNotNull("BeanMetadata not null", beans);
assertEquals("BeanMetadata size", 3, beans.size());
}
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java 2009-06-17 13:27:35 UTC (rev 90328)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java 2009-06-17 13:32:50 UTC (rev 90329)
@@ -64,14 +64,14 @@
ServiceMetadata serviceA = (ServiceMetadata)compList.get(1);
assertEquals("serviceA", serviceA.getId());
- List<String> intfsA = serviceA.getInterfaceNames();
+ List<String> intfsA = serviceA.getInterfaces();
assertTrue(intfsA.size() > 0);
assertEquals(ServiceA.class.getName(), intfsA.get(0));
ServiceMetadata serviceB = (ServiceMetadata)compList.get(2);
assertEquals("serviceB", serviceB.getId());
- List<String> intfsB = serviceB.getInterfaceNames();
+ List<String> intfsB = serviceB.getInterfaces();
assertTrue(intfsB.size() > 0);
assertEquals(ServiceB.class.getName(), intfsB.get(0));
}
15 years