public interface LifeCycle
Super-interface common to all lifecycles.
STATUS_INIT
status where every object goes
immediately after its creation,
STATUS_RELEASED
status where every object goes when the
release()
method is explicitly invoked;
getStatus()
method to retrieve the current object status;
release()
method to abruptly and recursively move an object in
the final STATUS_RELEASED
status.
RESULT_OK
, RESULT_INVALID_STATUS
and RESULT_GENERIC_ERROR
) that may returned by many JFT methods.
The three directs sub-interfaces of LifeCycle (JFT
, Context
and CommunicationLifeCycle
) add many other capabilities to this
interface.
Field Summary | |
---|---|
static int |
RESULT_GENERIC_ERROR
Generic failure-code returned when a more specific error is not available. |
static int |
RESULT_INVALID_STATUS
Failure-code returned when an operation is requested whitin a not correct status. |
static int |
RESULT_OK
Positive answer returned when the operation completed successfully. |
static int |
STATUS_INIT
Lifecycle status: initial status for every object that implements the LifeCycle interface. |
static int |
STATUS_RELEASED
Lifecycle status: final status for every object that implements the LifeCycle interface. |
Method Summary | |
---|---|
Enumeration |
enumChilds()
Returns an enumeration of all non- STATUS_RELEASED childs of
this LifeCycle. |
int |
getStatus()
Returns the current lifecycle status of this object. |
void |
release()
Abruptly and recursively move an object in the final STATUS_RELEASED status. |
Field Detail |
---|
static final int RESULT_OK
static final int RESULT_GENERIC_ERROR
static final int RESULT_INVALID_STATUS
static final int STATUS_INIT
LifeCycle
interface. getStatus()
.
STATUS_INIT
.
getStatus()
and other specific activities allowed in this
status for the specific subinterfaces of LifeCycle.
release()
→ STATUS_RELEASED
.
static final int STATUS_RELEASED
LifeCycle
interface. getStatus()
.
release()
→
STATUS_RELEASED
.
getStatus()
or other activities that does not depend from the
status of the object (e.g. JFT.getLibraryVersion()
in JFT,
CommunicationLifeCycle.getContext()
in CommunicationLifeCycle,
etc...).
Method Detail |
---|
void release()
STATUS_RELEASED
status.
This object, and all others objects that depends from this object (see
later), are abruptly moved on the final STATUS_RELEASED
status. For the objects in this final status:
STATUS_RELEASED
description),
Listener
method invocation
is never made.
STATUS_RELEASED
status. Please note:
JFT, all contexts, all other connections and all other childs of others
connections are unaffected by this operation in this example.
This method may be invoked at any time, even if this object is already in
the final STATUS_RELEASED
status.
int getStatus()
Each object has a status that may be one of the two commons LifeCycle
status (STATUS_INIT
or STATUS_RELEASED
) or a specific
status that is described by a constant STATUS_
described
in one of the subinterface of LifeCycle
.
Enumeration enumChilds()
STATUS_RELEASED
childs of
this LifeCycle.
The hierarchy is depicted in the release()
description.
This method returns only the first level childs of a given LifeCycle: e.g. for a Context it returns only the Connections of this Context and not their ActivityLifeCycle childs.
This method may be invoked at any time, even if this object is in the final STATUS_RELEASED status.
STATUS_RELEASED
childs of
this LifeCycle. null
is never returned.