SmartFrog 3.10.000

org.smartfrog.sfcore.prim
Interface Prim

All Superinterfaces:
Diagnostics, Liveness, java.rmi.Remote, RemoteReferenceResolver, RemoteReferenceResolverHelper
All Known Subinterfaces:
Compound, CopyFile, DetachingCompound, ProcessCompound
All Known Implementing Classes:
AbstractClasspathImpl, AbstractPolicy, ApacheImpl, ArrayCompoundImpl, AssertComponent, Attribute, Autoloader, BalancerImpl, Comparator, CompoundImpl, Constant, Container, CopyFileImpl, CounterImpl, CPUMonitorImpl, Delay, Delay, DeployByCopyImpl, Deployer, DetachingCompoundImpl, DirectoryClasspathImpl, DisplayThresholderImpl, DoNothing, DownloadImpl, Dup, During, EventCompoundImpl, EventCounter, EventPrimImpl, EventQueue, EventSend, ExampleTemplateImpl, FileImpl, FileTesterImpl, FileUsingComponentImpl, FileUsingCompoundImpl, FireBreak, FlattenLocalFilesPolicy, GameArenaWrapper, Generator, GeneratorImpl, GraphImpl, InputImpl, JavaPackageImpl, LibraryArtifactImpl, LibraryClasspathImpl, LibraryImpl, LoadClassImpl, LoadPropertyFileImpl, LocalFilestoreImpl, LoggerImpl, Maven1Policy, Maven2Policy, MkdirImpl, Negate, NetElemImpl, OnEvent, OutputImpl, Parallel, PersistentCounterImpl, Plus, PrimImpl, Printer, PrinterImpl, ProcessCompoundImpl, ProgressBarsImpl, RandomSequence, Repeat, Retract, Retry, Run, RunJavaImpl, RunShellImpl, SelfDeletingFileImpl, Sequence, SFConcatImpl, SFDeployDisplay, SFDisplay, SFLogRegistrationImpl, SFLogStdStreamImpl, SFLogToFile, SFMCastClientImpl, SFMCastServerImpl, SFPersist, SFPrimLogImpl, SFProcessExecutionImpl, SFReplaceFileVar, SFScriptExecutionImpl, SFScriptImpl, SFSetPropertyImpl, SFTrace, SFTraceDisplay, Spawn, StressControlGuiImpl, StressTesterImpl, SystemPropertiesImpl, TempDirImpl, TempFileImpl, Terminator, Tester, TextFileImpl, ThresholderImpl, TideMeterImpl, Timeout, Times, TouchFileImpl, Try, UpdatableCompound, UpdatablePrim

public interface Prim
extends Liveness, RemoteReferenceResolver, RemoteReferenceResolverHelper, Diagnostics, java.rmi.Remote

Defines the basic interface for all deployed components. A deployed component knows how to react to termination, liveness, etc.


Method Summary
 java.lang.Object sfAddAttribute(java.lang.Object name, java.lang.Object value)
          Add an attribute to the component's context.
 java.lang.Object sfAttributeKeyFor(java.lang.Object value)
          Returns the attribute key for a given value.
 java.util.Iterator sfAttributes()
          Returns an ordered iterator over the attribute names in the context.
 Reference sfCompleteName()
          Returns a reference to the component from the root of the containment tree.
 boolean sfContainsAttribute(java.lang.Object attribute)
          Returns true if the context contains attribute.
 boolean sfContainsValue(java.lang.Object value)
          Returns true if the context contains value.
 Context sfContext()
          Returns the context of this component.
 void sfDeploy()
          Deploy the component.
 java.net.InetAddress sfDeployedHost()
          Request the host on which this component is deployed.
 java.lang.String sfDeployedProcessName()
          Request the process in which this component is deployed, the name being that defined in the sfProcessName attribute or the string ROOT if in the root process compound.
 void sfDeployWith(Prim parent, Context cxt)
          Private method to set up a freshly deployed component.
 void sfDetach()
          Request component to detach itself from its parent, and becoming a root component.
 void sfDetachAndTerminate(TerminationRecord status)
          Request component to detach itself from its container and terminate with a given termination status.
 void sfDumpState(Dump target)
          Request component to "dump it's state" to a target object which implements the Dump interface.
 boolean sfIsDeployed()
          Returns value of flag indicating if this component has been deployed.
 boolean sfIsStarted()
          Returns value of flag indicating if this component has been started.
 boolean sfIsTerminated()
          Returns value of flag indicating if this component has been terminated.
 boolean sfIsTerminating()
          Returns value of flag indicating if this component is terminating.
 Prim sfParent()
          Gets the parent of the component.
 void sfParentageChanged()
          Parentage changed in component hierachy.
 java.lang.Object sfRemoveAttribute(java.lang.Object name)
          Remove named attribute from component context.
 java.lang.Object sfReplaceAttribute(java.lang.Object name, java.lang.Object value)
          Replace named attribute in component context.
 void sfStart()
          Start the component's main processing thread.
 void sfTerminate(TerminationRecord status)
          Request component to terminate with a given termination status.
 void sfTerminatedWith(TerminationRecord status, Prim comp)
          Notification of other component that it has been terminated.
 void sfTerminateQuietlyWith(TerminationRecord status)
          Request this component to terminate quietly without telling anyone else.
 java.util.Iterator sfValues()
          Returns an ordered iterator over the values in the context.
 
Methods inherited from interface org.smartfrog.sfcore.prim.Liveness
sfPing
 
Methods inherited from interface org.smartfrog.sfcore.reference.RemoteReferenceResolver
sfResolve, sfResolve, sfResolveHere, sfResolveHere, sfResolveParent
 
Methods inherited from interface org.smartfrog.sfcore.reference.RemoteReferenceResolverHelper
sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolveWithParser
 
Methods inherited from interface org.smartfrog.sfcore.prim.Diagnostics
sfDiagnosticsReport
 

Method Detail

sfAddAttribute

java.lang.Object sfAddAttribute(java.lang.Object name,
                                java.lang.Object value)
                                throws SmartFrogRuntimeException,
                                       java.rmi.RemoteException
Add an attribute to the component's context. Values should be marshallable types if they are to be referenced remotely at run-time. If an attribute with this name already exists it is not replaced.

Parameters:
name - name of attribute
value - object to be added in context
Returns:
value if successfull, null otherwise
Throws:
java.rmi.RemoteException - In case of Remote/nework error
SmartFrogRuntimeException - when name or value are null

sfRemoveAttribute

java.lang.Object sfRemoveAttribute(java.lang.Object name)
                                   throws SmartFrogRuntimeException,
                                          java.rmi.RemoteException
Remove named attribute from component context. Non present attribute names are ignored.

Parameters:
name - name of attribute to be removed
Returns:
the removed value if successfull, null otherwise
Throws:
java.rmi.RemoteException - In case of Remote/nework error
SmartFrogRuntimeException - when name is null

sfAttributeKeyFor

java.lang.Object sfAttributeKeyFor(java.lang.Object value)
                                   throws java.rmi.RemoteException
Returns the attribute key for a given value.

Parameters:
value - value to look up the key for
Returns:
key for given value or null if not found
Throws:
java.rmi.RemoteException - In case of Remote/nework error

sfContainsValue

boolean sfContainsValue(java.lang.Object value)
                        throws java.rmi.RemoteException
Returns true if the context contains value.

Parameters:
value - object to check
Returns:
true if context contains value, false otherwise
Throws:
java.rmi.RemoteException - In case of Remote/nework error

sfContainsAttribute

boolean sfContainsAttribute(java.lang.Object attribute)
                            throws java.rmi.RemoteException
Returns true if the context contains attribute.

Parameters:
attribute - to check
Returns:
true if context contains key, false otherwise
Throws:
java.rmi.RemoteException - In case of Remote/nework error

sfReplaceAttribute

java.lang.Object sfReplaceAttribute(java.lang.Object name,
                                    java.lang.Object value)
                                    throws SmartFrogRuntimeException,
                                           java.rmi.RemoteException
Replace named attribute in component context. If attribute is not present it is added to the context.

Parameters:
name - of attribute to replace
value - attribute value to replace or add
Returns:
the old value if present, null otherwise
Throws:
java.rmi.RemoteException - In case of Remote/nework error
SmartFrogRuntimeException - when name or value are null

sfAttributes

java.util.Iterator sfAttributes()
                                throws java.rmi.RemoteException
Returns an ordered iterator over the attribute names in the context. The remove operation of this Iterator won't affect the contents of this component

Returns:
iterator
Throws:
java.rmi.RemoteException - In case of Remote/nework error

sfValues

java.util.Iterator sfValues()
                            throws java.rmi.RemoteException
Returns an ordered iterator over the values in the context. The remove operation of this Iterator won't affect the contents of this component

Returns:
iterator
Throws:
java.rmi.RemoteException - In case of Remote/nework error

sfContext

Context sfContext()
                  throws java.rmi.RemoteException
Returns the context of this component.

Returns:
component context
Throws:
java.rmi.RemoteException - In case of Remote/nework error

sfCompleteName

Reference sfCompleteName()
                         throws java.rmi.RemoteException
Returns a reference to the component from the root of the containment tree. If the given component is an attribute of this component, the complete name of this compoonent is returned.

Returns:
reference to this object
Throws:
java.rmi.RemoteException - In case of Remote/nework error

sfParent

Prim sfParent()
              throws java.rmi.RemoteException
Gets the parent of the component.

Returns:
a component or null this component is root
Throws:
java.rmi.RemoteException - In case of Remote/nework error

sfDeployWith

void sfDeployWith(Prim parent,
                  Context cxt)
                  throws SmartFrogException,
                         java.rmi.RemoteException
Private method to set up a freshly deployed component. New primitives should only override sfDeploy.

Parameters:
parent - parent of component
cxt - context for component
Throws:
SmartFrogException - failed to deploy primitive
java.rmi.RemoteException - In case of Remote/nework error

sfDeploy

void sfDeploy()
              throws SmartFrogException,
                     java.rmi.RemoteException
Deploy the component. The component can not assume that other parts of the application are already deployed.

Throws:
SmartFrogException - error while deploying
java.rmi.RemoteException - In case of Remote/nework error

sfStart

void sfStart()
             throws SmartFrogException,
                    java.rmi.RemoteException
Start the component's main processing thread. Implementations should not block in this call, but spawn off another thread.

Throws:
SmartFrogException - sfStart failure
java.rmi.RemoteException - In case of Remote/nework error

sfDumpState

void sfDumpState(Dump target)
                 throws java.rmi.RemoteException
Request component to "dump it's state" to a target object which implements the Dump interface.

Parameters:
target - object to send dumpState to
Throws:
java.rmi.RemoteException - In case of Remote/nework error

sfTerminate

void sfTerminate(TerminationRecord status)
                 throws java.rmi.RemoteException
Request component to terminate with a given termination status. This will cause the component to notify termination to its container. Implementations don't generally implement this. They override the sfTerminateWith hook.

Parameters:
status - termination status
Throws:
java.rmi.RemoteException - In case of Remote/nework error

sfDetach

void sfDetach()
              throws SmartFrogException,
                     java.rmi.RemoteException
Request component to detach itself from its parent, and becoming a root component.

Throws:
SmartFrogException - failed to detach
java.rmi.RemoteException - In case of Remote/nework error

sfDetachAndTerminate

void sfDetachAndTerminate(TerminationRecord status)
                          throws java.rmi.RemoteException
Request component to detach itself from its container and terminate with a given termination status. This will not notify the container of termination.

Parameters:
status - termination status
Throws:
java.rmi.RemoteException - In case of Remote/nework error

sfTerminatedWith

void sfTerminatedWith(TerminationRecord status,
                      Prim comp)
                      throws java.rmi.RemoteException
Notification of other component that it has been terminated. This would normally be called from sub-components which are terminated.

Parameters:
comp - terminated component
status - termination record for component
Throws:
java.rmi.RemoteException - In case of Remote/nework error

sfTerminateQuietlyWith

void sfTerminateQuietlyWith(TerminationRecord status)
                            throws java.rmi.RemoteException
Request this component to terminate quietly without telling anyone else.

Parameters:
status - status indicating termination type
Throws:
java.rmi.RemoteException - In case of Remote/nework error

sfDeployedHost

java.net.InetAddress sfDeployedHost()
                                    throws java.rmi.RemoteException
Request the host on which this component is deployed.

Returns:
the host InetAddress
Throws:
java.rmi.RemoteException - In case of Remote/nework error

sfDeployedProcessName

java.lang.String sfDeployedProcessName()
                                       throws java.rmi.RemoteException
Request the process in which this component is deployed, the name being that defined in the sfProcessName attribute or the string ROOT if in the root process compound.

Returns:
the name of the process
Throws:
java.rmi.RemoteException - In case of Remote/nework error

sfParentageChanged

void sfParentageChanged()
                        throws java.rmi.RemoteException
Parentage changed in component hierachy.

Throws:
java.rmi.RemoteException - In case of Remote/nework error

sfIsTerminated

boolean sfIsTerminated()
                       throws java.rmi.RemoteException
Returns value of flag indicating if this component has been terminated.

Throws:
java.rmi.RemoteException - In case of Remote/nework error

sfIsTerminating

boolean sfIsTerminating()
                        throws java.rmi.RemoteException
Returns value of flag indicating if this component is terminating.

Throws:
java.rmi.RemoteException - In case of Remote/nework error

sfIsDeployed

boolean sfIsDeployed()
                     throws java.rmi.RemoteException
Returns value of flag indicating if this component has been deployed.

Throws:
java.rmi.RemoteException - In case of Remote/nework error

sfIsStarted

boolean sfIsStarted()
                    throws java.rmi.RemoteException
Returns value of flag indicating if this component has been started.

Throws:
java.rmi.RemoteException - In case of Remote/nework error

SmartFrog CORE 3.10.000

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