org.jboss.osgi.resolver.spi
Class AbstractModule

java.lang.Object
  extended by org.jboss.osgi.resolver.spi.AbstractModule
All Implemented Interfaces:
XAttachmentSupport, XElement, XModule

public class AbstractModule
extends Object
implements XModule

The abstract implementation of an XModule. This is the resolver representation of a Bundle.

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

Method Summary
<T> T
addAttachment(Class<T> clazz, T value)
          Attach an arbirtary object with this element.
protected  void addWire(org.jboss.osgi.resolver.spi.AbstractWire wire)
           
 boolean equals(Object obj)
           
<T> T
getAttachment(Class<T> clazz)
          Get the attached object for a given key
 XBundleCapability getBundleCapability()
          Get this modules host capability
 List<String> getBundleClassPath()
          Get the bundle class paths
 List<XRequireBundleRequirement> getBundleRequirements()
          Get the bundle requirements
 List<XCapability> getCapabilities()
          Get all module capabilities
 List<XPackageRequirement> getDynamicPackageRequirements()
          Get the dynamic package requirements
 XFragmentHostRequirement getHostRequirement()
          Get the fragment host requirement if this module is a fragment
 String getModuleActivator()
          Get the optional module activator
 XModuleIdentity getModuleId()
          Get the module id
 String getName()
          Get the name for this capability.
 List<XPackageCapability> getPackageCapabilities()
          Get the package capabilities
 List<XPackageRequirement> getPackageRequirements()
          Get the non-dynamic package requirements
 List<XRequirement> getRequirements()
          Get all module requirements
 XResolver getResolver()
          Get the resolver that is controlling this module.
 Version getVersion()
          Get the module version
 List<XWire> getWires()
          Get the list of wires for this module
 int hashCode()
           
 boolean isFragment()
          True is this module represents a fragment
 boolean isResolved()
          True if this module is resolved
<T> T
removeAttachment(Class<T> clazz)
          Remove an attached object for a given key
 StringBuffer toLongString(StringBuffer buffer)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.osgi.resolver.XElement
getName
 

Method Detail

getResolver

public XResolver getResolver()
Description copied from interface: XModule
Get the resolver that is controlling this module.

Specified by:
getResolver in interface XModule
Returns:
The resolver or null if this module has not been added to a resolver

getModuleId

public XModuleIdentity getModuleId()
Description copied from interface: XModule
Get the module id

Specified by:
getModuleId in interface XModule

getVersion

public Version getVersion()
Description copied from interface: XModule
Get the module version

Specified by:
getVersion in interface XModule

getModuleActivator

public String getModuleActivator()
Description copied from interface: XModule
Get the optional module activator

Specified by:
getModuleActivator in interface XModule

isResolved

public boolean isResolved()
Description copied from interface: XModule
True if this module is resolved

Specified by:
isResolved in interface XModule

getCapabilities

public List<XCapability> getCapabilities()
Description copied from interface: XModule
Get all module capabilities

Specified by:
getCapabilities in interface XModule

getRequirements

public List<XRequirement> getRequirements()
Description copied from interface: XModule
Get all module requirements

Specified by:
getRequirements in interface XModule

getBundleRequirements

public List<XRequireBundleRequirement> getBundleRequirements()
Description copied from interface: XModule
Get the bundle requirements

Specified by:
getBundleRequirements in interface XModule

getBundleCapability

public XBundleCapability getBundleCapability()
Description copied from interface: XModule
Get this modules host capability

Specified by:
getBundleCapability in interface XModule

getPackageCapabilities

public List<XPackageCapability> getPackageCapabilities()
Description copied from interface: XModule
Get the package capabilities

Specified by:
getPackageCapabilities in interface XModule

getPackageRequirements

public List<XPackageRequirement> getPackageRequirements()
Description copied from interface: XModule
Get the non-dynamic package requirements

Specified by:
getPackageRequirements in interface XModule

getDynamicPackageRequirements

public List<XPackageRequirement> getDynamicPackageRequirements()
Description copied from interface: XModule
Get the dynamic package requirements

Specified by:
getDynamicPackageRequirements in interface XModule

getHostRequirement

public XFragmentHostRequirement getHostRequirement()
Description copied from interface: XModule
Get the fragment host requirement if this module is a fragment

Specified by:
getHostRequirement in interface XModule
Returns:
null if this module is not a fragment

isFragment

public boolean isFragment()
Description copied from interface: XModule
True is this module represents a fragment

Specified by:
isFragment in interface XModule

getBundleClassPath

public List<String> getBundleClassPath()
Description copied from interface: XModule
Get the bundle class paths

Specified by:
getBundleClassPath in interface XModule

getWires

public List<XWire> getWires()
Description copied from interface: XModule
Get the list of wires for this module

Specified by:
getWires in interface XModule
Returns:
The list of wires when the module is resolved, otherwise null.

addWire

protected void addWire(org.jboss.osgi.resolver.spi.AbstractWire wire)

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toLongString

public StringBuffer toLongString(StringBuffer buffer)

toString

public String toString()
Overrides:
toString in class Object

getName

public String getName()
Description copied from interface: XElement
Get the name for this capability.

Specified by:
getName in interface XElement


Copyright © 2010. All Rights Reserved.