org.jboss.osgi.resolver.v2.spi
Class AbstractResource

java.lang.Object
  extended by org.jboss.osgi.resolver.v2.spi.AbstractResource
All Implemented Interfaces:
XAttachmentSupport, XElement, XResource, org.osgi.framework.resource.Resource
Direct Known Subclasses:
URLBasedResource

public class AbstractResource
extends Object
implements XResource

The abstract implementation of an XResource.

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

Constructor Summary
AbstractResource()
           
 
Method Summary
<T> T
addAttachment(Class<T> clazz, T value)
          Attach an arbirtary object with this element.
protected  void addCapability(org.osgi.framework.resource.Capability cap)
           
protected  void addRequirement(org.osgi.framework.resource.Requirement req)
           
<T> T
getAttachment(Class<T> clazz)
          Get the attached object for a given key
 List<org.osgi.framework.resource.Capability> getCapabilities(String namespace)
           
 InputStream getContent()
           
 XIdentityCapability getIdentityCapability()
           
 List<org.osgi.framework.resource.Requirement> getRequirements(String namespace)
           
 boolean isFragment()
           
<T> T
removeAttachment(Class<T> clazz)
          Remove an attached object for a given key
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.osgi.resolver.v2.XAttachmentSupport
addAttachment, getAttachment, removeAttachment
 

Constructor Detail

AbstractResource

public AbstractResource()
Method Detail

addCapability

protected void addCapability(org.osgi.framework.resource.Capability cap)

addRequirement

protected void addRequirement(org.osgi.framework.resource.Requirement req)

getCapabilities

public List<org.osgi.framework.resource.Capability> getCapabilities(String namespace)
Specified by:
getCapabilities in interface org.osgi.framework.resource.Resource

getRequirements

public List<org.osgi.framework.resource.Requirement> getRequirements(String namespace)
Specified by:
getRequirements in interface org.osgi.framework.resource.Resource

getIdentityCapability

public XIdentityCapability getIdentityCapability()
Specified by:
getIdentityCapability in interface XResource

isFragment

public boolean isFragment()
Specified by:
isFragment in interface XResource

getContent

public InputStream getContent()
Specified by:
getContent in interface XResource

toString

public String toString()
Overrides:
toString in class Object

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.