cuba.wired
Class WiredComponentDesc

java.lang.Object
  extended by cuba.wired.AbstractDescriptor
      extended by cuba.wired.WiredComponentDesc

public class WiredComponentDesc
extends AbstractDescriptor

Description of a CUBA component type in a wired environment The implementation class member is usually not set, leaving the information in the adapters' hands. However, the member can be set in a special copy constructor which is of interest to introduce mock implementations for test purposes.

Author:
Jan Lessner

Field Summary
 
Fields inherited from class cuba.wired.AbstractDescriptor
globalName
 
Constructor Summary
WiredComponentDesc(java.lang.String globalName, java.lang.Class externalWiredAdapter, java.lang.Class internalWiredAdapter, java.lang.Class externalInterface, java.lang.Class internalInterface, ComponentRefMap componentRefs, ResourceRefMap resourceRefs, EnvironmentRefMap environmentRefs, boolean cmt, java.lang.String type)
           
WiredComponentDesc(WiredComponentDesc source, java.lang.Class implementation)
          Copy constructor, allowing to specify an alternative implementation class for the component.
 
Method Summary
 java.lang.String checkImplements(java.lang.Class interfaze, boolean internal, boolean exact)
          Checks wether the component, described by this descriptor provides the passed interface
 boolean getCmt()
           
 ComponentRefMap getComponentRefs()
           
 EnvironmentRefMap getEnvironmentRefs()
           
 java.lang.Class getExternalInterface()
           
 java.lang.Class getExternalWiredAdapter()
           
 java.lang.Class getImplementation()
           
 java.lang.Class getInternalInterface()
           
 java.lang.Class getInternalWiredAdapter()
           
 ResourceRefMap getResourceRefs()
           
 java.lang.String getType()
           
 
Methods inherited from class cuba.wired.AbstractDescriptor
getGlobalName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WiredComponentDesc

public WiredComponentDesc(java.lang.String globalName,
                          java.lang.Class externalWiredAdapter,
                          java.lang.Class internalWiredAdapter,
                          java.lang.Class externalInterface,
                          java.lang.Class internalInterface,
                          ComponentRefMap componentRefs,
                          ResourceRefMap resourceRefs,
                          EnvironmentRefMap environmentRefs,
                          boolean cmt,
                          java.lang.String type)

WiredComponentDesc

public WiredComponentDesc(WiredComponentDesc source,
                          java.lang.Class implementation)
Copy constructor, allowing to specify an alternative implementation class for the component. This is especially of interest for test purposes to substitute a component's actual implementation by a mock version.

Parameters:
source - The descriptor to copy the original data from
implementation - The implementation class to use. This must be a derivation of the original implementation class, otherwise the adapters will cause class cast exceptions later on.
Method Detail

getExternalInterface

public java.lang.Class getExternalInterface()

getInternalInterface

public java.lang.Class getInternalInterface()

getComponentRefs

public ComponentRefMap getComponentRefs()

getResourceRefs

public ResourceRefMap getResourceRefs()

getEnvironmentRefs

public EnvironmentRefMap getEnvironmentRefs()

getCmt

public boolean getCmt()

getType

public java.lang.String getType()

getExternalWiredAdapter

public java.lang.Class getExternalWiredAdapter()

getInternalWiredAdapter

public java.lang.Class getInternalWiredAdapter()

getImplementation

public java.lang.Class getImplementation()

checkImplements

public java.lang.String checkImplements(java.lang.Class interfaze,
                                        boolean internal,
                                        boolean exact)
Description copied from class: AbstractDescriptor
Checks wether the component, described by this descriptor provides the passed interface

Specified by:
checkImplements in class AbstractDescriptor
Parameters:
interfaze - The required interface
internal - true when looking for an internal interface
exact - true when looking for an exact match, otherwise also a derived interface would be accepted.
Returns:
null if the components matches. Otherwise, the name of the component's interface, supposed to be used in an error message.