com.ebmwebsourcing.easyviper.core.fractal
Class FractalHelper

java.lang.Object
  extended by com.ebmwebsourcing.easyviper.core.fractal.FractalHelper

public class FractalHelper
extends java.lang.Object

This class helps fractal management.

Author:
Nicolas Salatge - eBM WebSourcing

Field Summary
static java.lang.String CORE_EXPLORER_COMPOSITE
          the petals component name.
static java.lang.String EXPLORER_COMPOSITE
          the explorer composite component name.
static java.lang.String FCAPPL_BINDING
          the FCAPPL binding name.
 
Method Summary
 void addBindings(org.objectweb.fractal.api.Component component, java.util.List<Binding> listOfBindings)
          Add a component in a composite component.
 void addComponent(org.objectweb.fractal.api.Component newComponent, org.objectweb.fractal.api.Component parentComponent, java.util.List<Binding> listOfBindings)
          Add a component in a composite component.
 void changeName(org.objectweb.fractal.api.Component comp, java.lang.String name)
          Change the name of the component
 void createExplorer(org.objectweb.fractal.api.Component component, java.lang.String fractalName, java.lang.String fractalDefinition)
          Create an explorer for the specified component (the component requires an explicit interface named fcAppl of type org.objectweb.fractal.api.Component).
 org.objectweb.fractal.api.Component createExplorer(java.lang.String fractalName, java.lang.String fractalDefinition)
          Create an explorer for the specified component (the component requires an explicit interface named fcAppl of type org.objectweb.fractal.api.Component).
 org.objectweb.fractal.api.Component createNewComponent(java.lang.String name, java.util.Map<java.lang.Object,java.lang.Object> ctxt)
          Create a new component.
 void deleteAllClientBindingsOfComponent(org.objectweb.fractal.api.Component component)
          Delete all client binding of component.
 void deleteBindings(org.objectweb.fractal.api.Component component, java.util.List<Binding> listOfBindings)
          Delete a component in a composite component.
 void deleteComponent(org.objectweb.fractal.api.Component oldComponent)
          Delete a component in a composite component.
 void deleteComponent(org.objectweb.fractal.api.Component oldComponent, org.objectweb.fractal.api.Component parentComponent, java.util.List<Binding> listOfBindings)
          Delete a component in a composite component.
 void deleteLinkWithAnItfClientOfComponent(org.objectweb.fractal.api.Component component, java.lang.String itfCLient)
          Delete all client binding of component.
 java.util.List<org.objectweb.fractal.api.Component> getClientComponentsLinkedToServerInterfacesOfComponent(org.objectweb.fractal.api.Component parentComponent, org.objectweb.fractal.api.Interface itfOfComponent)
          A utility function allowing to get components interface binding to the client interface of the component controller.
 org.objectweb.fractal.api.Component getComponentByInterface(org.objectweb.fractal.api.Component parent, org.objectweb.fractal.api.Interface itf, java.lang.String interfaceName)
          A utility function allowing to get a component from an interface
 java.util.List<org.objectweb.fractal.api.Component> getComponents(org.objectweb.fractal.api.Component parent)
          A utility function allowing to get a component from any content controller.
 java.util.List<org.objectweb.fractal.api.Component> getComponentsByName(org.objectweb.fractal.api.Component parent, java.lang.String name)
          A utility function allowing to get a component from any content controller.
 org.objectweb.fractal.adl.Factory getFactory()
          Get the factory to manage components.
 org.objectweb.fractal.api.Component getFirstComponentByName(org.objectweb.fractal.api.Component parent, java.lang.String name)
          A utility function allowing to get the first component with the given name.
static FractalHelper getFractalHelper()
          Get a FractalHelper instance.
 org.objectweb.fractal.api.control.LifeCycleController getLifeCycleControllerByName(org.objectweb.fractal.api.Component parent, java.lang.String name)
          A utility function allowing to get a component LifeCycleController from a content controller.
 java.util.List<java.lang.String> getListOfBinds(org.objectweb.fractal.api.Component component)
           
 java.lang.String getName(org.objectweb.fractal.api.Component comp)
           
 org.objectweb.fractal.api.Component getParent(org.objectweb.fractal.api.Component childrenComponent)
           
 java.util.Map<java.lang.String,org.objectweb.fractal.api.Interface> getServerInterfacesLinkedToClientInterfacesOfComponent(org.objectweb.fractal.api.Component component)
          A utility function allowing to get components interface binding to the client interface of the component controller.
 boolean isAlreadyBind(org.objectweb.fractal.api.Component component, java.lang.String clientItfName, org.objectweb.fractal.api.Interface itf)
           
 boolean isBinded(org.objectweb.fractal.api.Component component, java.lang.String clientItfName)
           
 boolean isStarted(org.objectweb.fractal.api.Component comp)
           
 boolean startComponent(org.objectweb.fractal.api.Component component)
          A utility function to start the given fractal component.
 void stopAllSubComponents(org.objectweb.fractal.api.Component composite)
          A utility function to stop the given fractal composite.
 boolean stopComponent(org.objectweb.fractal.api.Component component)
          A utility function to stop the given fractal component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXPLORER_COMPOSITE

public static final java.lang.String EXPLORER_COMPOSITE
the explorer composite component name.

See Also:
Constant Field Values

CORE_EXPLORER_COMPOSITE

public static final java.lang.String CORE_EXPLORER_COMPOSITE
the petals component name.

See Also:
Constant Field Values

FCAPPL_BINDING

public static final java.lang.String FCAPPL_BINDING
the FCAPPL binding name.

See Also:
Constant Field Values
Method Detail

getFractalHelper

public static FractalHelper getFractalHelper()
                                      throws CoreException
Get a FractalHelper instance.

Returns:
the fractalHelper instance
Throws:
org.objectweb.fractal.adl.ADLException - : occurs when it is impossible to get the fractal explorer
CoreException

getFactory

public org.objectweb.fractal.adl.Factory getFactory()
                                             throws CoreException
Get the factory to manage components.

Returns:
The factory
Throws:
org.objectweb.fractal.adl.ADLException - : occurs when the framework of Petals is incorrect
CoreException

createNewComponent

public org.objectweb.fractal.api.Component createNewComponent(java.lang.String name,
                                                              java.util.Map<java.lang.Object,java.lang.Object> ctxt)
                                                       throws CoreException
Create a new component.

Parameters:
name - The class name of the component
Returns:
the new component
Throws:
org.objectweb.fractal.adl.ADLException - : occurs when the framework of Petals is incorrect
CoreException

changeName

public void changeName(org.objectweb.fractal.api.Component comp,
                       java.lang.String name)
                throws CoreException
Change the name of the component

Parameters:
name -
Throws:
CoreException

getName

public java.lang.String getName(org.objectweb.fractal.api.Component comp)

getComponentsByName

public java.util.List<org.objectweb.fractal.api.Component> getComponentsByName(org.objectweb.fractal.api.Component parent,
                                                                               java.lang.String name)
A utility function allowing to get a component from any content controller.

Parameters:
parentContentController - parentContentController
name - component name
Returns:
the component, null if not found

getFirstComponentByName

public org.objectweb.fractal.api.Component getFirstComponentByName(org.objectweb.fractal.api.Component parent,
                                                                   java.lang.String name)
A utility function allowing to get the first component with the given name.

Parameters:
parentContentController - parentContentController
name - component name
Returns:
the component, null if not found

getComponentByInterface

public org.objectweb.fractal.api.Component getComponentByInterface(org.objectweb.fractal.api.Component parent,
                                                                   org.objectweb.fractal.api.Interface itf,
                                                                   java.lang.String interfaceName)
A utility function allowing to get a component from an interface

Parameters:
parentContentController - parentContentController
name - component name
Returns:
the component, null if not found

getComponents

public java.util.List<org.objectweb.fractal.api.Component> getComponents(org.objectweb.fractal.api.Component parent)
A utility function allowing to get a component from any content controller.

Parameters:
parentContentController - parentContentController
name - component name
Returns:
the component, null if not found

getServerInterfacesLinkedToClientInterfacesOfComponent

public java.util.Map<java.lang.String,org.objectweb.fractal.api.Interface> getServerInterfacesLinkedToClientInterfacesOfComponent(org.objectweb.fractal.api.Component component)
A utility function allowing to get components interface binding to the client interface of the component controller.

Parameters:
parentContentController - parentContentController
name - component name
Returns:
the component, null if not found

getClientComponentsLinkedToServerInterfacesOfComponent

public java.util.List<org.objectweb.fractal.api.Component> getClientComponentsLinkedToServerInterfacesOfComponent(org.objectweb.fractal.api.Component parentComponent,
                                                                                                                  org.objectweb.fractal.api.Interface itfOfComponent)
A utility function allowing to get components interface binding to the client interface of the component controller.

Parameters:
parentContentController - parentContentController
name - component name
Returns:
the component, null if not found

getLifeCycleControllerByName

public org.objectweb.fractal.api.control.LifeCycleController getLifeCycleControllerByName(org.objectweb.fractal.api.Component parent,
                                                                                          java.lang.String name)
                                                                                   throws CoreException
A utility function allowing to get a component LifeCycleController from a content controller.

Parameters:
parentContentController - the parent content controller
name - the name of the component
Returns:
the LifeCycleController of the component, null if not found
Throws:
CoreException

isStarted

public boolean isStarted(org.objectweb.fractal.api.Component comp)

startComponent

public boolean startComponent(org.objectweb.fractal.api.Component component)
                       throws CoreException
A utility function to start the given fractal component.

Parameters:
component - the fractal component
Returns:
true if the component was found and stopped, false otherwise
Throws:
org.objectweb.fractal.api.NoSuchInterfaceException - : impossible to stop the component
org.objectweb.fractal.api.control.IllegalLifeCycleException - : impossible to stop the component
CoreException

stopComponent

public boolean stopComponent(org.objectweb.fractal.api.Component component)
                      throws CoreException
A utility function to stop the given fractal component.

Parameters:
component - the fractal component to stop
Returns:
true if the component was found and stopped, false otherwise
Throws:
org.objectweb.fractal.api.NoSuchInterfaceException - : impossible to stop the component
org.objectweb.fractal.api.control.IllegalLifeCycleException - : impossible to stop the component
CoreException

stopAllSubComponents

public void stopAllSubComponents(org.objectweb.fractal.api.Component composite)
                          throws CoreException
A utility function to stop the given fractal composite.

Parameters:
composite -
Throws:
org.objectweb.fractal.api.NoSuchInterfaceException
org.objectweb.fractal.api.control.IllegalLifeCycleException
org.objectweb.fractal.api.NoSuchInterfaceException
CoreException

addComponent

public void addComponent(org.objectweb.fractal.api.Component newComponent,
                         org.objectweb.fractal.api.Component parentComponent,
                         java.util.List<Binding> listOfBindings)
                  throws CoreException
Add a component in a composite component.

Parameters:
newComponent - The new component
parentComponent - The parent component
listOfBindings - the list of binding to create between this new component and the others
Throws:
org.objectweb.fractal.api.NoSuchInterfaceException - : Impossible to add a component
org.objectweb.fractal.api.control.IllegalLifeCycleException - : Impossible to add a component
org.objectweb.fractal.api.control.IllegalContentException - : Impossible to add a component
org.objectweb.fractal.api.control.IllegalBindingException - : Impossible to add a component
CoreException

deleteComponent

public void deleteComponent(org.objectweb.fractal.api.Component oldComponent)
                     throws CoreException
Delete a component in a composite component.

Parameters:
oldComponent - The component to delete
parentComponent - The parent component
listOfBindings - the list of binding to create between this new component and the others
Throws:
org.objectweb.fractal.api.NoSuchInterfaceException - : Impossible to add a component
org.objectweb.fractal.api.control.IllegalLifeCycleException - : Impossible to add a component
org.objectweb.fractal.api.control.IllegalContentException - : Impossible to add a component
org.objectweb.fractal.api.control.IllegalBindingException - : Impossible to add a component
CoreException

deleteComponent

public void deleteComponent(org.objectweb.fractal.api.Component oldComponent,
                            org.objectweb.fractal.api.Component parentComponent,
                            java.util.List<Binding> listOfBindings)
                     throws CoreException
Delete a component in a composite component.

Parameters:
oldComponent - The component to delete
parentComponent - The parent component
listOfBindings - the list of binding to create between this new component and the others
Throws:
org.objectweb.fractal.api.NoSuchInterfaceException - : Impossible to add a component
org.objectweb.fractal.api.control.IllegalLifeCycleException - : Impossible to add a component
org.objectweb.fractal.api.control.IllegalContentException - : Impossible to add a component
org.objectweb.fractal.api.control.IllegalBindingException - : Impossible to add a component
CoreException

addBindings

public void addBindings(org.objectweb.fractal.api.Component component,
                        java.util.List<Binding> listOfBindings)
                 throws CoreException
Add a component in a composite component.

Parameters:
newComponent - The new component
parentComponent - The parent component
listOfBindings - the list of binding to create between this new component and the others
Throws:
org.objectweb.fractal.api.NoSuchInterfaceException - : Impossible to add a component
org.objectweb.fractal.api.control.IllegalLifeCycleException - : Impossible to add a component
org.objectweb.fractal.api.control.IllegalContentException - : Impossible to add a component
org.objectweb.fractal.api.control.IllegalBindingException - : Impossible to add a component
CoreException

isBinded

public boolean isBinded(org.objectweb.fractal.api.Component component,
                        java.lang.String clientItfName)
                 throws CoreException
Throws:
CoreException

isAlreadyBind

public boolean isAlreadyBind(org.objectweb.fractal.api.Component component,
                             java.lang.String clientItfName,
                             org.objectweb.fractal.api.Interface itf)
                      throws CoreException
Throws:
CoreException

getListOfBinds

public java.util.List<java.lang.String> getListOfBinds(org.objectweb.fractal.api.Component component)
                                                throws CoreException
Throws:
CoreException

getParent

public org.objectweb.fractal.api.Component getParent(org.objectweb.fractal.api.Component childrenComponent)
                                              throws CoreException
Throws:
CoreException

deleteBindings

public void deleteBindings(org.objectweb.fractal.api.Component component,
                           java.util.List<Binding> listOfBindings)
                    throws CoreException
Delete a component in a composite component.

Parameters:
newComponent - The new component
parentComponent - The parent component
listOfBindings - the list of binding to create between this new component and the others
Throws:
org.objectweb.fractal.api.NoSuchInterfaceException - : Impossible to add a component
org.objectweb.fractal.api.control.IllegalLifeCycleException - : Impossible to add a component
org.objectweb.fractal.api.control.IllegalContentException - : Impossible to add a component
org.objectweb.fractal.api.control.IllegalBindingException - : Impossible to add a component
CoreException

deleteAllClientBindingsOfComponent

public void deleteAllClientBindingsOfComponent(org.objectweb.fractal.api.Component component)
                                        throws CoreException
Delete all client binding of component.

Parameters:
newComponent - The new component
parentComponent - The parent component
listOfBindings - the list of binding to create between this new component and the others
Throws:
org.objectweb.fractal.api.NoSuchInterfaceException - : Impossible to add a component
org.objectweb.fractal.api.control.IllegalLifeCycleException - : Impossible to add a component
org.objectweb.fractal.api.control.IllegalContentException - : Impossible to add a component
org.objectweb.fractal.api.control.IllegalBindingException - : Impossible to add a component
CoreException

deleteLinkWithAnItfClientOfComponent

public void deleteLinkWithAnItfClientOfComponent(org.objectweb.fractal.api.Component component,
                                                 java.lang.String itfCLient)
                                          throws CoreException
Delete all client binding of component.

Parameters:
newComponent - The new component
parentComponent - The parent component
listOfBindings - the list of binding to create between this new component and the others
Throws:
org.objectweb.fractal.api.NoSuchInterfaceException - : Impossible to add a component
org.objectweb.fractal.api.control.IllegalLifeCycleException - : Impossible to add a component
org.objectweb.fractal.api.control.IllegalContentException - : Impossible to add a component
org.objectweb.fractal.api.control.IllegalBindingException - : Impossible to add a component
CoreException

createExplorer

public org.objectweb.fractal.api.Component createExplorer(java.lang.String fractalName,
                                                          java.lang.String fractalDefinition)
                                                   throws CoreException
Create an explorer for the specified component (the component requires an explicit interface named fcAppl of type org.objectweb.fractal.api.Component).

Parameters:
component - the component to explore
Throws:
org.objectweb.fractal.adl.ADLException - : occurs when it is impossible to create the explorer
org.objectweb.fractal.api.NoSuchInterfaceException - : occurs when it is impossible to create the explorer
org.objectweb.fractal.api.control.IllegalBindingException - : occurs when it is impossible to create the explorer
org.objectweb.fractal.api.control.IllegalLifeCycleException - : occurs when it is impossible to create the explorer
org.objectweb.fractal.api.control.IllegalContentException - : occurs when it is impossible to create the explorer
CoreException

createExplorer

public void createExplorer(org.objectweb.fractal.api.Component component,
                           java.lang.String fractalName,
                           java.lang.String fractalDefinition)
                    throws CoreException
Create an explorer for the specified component (the component requires an explicit interface named fcAppl of type org.objectweb.fractal.api.Component).

Parameters:
component - the component to explore
Throws:
org.objectweb.fractal.adl.ADLException - : occurs when it is impossible to create the explorer
org.objectweb.fractal.api.NoSuchInterfaceException - : occurs when it is impossible to create the explorer
org.objectweb.fractal.api.control.IllegalBindingException - : occurs when it is impossible to create the explorer
org.objectweb.fractal.api.control.IllegalLifeCycleException - : occurs when it is impossible to create the explorer
org.objectweb.fractal.api.control.IllegalContentException - : occurs when it is impossible to create the explorer
CoreException


Copyright © 2009 eBM WebSourcing. All Rights Reserved.