Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright (c) OSGi Alliance (2012). 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.namespace;
 
Host Capability and Requirement Namespace.

This class defines the names for the attributes and directives for this namespace. All unspecified capability attributes are of type String and are used as arbitrary matching attributes for the capability. The values associated with the specified directive and attribute keys are of type String, unless otherwise indicated.

Unless otherwise noted, all directives specified on the Bundle-SymbolicName header are visible in the capability and all directives specified on the Fragment-Host header are visible in the requirement.

  • The uses directive must be ignored. A uses directive specified on the Bundle-SymbolicName header must be ignored. A uses directive must not be present in the capability.
  • The effective directives must be ignored. This namespace is only effective at resolve time. An effective directive specified on the Bundle-SymbolicName or Fragment-Host headers must be ignored. An effective directive must not be present in a capability or requirement.
  • The cardinality directive has limited applicability to this namespace. A cardinality directive specified on the Fragment-Host header must be ignored. All requirements must have the cardinality directive set to multiple.

A non-fragment resource with the with the osgi.bundle type identity provides zero or one host capabilities. A fragment resource with the osgi.fragment type identity must not declare a host capability and must declare exactly one host requirement.

† A resource with no bundle symbolic name must not provide a host capability.

Version:
$Id: aa3cc744c7b9c21d908260f456567ab8a6de1430 $
Immutable:
 
 public final class HostNamespace extends AbstractWiringNamespace {

Namespace name for host capabilities and requirements.

Also, the capability attribute used to specify the symbolic name of the host.

 
 	public static final String	HOST_NAMESPACE"osgi.wiring.host";

The capability directive identifying if the resource is a singleton. A String value of "true" indicates the resource is a singleton; any other value or null indicates the resource is not a singleton.

This directive should be examined using the identity namespace.

 
 	public static final String	CAPABILITY_SINGLETON_DIRECTIVE"singleton";

The capability directive identifying if and when a fragment may attach to a host bundle. The default value is always.

	public static final String	CAPABILITY_FRAGMENT_ATTACHMENT_DIRECTIVE"fragment-attachment";

The directive value indicating that fragments are allowed to attach to the host bundle at any time (while the host is resolved or during the process of resolving the host bundle).

	public static final String	FRAGMENT_ATTACHMENT_ALWAYS"always";

The directive value indicating that fragments are allowed to attach to the host bundle only during the process of resolving the host bundle.

	public static final String	FRAGMENT_ATTACHMENT_RESOLVETIME"resolve-time";

The directive value indicating that no fragments are allowed to attach to the host bundle at any time.

	public static final String	FRAGMENT_ATTACHMENT_NEVER"never";

The requirement directive used to specify the type of the extension fragment.

	public final static String	REQUIREMENT_EXTENSION_DIRECTIVE"extension";

The directive value indicating that the extension fragment is to be loaded by the framework's class loader.

	public final static String	EXTENSION_FRAMEWORK"framework";

The directive value indicating that the extension fragment is to be loaded by the boot class loader.

	public final static String	EXTENSION_BOOTCLASSPATH"bootclasspath";

The requirement directive used to specify the visibility type for a requirement.

This directive should be examined using the bundle namespace.

	public final static String	REQUIREMENT_VISIBILITY_DIRECTIVE"visibility";
	private HostNamespace() {
		// empty
	}
New to GrepCode? Check out our FAQ X