Web Dynpro API Documentation

com.sap.tc.webdynpro.progmodel.api
Interface IWDComponentUsage


public interface IWDComponentUsage

API of component usages. A component usage provides access to the interfaces of an embedded component and manages the lifecycle of an embedded component instance.

Version:
$Id: //tc/WebDynproRuntime/630_VAL_REL/src/_webdynpro_progmodel/java/com/sap/tc/webdynpro/progmodel/api/IWDComponentUsage.java#2 $

Method Summary
 void addEventHandler(IWDEventInfo event, IWDEventHandlerInfo eventHandler, IWDController controller)
          Subscribe the specified event handler to the specified event.
 void createComponent()
          Creates a component instance for this component usage.
 void createComponent(java.lang.String componentName)
          Creates a component instance for this component usage.
 void createComponent(java.lang.String componentName, java.lang.String deployableObjectName)
          Creates a component instance for this component usage.
 IWDComponentUsage createComponentUsageOfSameType(java.lang.String name)
          Creates a component usage with the given name which has the same component interface type assigned as this component usage.
 void deleteComponent()
          Deletes the component instance associated with this component usage.
 void enterReferencingMode(IWDComponentUsage componentUsage)
          Component usage does not manage its own component instance from now on.
 void enterReferencingModeUnsafe(IWDComponentUsage componentUsage)
          Deprecated. This API may be withdrawn with the first new NetWeaver release in 2006. Use enterReferencingMode(IWDComponentUsage) instead.
 IWDComponentUsageInfo getComponentUsageInfo()
          Returns the metadata describing this component usage.
 IWDExternalControllerInterface getConfigurationController()
          Get the configuration controller of the component instance.
 IWDExternalControllerInterface getInterfaceController()
          Get the interface controller of the component instance.
 boolean hasActiveComponent()
          Returns true iff this component usage has an existing component instance.
 boolean isReferenced()
          Returns true if this component usage is referenced to by other component usages.
 boolean isReferencing()
          Returns true iff this component usage is in referencing mode.
 void leaveReferencingMode()
          Restores the lifecycle manage of the component usage back to itself.
 void removeEventHandler(IWDEventInfo event, IWDEventHandlerInfo eventHandler, IWDController controller)
          Unsubscribe the specified event handler from the specified event.
 

Method Detail

getComponentUsageInfo

public IWDComponentUsageInfo getComponentUsageInfo()
Returns the metadata describing this component usage.
Returns:
the component usage metadata object

createComponent

public void createComponent()
Creates a component instance for this component usage. The type defined by the component usage declared at design time is used for creating the component instance. The method fails if the Component Usage is associated to a Component Interface Definition. Precondition: hasActiveComponent() == false && isReferencing() == false

createComponent

public void createComponent(java.lang.String componentName)
Creates a component instance for this component usage. The Component implementation is in the same deployable object as this Component Usage. Precondition: hasActiveComponent() == false && isReferencing() == false
Parameters:
componentName - The fully qualified name of the Component Implementation to use

createComponent

public void createComponent(java.lang.String componentName,
                            java.lang.String deployableObjectName)
Creates a component instance for this component usage. Precondition: hasActiveComponent() == false && isReferencing() == false
Parameters:
componentName - The fully qualified name of the Component Implementation to use
deployableObjectName - Name of the deployable object which contains the Component implementation to use

deleteComponent

public void deleteComponent()
Deletes the component instance associated with this component usage. If no instance exists, the method exits silently. Precondition: isReferencing() == false

hasActiveComponent

public boolean hasActiveComponent()
Returns true iff this component usage has an existing component instance.
Returns:
true iff this component usage has an existing component instance

getInterfaceController

public IWDExternalControllerInterface getInterfaceController()
Get the interface controller of the component instance. The returned generic controller interface object should be cast as the specific component interface IExternal<<>name<>>. Precondition: hasActiveComponent() == true

getConfigurationController

public IWDExternalControllerInterface getConfigurationController()
Get the configuration controller of the component instance. The returned generic controller interface object should be cast as the specific component interface IExternal<<>name<>>. Precondition: hasActiveComponent() == true

enterReferencingMode

public void enterReferencingMode(IWDComponentUsage componentUsage)
Component usage does not manage its own component instance from now on. Instead, the lifecycle is controlled by the component usage componentUsage. Note: Accessing a visual interface via a component usage in referecing mode ist not supported. Reverse context mapping via a component usage in referencing mode is not supported. Nevertheless, the component's visual interface and reverse context mapping can be used by the component usage which refers to the component instnce without being in referencing mode. Precondition: isReferencing() == true || hasActiveComponent() == false Precondition: The referenced component usage and this component usage must refer to comatible types. This condition is met if
* the component usages refer to the same component implementation
* the component usages refer to the same component interface definition
* the referencing component usage refers to a component interface definition which is implemented by the component implementation the referred component usage referres to
.
Parameters:
referencedUsage - component usage this component usage will refer to

enterReferencingModeUnsafe

public void enterReferencingModeUnsafe(IWDComponentUsage componentUsage)
Deprecated. This API may be withdrawn with the first new NetWeaver release in 2006. Use enterReferencingMode(IWDComponentUsage) instead.


leaveReferencingMode

public void leaveReferencingMode()
Restores the lifecycle manage of the component usage back to itself. If the component usage is not in referencing mode, then the method exits silently.

isReferencing

public boolean isReferencing()
Returns true iff this component usage is in referencing mode.
Returns:
true iff this component usage is in referencing mode
See Also:
enterReferencingMode(IWDComponentUsage)

isReferenced

public boolean isReferenced()
Returns true if this component usage is referenced to by other component usages.
See Also:
enterReferencingMode(IWDComponentUsage)

createComponentUsageOfSameType

public IWDComponentUsage createComponentUsageOfSameType(java.lang.String name)
Creates a component usage with the given name which has the same component interface type assigned as this component usage.
Parameters:
name - the name of the component usage to create
Returns:
the newly created component usage

addEventHandler

public void addEventHandler(IWDEventInfo event,
                            IWDEventHandlerInfo eventHandler,
                            IWDController controller)
Subscribe the specified event handler to the specified event. The event must be defined in the interface controller or in the configuration controller of the component this component usage refers to. The controller must be part of the parent component of this component usage.
Parameters:
event - Repository object of the event to subscribe to
eventHandler - Repository object of the event handler
controller - Controller which owns the event handler

removeEventHandler

public void removeEventHandler(IWDEventInfo event,
                               IWDEventHandlerInfo eventHandler,
                               IWDController controller)
Unsubscribe the specified event handler from the specified event. The event handler must have been subscribed with addEventHandler(IWDEventInfo, IWDEventHandlerInfo, IWDController) .
Parameters:
event - Repository object of the event to unsubscribe from
eventHandler - Repository object of the event handler
controller - Controller which owns the event handler

Web Dynpro API Documentation

Copyright © 2004 SAP AG. Automatically generated Thu Mar 3 2005, 22:15