Class AbstractMaleSocket
- java.lang.Object
-
- jmri.jmrit.logixng.implementation.AbstractMaleSocket
-
- All Implemented Interfaces:
PropertyChangeProvider
,Base
,Debugable
,MaleSocket
- Direct Known Subclasses:
AbstractDebuggerMaleSocket
,DefaultMaleAnalogActionSocket
,DefaultMaleAnalogExpressionSocket
,DefaultMaleDigitalActionSocket
,DefaultMaleDigitalBooleanActionSocket
,DefaultMaleDigitalExpressionSocket
,DefaultMaleStringActionSocket
,DefaultMaleStringExpressionSocket
,ModuleEditorMaleSocket
public abstract class AbstractMaleSocket extends java.lang.Object implements MaleSocket
The abstract class that is the base class for all LogixNG classes that implements the Base interface.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jmri.jmrit.logixng.Base
Base.PrintTreeSettings, Base.RunnableWithBase, Base.RunnableWithBaseThrowException
-
Nested classes/interfaces inherited from interface jmri.jmrit.logixng.Debugable
Debugable.DebugConfig
-
Nested classes/interfaces inherited from interface jmri.jmrit.logixng.MaleSocket
MaleSocket.ErrorHandlingType
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<SymbolTable.VariableData>
_localVariables
-
Fields inherited from interface jmri.jmrit.logixng.Base
PRINT_LINE_NUMBERS_FORMAT, PROPERTY_CHILD_COUNT, PROPERTY_CHILD_REORDER, PROPERTY_LAST_RESULT_CHANGED, PROPERTY_SOCKET_CONNECTED, PROPERTY_SOCKET_DISCONNECTED, SEPARATOR, SOCKET_CONNECTED, SOCKET_DISCONNECTED
-
-
Constructor Summary
Constructors Constructor Description AbstractMaleSocket(BaseManager<? extends NamedBean> manager, Base object)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addLocalVariable(java.lang.String name, SymbolTable.InitialValueType initialValueType, java.lang.String initialValueData)
void
addLocalVariable(SymbolTable.VariableData variableData)
void
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Add aPropertyChangeListener
to the listener list.void
addPropertyChangeListener(java.beans.PropertyChangeListener l, java.lang.String name, java.lang.String listenerRef)
Request a call-back when a bound property changes.void
addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener l)
Add aPropertyChangeListener
for a specific property.void
addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener l, java.lang.String name, java.lang.String listenerRef)
Request a call-back when a bound property changes.void
clearLocalVariables()
Base
deepCopyChildren(Base original, java.util.Map<java.lang.String,java.lang.String> systemNames, java.util.Map<java.lang.String,java.lang.String> userNames)
Do a deep copy of children from the original to me.void
dispose()
Deactivate this object, so that it releases as many resources as possible and no longer effects others.protected abstract void
disposeMe()
Disposes this object.boolean
getCatchAbortExecution()
Is the node catching AbortExecution or not?Category
getCategory()
Get the category.FemaleSocket
getChild(int index)
Get a child of this itemint
getChildCount()
Get the number of children.java.lang.String
getComment()
Get associated comment text.ConditionalNG
getConditionalNG()
Get the ConditionalNG of this item.Base
getDeepCopy(java.util.Map<java.lang.String,java.lang.String> systemNames, java.util.Map<java.lang.String,java.lang.String> userNames)
Create a deep copy of myself and my children The item needs to try to lookup itself in both systemNames and userNames to see if the user has given a new system name and/or a new user name.If no new system name is given, an auto system name is used.MaleSocket.ErrorHandlingType
getErrorHandlingType()
Get the error handling type for this socket.boolean
getListen()
Get whenether the node should listen to changes or not.java.lang.String
getListenerRef(java.beans.PropertyChangeListener l)
Get the textual reference for the specific listenerjava.util.ArrayList<java.lang.String>
getListenerRefs()
Returns a list of all the listeners referencesvoid
getListenerRefsIncludingChildren(java.util.List<java.lang.String> list)
Returns a list of all the listeners references for this object and all its children.java.util.List<SymbolTable.VariableData>
getLocalVariables()
LogixNG
getLogixNG()
Get the LogixNG of this item.java.lang.String
getLongDescription(java.util.Locale locale)
Get a long description of this item.BaseManager<? extends NamedBean>
getManager()
Get the manager that stores this socket.int
getNumPropertyChangeListeners()
Number of current listeners.Base
getObject()
Get the object that this male socket holds.Base
getParent()
Get the parent.java.beans.PropertyChangeListener[]
getPropertyChangeListeners()
Get allPropertyChangeListener
s currently attached to this object.java.beans.PropertyChangeListener[]
getPropertyChangeListeners(java.lang.String propertyName)
Get allPropertyChangeListener
s currently listening to changes to the specified property.java.beans.PropertyChangeListener[]
getPropertyChangeListenersByReference(java.lang.String name)
Get a list of all the property change listeners that are registered using a specific nameBase
getRoot()
Get the root of the tree that this item belongs to.java.lang.String
getShortDescription(java.util.Locale locale)
Get a short description of this item.java.lang.String
getSystemName()
Get the system name.void
getUsageDetail(int level, NamedBean bean, java.util.List<NamedBeanUsageReport> report, NamedBean cdl)
Add a new NamedBeanUsageReport to the report list if there are any matches in this action or expresssion.void
getUsageTree(int level, NamedBean bean, java.util.List<NamedBeanUsageReport> report, NamedBean cdl)
Navigate the LogixNG tree.java.lang.String
getUserName()
Get the user name.void
handleError(Base item, java.lang.String message, java.lang.RuntimeException e, org.slf4j.Logger log)
Handle an error that has happened during execution or evaluation of this item.void
handleError(Base item, java.lang.String message, java.util.List<java.lang.String> messageList, JmriException e, org.slf4j.Logger log)
Handle an error that has happened during execution or evaluation of this item.void
handleError(Base item, java.lang.String message, JmriException e, org.slf4j.Logger log)
Handle an error that has happened during execution or evaluation of this item.boolean
hasChild(Base b)
Does this item has the child b?boolean
isActive()
Is this item active?boolean
isLocked()
Is the node locked?boolean
isSystem()
Is the node a system node?protected void
printLocalVariable(Base.PrintTreeSettings settings, java.util.Locale locale, java.io.PrintWriter writer, java.lang.String currentIndent, MutableInt lineNumber, SymbolTable.VariableData localVariable)
void
printTree(Base.PrintTreeSettings settings, java.io.PrintWriter writer, java.lang.String indent, MutableInt lineNumber)
Print the tree to a stream.void
printTree(Base.PrintTreeSettings settings, java.util.Locale locale, java.io.PrintWriter writer, java.lang.String indent, java.lang.String currentIndent, MutableInt lineNumber)
Print the tree to a stream.void
printTree(Base.PrintTreeSettings settings, java.util.Locale locale, java.io.PrintWriter writer, java.lang.String indent, MutableInt lineNumber)
Print the tree to a stream.protected void
printTreeRow(Base.PrintTreeSettings settings, java.util.Locale locale, java.io.PrintWriter writer, java.lang.String currentIndent, MutableInt lineNumber)
Print this row.void
registerListeners()
Register listeners if this object needs that.protected abstract void
registerListenersForThisClass()
Register listeners if this object needs that.void
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Remove the specified listener from this object.void
removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener l)
Remove the specified listener of the specified property from this object.void
setCatchAbortExecution(boolean catchAbortExecution)
Set if the node should catch AbortExecution or not.void
setComment(java.lang.String comment)
Set associated comment text.void
setErrorHandlingType(MaleSocket.ErrorHandlingType errorHandlingType)
Set the error handling type for this socket.void
setListen(boolean listen)
Set whenether the node should listen to changes or not.void
setLocked(boolean locked)
Set if the node is locked or not.void
setParent(Base parent)
Set the parent.boolean
setParentForAllChildren(java.util.List<java.lang.String> errors)
Set the parent for all the children.void
setSystem(boolean system)
Set if the node is system or not.void
setUserName(java.lang.String s)
Get the user name.java.lang.String
toString()
void
unregisterListeners()
Unregister listeners if this object needs that.protected abstract void
unregisterListenersForThisClass()
Unregister listeners if this object needs that.void
updateListenerRef(java.beans.PropertyChangeListener l, java.lang.String newName)
void
vetoableChange(java.beans.PropertyChangeEvent evt)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jmri.jmrit.logixng.Base
doSocketOperation, existsInTree, forEntireTree, forEntireTreeWithException, getLongDescription, getModule, getShortDescription, isSocketOperationAllowed, printTree, printTree
-
Methods inherited from interface jmri.jmrit.logixng.Debugable
createDebugConfig, getDebugConfig, setDebugConfig
-
Methods inherited from interface jmri.jmrit.logixng.MaleSocket
find, isEnabled, isSupportingLocalVariables, setEnabled, setEnabledFlag, setup
-
-
-
-
Field Detail
-
_localVariables
protected final java.util.List<SymbolTable.VariableData> _localVariables
-
-
Constructor Detail
-
AbstractMaleSocket
public AbstractMaleSocket(BaseManager<? extends NamedBean> manager, Base object)
-
-
Method Detail
-
getObject
public final Base getObject()
Get the object that this male socket holds. This method is used when the object is going to be configured.- Specified by:
getObject
in interfaceMaleSocket
- Returns:
- the object this male socket holds
-
isLocked
public boolean isLocked()
Is the node locked?- Specified by:
isLocked
in interfaceMaleSocket
- Returns:
- true if locked, false otherwise
-
setLocked
public void setLocked(boolean locked)
Set if the node is locked or not.- Specified by:
setLocked
in interfaceMaleSocket
- Parameters:
locked
- true if locked, false otherwise
-
isSystem
public boolean isSystem()
Is the node a system node?- Specified by:
isSystem
in interfaceMaleSocket
- Returns:
- true if system, false otherwise
-
setSystem
public void setSystem(boolean system)
Set if the node is system or not.- Specified by:
setSystem
in interfaceMaleSocket
- Parameters:
system
- true if system, false otherwise
-
getCategory
public final Category getCategory()
Get the category.- Specified by:
getCategory
in interfaceBase
- Returns:
- the category
-
getChild
public final FemaleSocket getChild(int index) throws java.lang.IllegalArgumentException, java.lang.UnsupportedOperationException
Description copied from interface:Base
Get a child of this item
-
getChildCount
public final int getChildCount()
Description copied from interface:Base
Get the number of children.- Specified by:
getChildCount
in interfaceBase
- Returns:
- the number of children
-
getShortDescription
public final java.lang.String getShortDescription(java.util.Locale locale)
Description copied from interface:Base
Get a short description of this item.- Specified by:
getShortDescription
in interfaceBase
- Parameters:
locale
- The locale to be used- Returns:
- a short description
-
getLongDescription
public final java.lang.String getLongDescription(java.util.Locale locale)
Description copied from interface:Base
Get a long description of this item.- Specified by:
getLongDescription
in interfaceBase
- Parameters:
locale
- The locale to be used- Returns:
- a long description
-
getUserName
public final java.lang.String getUserName()
Description copied from interface:Base
Get the user name.- Specified by:
getUserName
in interfaceBase
- Returns:
- the user name
-
setUserName
public final void setUserName(java.lang.String s) throws NamedBean.BadUserNameException
Description copied from interface:Base
Get the user name.- Specified by:
setUserName
in interfaceBase
- Parameters:
s
- the new user name- Throws:
NamedBean.BadUserNameException
-
getSystemName
public final java.lang.String getSystemName()
Description copied from interface:Base
Get the system name.- Specified by:
getSystemName
in interfaceBase
- Returns:
- the system name
-
addPropertyChangeListener
public final void addPropertyChangeListener(java.beans.PropertyChangeListener l, java.lang.String name, java.lang.String listenerRef)
Description copied from interface:Base
Request a call-back when a bound property changes. Bound properties are the known state, commanded state, user and system names.- Specified by:
addPropertyChangeListener
in interfaceBase
- Parameters:
l
- The listener. This may change in the future to be a subclass of NamedProprtyChangeListener that carries the name and listenerRef values internallyname
- The name (either system or user) that the listener uses for this namedBean, this parameter is used to help determine when which listeners should be moved when the username is moved from one bean to anotherlistenerRef
- A textual reference for the listener, that can be presented to the user when a delete is called
-
addPropertyChangeListener
public final void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener l, java.lang.String name, java.lang.String listenerRef)
Description copied from interface:Base
Request a call-back when a bound property changes. Bound properties are the known state, commanded state, user and system names.- Specified by:
addPropertyChangeListener
in interfaceBase
- Parameters:
propertyName
- The name of the property to listen tol
- The listener. This may change in the future to be a subclass of NamedProprtyChangeListener that carries the name and listenerRef values internallyname
- The name (either system or user) that the listener uses for this namedBean, this parameter is used to help determine when which listeners should be moved when the username is moved from one bean to anotherlistenerRef
- A textual reference for the listener, that can be presented to the user when a delete is called
-
addPropertyChangeListener
public final void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Description copied from interface:PropertyChangeProvider
Add aPropertyChangeListener
to the listener list.- Specified by:
addPropertyChangeListener
in interfacePropertyChangeProvider
- Parameters:
l
- The PropertyChangeListener to be added
-
addPropertyChangeListener
public final void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener l)
Description copied from interface:PropertyChangeProvider
Add aPropertyChangeListener
for a specific property.- Specified by:
addPropertyChangeListener
in interfacePropertyChangeProvider
- Parameters:
propertyName
- The name of the property to listen on.l
- The PropertyChangeListener to be added
-
removePropertyChangeListener
public final void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Description copied from interface:PropertyChangeProvider
Remove the specified listener from this object.- Specified by:
removePropertyChangeListener
in interfacePropertyChangeProvider
- Parameters:
l
- ThePropertyChangeListener
to remove.
-
removePropertyChangeListener
public final void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener l)
Description copied from interface:PropertyChangeProvider
Remove the specified listener of the specified property from this object.- Specified by:
removePropertyChangeListener
in interfacePropertyChangeProvider
- Parameters:
propertyName
- The name of the property to stop listening to.l
- ThePropertyChangeListener
to remove.
-
updateListenerRef
public final void updateListenerRef(java.beans.PropertyChangeListener l, java.lang.String newName)
- Specified by:
updateListenerRef
in interfaceBase
-
vetoableChange
public final void vetoableChange(java.beans.PropertyChangeEvent evt) throws java.beans.PropertyVetoException
- Specified by:
vetoableChange
in interfaceBase
- Throws:
java.beans.PropertyVetoException
-
getListenerRef
public final java.lang.String getListenerRef(java.beans.PropertyChangeListener l)
Description copied from interface:Base
Get the textual reference for the specific listener- Specified by:
getListenerRef
in interfaceBase
- Parameters:
l
- the listener of interest- Returns:
- the textual reference
-
getListenerRefs
public final java.util.ArrayList<java.lang.String> getListenerRefs()
Description copied from interface:Base
Returns a list of all the listeners references- Specified by:
getListenerRefs
in interfaceBase
- Returns:
- a list of textual references
-
getNumPropertyChangeListeners
public final int getNumPropertyChangeListeners()
Description copied from interface:Base
Number of current listeners. May return -1 if the information is not available for some reason.- Specified by:
getNumPropertyChangeListeners
in interfaceBase
- Returns:
- the number of listeners.
-
getPropertyChangeListeners
public final java.beans.PropertyChangeListener[] getPropertyChangeListeners()
Description copied from interface:PropertyChangeProvider
Get allPropertyChangeListener
s currently attached to this object.- Specified by:
getPropertyChangeListeners
in interfacePropertyChangeProvider
- Returns:
- An array of PropertyChangeListeners.
-
getPropertyChangeListeners
public final java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String propertyName)
Description copied from interface:PropertyChangeProvider
Get allPropertyChangeListener
s currently listening to changes to the specified property.- Specified by:
getPropertyChangeListeners
in interfacePropertyChangeProvider
- Parameters:
propertyName
- the name of the property of interest- Returns:
- an array of PropertyChangeListeners
-
getPropertyChangeListenersByReference
public final java.beans.PropertyChangeListener[] getPropertyChangeListenersByReference(java.lang.String name)
Description copied from interface:Base
Get a list of all the property change listeners that are registered using a specific name- Specified by:
getPropertyChangeListenersByReference
in interfaceBase
- Parameters:
name
- The name (either system or user) that the listener has registered as referencing this namedBean- Returns:
- empty list if none
-
getComment
public java.lang.String getComment()
Description copied from interface:Base
Get associated comment text. A LogixNG comment can have multiple lines, separated with \n.- Specified by:
getComment
in interfaceBase
- Returns:
- the comment or null
-
setComment
public void setComment(java.lang.String comment)
Description copied from interface:Base
Set associated comment text.Comments can be any valid text.
- Specified by:
setComment
in interfaceBase
- Parameters:
comment
- the comment or null to remove an existing comment
-
getListen
public boolean getListen()
Description copied from interface:MaleSocket
Get whenether the node should listen to changes or not.- Specified by:
getListen
in interfaceMaleSocket
- Returns:
- true if listen, false if not listen
-
setListen
public void setListen(boolean listen)
Description copied from interface:MaleSocket
Set whenether the node should listen to changes or not.- Specified by:
setListen
in interfaceMaleSocket
- Parameters:
listen
- true if listen, false if not listen
-
getCatchAbortExecution
public boolean getCatchAbortExecution()
Description copied from interface:MaleSocket
Is the node catching AbortExecution or not?- Specified by:
getCatchAbortExecution
in interfaceMaleSocket
- Returns:
- true if catching, false otherwise
-
setCatchAbortExecution
public void setCatchAbortExecution(boolean catchAbortExecution)
Description copied from interface:MaleSocket
Set if the node should catch AbortExecution or not.- Specified by:
setCatchAbortExecution
in interfaceMaleSocket
- Parameters:
catchAbortExecution
- true if catch, false otherwise
-
addLocalVariable
public void addLocalVariable(java.lang.String name, SymbolTable.InitialValueType initialValueType, java.lang.String initialValueData)
- Specified by:
addLocalVariable
in interfaceMaleSocket
-
addLocalVariable
public void addLocalVariable(SymbolTable.VariableData variableData)
- Specified by:
addLocalVariable
in interfaceMaleSocket
-
clearLocalVariables
public void clearLocalVariables()
- Specified by:
clearLocalVariables
in interfaceMaleSocket
-
getLocalVariables
public java.util.List<SymbolTable.VariableData> getLocalVariables()
- Specified by:
getLocalVariables
in interfaceMaleSocket
-
getParent
public Base getParent()
Description copied from interface:Base
Get the parent.The following rules apply
- LogixNGs has no parent. The method throws an UnsupportedOperationException if called.
- Expressions and actions has the male socket that they are connected to as their parent.
- Male sockets has the female socket that they are connected to as their parent.
- The parent of a female sockets is the LogixNG, expression or action that has this female socket.
- The parent of a male sockets is the same parent as the expression or action that it contains.
-
setParent
public void setParent(Base parent)
Description copied from interface:Base
Set the parent.The following rules apply
- ExecutionGroups has no parent. The method throws an UnsupportedOperationException if called.
- LogixNGs has the execution group as its parent.
- Expressions and actions has the male socket that they are connected to as their parent.
- Male sockets has the female socket that they are connected to as their parent.
- The parent of a female sockets is the LogixNG, expression or action that has this female socket.
- The parent of a male sockets is the same parent as the expression or action that it contains.
-
getConditionalNG
public final ConditionalNG getConditionalNG()
Description copied from interface:Base
Get the ConditionalNG of this item.- Specified by:
getConditionalNG
in interfaceBase
- Returns:
- the ConditionalNG that owns this item
-
getLogixNG
public final LogixNG getLogixNG()
Description copied from interface:Base
Get the LogixNG of this item.- Specified by:
getLogixNG
in interfaceBase
- Returns:
- the LogixNG that owns this item
-
setParentForAllChildren
public final boolean setParentForAllChildren(java.util.List<java.lang.String> errors)
Set the parent for all the children.- Specified by:
setParentForAllChildren
in interfaceBase
- Parameters:
errors
- a list of potential errors- Returns:
- true if success, false otherwise
-
registerListenersForThisClass
protected abstract void registerListenersForThisClass()
Register listeners if this object needs that.Important: This method may be called more than once. Methods overriding this method must ensure that listeners are not registered more than once.
-
unregisterListenersForThisClass
protected abstract void unregisterListenersForThisClass()
Unregister listeners if this object needs that.Important: This method may be called more than once. Methods overriding this method must ensure that listeners are not unregistered more than once.
-
registerListeners
public final void registerListeners()
Register listeners if this object needs that.Important: This method may be called more than once. Methods overriding this method must ensure that listeners are not registered more than once.
- Specified by:
registerListeners
in interfaceBase
-
unregisterListeners
public final void unregisterListeners()
Unregister listeners if this object needs that.Important: This method may be called more than once. Methods overriding this method must ensure that listeners are not unregistered more than once.
- Specified by:
unregisterListeners
in interfaceBase
-
isActive
public final boolean isActive()
Is this item active? If this item is enabled and all the parents are enabled, this item is active.
-
printTreeRow
protected void printTreeRow(Base.PrintTreeSettings settings, java.util.Locale locale, java.io.PrintWriter writer, java.lang.String currentIndent, MutableInt lineNumber)
Print this row. If getObject() doesn't return an AbstractMaleSocket, print this row.If a male socket that extends AbstractMaleSocket wants to print something here, it needs to override this method.
The reason this method doesn't print if getObject() returns an AbstractMaleSocket is to protect so it doesn't print itself twice if it's embedding an other AbstractMaleSocket. An example of this is the AbstractDebuggerMaleSocket which embeds other male sockets.
- Parameters:
settings
- settings for what to printlocale
- The locale to be usedwriter
- the stream to print the tree tocurrentIndent
- the current indentationlineNumber
- the line number
-
printLocalVariable
protected void printLocalVariable(Base.PrintTreeSettings settings, java.util.Locale locale, java.io.PrintWriter writer, java.lang.String currentIndent, MutableInt lineNumber, SymbolTable.VariableData localVariable)
-
printTree
public void printTree(Base.PrintTreeSettings settings, java.io.PrintWriter writer, java.lang.String indent, MutableInt lineNumber)
Print the tree to a stream.
-
printTree
public void printTree(Base.PrintTreeSettings settings, java.util.Locale locale, java.io.PrintWriter writer, java.lang.String indent, MutableInt lineNumber)
Print the tree to a stream.
-
printTree
public void printTree(Base.PrintTreeSettings settings, java.util.Locale locale, java.io.PrintWriter writer, java.lang.String indent, java.lang.String currentIndent, MutableInt lineNumber)
Print the tree to a stream.
-
getUsageTree
public void getUsageTree(int level, NamedBean bean, java.util.List<NamedBeanUsageReport> report, NamedBean cdl)
Navigate the LogixNG tree.- Specified by:
getUsageTree
in interfaceBase
- Parameters:
level
- The current recursion level for debugging.bean
- The named bean that is the object of the search.report
- A list of NamedBeanUsageReport usage reports.cdl
- The current ConditionalNG bean. Null for Module searches since there is no conditional
-
getUsageDetail
public void getUsageDetail(int level, NamedBean bean, java.util.List<NamedBeanUsageReport> report, NamedBean cdl)
Add a new NamedBeanUsageReport to the report list if there are any matches in this action or expresssion.NamedBeanUsageReport Usage keys:
- LogixNGAction
- LogixNGExpression
- Specified by:
getUsageDetail
in interfaceBase
- Parameters:
level
- The current recursion level for debugging.bean
- The named bean that is the object of the search.report
- A list of NamedBeanUsageReport usage reports.cdl
- The current ConditionalNG bean. Null for Module searches since there is no conditional
-
getManager
public BaseManager<? extends NamedBean> getManager()
Description copied from interface:MaleSocket
Get the manager that stores this socket. This method is used when the object is going to be configured.- Specified by:
getManager
in interfaceMaleSocket
- Returns:
- the manager
-
getDeepCopy
public final Base getDeepCopy(java.util.Map<java.lang.String,java.lang.String> systemNames, java.util.Map<java.lang.String,java.lang.String> userNames) throws JmriException
Description copied from interface:Base
Create a deep copy of myself and my children The item needs to try to lookup itself in both systemNames and userNames to see if the user has given a new system name and/or a new user name.If no new system name is given, an auto system name is used. If no user name is given, a null user name is used.- Specified by:
getDeepCopy
in interfaceBase
- Parameters:
systemNames
- a map of old and new system nameuserNames
- a map of old system name and new user name- Returns:
- a deep copy
- Throws:
JmriException
- in case of an error
-
deepCopyChildren
public final Base deepCopyChildren(Base original, java.util.Map<java.lang.String,java.lang.String> systemNames, java.util.Map<java.lang.String,java.lang.String> userNames) throws JmriException
Description copied from interface:Base
Do a deep copy of children from the original to me.- Specified by:
deepCopyChildren
in interfaceBase
- Parameters:
original
- the item to copy fromsystemNames
- a map of old and new system nameuserNames
- a map of old system name and new user name- Returns:
- myself
- Throws:
JmriException
- in case of an error
-
disposeMe
protected abstract void disposeMe()
Disposes this object. This must remove _all_ connections!
-
dispose
public final void dispose()
Deactivate this object, so that it releases as many resources as possible and no longer effects others.For example, if this object has listeners, after a call to this method it should no longer notify those listeners. Any native or system-wide resources it maintains should be released, including threads, files, etc.
It is an error to invoke any other methods on this object once dispose() has been called. Note, however, that there is no guarantee about behavior in that case.
Afterwards, references to this object may still exist elsewhere, preventing its garbage collection. But it's formally dead, and shouldn't be keeping any other objects alive. Therefore, this method should null out any references to other objects that this object contained.
-
getErrorHandlingType
public MaleSocket.ErrorHandlingType getErrorHandlingType()
Description copied from interface:MaleSocket
Get the error handling type for this socket.- Specified by:
getErrorHandlingType
in interfaceMaleSocket
- Returns:
- the error handling type
-
setErrorHandlingType
public void setErrorHandlingType(MaleSocket.ErrorHandlingType errorHandlingType)
Description copied from interface:MaleSocket
Set the error handling type for this socket.- Specified by:
setErrorHandlingType
in interfaceMaleSocket
- Parameters:
errorHandlingType
- the error handling type
-
handleError
public void handleError(Base item, java.lang.String message, JmriException e, org.slf4j.Logger log) throws JmriException
Description copied from interface:MaleSocket
Handle an error that has happened during execution or evaluation of this item.- Specified by:
handleError
in interfaceMaleSocket
- Parameters:
item
- the item that had the errormessage
- the error messagee
- the exception that has happenedlog
- the logger- Throws:
JmriException
- if the male socket is configured to throw an exception
-
handleError
public void handleError(Base item, java.lang.String message, java.util.List<java.lang.String> messageList, JmriException e, org.slf4j.Logger log) throws JmriException
Description copied from interface:MaleSocket
Handle an error that has happened during execution or evaluation of this item.- Specified by:
handleError
in interfaceMaleSocket
- Parameters:
item
- the item that had the errormessage
- the error messagemessageList
- a list of error messagese
- the exception that has happenedlog
- the logger- Throws:
JmriException
- if the male socket is configured to throw an exception
-
handleError
public void handleError(Base item, java.lang.String message, java.lang.RuntimeException e, org.slf4j.Logger log) throws JmriException
Description copied from interface:MaleSocket
Handle an error that has happened during execution or evaluation of this item.- Specified by:
handleError
in interfaceMaleSocket
- Parameters:
item
- the item that had the errormessage
- the error messagee
- the exception that has happenedlog
- the logger- Throws:
JmriException
- if the male socket is configured to throw an exception
-
getListenerRefsIncludingChildren
public void getListenerRefsIncludingChildren(java.util.List<java.lang.String> list)
Returns a list of all the listeners references for this object and all its children.- Specified by:
getListenerRefsIncludingChildren
in interfaceBase
- Parameters:
list
- a list of textual references
-
hasChild
public boolean hasChild(@Nonnull Base b)
Description copied from interface:Base
Does this item has the child b?
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-