You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by gn...@apache.org on 2009/04/22 17:57:38 UTC
svn commit: r767576 [3/4] - in /geronimo/sandbox/blueprint:
blueprint-api/src/main/java/org/osgi/service/blueprint/context/
blueprint-api/src/main/java/org/osgi/service/blueprint/convert/
blueprint-api/src/main/java/org/osgi/service/blueprint/namespace...
Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/ServiceRegistrationProxy.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/ServiceRegistrationProxy.java?rev=767576&r1=767575&r2=767576&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/ServiceRegistrationProxy.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/ServiceRegistrationProxy.java Wed Apr 22 15:57:35 2009
@@ -31,21 +31,21 @@
import org.osgi.framework.Constants;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.blueprint.context.ModuleContext;
-import org.osgi.service.blueprint.reflect.ReferenceValue;
-import org.osgi.service.blueprint.reflect.RegistrationListenerMetadata;
-import org.osgi.service.blueprint.reflect.ServiceExportComponentMetadata;
+import org.osgi.service.blueprint.context.BlueprintContext;
+import org.osgi.service.blueprint.reflect.RefMetadata;
+import org.osgi.service.blueprint.reflect.RegistrationListener;
+import org.osgi.service.blueprint.reflect.ServiceMetadata;
/**
* TODO: javadoc
*/
public class ServiceRegistrationProxy implements ServiceRegistration {
- private ModuleContext moduleContext;
+ private BlueprintContext moduleContext;
private Object service;
private Map serviceProperties;
private List<Listener> listeners;
- private ServiceExportComponentMetadata metadata;
+ private ServiceMetadata metadata;
private ServiceRegistration registration = null;
private Map registrationProperties = null;
@@ -69,18 +69,18 @@
}
Set<String> classes;
switch (metadata.getAutoExportMode()) {
- case ServiceExportComponentMetadata.EXPORT_MODE_INTERFACES:
+ case ServiceMetadata.AUTO_EXPORT_INTERFACES:
classes = ReflectionUtils.getImplementedInterfaces(new HashSet<String>(), serviceClass);
break;
- case ServiceExportComponentMetadata.EXPORT_MODE_CLASS_HIERARCHY:
+ case ServiceMetadata.AUTO_EXPORT_CLASS_HIERARCHY:
classes = ReflectionUtils.getSuperClasses(new HashSet<String>(), serviceClass);
break;
- case ServiceExportComponentMetadata.EXPORT_MODE_ALL:
+ case ServiceMetadata.AUTO_EXPORT_ALL_CLASSES:
classes = ReflectionUtils.getSuperClasses(new HashSet<String>(), serviceClass);
classes = ReflectionUtils.getImplementedInterfaces(classes, serviceClass);
break;
default:
- classes = metadata.getInterfaceNames();
+ classes = new HashSet<String>(metadata.getInterfaceNames());
break;
}
@@ -107,9 +107,9 @@
}
private String getComponentName() {
- if (metadata.getExportedComponent() instanceof ReferenceValue) {
- ReferenceValue ref = (ReferenceValue) metadata.getExportedComponent();
- return ref.getComponentName();
+ if (metadata.getServiceComponent() instanceof RefMetadata) {
+ RefMetadata ref = (RefMetadata) metadata.getServiceComponent();
+ return ref.getComponentId();
} else {
return null;
}
@@ -158,7 +158,7 @@
public static class Listener {
private Object listener;
- private RegistrationListenerMetadata metadata;
+ private RegistrationListener metadata;
private Method registerMethod;
private Method unregisterMethod;
Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/UnaryServiceReferenceRecipe.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/UnaryServiceReferenceRecipe.java?rev=767576&r1=767575&r2=767576&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/UnaryServiceReferenceRecipe.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/UnaryServiceReferenceRecipe.java Wed Apr 22 15:57:35 2009
@@ -22,20 +22,18 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.Set;
+import java.util.HashSet;
import net.sf.cglib.proxy.Dispatcher;
-import org.apache.geronimo.blueprint.Destroyable;
import org.apache.geronimo.blueprint.ModuleContextEventSender;
import org.apache.xbean.recipe.ConstructionException;
import org.apache.xbean.recipe.ExecutionContext;
import org.apache.xbean.recipe.Recipe;
import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceEvent;
-import org.osgi.framework.ServiceListener;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.blueprint.context.ModuleContext;
+import org.osgi.service.blueprint.context.BlueprintContext;
import org.osgi.service.blueprint.context.ServiceUnavailableException;
-import org.osgi.service.blueprint.reflect.UnaryServiceReferenceComponentMetadata;
+import org.osgi.service.blueprint.reflect.ReferenceMetadata;
/**
* A recipe to create an unary OSGi service reference.
@@ -47,23 +45,23 @@
*/
public class UnaryServiceReferenceRecipe extends AbstractServiceReferenceRecipe {
- private final UnaryServiceReferenceComponentMetadata metadata;
+ private final ReferenceMetadata metadata;
private Class proxyClass;
private volatile ServiceReference trackedServiceReference;
private volatile Object trackedService;
private final Object monitor = new Object();
- public UnaryServiceReferenceRecipe(ModuleContext moduleContext,
+ public UnaryServiceReferenceRecipe(BlueprintContext moduleContext,
ModuleContextEventSender sender,
- UnaryServiceReferenceComponentMetadata metadata,
+ ReferenceMetadata metadata,
Recipe listenersRecipe) {
super(moduleContext, sender, metadata, listenersRecipe);
this.metadata = metadata;
}
protected Object internalCreate(Type expectedType, boolean lazyRefAllowed) throws ConstructionException {
- // TODO: serviceAvailabilitySpecification
+ // TODO: availability
try {
// Create the proxy
Object obj = createProxy(new ServiceDispatcher(), metadata.getInterfaceNames());
@@ -163,7 +161,7 @@
public Object loadObject() throws Exception {
Object svc = trackedService;
if (svc == null && metadata.getTimeout() > 0) {
- Set<String> interfaces = (Set<String>) metadata.getInterfaceNames();
+ Set<String> interfaces = new HashSet<String>(metadata.getInterfaceNames());
sender.sendWaiting(moduleContext, interfaces.toArray(new String[interfaces.size()]), getOsgiFilter());
synchronized (monitor) {
monitor.wait(metadata.getTimeout());
Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/namespace/ComponentDefinitionRegistryImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/namespace/ComponentDefinitionRegistryImpl.java?rev=767576&r1=767575&r2=767576&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/namespace/ComponentDefinitionRegistryImpl.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/namespace/ComponentDefinitionRegistryImpl.java Wed Apr 22 15:57:35 2009
@@ -28,9 +28,10 @@
import org.osgi.service.blueprint.namespace.ComponentDefinitionRegistry;
import org.osgi.service.blueprint.namespace.ComponentNameAlreadyInUseException;
import org.osgi.service.blueprint.reflect.ComponentMetadata;
-import org.osgi.service.blueprint.reflect.ComponentValue;
-import org.osgi.service.blueprint.reflect.ReferenceValue;
-import org.osgi.service.blueprint.reflect.Value;
+import org.osgi.service.blueprint.reflect.RefMetadata;
+import org.osgi.service.blueprint.reflect.Metadata;
+import org.osgi.service.blueprint.reflect.BeanMetadata;
+import org.osgi.service.blueprint.reflect.Target;
/**
* TODO: javadoc
@@ -41,13 +42,13 @@
public class ComponentDefinitionRegistryImpl implements ComponentDefinitionRegistry {
private final Map<String, ComponentMetadata> components;
- private final List<Value> typeConverters;
+ private final List<Target> typeConverters;
private String defaultInitMethod;
private String defaultDestroyMethod;
public ComponentDefinitionRegistryImpl() {
components = new HashMap<String, ComponentMetadata>();
- typeConverters = new ArrayList<Value>();
+ typeConverters = new ArrayList<Target>();
}
public boolean containsComponentDefinition(String name) {
@@ -63,7 +64,7 @@
}
public void registerComponentDefinition(ComponentMetadata component) throws ComponentNameAlreadyInUseException {
- String name = component.getName();
+ String name = component.getId();
if (components.containsKey(name)) {
throw new ComponentNameAlreadyInUseException(name);
}
@@ -74,28 +75,28 @@
components.remove(name);
}
- public void registerTypeConverter(Value typeConverter) {
+ public void registerTypeConverter(Target typeConverter) {
typeConverters.add(typeConverter);
}
- public List<Value> getTypeConverters() {
+ public List<Target> getTypeConverters() {
return Collections.unmodifiableList(typeConverters);
}
public List<String> getTypeConverterNames() {
- List<String> names = new ArrayList<String>();
- for (Value value : typeConverters) {
- if (value instanceof ComponentValue) {
- ComponentValue componentValue = (ComponentValue) value;
- names.add(componentValue.getComponentMetadata().getName());
- } else if (value instanceof ReferenceValue) {
- ReferenceValue referenceValue = (ReferenceValue) value;
- names.add(referenceValue.getComponentName());
+ List<String> ids = new ArrayList<String>();
+ for (Target value : typeConverters) {
+ if (value instanceof ComponentMetadata) {
+ ComponentMetadata beanMetadata = (ComponentMetadata) value;
+ ids.add(beanMetadata.getId());
+ } else if (value instanceof RefMetadata) {
+ RefMetadata referenceValue = (RefMetadata) value;
+ ids.add(referenceValue.getComponentId());
} else {
throw new RuntimeException("Unexpected converter type: " + value);
}
}
- return names;
+ return ids;
}
public void setDefaultInitMethod(String method) {
Copied: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/BeanArgumentImpl.java (from r767394, geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ParameterSpecificationImpl.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/BeanArgumentImpl.java?p2=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/BeanArgumentImpl.java&p1=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ParameterSpecificationImpl.java&r1=767394&r2=767576&rev=767576&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ParameterSpecificationImpl.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/BeanArgumentImpl.java Wed Apr 22 15:57:35 2009
@@ -18,8 +18,8 @@
*/
package org.apache.geronimo.blueprint.reflect;
-import org.osgi.service.blueprint.reflect.ParameterSpecification;
-import org.osgi.service.blueprint.reflect.Value;
+import org.osgi.service.blueprint.reflect.BeanArgument;
+import org.osgi.service.blueprint.reflect.Metadata;
/**
* TODO: javadoc
@@ -27,41 +27,41 @@
* @author <a href="mailto:dev@geronimo.apache.org">Apache Geronimo Project</a>
* @version $Rev: 760378 $, $Date: 2009-03-31 11:31:38 +0200 (Tue, 31 Mar 2009) $
*/
-public class ParameterSpecificationImpl implements ParameterSpecification {
+public class BeanArgumentImpl implements BeanArgument {
- private Value value;
- private String typeName;
+ private Metadata value;
+ private String valueType;
private int index = -1;
- public ParameterSpecificationImpl() {
+ public BeanArgumentImpl() {
}
- public ParameterSpecificationImpl(Value value, String typeName, int index) {
+ public BeanArgumentImpl(Metadata value, String valueType, int index) {
this.value = value;
- this.typeName = typeName;
+ this.valueType = valueType;
this.index = index;
}
- public ParameterSpecificationImpl(ParameterSpecification source) {
- value = MetadataUtil.cloneValue(source.getValue());
- typeName = source.getTypeName();
+ public BeanArgumentImpl(BeanArgument source) {
+ value = MetadataUtil.cloneMetadata(source.getValue());
+ valueType = source.getValueType();
index = source.getIndex();
}
-
- public Value getValue() {
+
+ public Metadata getValue() {
return value;
}
- public void setValue(Value value) {
+ public void setValue(Metadata value) {
this.value = value;
}
- public String getTypeName() {
- return typeName;
+ public String getValueType() {
+ return valueType;
}
- public void setTypeName(String typeName) {
- this.typeName = typeName;
+ public void setValueType(String valueType) {
+ this.valueType = valueType;
}
public int getIndex() {
@@ -73,6 +73,6 @@
}
public String toString() {
- return index + " " + value + " " + typeName;
+ return index + " " + value + " " + valueType;
}
}
Copied: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/BeanMetadataImpl.java (from r767394, geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/LocalComponentMetadataImpl.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/BeanMetadataImpl.java?p2=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/BeanMetadataImpl.java&p1=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/LocalComponentMetadataImpl.java&r1=767394&r2=767576&rev=767576&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/LocalComponentMetadataImpl.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/BeanMetadataImpl.java Wed Apr 22 15:57:35 2009
@@ -19,16 +19,13 @@
package org.apache.geronimo.blueprint.reflect;
import java.util.ArrayList;
-import java.util.Collection;
+import java.util.List;
import java.util.Collections;
-import java.util.Iterator;
-import org.osgi.service.blueprint.reflect.ConstructorInjectionMetadata;
-import org.osgi.service.blueprint.reflect.LocalComponentMetadata;
-import org.osgi.service.blueprint.reflect.MethodInjectionMetadata;
-import org.osgi.service.blueprint.reflect.ParameterSpecification;
-import org.osgi.service.blueprint.reflect.PropertyInjectionMetadata;
-import org.osgi.service.blueprint.reflect.Value;
+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;
/**
* TODO: javadoc
@@ -36,46 +33,42 @@
* @author <a href="mailto:dev@geronimo.apache.org">Apache Geronimo Project</a>
* @version $Rev: 760378 $, $Date: 2009-03-31 11:31:38 +0200 (Tue, 31 Mar 2009) $
*/
-public class LocalComponentMetadataImpl extends ComponentMetadataImpl implements LocalComponentMetadata {
+public class BeanMetadataImpl extends ComponentMetadataImpl implements BeanMetadata {
private String className;
- private String scope;
- private boolean isLazy;
private String initMethodName;
private String destroyMethodName;
- private ConstructorInjectionMetadataImpl constructorInjectionMetadata;
- private Collection<PropertyInjectionMetadata> propertyInjectionMetadata;
- private MethodInjectionMetadata factoryMethodMetadata;
- private Value factoryComponent;
+ private List<BeanArgument> arguments;
+ private List<BeanProperty> properties;
+ private boolean isLazyInit;
+ private String factoryMethodName;
+ private Target factoryComponent;
+ private String scope;
+ private Class runtimeClass;
+ private List<String> explicitDependencies;
- public LocalComponentMetadataImpl() {
- constructorInjectionMetadata = new ConstructorInjectionMetadataImpl();
- propertyInjectionMetadata = new ArrayList<PropertyInjectionMetadata>();
+ public BeanMetadataImpl() {
}
- public LocalComponentMetadataImpl(LocalComponentMetadata source) {
+ public BeanMetadataImpl(BeanMetadata source) {
super(source);
- initMethodName = source.getInitMethodName();
- destroyMethodName = source.getDestroyMethodName();
- className = source.getClassName();
- scope = source.getScope();
- isLazy = source.isLazy();
- if (source.getConstructorInjectionMetadata() != null) {
- constructorInjectionMetadata = new ConstructorInjectionMetadataImpl(source.getConstructorInjectionMetadata());
- }
- if (source.getFactoryMethodMetadata() != null) {
- factoryMethodMetadata = new MethodInjectionMetadataImpl(source.getFactoryMethodMetadata());
- }
- factoryComponent = MetadataUtil.cloneValue(source.getFactoryComponent());
- if (source.getPropertyInjectionMetadata() != null) {
- propertyInjectionMetadata = new ArrayList<PropertyInjectionMetadata>();
- Iterator propertySource = source.getPropertyInjectionMetadata().iterator();
- while (propertySource.hasNext()) {
- propertyInjectionMetadata.add(new PropertyInjectionMetadataImpl((PropertyInjectionMetadata)propertySource.next()));
- }
+ this.className = source.getClassName();
+ this.initMethodName = source.getInitMethodName();
+ this.destroyMethodName = source.getDestroyMethodName();
+ for (BeanArgument argument : source.getArguments()) {
+ addArgument(new BeanArgumentImpl(argument));
}
+ for (BeanProperty property : source.getProperties()) {
+ addProperty(new BeanPropertyImpl(property));
+ }
+ this.isLazyInit = source.isLazyInit();
+ this.factoryMethodName = source.getFactoryMethodName();
+ this.factoryComponent = MetadataUtil.cloneTarget(source.getFactoryComponent());
+ this.scope = source.getScope();
+ this.runtimeClass = source.getRuntimeClass();
+ this.explicitDependencies = new ArrayList<String>(source.getExplicitDependencies());
}
-
+
public String getClassName() {
return className;
}
@@ -100,55 +93,101 @@
this.destroyMethodName = destroyMethodName;
}
- public ConstructorInjectionMetadata getConstructorInjectionMetadata() {
- return constructorInjectionMetadata;
+ public List<BeanArgument> getArguments() {
+ if (this.arguments == null) {
+ return Collections.emptyList();
+ } else {
+ return Collections.unmodifiableList(this.arguments);
+ }
+ }
+
+ public void setArguments(List<BeanArgument> arguments) {
+ this.arguments = arguments;
}
- public Collection<PropertyInjectionMetadata> getPropertyInjectionMetadata() {
- if (propertyInjectionMetadata == null) {
+ public void addArgument(BeanArgument argument) {
+ if (this.arguments == null) {
+ this.arguments = new ArrayList<BeanArgument>();
+ }
+ this.arguments.add(argument);
+ }
+
+ public List<BeanProperty> getProperties() {
+ if (this.properties == null) {
return Collections.emptyList();
} else {
- return Collections.unmodifiableCollection(propertyInjectionMetadata);
+ return Collections.unmodifiableList(this.properties);
+ }
+ }
+
+ public void setProperties(List<BeanProperty> properties) {
+ this.properties = properties;
+ }
+
+ public void addProperty(BeanProperty property) {
+ if (this.properties == null) {
+ this.properties = new ArrayList<BeanProperty>();
}
+ this.properties.add(property);
}
- public boolean isLazy() {
- return isLazy;
+ public boolean isLazyInit() {
+ return this.isLazyInit;
}
- public void setLazy(boolean lazy) {
- isLazy = lazy;
+ public void setLazyInit(boolean lazyInit) {
+ this.isLazyInit = lazyInit;
}
- public MethodInjectionMetadata getFactoryMethodMetadata() {
- return factoryMethodMetadata;
+ public String getFactoryMethodName() {
+ return this.factoryMethodName;
}
- public void setFactoryMethodMetadata(MethodInjectionMetadata factoryMethodMetadata) {
- this.factoryMethodMetadata = factoryMethodMetadata;
+ public void setFactoryMethodName(String factoryMethodName) {
+ this.factoryMethodName = factoryMethodName;
}
- public Value getFactoryComponent() {
- return factoryComponent;
+ public Target getFactoryComponent() {
+ return this.factoryComponent;
}
- public void setFactoryComponent(Value factoryComponent) {
+ public void setFactoryComponent(Target factoryComponent) {
this.factoryComponent = factoryComponent;
}
public String getScope() {
- return scope;
+ return this.scope;
}
public void setScope(String scope) {
this.scope = scope;
}
- public void addConsuctorArg(ParameterSpecification parameterSpecification) {
- constructorInjectionMetadata.addParameterSpecification(parameterSpecification);
+ public Class getRuntimeClass() {
+ return this.runtimeClass;
+ }
+
+ public void setRuntimeClass(Class runtimeClass) {
+ this.runtimeClass = runtimeClass;
+ }
+
+ public List<String> getExplicitDependencies() {
+ if (this.explicitDependencies == null) {
+ return Collections.emptyList();
+ } else {
+ return Collections.unmodifiableList(this.explicitDependencies);
+ }
}
- public void addProperty(PropertyInjectionMetadataImpl propertyInjectionMetadata) {
- this.propertyInjectionMetadata.add(propertyInjectionMetadata);
+ public void setExplicitDependencies(List<String> explicitDependencies) {
+ this.explicitDependencies = explicitDependencies;
}
+
+ public void addExplicitDependency(String explicitDependency) {
+ if (this.explicitDependencies == null) {
+ this.explicitDependencies = new ArrayList<String>();
+ }
+ this.explicitDependencies.add(explicitDependency);
+ }
+
}
Added: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/BeanPropertyImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/BeanPropertyImpl.java?rev=767576&view=auto
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/BeanPropertyImpl.java (added)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/BeanPropertyImpl.java Wed Apr 22 15:57:35 2009
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.apache.geronimo.blueprint.reflect;
+
+import org.osgi.service.blueprint.reflect.BeanArgument;
+import org.osgi.service.blueprint.reflect.Metadata;
+import org.osgi.service.blueprint.reflect.BeanProperty;
+
+/**
+ * TODO: javadoc
+ *
+ * @author <a href="mailto:dev@geronimo.apache.org">Apache Geronimo Project</a>
+ * @version $Rev: 760378 $, $Date: 2009-03-31 11:31:38 +0200 (Tue, 31 Mar 2009) $
+ */
+public class BeanPropertyImpl implements BeanProperty {
+
+ private String name;
+ private Metadata value;
+
+ public BeanPropertyImpl() {
+ }
+
+ public BeanPropertyImpl(String name, Metadata value) {
+ this.name = name;
+ this.value = value;
+ }
+
+ public BeanPropertyImpl(BeanProperty source) {
+ this.name = source.getName();
+ this.value = MetadataUtil.cloneMetadata(source.getValue());
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Metadata getValue() {
+ return value;
+ }
+
+ public void setValue(Metadata value) {
+ this.value = value;
+ }
+
+ public String toString() {
+ return name + " " + value;
+ }
+}
\ No newline at end of file
Copied: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/CollectionMetadataImpl.java (from r767394, geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ListValueImpl.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/CollectionMetadataImpl.java?p2=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/CollectionMetadataImpl.java&p1=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ListValueImpl.java&r1=767394&r2=767576&rev=767576&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ListValueImpl.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/CollectionMetadataImpl.java Wed Apr 22 15:57:35 2009
@@ -21,9 +21,10 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import java.util.Collections;
-import org.osgi.service.blueprint.reflect.ListValue;
-import org.osgi.service.blueprint.reflect.Value;
+import org.osgi.service.blueprint.reflect.Metadata;
+import org.osgi.service.blueprint.reflect.CollectionMetadata;
/**
* TODO: javadoc
@@ -31,44 +32,62 @@
* @author <a href="mailto:dev@geronimo.apache.org">Apache Geronimo Project</a>
* @version $Rev: 760378 $, $Date: 2009-03-31 11:31:38 +0200 (Tue, 31 Mar 2009) $
*/
-public class ListValueImpl implements ListValue {
+public class CollectionMetadataImpl implements CollectionMetadata {
- private String valueType;
- private List<Value> list;
+ private Class collectionClass;
+ private String valueTypeName;
+ private List<Metadata> values;
- public ListValueImpl() {
+ public CollectionMetadataImpl() {
}
- public ListValueImpl(String valueType, List<Value> list) {
- this.valueType = valueType;
- this.list = list;
+ public CollectionMetadataImpl(Class collectionClass, String valueTypeName, List<Metadata> values) {
+ this.collectionClass = collectionClass;
+ this.valueTypeName = valueTypeName;
+ this.values = values;
}
- public ListValueImpl(ListValue source) {
- if (source.getList() != null) {
- list = new ArrayList<Value>();
- Iterator i = source.getList().iterator();
- while (i.hasNext()) {
- list.add(MetadataUtil.cloneValue((Value)i.next()));
- }
+ public CollectionMetadataImpl(CollectionMetadata source) {
+ this.collectionClass = source.getCollectionClass();
+ this.valueTypeName = source.getValueTypeName();
+ for (Metadata value : source.getValues()) {
+ addValue(MetadataUtil.cloneMetadata(value));
}
- valueType = source.getValueType();
}
-
- public String getValueType() {
- return valueType;
+
+ public Class getCollectionClass() {
+ return collectionClass;
+ }
+
+ public void setCollectionClass(Class collectionClass) {
+ this.collectionClass = collectionClass;
+ }
+
+ public String getValueTypeName() {
+ return valueTypeName;
}
- public void setValueType(String valueType) {
- this.valueType = valueType;
+ public void setValueTypeName(String valueTypeName) {
+ this.valueTypeName = valueTypeName;
}
- public List<Value> getList() {
- return list;
+ public List<Metadata> getValues() {
+ if (this.values == null) {
+ return Collections.emptyList();
+ } else {
+ return Collections.unmodifiableList(this.values);
+ }
}
- public void setList(List<Value> list) {
- this.list = list;
+ public void setValues(List<Metadata> values) {
+ this.values = values;
+ }
+
+ public void addValue(Metadata value) {
+ if (this.values == null) {
+ this.values = new ArrayList<Metadata>();
+ }
+ this.values.add(value);
}
}
Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ComponentMetadataImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ComponentMetadataImpl.java?rev=767576&r1=767575&r2=767576&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ComponentMetadataImpl.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ComponentMetadataImpl.java Wed Apr 22 15:57:35 2009
@@ -18,10 +18,6 @@
*/
package org.apache.geronimo.blueprint.reflect;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
import org.osgi.service.blueprint.reflect.ComponentMetadata;
/**
@@ -32,35 +28,21 @@
*/
public class ComponentMetadataImpl implements ComponentMetadata {
- private String name;
- private Set<String> explicitDependencies;
-
+ private String id;
+
protected ComponentMetadataImpl() {
}
protected ComponentMetadataImpl(ComponentMetadata source) {
- name = source.getName();
- if (source.getExplicitDependencies() != null) {
- explicitDependencies = new HashSet<String>(source.getExplicitDependencies());
- }
+ id = source.getId();
}
- public String getName() {
- return name;
+ public String getId() {
+ return id;
}
- public void setName(String name) {
- this.name = name;
+ public void setId(String id) {
+ this.id = id;
}
- public Set<String> getExplicitDependencies() {
- if (explicitDependencies == null) {
- return Collections.emptySet();
- }
- return Collections.unmodifiableSet(explicitDependencies);
- }
-
- public void setExplicitDependencies(Set<String> explicitDependencies) {
- this.explicitDependencies = explicitDependencies;
- }
}
Copied: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/IdRefMetadataImpl.java (from r767394, geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ReferenceNameValueImpl.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/IdRefMetadataImpl.java?p2=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/IdRefMetadataImpl.java&p1=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ReferenceNameValueImpl.java&r1=767394&r2=767576&rev=767576&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ReferenceNameValueImpl.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/IdRefMetadataImpl.java Wed Apr 22 15:57:35 2009
@@ -18,7 +18,7 @@
*/
package org.apache.geronimo.blueprint.reflect;
-import org.osgi.service.blueprint.reflect.ReferenceNameValue;
+import org.osgi.service.blueprint.reflect.IdRefMetadata;
/**
* TODO: javadoc
@@ -26,26 +26,26 @@
* @author <a href="mailto:dev@geronimo.apache.org">Apache Geronimo Project</a>
* @version $Rev: 760378 $, $Date: 2009-03-31 11:31:38 +0200 (Tue, 31 Mar 2009) $
*/
-public class ReferenceNameValueImpl implements ReferenceNameValue {
+public class IdRefMetadataImpl implements IdRefMetadata {
- private String referenceName;
+ private String componentId;
- public ReferenceNameValueImpl() {
+ public IdRefMetadataImpl() {
}
- public ReferenceNameValueImpl(String referenceName) {
- this.referenceName = referenceName;
+ public IdRefMetadataImpl(String componentId) {
+ this.componentId = componentId;
}
- public ReferenceNameValueImpl(ReferenceNameValue source) {
- referenceName = source.getReferenceName();
+ public IdRefMetadataImpl(IdRefMetadata source) {
+ componentId = source.getComponentId();
}
-
- public String getReferenceName() {
- return referenceName;
+
+ public String getComponentId() {
+ return componentId;
}
- public void setReferenceName(String referenceName) {
- this.referenceName = referenceName;
+ public void setComponentId(String componentId) {
+ this.componentId = componentId;
}
}
Copied: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ListenerImpl.java (from r767394, geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/BindingListenerMetadataImpl.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ListenerImpl.java?p2=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ListenerImpl.java&p1=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/BindingListenerMetadataImpl.java&r1=767394&r2=767576&rev=767576&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/BindingListenerMetadataImpl.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ListenerImpl.java Wed Apr 22 15:57:35 2009
@@ -18,8 +18,8 @@
*/
package org.apache.geronimo.blueprint.reflect;
-import org.osgi.service.blueprint.reflect.BindingListenerMetadata;
-import org.osgi.service.blueprint.reflect.Value;
+import org.osgi.service.blueprint.reflect.Listener;
+import org.osgi.service.blueprint.reflect.Target;
/**
* TODO: javadoc
@@ -27,37 +27,37 @@
* @author <a href="mailto:dev@geronimo.apache.org">Apache Geronimo Project</a>
* @version $Rev: 760378 $, $Date: 2009-03-31 11:31:38 +0200 (Tue, 31 Mar 2009) $
*/
-public class BindingListenerMetadataImpl implements BindingListenerMetadata {
+public class ListenerImpl implements Listener {
- private Value listenerComponent;
+ private Target listenerComponent;
private String bindMethodName;
private String unbindMethodName;
- public BindingListenerMetadataImpl() {
+ public ListenerImpl() {
}
- public BindingListenerMetadataImpl(Value listenerComponent, String bindMethodName, String unbindMethodName) {
+ public ListenerImpl(Target listenerComponent, String bindMethodName, String unbindMethodName) {
this.listenerComponent = listenerComponent;
this.bindMethodName = bindMethodName;
this.unbindMethodName = unbindMethodName;
}
- public BindingListenerMetadataImpl(BindingListenerMetadata source) {
- listenerComponent = MetadataUtil.cloneValue(source.getListenerComponent());
- bindMethodName = source.getBindMethodName();
- unbindMethodName = source.getUnbindMethodName();
+ public ListenerImpl(Listener source) {
+ this.listenerComponent = MetadataUtil.cloneTarget(source.getListenerComponent());
+ this.bindMethodName = source.getBindMethodName();
+ this.unbindMethodName = source.getUnbindMethodName();
}
-
- public Value getListenerComponent() {
- return listenerComponent;
+
+ public Target getListenerComponent() {
+ return this.listenerComponent;
}
- public void setListenerComponent(Value listenerComponent) {
+ public void setListenerComponent(Target listenerComponent) {
this.listenerComponent = listenerComponent;
}
public String getBindMethodName() {
- return bindMethodName;
+ return this.bindMethodName;
}
public void setBindMethodName(String bindMethodName) {
@@ -65,7 +65,7 @@
}
public String getUnbindMethodName() {
- return unbindMethodName;
+ return this.unbindMethodName;
}
public void setUnbindMethodName(String unbindMethodName) {
Added: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/MapEntryImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/MapEntryImpl.java?rev=767576&view=auto
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/MapEntryImpl.java (added)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/MapEntryImpl.java Wed Apr 22 15:57:35 2009
@@ -0,0 +1,40 @@
+package org.apache.geronimo.blueprint.reflect;
+
+import org.osgi.service.blueprint.reflect.MapEntry;
+import org.osgi.service.blueprint.reflect.NonNullMetadata;
+import org.osgi.service.blueprint.reflect.Metadata;
+
+public class MapEntryImpl implements MapEntry {
+
+ private NonNullMetadata key;
+ private Metadata value;
+
+ public MapEntryImpl() {
+ }
+
+ public MapEntryImpl(NonNullMetadata key, Metadata value) {
+ this.key = key;
+ this.value = value;
+ }
+
+ public MapEntryImpl(MapEntry entry) {
+ this.key = (NonNullMetadata) MetadataUtil.cloneMetadata(entry.getKey());
+ this.value = MetadataUtil.cloneMetadata(entry.getValue());
+ }
+
+ public NonNullMetadata getKey() {
+ return key;
+ }
+
+ public void setKey(NonNullMetadata key) {
+ this.key = key;
+ }
+
+ public Metadata getValue() {
+ return value;
+ }
+
+ public void setValue(Metadata value) {
+ this.value = value;
+ }
+}
Copied: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/MapMetadataImpl.java (from r767394, geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/MapValueImpl.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/MapMetadataImpl.java?p2=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/MapMetadataImpl.java&p1=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/MapValueImpl.java&r1=767394&r2=767576&rev=767576&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/MapValueImpl.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/MapMetadataImpl.java Wed Apr 22 15:57:35 2009
@@ -21,10 +21,14 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.Map.Entry;
-import org.osgi.service.blueprint.reflect.MapValue;
-import org.osgi.service.blueprint.reflect.Value;
+import org.osgi.service.blueprint.reflect.MapMetadata;
+import org.osgi.service.blueprint.reflect.Metadata;
+import org.osgi.service.blueprint.reflect.MapEntry;
/**
* TODO: javadoc
@@ -32,56 +36,61 @@
* @author <a href="mailto:dev@geronimo.apache.org">Apache Geronimo Project</a>
* @version $Rev: 760378 $, $Date: 2009-03-31 11:31:38 +0200 (Tue, 31 Mar 2009) $
*/
-public class MapValueImpl implements MapValue {
+public class MapMetadataImpl implements MapMetadata {
- private String keyType;
- private String valueType;
- private Map<Value, Value> map;
-
- public MapValueImpl() {
- }
-
- public MapValueImpl(String keyType, String valueType, Map<Value, Value> map) {
- this.keyType = keyType;
- this.valueType = valueType;
- this.map = map;
- }
-
- public MapValueImpl(MapValue source) {
- if (source.getMap() != null) {
- map = new HashMap<Value, Value>();
- // both the values and the keys are Value types, so we need to deep copy them
- Iterator i = source.getMap().entrySet().iterator();
- while (i.hasNext()) {
- Entry entry = (Entry)i.next();
- map.put(MetadataUtil.cloneValue((Value)entry.getKey()), MetadataUtil.cloneValue((Value)entry.getValue()));
- }
+ private String keyTypeName;
+ private String valueTypeName;
+ private List<MapEntry> entries;
+
+ public MapMetadataImpl() {
+ }
+
+ public MapMetadataImpl(String keyTypeName, String valueTypeName, List<MapEntry> entries) {
+ this.keyTypeName = keyTypeName;
+ this.valueTypeName = valueTypeName;
+ this.entries = entries;
+ }
+
+ public MapMetadataImpl(MapMetadata source) {
+ this.valueTypeName = source.getValueTypeName();
+ this.keyTypeName = source.getKeyTypeName();
+ for (MapEntry entry : source.getEntries()) {
+ addEntry(new MapEntryImpl(entry));
}
- valueType = source.getValueType();
- keyType = source.getKeyType();
}
-
- public String getKeyType() {
- return keyType;
+
+ public String getKeyTypeName() {
+ return this.keyTypeName;
}
- public void setKeyType(String keyType) {
- this.keyType = keyType;
+ public void setKeyTypeName(String keyTypeName) {
+ this.keyTypeName = keyTypeName;
}
- public String getValueType() {
- return valueType;
+ public String getValueTypeName() {
+ return this.valueTypeName;
}
- public void setValueType(String valueType) {
- this.valueType = valueType;
+ public void setValueTypeName(String valueTypeName) {
+ this.valueTypeName = valueTypeName;
}
- public Map<Value, Value> getMap() {
- return map;
+ public List<MapEntry> getEntries() {
+ if (this.entries == null) {
+ return Collections.emptyList();
+ } else {
+ return Collections.unmodifiableList(this.entries);
+ }
}
- public void setMap(Map<Value, Value> map) {
- this.map = map;
+ public void setEntries(List<MapEntry> entries) {
+ this.entries = entries;
+ }
+
+ public void addEntry(MapEntry entry) {
+ if (this.entries == null) {
+ this.entries = new ArrayList<MapEntry>();
+ }
+ this.entries.add(entry);
}
}
Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/MetadataUtil.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/MetadataUtil.java?rev=767576&r1=767575&r2=767576&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/MetadataUtil.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/MetadataUtil.java Wed Apr 22 15:57:35 2009
@@ -17,22 +17,19 @@
package org.apache.geronimo.blueprint.reflect;
-import org.osgi.service.blueprint.reflect.ArrayValue;
-import org.osgi.service.blueprint.reflect.CollectionBasedServiceReferenceComponentMetadata;
+import org.osgi.service.blueprint.reflect.BeanMetadata;
import org.osgi.service.blueprint.reflect.ComponentMetadata;
-import org.osgi.service.blueprint.reflect.ComponentValue;
-import org.osgi.service.blueprint.reflect.ListValue;
-import org.osgi.service.blueprint.reflect.LocalComponentMetadata;
-import org.osgi.service.blueprint.reflect.MapValue;
-import org.osgi.service.blueprint.reflect.NullValue;
-import org.osgi.service.blueprint.reflect.PropertiesValue;
-import org.osgi.service.blueprint.reflect.ReferenceNameValue;
-import org.osgi.service.blueprint.reflect.ReferenceValue;
-import org.osgi.service.blueprint.reflect.ServiceExportComponentMetadata;
-import org.osgi.service.blueprint.reflect.SetValue;
-import org.osgi.service.blueprint.reflect.TypedStringValue;
-import org.osgi.service.blueprint.reflect.UnaryServiceReferenceComponentMetadata;
-import org.osgi.service.blueprint.reflect.Value;
+import org.osgi.service.blueprint.reflect.IdRefMetadata;
+import org.osgi.service.blueprint.reflect.MapMetadata;
+import org.osgi.service.blueprint.reflect.Metadata;
+import org.osgi.service.blueprint.reflect.NullMetadata;
+import org.osgi.service.blueprint.reflect.PropsMetadata;
+import org.osgi.service.blueprint.reflect.RefCollectionMetadata;
+import org.osgi.service.blueprint.reflect.RefMetadata;
+import org.osgi.service.blueprint.reflect.ReferenceMetadata;
+import org.osgi.service.blueprint.reflect.ServiceMetadata;
+import org.osgi.service.blueprint.reflect.Target;
+import org.osgi.service.blueprint.reflect.ValueMetadata;
/**
@@ -40,46 +37,43 @@
* bits of metadata into concrete class implementations.
*/
public class MetadataUtil {
-
- static public Value cloneValue(Value source) {
+
+ static public Metadata cloneMetadata(Metadata source) {
if (source == null) {
return null;
}
- else if (source instanceof ArrayValue) {
- return new ArrayValueImpl((ArrayValue)source);
- }
- else if (source instanceof ComponentValue) {
- return new ComponentValueImpl((ComponentValue)source);
+ else if (source instanceof MapMetadata) {
+ return new MapMetadataImpl((MapMetadata)source);
}
- else if (source instanceof ListValue) {
- return new ListValueImpl((ListValue)source);
+ else if (source instanceof NullMetadata) {
+ return NullMetadata.NULL;
}
- else if (source instanceof SetValue) {
- return new SetValueImpl((SetValue)source);
+ else if (source instanceof PropsMetadata) {
+ return new PropsMetadataImpl((PropsMetadata)source);
}
- else if (source instanceof MapValue) {
- return new MapValueImpl((MapValue)source);
+ else if (source instanceof RefMetadata) {
+ return new RefMetadataImpl((RefMetadata)source);
}
- else if (source instanceof NullValue) {
- return NullValue.NULL;
+ else if (source instanceof IdRefMetadata) {
+ return new IdRefMetadataImpl((IdRefMetadata)source);
}
- else if (source instanceof PropertiesValue) {
- return new PropertiesValueImpl((PropertiesValue)source);
+ else if (source instanceof ValueMetadata) {
+ return new ValueMetadataImpl((ValueMetadata)source);
}
- else if (source instanceof PropertiesValue) {
- return new PropertiesValueImpl((PropertiesValue)source);
+ else if (source instanceof BeanMetadata) {
+ return new BeanMetadataImpl((BeanMetadata)source);
}
- else if (source instanceof ReferenceNameValue) {
- return new ReferenceNameValueImpl((ReferenceNameValue)source);
+ else if (source instanceof RefCollectionMetadata) {
+ return new RefCollectionMetadataImpl((RefCollectionMetadata)source);
}
- else if (source instanceof ReferenceValue) {
- return new ReferenceValueImpl((ReferenceValue)source);
+ else if (source instanceof ServiceMetadata) {
+ return new ServiceMetadataImpl((ServiceMetadata)source);
}
- else if (source instanceof TypedStringValue) {
- return new TypedStringValueImpl((TypedStringValue)source);
+ else if (source instanceof ReferenceMetadata) {
+ return new ReferenceMetadataImpl((ReferenceMetadata)source);
}
- throw new RuntimeException("Unknown Value type received: " + source.getClass().getName());
+ throw new RuntimeException("Unknown Metadata type received: " + source.getClass().getName());
}
@@ -92,28 +86,19 @@
* @return A mutable instance of this metadata item.
*/
static public ComponentMetadata cloneComponentMetadata(ComponentMetadata source) {
- if (source == null) {
- return null;
- } else if (source instanceof LocalComponentMetadata) {
- return new LocalComponentMetadataImpl((LocalComponentMetadata)source);
- }
- else if (source instanceof CollectionBasedServiceReferenceComponentMetadata) {
- return new CollectionBasedServiceReferenceComponentMetadataImpl((CollectionBasedServiceReferenceComponentMetadata)source);
- }
- else if (source instanceof CollectionBasedServiceReferenceComponentMetadata) {
- return new CollectionBasedServiceReferenceComponentMetadataImpl((CollectionBasedServiceReferenceComponentMetadata)source);
- }
- else if (source instanceof ServiceExportComponentMetadata) {
- return new ServiceExportComponentMetadataImpl((ServiceExportComponentMetadata)source);
- }
- else if (source instanceof ServiceExportComponentMetadata) {
- return new ServiceExportComponentMetadataImpl((ServiceExportComponentMetadata)source);
- }
- else if (source instanceof UnaryServiceReferenceComponentMetadata) {
- return new UnaryServiceReferenceComponentMetadataImpl((UnaryServiceReferenceComponentMetadata)source);
- }
+ return (ComponentMetadata) cloneMetadata(source);
+ }
- throw new RuntimeException("Unknown ComponentMetadata type received: " + source.getClass().getName());
+ /**
+ * Clone a target item, returning a mutable
+ * instance.
+ *
+ * @param source The source target item.
+ *
+ * @return A mutable instance of this target item.
+ */
+ static public Target cloneTarget(Target source) {
+ return (Target) cloneMetadata(source);
}
}
Copied: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/PropsMetadataImpl.java (from r767394, geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/PropertiesValueImpl.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/PropsMetadataImpl.java?p2=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/PropsMetadataImpl.java&p1=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/PropertiesValueImpl.java&r1=767394&r2=767576&rev=767576&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/PropertiesValueImpl.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/PropsMetadataImpl.java Wed Apr 22 15:57:35 2009
@@ -19,8 +19,13 @@
package org.apache.geronimo.blueprint.reflect;
import java.util.Properties;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.Collections;
-import org.osgi.service.blueprint.reflect.PropertiesValue;
+import org.osgi.service.blueprint.reflect.PropsMetadata;
+import org.osgi.service.blueprint.reflect.MapEntry;
/**
* TODO: javadoc
@@ -28,28 +33,40 @@
* @author <a href="mailto:dev@geronimo.apache.org">Apache Geronimo Project</a>
* @version $Rev: 760378 $, $Date: 2009-03-31 11:31:38 +0200 (Tue, 31 Mar 2009) $
*/
-public class PropertiesValueImpl implements PropertiesValue {
+public class PropsMetadataImpl implements PropsMetadata {
- private Properties propertiesValue;
+ private List<MapEntry> entries;
- public PropertiesValueImpl() {
+ public PropsMetadataImpl() {
}
- public PropertiesValueImpl(Properties propertiesValue) {
- this.propertiesValue = propertiesValue;
+ public PropsMetadataImpl(List<MapEntry> entries) {
+ this.entries = entries;
}
- public PropertiesValueImpl(PropertiesValue source) {
- if (source.getPropertiesValue() != null) {
- propertiesValue = new Properties(source.getPropertiesValue());
+ public PropsMetadataImpl(PropsMetadata source) {
+ for (MapEntry entry : source.getEntries()) {
+ addEntry(new MapEntryImpl(entry));
}
}
-
- public Properties getPropertiesValue() {
- return propertiesValue;
+
+ public List<MapEntry> getEntries() {
+ if (this.entries == null) {
+ return Collections.emptyList();
+ } else {
+ return Collections.unmodifiableList(this.entries);
+ }
+ }
+
+ public void setEntries(List<MapEntry> entries) {
+ this.entries = entries;
}
- public void setPropertiesValue(Properties propertiesValue) {
- this.propertiesValue = propertiesValue;
+ public void addEntry(MapEntry entry) {
+ if (this.entries == null) {
+ this.entries = new ArrayList<MapEntry>();
+ }
+ this.entries.add(entry);
}
+
}
Copied: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RefCollectionMetadataImpl.java (from r767394, geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/CollectionBasedServiceReferenceComponentMetadataImpl.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RefCollectionMetadataImpl.java?p2=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RefCollectionMetadataImpl.java&p1=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/CollectionBasedServiceReferenceComponentMetadataImpl.java&r1=767394&r2=767576&rev=767576&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/CollectionBasedServiceReferenceComponentMetadataImpl.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RefCollectionMetadataImpl.java Wed Apr 22 15:57:35 2009
@@ -18,8 +18,8 @@
*/
package org.apache.geronimo.blueprint.reflect;
-import org.osgi.service.blueprint.reflect.CollectionBasedServiceReferenceComponentMetadata;
-import org.osgi.service.blueprint.reflect.Value;
+import org.osgi.service.blueprint.reflect.RefCollectionMetadata;
+import org.osgi.service.blueprint.reflect.Target;
/**
* TODO: javadoc
@@ -27,24 +27,24 @@
* @author <a href="mailto:dev@geronimo.apache.org">Apache Geronimo Project</a>
* @version $Rev: 760378 $, $Date: 2009-03-31 11:31:38 +0200 (Tue, 31 Mar 2009) $
*/
-public class CollectionBasedServiceReferenceComponentMetadataImpl extends ServiceReferenceComponentMetadataImpl implements CollectionBasedServiceReferenceComponentMetadata {
+public class RefCollectionMetadataImpl extends ServiceReferenceMetadataImpl implements RefCollectionMetadata {
private Class collectionType;
- private Value comparator;
- private int orderingComparisonBasis;
+ private Target comparator;
+ private int orderingBasis;
private int memberType;
- public CollectionBasedServiceReferenceComponentMetadataImpl() {
+ public RefCollectionMetadataImpl() {
}
- public CollectionBasedServiceReferenceComponentMetadataImpl(CollectionBasedServiceReferenceComponentMetadata source) {
+ public RefCollectionMetadataImpl(RefCollectionMetadata source) {
super(source);
- comparator = MetadataUtil.cloneValue(source.getComparator());
collectionType = source.getCollectionType();
- orderingComparisonBasis = source.getOrderingComparisonBasis();
+ comparator = MetadataUtil.cloneTarget(source.getComparator());
+ orderingBasis = source.getOrderingBasis();
memberType = source.getMemberType();
}
-
+
public Class getCollectionType() {
return collectionType;
}
@@ -53,20 +53,20 @@
this.collectionType = collectionType;
}
- public Value getComparator() {
+ public Target getComparator() {
return comparator;
}
- public void setComparator(Value comparator) {
+ public void setComparator(Target comparator) {
this.comparator = comparator;
}
- public int getOrderingComparisonBasis() {
- return orderingComparisonBasis;
+ public int getOrderingBasis() {
+ return orderingBasis;
}
- public void setOrderingComparisonBasis(int orderingComparisonBasis) {
- this.orderingComparisonBasis = orderingComparisonBasis;
+ public void setOrderingBasis(int orderingComparisonBasis) {
+ this.orderingBasis = orderingComparisonBasis;
}
public int getMemberType() {
Copied: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RefMetadataImpl.java (from r767394, geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ReferenceValueImpl.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RefMetadataImpl.java?p2=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RefMetadataImpl.java&p1=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ReferenceValueImpl.java&r1=767394&r2=767576&rev=767576&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ReferenceValueImpl.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RefMetadataImpl.java Wed Apr 22 15:57:35 2009
@@ -18,7 +18,7 @@
*/
package org.apache.geronimo.blueprint.reflect;
-import org.osgi.service.blueprint.reflect.ReferenceValue;
+import org.osgi.service.blueprint.reflect.RefMetadata;
/**
* TODO: javadoc
@@ -26,27 +26,17 @@
* @author <a href="mailto:dev@geronimo.apache.org">Apache Geronimo Project</a>
* @version $Rev: 760378 $, $Date: 2009-03-31 11:31:38 +0200 (Tue, 31 Mar 2009) $
*/
-public class ReferenceValueImpl implements ReferenceValue {
+public class RefMetadataImpl extends IdRefMetadataImpl implements RefMetadata {
- private String componentName;
-
- public ReferenceValueImpl() {
- }
-
- public ReferenceValueImpl(String componentName) {
- this.componentName = componentName;
+ public RefMetadataImpl() {
}
- public ReferenceValueImpl(ReferenceValue source) {
- componentName = source.getComponentName();
- }
-
- public String getComponentName() {
- return componentName;
+ public RefMetadataImpl(String componentId) {
+ super(componentId);
}
- public void setComponentName(String componentName) {
- this.componentName = componentName;
+ public RefMetadataImpl(RefMetadata source) {
+ super(source);
}
}
Copied: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ReferenceMetadataImpl.java (from r767394, geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/UnaryServiceReferenceComponentMetadataImpl.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ReferenceMetadataImpl.java?p2=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ReferenceMetadataImpl.java&p1=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/UnaryServiceReferenceComponentMetadataImpl.java&r1=767394&r2=767576&rev=767576&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/UnaryServiceReferenceComponentMetadataImpl.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ReferenceMetadataImpl.java Wed Apr 22 15:57:35 2009
@@ -18,7 +18,7 @@
*/
package org.apache.geronimo.blueprint.reflect;
-import org.osgi.service.blueprint.reflect.UnaryServiceReferenceComponentMetadata;
+import org.osgi.service.blueprint.reflect.ReferenceMetadata;
/**
* TODO: javadoc
@@ -26,18 +26,18 @@
* @author <a href="mailto:dev@geronimo.apache.org">Apache Geronimo Project</a>
* @version $Rev: 760378 $, $Date: 2009-03-31 11:31:38 +0200 (Tue, 31 Mar 2009) $
*/
-public class UnaryServiceReferenceComponentMetadataImpl extends ServiceReferenceComponentMetadataImpl implements UnaryServiceReferenceComponentMetadata {
+public class ReferenceMetadataImpl extends ServiceReferenceMetadataImpl implements ReferenceMetadata {
private long timeout;
- public UnaryServiceReferenceComponentMetadataImpl() {
+ public ReferenceMetadataImpl() {
}
- public UnaryServiceReferenceComponentMetadataImpl(UnaryServiceReferenceComponentMetadata source) {
+ public ReferenceMetadataImpl(ReferenceMetadata source) {
super(source);
timeout = source.getTimeout();
}
-
+
public long getTimeout() {
return timeout;
}
Copied: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RegistrationListenerImpl.java (from r767394, geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RegistrationListenerMetadataImpl.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RegistrationListenerImpl.java?p2=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RegistrationListenerImpl.java&p1=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RegistrationListenerMetadataImpl.java&r1=767394&r2=767576&rev=767576&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RegistrationListenerMetadataImpl.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/RegistrationListenerImpl.java Wed Apr 22 15:57:35 2009
@@ -18,8 +18,8 @@
*/
package org.apache.geronimo.blueprint.reflect;
-import org.osgi.service.blueprint.reflect.RegistrationListenerMetadata;
-import org.osgi.service.blueprint.reflect.Value;
+import org.osgi.service.blueprint.reflect.RegistrationListener;
+import org.osgi.service.blueprint.reflect.Target;
/**
* TODO: javadoc
@@ -27,32 +27,32 @@
* @author <a href="mailto:dev@geronimo.apache.org">Apache Geronimo Project</a>
* @version $Rev: 760378 $, $Date: 2009-03-31 11:31:38 +0200 (Tue, 31 Mar 2009) $
*/
-public class RegistrationListenerMetadataImpl implements RegistrationListenerMetadata {
+public class RegistrationListenerImpl implements RegistrationListener {
- private Value listenerComponent;
+ private Target listenerComponent;
private String registrationMethodName;
private String unregistrationMethodName;
- public RegistrationListenerMetadataImpl() {
+ public RegistrationListenerImpl() {
}
- public RegistrationListenerMetadataImpl(Value listenerComponent, String registrationMethodName, String unregistrationMethodName) {
+ public RegistrationListenerImpl(Target listenerComponent, String registrationMethodName, String unregistrationMethodName) {
this.listenerComponent = listenerComponent;
this.registrationMethodName = registrationMethodName;
this.unregistrationMethodName = unregistrationMethodName;
}
- public RegistrationListenerMetadataImpl(RegistrationListenerMetadata source) {
- listenerComponent = MetadataUtil.cloneValue(source.getListenerComponent());
+ public RegistrationListenerImpl(RegistrationListener source) {
+ listenerComponent = MetadataUtil.cloneTarget(source.getListenerComponent());
registrationMethodName = source.getRegistrationMethodName();
unregistrationMethodName = source.getUnregistrationMethodName();
}
-
- public Value getListenerComponent() {
+
+ public Target getListenerComponent() {
return listenerComponent;
}
- public void setListenerComponent(Value listenerComponent) {
+ public void setListenerComponent(Target listenerComponent) {
this.listenerComponent = listenerComponent;
}
Copied: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ServiceMetadataImpl.java (from r767394, geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ServiceExportComponentMetadataImpl.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ServiceMetadataImpl.java?p2=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ServiceMetadataImpl.java&p1=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ServiceExportComponentMetadataImpl.java&r1=767394&r2=767576&rev=767576&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ServiceExportComponentMetadataImpl.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ServiceMetadataImpl.java Wed Apr 22 15:57:35 2009
@@ -21,16 +21,15 @@
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.Iterator;
-import java.util.Map;
import java.util.Set;
import java.util.ArrayList;
+import java.util.List;
-import org.osgi.service.blueprint.reflect.RegistrationListenerMetadata;
-import org.osgi.service.blueprint.reflect.ServiceExportComponentMetadata;
-import org.osgi.service.blueprint.reflect.Value;
-import org.osgi.service.blueprint.reflect.MapValue;
+import org.osgi.service.blueprint.reflect.RegistrationListener;
+import org.osgi.service.blueprint.reflect.ServiceMetadata;
+import org.osgi.service.blueprint.reflect.MapEntry;
+import org.osgi.service.blueprint.reflect.Target;
/**
* TODO: javadoc
@@ -38,83 +37,88 @@
* @author <a href="mailto:dev@geronimo.apache.org">Apache Geronimo Project</a>
* @version $Rev: 760378 $, $Date: 2009-03-31 11:31:38 +0200 (Tue, 31 Mar 2009) $
*/
-public class ServiceExportComponentMetadataImpl extends ComponentMetadataImpl implements ServiceExportComponentMetadata {
+public class ServiceMetadataImpl extends ComponentMetadataImpl implements ServiceMetadata {
- private Value exportedComponent;
- private Set<String> interfaceNames;
+ private Target exportedComponent;
+ private List<String> interfaceNames;
private int autoExportMode;
- private Map serviceProperties;
- private MapValue servicePropertiesValue;
+ private List<MapEntry> serviceProperties;
private int ranking;
- private Collection<RegistrationListenerMetadata> registrationListeners;
+ private Collection<RegistrationListener> registrationListeners;
+ private List<String> explicitDependencies;
- public ServiceExportComponentMetadataImpl() {
+ public ServiceMetadataImpl() {
}
- public ServiceExportComponentMetadataImpl(ServiceExportComponentMetadata source) {
+ public ServiceMetadataImpl(ServiceMetadata source) {
super(source);
- if (source.getServiceProperties() != null) {
- serviceProperties = new HashMap(source.getServiceProperties());
+ this.exportedComponent = MetadataUtil.cloneTarget(source.getServiceComponent());
+ this.interfaceNames = new ArrayList<String>(source.getInterfaceNames());
+ this.autoExportMode = source.getAutoExportMode();
+ for (MapEntry serviceProperty : source.getServiceProperties()) {
+ addServiceProperty(new MapEntryImpl(serviceProperty));
}
- exportedComponent = MetadataUtil.cloneValue(source.getExportedComponent());
- ranking = source.getRanking();
- if (source.getInterfaceNames() != null) {
- interfaceNames = new HashSet<String>(source.getInterfaceNames());
- }
- if (source.getRegistrationListeners() != null) {
- Iterator i = source.getRegistrationListeners().iterator();
- registrationListeners = new ArrayList<RegistrationListenerMetadata>();
- while (i.hasNext()) {
- registrationListeners.add(new RegistrationListenerMetadataImpl((RegistrationListenerMetadata)i.next()));
- }
+ this.ranking = source.getRanking();
+ for (RegistrationListener listener : source.getRegistrationListeners()) {
+ addRegistrationListener(new RegistrationListenerImpl(listener));
}
- autoExportMode = source.getAutoExportMode();
+ this.explicitDependencies = new ArrayList<String>(source.getExplicitDependencies());
}
-
- public Value getExportedComponent() {
+
+ public Target getServiceComponent() {
return exportedComponent;
}
- public void setExportedComponent(Value exportedComponent) {
+ public void setExportedComponent(Target exportedComponent) {
this.exportedComponent = exportedComponent;
}
- public Set<String> getInterfaceNames() {
- if (interfaceNames == null) {
- return Collections.emptySet();
+ public List<String> getInterfaceNames() {
+ if (this.interfaceNames == null) {
+ return Collections.emptyList();
} else {
- return Collections.unmodifiableSet(interfaceNames);
+ return Collections.unmodifiableList(this.interfaceNames);
}
}
- public void setInterfaceNames(Set<String> interfaceNames) {
+ public void setInterfaceNames(List<String> interfaceNames) {
this.interfaceNames = interfaceNames;
}
+ public void addInterfaceName(String interfaceName) {
+ if (this.interfaceNames == null) {
+ this.interfaceNames = new ArrayList<String>();
+ }
+ this.interfaceNames.add(interfaceName);
+ }
+
public int getAutoExportMode() {
- return autoExportMode;
+ return this.autoExportMode;
}
public void setAutoExportMode(int autoExportMode) {
this.autoExportMode = autoExportMode;
}
- public Map getServiceProperties() {
- return serviceProperties;
+ public List<MapEntry> getServiceProperties() {
+ if (this.serviceProperties == null) {
+ return Collections.emptyList();
+ } else {
+ return Collections.unmodifiableList(this.serviceProperties);
+ }
}
- public void setServiceProperties(Map serviceProperties) {
+ public void setServiceProperties(List<MapEntry> serviceProperties) {
this.serviceProperties = serviceProperties;
}
-
- public MapValue getServicePropertiesValue() {
- return servicePropertiesValue;
+
+ public void addServiceProperty(MapEntry serviceProperty) {
+ if (this.serviceProperties == null) {
+ this.serviceProperties = new ArrayList<MapEntry>();
+ }
+ this.serviceProperties.add(serviceProperty);
}
- public void setServicePropertiesValue(MapValue servicePropertiesValue) {
- this.servicePropertiesValue = servicePropertiesValue;
- }
-
public int getRanking() {
return ranking;
}
@@ -123,22 +127,38 @@
this.ranking = ranking;
}
- public Collection<RegistrationListenerMetadata> getRegistrationListeners() {
- if (registrationListeners == null) {
+ public Collection<RegistrationListener> getRegistrationListeners() {
+ if (this.registrationListeners == null) {
return Collections.emptySet();
} else {
- return Collections.unmodifiableCollection(registrationListeners);
+ return Collections.unmodifiableCollection(this.registrationListeners);
}
}
- public void setRegistrationListeners(Collection<RegistrationListenerMetadata> registrationListeners) {
+ public void setRegistrationListeners(Collection<RegistrationListener> registrationListeners) {
this.registrationListeners = registrationListeners;
}
- public void addRegistrationListener(RegistrationListenerMetadata registrationListenerMetadata) {
+ public void addRegistrationListener(RegistrationListener registrationListenerMetadata) {
if (this.registrationListeners == null) {
- this.registrationListeners = new ArrayList<RegistrationListenerMetadata>();
+ this.registrationListeners = new ArrayList<RegistrationListener>();
}
this.registrationListeners.add(registrationListenerMetadata);
}
+
+ public List<String> getExplicitDependencies() {
+ return this.explicitDependencies;
+ }
+
+ public void setExplicitDependencies(List<String> explicitDependencies) {
+ this.explicitDependencies = explicitDependencies;
+ }
+
+ public void addExplicitDependency(String explicitDependency) {
+ if (this.explicitDependencies == null) {
+ this.explicitDependencies = new ArrayList<String>();
+ }
+ this.explicitDependencies.add(explicitDependency);
+ }
+
}
Copied: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ServiceReferenceMetadataImpl.java (from r767394, geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ServiceReferenceComponentMetadataImpl.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ServiceReferenceMetadataImpl.java?p2=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ServiceReferenceMetadataImpl.java&p1=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ServiceReferenceComponentMetadataImpl.java&r1=767394&r2=767576&rev=767576&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ServiceReferenceComponentMetadataImpl.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ServiceReferenceMetadataImpl.java Wed Apr 22 15:57:35 2009
@@ -20,13 +20,11 @@
import java.util.Collection;
import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
+import java.util.List;
import java.util.ArrayList;
-import org.osgi.service.blueprint.reflect.BindingListenerMetadata;
-import org.osgi.service.blueprint.reflect.ServiceReferenceComponentMetadata;
+import org.osgi.service.blueprint.reflect.Listener;
+import org.osgi.service.blueprint.reflect.ServiceReferenceMetadata;
/**
* TODO: javadoc
@@ -34,51 +32,51 @@
* @author <a href="mailto:dev@geronimo.apache.org">Apache Geronimo Project</a>
* @version $Rev: 760378 $, $Date: 2009-03-31 11:31:38 +0200 (Tue, 31 Mar 2009) $
*/
-public class ServiceReferenceComponentMetadataImpl extends ComponentMetadataImpl implements ServiceReferenceComponentMetadata {
+public class ServiceReferenceMetadataImpl extends ComponentMetadataImpl implements ServiceReferenceMetadata {
- private int serviceAvailabilitySpecification;
- private Set<String> interfaceNames;
+ private int availability;
+ private List<String> interfaceNames;
private String componentName;
private String filter;
- private Collection<BindingListenerMetadata> bindingListeners;
+ private Collection<Listener> serviceListeners;
- public ServiceReferenceComponentMetadataImpl() {
- bindingListeners = new ArrayList<BindingListenerMetadata>();
+ public ServiceReferenceMetadataImpl() {
}
- public ServiceReferenceComponentMetadataImpl(ServiceReferenceComponentMetadata source) {
+ public ServiceReferenceMetadataImpl(ServiceReferenceMetadata source) {
super(source);
- if (source.getBindingListeners() != null) {
- bindingListeners = new ArrayList<BindingListenerMetadata>();
- Iterator i = source.getBindingListeners().iterator();
- while (i.hasNext()) {
- bindingListeners.add(new BindingListenerMetadataImpl((BindingListenerMetadata)i.next()));
- }
+ this.availability = source.getAvailability();
+ this.interfaceNames = new ArrayList<String>(source.getInterfaceNames());
+ this.componentName = source.getComponentName();
+ this.filter = source.getFilter();
+ for (Listener listener : source.getServiceListeners()) {
+ addServiceListener(new ListenerImpl(listener));
}
- if (source.getInterfaceNames() != null) {
- interfaceNames = new HashSet<String>(source.getInterfaceNames());
- }
- serviceAvailabilitySpecification = source.getServiceAvailabilitySpecification();
- filter = source.getFilter();
- componentName = source.getComponentName();
}
-
- public int getServiceAvailabilitySpecification() {
- return serviceAvailabilitySpecification;
+
+ public int getAvailability() {
+ return availability;
}
- public void setServiceAvailabilitySpecification(int serviceAvailabilitySpecification) {
- this.serviceAvailabilitySpecification = serviceAvailabilitySpecification;
+ public void setAvailability(int availability) {
+ this.availability = availability;
}
- public Set<String> getInterfaceNames() {
+ public List<String> getInterfaceNames() {
return interfaceNames;
}
- public void setInterfaceNames(Set<String> interfaceNames) {
+ public void setInterfaceNames(List<String> interfaceNames) {
this.interfaceNames = interfaceNames;
}
+ public void addInterfaceName(String interfaceName) {
+ if (this.interfaceNames == null) {
+ this.interfaceNames = new ArrayList<String>();
+ }
+ this.interfaceNames.add(interfaceName);
+ }
+
public String getComponentName() {
return componentName;
}
@@ -95,15 +93,22 @@
this.filter = filter;
}
- public Collection<BindingListenerMetadata> getBindingListeners() {
- if (bindingListeners == null) {
+ public Collection<Listener> getServiceListeners() {
+ if (this.serviceListeners == null) {
return Collections.emptyList();
} else {
- return Collections.unmodifiableCollection(bindingListeners);
+ return Collections.unmodifiableCollection(this.serviceListeners);
}
}
- public void addBindingListener(BindingListenerMetadata bindingListenerMetadata) {
- bindingListeners.add(bindingListenerMetadata);
+ public void setServiceListeners(Collection<Listener> listeners) {
+ this.serviceListeners = listeners;
+ }
+
+ public void addServiceListener(Listener bindingListenerMetadata) {
+ if (this.serviceListeners == null) {
+ this.serviceListeners = new ArrayList<Listener>();
+ }
+ this.serviceListeners.add(bindingListenerMetadata);
}
}
Copied: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ValueMetadataImpl.java (from r767394, geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/TypedStringValueImpl.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ValueMetadataImpl.java?p2=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ValueMetadataImpl.java&p1=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/TypedStringValueImpl.java&r1=767394&r2=767576&rev=767576&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/TypedStringValueImpl.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/ValueMetadataImpl.java Wed Apr 22 15:57:35 2009
@@ -18,7 +18,7 @@
*/
package org.apache.geronimo.blueprint.reflect;
-import org.osgi.service.blueprint.reflect.TypedStringValue;
+import org.osgi.service.blueprint.reflect.ValueMetadata;
/**
* TODO: javadoc
@@ -26,24 +26,24 @@
* @author <a href="mailto:dev@geronimo.apache.org">Apache Geronimo Project</a>
* @version $Rev: 760378 $, $Date: 2009-03-31 11:31:38 +0200 (Tue, 31 Mar 2009) $
*/
-public class TypedStringValueImpl implements TypedStringValue {
+public class ValueMetadataImpl implements ValueMetadata {
private String stringValue;
private String typeName;
- public TypedStringValueImpl() {
+ public ValueMetadataImpl() {
}
- public TypedStringValueImpl(String stringValue) {
+ public ValueMetadataImpl(String stringValue) {
this.stringValue = stringValue;
}
- public TypedStringValueImpl(String stringValue, String typeName) {
+ public ValueMetadataImpl(String stringValue, String typeName) {
this.stringValue = stringValue;
this.typeName = typeName;
}
- public TypedStringValueImpl(TypedStringValue source) {
+ public ValueMetadataImpl(ValueMetadata source) {
this.stringValue = source.getStringValue();
this.typeName = source.getTypeName();
}
Copied: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/utils/BundleDelegatingClassLoader.java (from r767394, geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/BundleDelegatingClassLoader.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/utils/BundleDelegatingClassLoader.java?p2=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/utils/BundleDelegatingClassLoader.java&p1=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/BundleDelegatingClassLoader.java&r1=767394&r2=767576&rev=767576&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/BundleDelegatingClassLoader.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/utils/BundleDelegatingClassLoader.java Wed Apr 22 15:57:35 2009
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.geronimo.blueprint.context;
+package org.apache.geronimo.blueprint.utils;
import java.net.URL;
import java.util.Enumeration;