CON - The type of the connection to be used.Closable, Closable.CloseAutomaton, ClosedAccessor, ConnectionComponent<CON>, ConnectionComponent.ConnectionAutomaton<CON>, ConnectionOpenable<CON>, ConnectionOpenable.ConnectionOpenAutomaton<CON>, ConnectionStatusAccessor, OpenedAccessorpublic class ConnectionAutomatonImpl<CON> extends Object implements ConnectionComponent.ConnectionAutomaton<CON>
ConnectionComponent.ConnectionAutomaton.Closable.CloseAutomaton, Closable.CloseBuilder<B extends Closable.CloseBuilder<B>>ClosedAccessor.ClosedMutator, ClosedAccessor.ClosedPropertyConnectionComponent.ConnectionAutomaton<CON>, ConnectionComponent.ConnectionComponentBuilder<CON,B extends ConnectionComponent.ConnectionComponentBuilder<CON,B>>ConnectionOpenable.ConnectionOpenAutomaton<CON>, ConnectionOpenable.ConnectionOpenBuilder<CON,B extends ConnectionOpenable.ConnectionOpenBuilder<CON,B>>ConnectionStatusAccessor.ConnectionStatusMutator, ConnectionStatusAccessor.ConnectionStatusPropertyOpenedAccessor.OpenedMutator, OpenedAccessor.OpenedProperty| Modifier and Type | Field | Description |
|---|---|---|
protected ConnectionComponent<CON> |
_connectionComponent |
| Constructor | 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 | 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.
|
closeIn, closeQuietly, closeUncheckedopenUncheckedisConnectionOpenedprotected 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()
ConnectionStatus property from the property.
Determines in which ConnectionStatus status a component is in.getConnectionStatus in interface ConnectionStatusAccessorConnectionStatus property stored by the
property.public boolean isOpenable(CON aConnection)
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
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()
Openable.open() or
ConnectionOpenable.open(Object).isOpened in interface OpenedAccessorpublic boolean isClosable()
isClosable in interface Closable.CloseAutomatonClosable.close() is possible.public boolean isClosed()
Closable.close().isClosed in interface ClosedAccessorpublic void close()
CloseException as
upon close we may have to do things like flushing buffers which can fail
(and would otherwise fail unhandled or even worse unnoticed).Copyright © 2018. All rights reserved.