diff options
Diffstat (limited to 'bundles/org.eclipse.osgi.services/src/org/osgi/service/component/runtime/dto')
6 files changed, 123 insertions, 18 deletions
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/component/runtime/dto/ComponentConfigurationDTO.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/component/runtime/dto/ComponentConfigurationDTO.java index a3e98bbac..aabff50a2 100644..100755 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/component/runtime/dto/ComponentConfigurationDTO.java +++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/component/runtime/dto/ComponentConfigurationDTO.java @@ -1,5 +1,5 @@ /* - * Copyright (c) OSGi Alliance (2013, 2014). All Rights Reserved. + * Copyright (c) OSGi Alliance (2013, 2018). 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. @@ -17,7 +17,9 @@ package org.osgi.service.component.runtime.dto; import java.util.Map; + import org.osgi.dto.DTO; +import org.osgi.framework.dto.ServiceReferenceDTO; import org.osgi.service.component.ComponentContext; /** @@ -59,6 +61,23 @@ public class ComponentConfigurationDTO extends DTO { public static final int ACTIVE = 8; /** + * The component configuration failed to activate. + * <p> + * This means the component configuration is satisfied but that either: + * <ul> + * <li>an exception occurred loading the implementation class,</li> + * <li>the static initializer threw an exception,</li> + * <li>the constructor threw an exception, or</li> + * <li>the activate method threw an exception.</li> + * </ul> + * The failure information from the exception is available from + * {@link #failure}. + * + * @since 1.4 + */ + public static final int FAILED_ACTIVATION = 16; + + /** * The representation of the component configuration's component * description. */ @@ -66,10 +85,10 @@ public class ComponentConfigurationDTO extends DTO { /** * The current state of the component configuration. - * * <p> * This is one of {@link #UNSATISFIED_CONFIGURATION}, - * {@link #UNSATISFIED_REFERENCE}, {@link #SATISFIED} or {@link #ACTIVE}. + * {@link #UNSATISFIED_REFERENCE}, {@link #SATISFIED}, {@link #ACTIVE}, or + * {@link #FAILED_ACTIVATION}. */ public int state; @@ -110,4 +129,33 @@ public class ComponentConfigurationDTO extends DTO { * empty if the component configuration has no unsatisfied references. */ public UnsatisfiedReferenceDTO[] unsatisfiedReferences; + + /** + * The failure information if the component configuration state is + * {@link #FAILED_ACTIVATION}. + * <p> + * This is the failure exception converted to a String using: + * + * <pre> + * StringWriter sw = new StringWriter(); + * exception.printStackTrace(new PrintWriter(sw)); + * sw.toString(); + * </pre> + * + * This must be {@code null} if the component configuration state is not + * {@link #FAILED_ACTIVATION}. + * + * @since 1.4 + */ + public String failure; + + /** + * The registered service of the component configuration. + * <p> + * This must be non-{@code null} if the component configuration is + * registered as a service. Otherwise it must be {@code null}. + * + * @since 1.4 + */ + public ServiceReferenceDTO service; } diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/component/runtime/dto/ComponentDescriptionDTO.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/component/runtime/dto/ComponentDescriptionDTO.java index 9f098a6ed..78df935bf 100644..100755 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/component/runtime/dto/ComponentDescriptionDTO.java +++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/component/runtime/dto/ComponentDescriptionDTO.java @@ -1,5 +1,5 @@ /* - * Copyright (c) OSGi Alliance (2013, 2014). All Rights Reserved. + * Copyright (c) OSGi Alliance (2013, 2017). 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. @@ -17,6 +17,7 @@ package org.osgi.service.component.runtime.dto; import java.util.Map; + import org.osgi.dto.DTO; import org.osgi.framework.dto.BundleDTO; @@ -49,7 +50,7 @@ public class ComponentDescriptionDTO extends DTO { * <p> * This is declared in the {@code factory} attribute of the * {@code component} element. This must be {@code null} if the component - * description is not declared as a component factory. + * description is not declared as a factory component. */ public String factory; @@ -101,11 +102,11 @@ public class ComponentDescriptionDTO extends DTO { public String[] serviceInterfaces; /** - * The declared component properties. - * + * The component properties. * <p> - * These are declared in the {@code property} and {@code properties} - * elements. + * These are declared in the component description by the {@code property} + * and {@code properties} elements as well as the {@code target} attribute + * of the {@code reference} elements. */ public Map<String, Object> properties; @@ -168,4 +169,38 @@ public class ComponentDescriptionDTO extends DTO { * pid if the component description does not declare a configuration pid. */ public String[] configurationPid; + + /** + * The factory properties. + * <p> + * These are declared in the component description by the + * {@code factory-property} and {@code factory-properties} elements. This + * must be {@code null} if the component description is not declared as a + * {@link #factory factory component}. + * + * @since 1.4 + */ + public Map<String,Object> factoryProperties; + + /** + * The activation fields. + * <p> + * These are declared in the {@code activation-fields} attribute of the + * {@code component} element. The array must be empty if the component + * description does not declare any activation fields. + * + * @since 1.4 + */ + public String[] activationFields; + + /** + * The constructor parameter count. + * <p> + * This is declared in the {@code init} attribute of the {@code component} + * element. This must be {@code 0} if the component description does not + * declare an {@code init} attribute. + * + * @since 1.4 + */ + public int init; } diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/component/runtime/dto/ReferenceDTO.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/component/runtime/dto/ReferenceDTO.java index fca241327..c806c0a78 100644..100755 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/component/runtime/dto/ReferenceDTO.java +++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/component/runtime/dto/ReferenceDTO.java @@ -1,5 +1,5 @@ /* - * Copyright (c) OSGi Alliance (2013, 2015). All Rights Reserved. + * Copyright (c) OSGi Alliance (2013, 2017). 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. @@ -145,4 +145,27 @@ public class ReferenceDTO extends DTO { * not declare a scope for the reference. */ public String scope; + + /** + * The zero-based parameter number of the constructor parameter for the + * reference. + * <p> + * This is declared in the {@code parameter} attribute of the + * {@code reference} element. This must be {@code null} if the component + * description does not declare a parameter number for the reference. + * + * @since 1.4 + */ + public Integer parameter; + + /** + * The collection type for the reference. + * <p> + * This is declared in the {@code field-collection-type} attribute of the + * {@code reference} element. This must be {@code null} if the component + * description does not declare a collection type for the reference. + * + * @since 1.4 + */ + public String collectionType; } diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/component/runtime/dto/SatisfiedReferenceDTO.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/component/runtime/dto/SatisfiedReferenceDTO.java index 20de229ef..20de229ef 100644..100755 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/component/runtime/dto/SatisfiedReferenceDTO.java +++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/component/runtime/dto/SatisfiedReferenceDTO.java diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/component/runtime/dto/package-info.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/component/runtime/dto/package-info.java index d7d82da09..017778a97 100644 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/component/runtime/dto/package-info.java +++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/component/runtime/dto/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) OSGi Alliance (2014). All Rights Reserved. + * Copyright (c) OSGi Alliance (2014, 2016). 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. @@ -15,28 +15,28 @@ */ /** - * Service Component Runtime Data Transfer Objects Package Version 1.3. - * + * Service Component Runtime Data Transfer Objects Package Version 1.4. * <p> * Bundles wishing to use this package must list the package in the * Import-Package header of the bundle's manifest. This package has two types of * users: the consumers that use the API in this package and the providers that * implement the API in this package. - * * <p> * Example import for consumers using the API in this package: * <p> - * {@code Import-Package: org.osgi.service.component.runtime.dto; version="[1.3,2.0)"} + * {@code Import-Package: org.osgi.service.component.runtime.dto; version="[1.4,2.0)"} * <p> * Example import for providers implementing the API in this package: * <p> - * {@code Import-Package: org.osgi.service.component.runtime.dto; version="[1.3,1.4)"} + * {@code Import-Package: org.osgi.service.component.runtime.dto; version="[1.4,1.5)"} * * @author $Id$ */ -@Version("1.3") +@Version(COMPONENT_SPECIFICATION_VERSION) package org.osgi.service.component.runtime.dto; +import static org.osgi.service.component.ComponentConstants.COMPONENT_SPECIFICATION_VERSION; + import org.osgi.annotation.versioning.Version; diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/component/runtime/dto/packageinfo b/bundles/org.eclipse.osgi.services/src/org/osgi/service/component/runtime/dto/packageinfo deleted file mode 100644 index 0117a56c1..000000000 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/component/runtime/dto/packageinfo +++ /dev/null @@ -1 +0,0 @@ -version 1.3 |