SmartFrog 3.10.000

org.smartfrog.sfcore.utils
Class ParentHelper

java.lang.Object
  extended by org.smartfrog.sfcore.utils.ParentHelper
All Implemented Interfaces:
java.rmi.Remote, ChildMinder

public class ParentHelper
extends java.lang.Object
implements ChildMinder

Contains all the child-minding logic for anything that wants to host children


Field Summary
protected  java.util.Vector lifecycleChildren
          Maintains a temporal list of the children that have to be driven through their sfDeploy and sfStart lifecycle methods.
protected  java.util.Vector sfChildren
          Maintains children on which life of parent depends (and vice versa).
 
Constructor Summary
ParentHelper(Prim owner)
          construct a parent helper and bind to a prim class
 
Method Summary
 Prim deployComponentDescription(java.lang.Object name, Prim parent, ComponentDescription cmp, Context parms)
          An low-level SmartFrog method.
 void sfAddChild(Liveness child)
          Add a child.
 java.util.Enumeration sfChildren()
          Gets an enumeration over the children of the implementor.
 boolean sfContainsChild(Liveness child)
          Request whether implementor contains a given child.
 boolean sfRemoveChild(Liveness child)
          Remove a child.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sfChildren

protected java.util.Vector sfChildren
Maintains children on which life of parent depends (and vice versa).


lifecycleChildren

protected java.util.Vector lifecycleChildren
Maintains a temporal list of the children that have to be driven through their sfDeploy and sfStart lifecycle methods.

Constructor Detail

ParentHelper

public ParentHelper(Prim owner)
construct a parent helper and bind to a prim class

Parameters:
owner - he owner to which this helper should be bound
Method Detail

sfAddChild

public void sfAddChild(Liveness child)
                throws java.rmi.RemoteException
Add a child. if synchronized it locks processCompound when it registers back!

Specified by:
sfAddChild in interface ChildMinder
Parameters:
child - child to add
Throws:
java.rmi.RemoteException - In case of Remote/nework error

sfRemoveChild

public boolean sfRemoveChild(Liveness child)
                      throws SmartFrogRuntimeException,
                             java.rmi.RemoteException
Remove a child.

Specified by:
sfRemoveChild in interface ChildMinder
Parameters:
child - child to add
Returns:
Status of child removal
Throws:
SmartFrogRuntimeException - if failed ro remove
java.rmi.RemoteException - In case of Remote/nework error

sfContainsChild

public boolean sfContainsChild(Liveness child)
                        throws java.rmi.RemoteException
Request whether implementor contains a given child.

Specified by:
sfContainsChild in interface ChildMinder
Parameters:
child - child to check for
Returns:
true is child is present else false
Throws:
java.rmi.RemoteException - In case of Remote/nework error

sfChildren

public java.util.Enumeration sfChildren()
                                 throws java.rmi.RemoteException
Gets an enumeration over the children of the implementor.

Specified by:
sfChildren in interface ChildMinder
Returns:
enumeration over children
Throws:
java.rmi.RemoteException - In case of Remote/nework error

deployComponentDescription

public Prim deployComponentDescription(java.lang.Object name,
                                       Prim parent,
                                       ComponentDescription cmp,
                                       Context parms)
                                throws SmartFrogDeploymentException
An low-level SmartFrog method. It deploys a compiled component and makes it an attribute of the parent compound. Also start heartbeating the deployed component if the component registers. Note that the remaining lifecycle methods must still be invoked on the created component - namely sfDeploy() and sfStart(). This is primarily an internal method - the prefered method for end users is #sfCreateNewChild.

Note that the remaining lifecycle methods must still be invoked on the created component - namely sfDeploy() and sfStart().

Parameters:
name - name to name deployed component under in context
parent - of deployer component
cmp - compiled component to deploy
parms - parameters for description; can be null
Returns:
newly deployed component
Throws:
SmartFrogDeploymentException - failed to deploy compiled component

SmartFrog CORE 3.10.000

(C) Copyright 1998-2006 Hewlett-Packard Development Company, LP