SmartFrog 3.10.000

org.smartfrog.sfcore.languages.csf.csfcomponentdescription
Class CSFComponentDescriptionImpl

java.lang.Object
  extended by org.smartfrog.sfcore.reference.ReferenceResolverHelperImpl
      extended by org.smartfrog.sfcore.componentdescription.ComponentDescriptionImpl
          extended by org.smartfrog.sfcore.languages.sf.sfcomponentdescription.SFComponentDescriptionImpl
              extended by org.smartfrog.sfcore.languages.csf.csfcomponentdescription.CSFComponentDescriptionImpl
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Copying, MessageKeys, PrettyPrinting, ComponentDescription, CSFComponentDescription, ComponentResolver, SFComponentDescription, Phases, ReferenceResolver, ReferenceResolverHelper

public class CSFComponentDescriptionImpl
extends SFComponentDescriptionImpl
implements java.io.Serializable, java.lang.Cloneable, CSFComponentDescription, MessageKeys

Defines the context class used by Components. Context implementations need to respect the ordering and copying requirements imposed by Components.

See Also:
Serialized Form

Field Summary
protected  java.util.Vector constraints
          The list of constraints associated with this component description
 
Fields inherited from class org.smartfrog.sfcore.languages.sf.sfcomponentdescription.SFComponentDescriptionImpl
phases, sfConfigRef, type
 
Fields inherited from class org.smartfrog.sfcore.componentdescription.ComponentDescriptionImpl
eager, parent, primParent, sfContext
 
Fields inherited from interface org.smartfrog.sfcore.common.MessageKeys
CANNOT_LINK_TO_PREDICATE, COMPONENT_TERMINATED, COPY_FAILED, COPY_SERIALIZE_FAILED, ERROR_NO_SECURITY_BUT_REQUIRED, ILLEGAL_BOOLEAN_PARAMETER, ILLEGAL_NUMERIC_PARAMETER, ILLEGAL_STRING_PARAMETER, ILLEGAL_VECTOR_PARAMETER, LIVENESS_SEND_FAILURE, LIVENESS_SEND_FAILURE_IN, MISSING_PARAMETER, MSG_CLASS_NOT_FOUND, MSG_CONNECT_ERR, MSG_CONT_OTHER_DEPLOY, MSG_DEPLOY_COMP_TERMINATED, MSG_DEPLOY_SUCCESS, MSG_DEPLOYWITH_PHASE_FAILED, MSG_DETACH_SUCCESS, MSG_DETACH_TERMINATE_SUCCESS, MSG_ERR_DEPLOY_FROM_URL, MSG_ERR_PARSE, MSG_ERR_RESOLVE_PHASE, MSG_ERR_SF_RUNNING, MSG_ERR_TERM, MSG_FAILED_INET_ADDRESS_LOOKUP, MSG_FAILED_TO_CONTACT_PARENT, MSG_FILE_NOT_FOUND, MSG_HOOK_ACTION_FAILED, MSG_ILLEGAL_ACCESS, MSG_ILLEGAL_CLASS_TYPE, MSG_ILLEGAL_CLASS_TYPE_EXPECTING_GOT, MSG_ILLEGAL_REFERENCE, MSG_INPUTSTREAM_NULL, MSG_INSTANTIATION_ERROR, MSG_INVALID_OBJECT_TYPE, MSG_INVOCATION_TARGET, MSG_LANG_NOT_FOUND, MSG_LIVENESS_START_FAILED, MSG_LOADING_URL, MSG_METHOD_NOT_FOUND, MSG_NON_REP_ATTRIB, MSG_NOT_COMPONENT_REFERENCE, MSG_NOT_FOUND_ATTRIBUTE, MSG_NOT_FOUND_REFERENCE, MSG_NOT_VALUE_REFERENCE, MSG_NULL_DEF_METHOD, MSG_NULL_URL, MSG_OBJECT_REGISTRATION_FAILED, MSG_PARENT_LOCATION_FAILED, MSG_PING_SUCCESS, MSG_RANDM_ERR, MSG_REMOTE_CONNECT_ERR, MSG_REPEATED_ATTRIBUTE, MSG_SF_DEAD, MSG_SF_READY, MSG_SF_TERMINATED, MSG_STACKTRACE_FOLLOWS, MSG_START_COMP_TERMINATED, MSG_TERMINATE_SUCCESS, MSG_UNHANDLED_EXCEPTION, MSG_UNKNOWN_HOST, MSG_UNRESOLVED_REFERENCE, MSG_UNRESOLVED_REFERENCE_IN, MSG_UPDATE_SUCCESS, MSG_URL_NOT_FOUND, MSG_URL_TO_PARSE_NOT_FOUND, MSG_WARNING_LIVENESS_ENABLED, MSG_WARNING_STACKTRACE_DISABLED, MSG_WARNING_STACKTRACE_ENABLED, ROOT_MUST_BE_COMPONENT, WARN_NO_SECURITY
 
Constructor Summary
CSFComponentDescriptionImpl(Reference type, CSFComponentDescription parent, Context cxt, boolean eager)
          Constuctor.
 
Method Summary
 void addConstraint(Constraint constraint)
          Add a constraint to this component description
 void constraintResolve()
          Internal method that constraint resolves a parsed component.
 java.lang.Object copy()
          Creates a deep copy of the compiled component.
 java.util.Vector getConstraints()
          Return coonstraints for this component.
 java.util.Vector setConstraints(java.util.Vector constraints)
          Set new coonstraints for this component.
 java.util.Vector sfGetPhases()
          Public method to get the set of phases defined in the component.
 Phases sfResolvePhases(java.util.Vector phases)
          Public method to carry out specific resolution actions as defined by the phases provided.
protected  void subtype(SFComponentDescription superType)
          Overrides method in SFCOmponentDescriptionImpl Adds copying of constraints
 void writeOn(java.io.Writer ps, int indent)
          Writes this component description on a writer.
 
Methods inherited from class org.smartfrog.sfcore.languages.sf.sfcomponentdescription.SFComponentDescriptionImpl
clone, copyValue, copyVector, doLinkResolve, doPlaceResolve, doTypeResolve, getType, linkResolve, place, placeResolve, resolveType, setType, sfAsComponentDescription, sfResolve, sfResolvePhase, sfResolvePhases, toString, typeResolve
 
Methods inherited from class org.smartfrog.sfcore.componentdescription.ComponentDescriptionImpl
addSystemProperties, addSystemProperties, getClassComponentDescription, getClassComponentDescription, getEager, initLog, setContext, setEager, setParent, setPrimParent, sfAddAttribute, sfAttributeKeyFor, sfAttributes, sfCompleteName, sfCompleteNameSafe, sfComponentDescription, sfComponentDescription, sfComponentDescription, sfComponentDescription, sfComponentDescriptionFromStr, sfComponentDescriptionFromStr, sfComponentDescriptionFromStr, sfComponentDescriptionFromStr, sfContainsAttribute, sfContainsValue, sfContext, sfDiagnosticsReport, sfLog, sfParent, sfParentageChanged, sfPrimParent, sfRemoveAttribute, sfReplaceAttribute, sfResolve, sfResolveHere, sfResolveHere, sfResolveParent, sfValues, tabPad, visit, visit, visit, visit, writeOn
 
Methods inherited from class org.smartfrog.sfcore.reference.ReferenceResolverHelperImpl
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 class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.smartfrog.sfcore.languages.sf.sfcomponentdescription.SFComponentDescription
getType, setType
 
Methods inherited from interface org.smartfrog.sfcore.languages.sf.sfcomponentdescription.ComponentResolver
doLinkResolve, doPlaceResolve, doTypeResolve, linkResolve, placeResolve, typeResolve
 
Methods inherited from interface org.smartfrog.sfcore.parser.Phases
sfAsComponentDescription, sfResolvePhase, sfResolvePhases
 
Methods inherited from interface org.smartfrog.sfcore.languages.sf.sfcomponentdescription.ComponentResolver
doLinkResolve, doPlaceResolve, doTypeResolve, linkResolve, placeResolve, typeResolve
 

Field Detail

constraints

protected java.util.Vector constraints
The list of constraints associated with this component description

Constructor Detail

CSFComponentDescriptionImpl

public CSFComponentDescriptionImpl(Reference type,
                                   CSFComponentDescription parent,
                                   Context cxt,
                                   boolean eager)
Constuctor.

Parameters:
type - supertype for component
parent - parent component
cxt - context for description
eager - eager flag
Method Detail

setConstraints

public java.util.Vector setConstraints(java.util.Vector constraints)
Set new coonstraints for this component.

Specified by:
setConstraints in interface CSFComponentDescription
Parameters:
constraints - new constraints for description
Returns:
the previous constraints

getConstraints

public java.util.Vector getConstraints()
Return coonstraints for this component.

Specified by:
getConstraints in interface CSFComponentDescription
Returns:
the vector of constraints

copy

public java.lang.Object copy()
Creates a deep copy of the compiled component. Parent, type and eager flag are the same in the copy. Resolvers are blanked in the copy to avoid resolution confusion. Resolution data object reference is copied if it implements the Copying interface, otherwise the pointer is shared with the copy.

Specified by:
copy in interface Copying
Overrides:
copy in class SFComponentDescriptionImpl
Returns:
copy of component

constraintResolve

public void constraintResolve()
                       throws SmartFrogCompileResolutionException
Internal method that constraint resolves a parsed component.

Throws:
SmartFrogCompileResolutionException - failed to type resolve

sfResolvePhases

public Phases sfResolvePhases(java.util.Vector phases)
                       throws SmartFrogException
Public method to carry out specific resolution actions as defined by the phases provided.

Specified by:
sfResolvePhases in interface Phases
Overrides:
sfResolvePhases in class SFComponentDescriptionImpl
Parameters:
phases - a vector of strings defining the names of the phases
Returns:
the resultant Phases object, ready for the next phase action or convertion into the core ComponentDescription
Throws:
SmartFrogException - In case of SmartFrog system error

sfGetPhases

public java.util.Vector sfGetPhases()
Public method to get the set of phases defined in the component. This will either be the phaseList attribute, or the standard set defined as though the phaseList attribute had been defined phaseList ["type", "place", "sfConfig", "link", "function"]; The attribute is removed to tidy the definition, but the result is cached for later use

Specified by:
sfGetPhases in interface Phases
Overrides:
sfGetPhases in class SFComponentDescriptionImpl
Returns:
Vector of Phases

addConstraint

public void addConstraint(Constraint constraint)
Add a constraint to this component description

Specified by:
addConstraint in interface CSFComponentDescription
Parameters:
constraint - new constraints for description

subtype

protected void subtype(SFComponentDescription superType)
Overrides method in SFCOmponentDescriptionImpl Adds copying of constraints

Overrides:
subtype in class SFComponentDescriptionImpl
Parameters:
superType - super type to copy from

writeOn

public void writeOn(java.io.Writer ps,
                    int indent)
             throws java.io.IOException
Writes this component description on a writer. Used by toString. Should be used instead of toString to write large descriptions to file, since memory can become a problem given the LONG strings created

Specified by:
writeOn in interface PrettyPrinting
Overrides:
writeOn in class SFComponentDescriptionImpl
Parameters:
ps - writer to write on
indent - the indent to use for printing offset
Throws:
java.io.IOException - failure while writing

SmartFrog CORE 3.10.000

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