public class DatabaseTableCreator extends LimitedFiringSource
Entity.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
protected java.sql.Connection |
_db
A JDBC database connection.
|
protected boolean |
createTableIfNotExisted |
PortParameter |
createTableIfNotExistParam
Flag indicates to create the table if the table doesn't exist
|
PortParameter |
dbParams
Parameter to access a database.
|
protected java.lang.String |
sqlScript |
PortParameter |
sqlScriptParam
A sql script to create the table
|
TypedIOPort |
statusPort
Output of this actor.
|
protected java.lang.String |
tableName |
PortParameter |
tableNameParam
The name of the table which will be created
|
_firingCountLimit, _iterationCount, firingCountLimit
_triggered, output, trigger
_typesValid
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
COMPLETED, NOT_READY, STOP_ITERATING
Constructor and Description |
---|
DatabaseTableCreator(CompositeEntity container,
java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
attributeChanged(Attribute attribute)
Reconfigure actor when certain attributes change.
|
void |
fire()
If connection is closed, open a new one.
|
protected void |
getConnection()
Get the database connection.
|
void |
initialize()
Close the connection if open.
|
void |
wrapup()
Close the connection if open.
|
postfire
_customTypeConstraints, prefire
_containedTypeConstraints, _defaultTypeConstraints, _fireAt, _fireAt, attributeTypeChanged, clone, clone, isBackwardTypeInferenceEnabled, newPort, typeConstraintList, typeConstraints
_actorFiring, _actorFiring, _declareDelayDependency, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, declareDelayDependency, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, preinitialize, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, stop, stopFire, terminate
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName
_addPort, _description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
isFireFunctional, isStrict, iterate, stop, stopFire, terminate
addInitializable, preinitialize, removeInitializable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
getDerivedLevel, getDerivedList, propagateValue
public TypedIOPort statusPort
public PortParameter tableNameParam
public PortParameter createTableIfNotExistParam
public PortParameter sqlScriptParam
public PortParameter dbParams
protected java.sql.Connection _db
protected java.lang.String tableName
protected boolean createTableIfNotExisted
protected java.lang.String sqlScript
public DatabaseTableCreator(CompositeEntity container, java.lang.String name) throws NameDuplicationException, IllegalActionException
public void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class LimitedFiringSource
IllegalActionException
- If the parent class throws it,
which could occur if, for example, the director will not accept
sequence actors.public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged
in class LimitedFiringSource
attribute
- The changed Attribute.IllegalActionException
public void fire() throws IllegalActionException
fire
in interface Executable
fire
in class Source
IllegalActionException
- Not thrown in this base class.public void wrapup() throws IllegalActionException
wrapup
in interface Initializable
wrapup
in class AtomicActor<TypedIOPort>
IllegalActionException
- Not thrown in this base class.protected void getConnection() throws IllegalActionException
IllegalActionException