org.jboss.osgi.resolver.spi
Class AbstractEnvironment

java.lang.Object
  extended by org.jboss.osgi.resolver.spi.AbstractEnvironment
All Implemented Interfaces:
XAttachmentSupport, XElement, XEnvironment, org.osgi.service.resolver.Environment

public class AbstractEnvironment
extends Object
implements XEnvironment

The abstract implementation of a XEnvironment.

Since:
02-Jul-2010
Author:
thomas.diesler@jboss.com

Constructor Summary
AbstractEnvironment(XCapabilityComparator comp)
           
 
Method Summary
<T> T
adapt(Class<T> clazz)
           
<T> T
addAttachment(Class<T> clazz, T value)
          Attach an arbirtary object with this element.
 Map<org.osgi.framework.resource.Resource,org.osgi.framework.resource.Wiring> applyResolverResults(Map<org.osgi.framework.resource.Resource,List<org.osgi.framework.resource.Wire>> wiremap)
           
 Collection<org.osgi.framework.resource.Capability> findProviders(org.osgi.framework.resource.Requirement req)
           
<T> T
getAttachment(Class<T> clazz)
          Get the attached object for a given key
 Comparator<org.osgi.framework.resource.Capability> getComparator()
           
 long getResourceIndex(org.osgi.framework.resource.Resource resource)
           
 org.osgi.framework.resource.Wiring getWiring(org.osgi.framework.resource.Resource resource)
           
 Map<org.osgi.framework.resource.Resource,org.osgi.framework.resource.Wiring> getWirings()
           
 void installResources(org.osgi.framework.resource.Resource... resarr)
           
 boolean isEffective(org.osgi.framework.resource.Requirement req)
           
<T> T
removeAttachment(Class<T> clazz)
          Remove an attached object for a given key
 void uninstallResources(org.osgi.framework.resource.Resource... resarr)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.osgi.resolver.XElement
adapt
 
Methods inherited from interface org.jboss.osgi.resolver.XAttachmentSupport
addAttachment, getAttachment, removeAttachment
 

Constructor Detail

AbstractEnvironment

public AbstractEnvironment(XCapabilityComparator comp)
Method Detail

getComparator

public Comparator<org.osgi.framework.resource.Capability> getComparator()

installResources

public void installResources(org.osgi.framework.resource.Resource... resarr)

uninstallResources

public void uninstallResources(org.osgi.framework.resource.Resource... resarr)

getResourceIndex

public long getResourceIndex(org.osgi.framework.resource.Resource resource)

findProviders

public Collection<org.osgi.framework.resource.Capability> findProviders(org.osgi.framework.resource.Requirement req)
Specified by:
findProviders in interface org.osgi.service.resolver.Environment

applyResolverResults

public Map<org.osgi.framework.resource.Resource,org.osgi.framework.resource.Wiring> applyResolverResults(Map<org.osgi.framework.resource.Resource,List<org.osgi.framework.resource.Wire>> wiremap)
Specified by:
applyResolverResults in interface XEnvironment

isEffective

public boolean isEffective(org.osgi.framework.resource.Requirement req)
Specified by:
isEffective in interface org.osgi.service.resolver.Environment

getWiring

public org.osgi.framework.resource.Wiring getWiring(org.osgi.framework.resource.Resource resource)
Specified by:
getWiring in interface XEnvironment

getWirings

public Map<org.osgi.framework.resource.Resource,org.osgi.framework.resource.Wiring> getWirings()
Specified by:
getWirings in interface org.osgi.service.resolver.Environment

adapt

public <T> T adapt(Class<T> clazz)
Specified by:
adapt in interface XElement

addAttachment

public <T> T addAttachment(Class<T> clazz,
                           T value)
Description copied from interface: XAttachmentSupport
Attach an arbirtary object with this element.

Specified by:
addAttachment in interface XAttachmentSupport
Parameters:
clazz - key for the attachment
Returns:
The previously attachment object or null

getAttachment

public <T> T getAttachment(Class<T> clazz)
Description copied from interface: XAttachmentSupport
Get the attached object for a given key

Specified by:
getAttachment in interface XAttachmentSupport
Parameters:
clazz - key for the attachment
Returns:
The attached object or null

removeAttachment

public <T> T removeAttachment(Class<T> clazz)
Description copied from interface: XAttachmentSupport
Remove an attached object for a given key

Specified by:
removeAttachment in interface XAttachmentSupport
Parameters:
clazz - key for the attachment
Returns:
The attached object or null


Copyright © 2012. All Rights Reserved.