CON
- The type of the connection to be used.public class ConnectionAutomatonImpl<CON> extends Object implements ConnectionComponent.ConnectionAutomaton<CON>
ConnectionComponent.ConnectionAutomaton
.ConnectionComponent.ConnectionAutomaton<CON>
ConnectionOpenable.ConnectionOpenAutomaton<CON>
OpenedAccessor.OpenedMutator, OpenedAccessor.OpenedProperty
Closable.CloseAutomaton
ClosedAccessor.ClosedMutator, ClosedAccessor.ClosedProperty
ConnectionStatusAccessor.ConnectionStatusMutator, ConnectionStatusAccessor.ConnectionStatusProperty
Modifier and Type | Field and Description |
---|---|
protected ConnectionComponent<CON> |
_connectionComponent |
Constructor and Description |
---|
ConnectionAutomatonImpl()
Empty constructor, such
LifeCycleComponent.LifeCycleAutomaton cannot do much more
than decline the various LifeCycleStatus states for you. |
ConnectionAutomatonImpl(ConnectionComponent<CON> aConnectionComponent)
This constructor uses a
LifeCycleStatus for wrapping it inside
the ConnectionAutomatonImpl , making sure of obeying and guarding
the correct LifeCycleStatus 's order of LifeCycleStatus
states for you. |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the component's connection(s).
|
ConnectionStatus |
getConnectionStatus()
Retrieves the
ConnectionStatus property from the property. |
boolean |
isClosable()
Determines whether the component's connection(s) may get closed.
|
boolean |
isClosed()
Retrieves the is-closed status.
|
boolean |
isOpenable(CON aConnection)
Determines whether the given connection may get opened, if true then
component may open a connection with the given connection via the
ConnectionOpenable.open(Object) method. |
boolean |
isOpened()
Retrieves the is-opened property from the opened property.
|
void |
open(CON aConnection)
Opens the component with the given connection, the component opens a
connection with the given connection.
|
protected ConnectionComponent<CON> _connectionComponent
public ConnectionAutomatonImpl()
LifeCycleComponent.LifeCycleAutomaton
cannot do much more
than decline the various LifeCycleStatus
states for you.public ConnectionAutomatonImpl(ConnectionComponent<CON> aConnectionComponent)
LifeCycleStatus
for wrapping it inside
the ConnectionAutomatonImpl
, making sure of obeying and guarding
the correct LifeCycleStatus
's order of LifeCycleStatus
states for you.aConnectionComponent
- The component to be guarded regarding the
correct declination of the LifeCycleStatus
states.public ConnectionStatus getConnectionStatus()
ConnectionStatusAccessor
ConnectionStatus
property from the property.
Determines in which ConnectionStatus
status a component is in.getConnectionStatus
in interface ConnectionStatusAccessor
ConnectionStatus
property stored by the
property.public boolean isOpenable(CON aConnection)
ConnectionOpenable.ConnectionOpenAutomaton
ConnectionOpenable.open(Object)
method. Usually no physical connection is
established; usually criteria describing the provided connection are
evaluated; for example the connection is tested against a black list,
a white list or against well-formedness or whether the specified
protocols are supported (in case of a connection being a String URL
beginning with "http://", "ftp://" or similar).
---------------------------------------------------------------------
CAUTION: Even in case true is returned, the actual opening of a
connection may fail (e.g. due to network failure or authentication
issues).
---------------------------------------------------------------------isOpenable
in interface ConnectionOpenable.ConnectionOpenAutomaton<CON>
aConnection
- The connection for which to determine whether it
can be used to open a connection.ConnectionOpenable.open(Object)
is theoretically possible.public void open(CON aConnection) throws OpenException
ConnectionOpenable
open
in interface ConnectionOpenable<CON>
aConnection
- The connection used for opening the connection.OpenException
- Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.public boolean isOpened()
OpenedAccessor
Openable.open()
or
ConnectionOpenable.open(Object)
.isOpened
in interface OpenedAccessor
public boolean isClosable()
Closable.CloseAutomaton
isClosable
in interface Closable.CloseAutomaton
Closable.close()
is possible.public boolean isClosed()
ClosedAccessor
Closable.close()
.isClosed
in interface ClosedAccessor
public void close()
Closable
Destroyable.destroy()
method, which must not throw
any exception as well.Copyright © 2015. All rights reserved.