|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectds.ov2.util.Registered_protocols
public class Registered_protocols
Service class for the registered protocols of one applet. This class provides the common functionality for the array of protocols of an applet. The applet specific code must allocate and maintain the protocols array. Everything else (consistency checking, protocol ID setting, protocol lookup) is done here.
Every applet should have precisely one instance of this class
(through this is not enforced). In the applet this instance must be
registered with Protocol_applet.set_registered_protocols
. Newly selected protocols
will then be looked up with get_protocol
of
this instance. The registration with Protocol_applet.set_registered_protocols
must be done manually at
initialization time, before the applet is selected.
During initialization or whenever the list of protocol changes
(because of delayed protocol initialization, for instance) the
applet specific code calls set_protocols
on
the only instance of this class. The instance then stores an alias
of the externally allocated protocols array for its operation and
computes the necessary data to use this new protocols array.
Field Summary | |
---|---|
private short |
max_protocol_index
The first nonaccessible protocol index. |
private Protocol[] |
protocols
Alias to the array of all supported protocols. |
Constructor Summary | |
---|---|
Registered_protocols()
Normal, empty constructor. |
|
Registered_protocols(Protocol[] protocols)
Convenience constructor, incorporating a call to set_protocols . |
Method Summary | |
---|---|
private void |
check_protocols()
Consistency check for the protocol array. |
short |
get_max_protocol_index()
Return max_protocol_index . |
Protocol |
get_protocol(short ins)
Select protocol. |
Protocol[] |
get_protocols()
Return the protocols array. |
void |
set_protocols(Protocol[] protocols)
(Re-)Initialize the protocols array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Protocol[] protocols
set_protocols
to register a new or changed
array.
get_protocols()
private short max_protocol_index
set_protocols
.
get_max_protocol_index()
Constructor Detail |
---|
public Registered_protocols()
public Registered_protocols(Protocol[] protocols)
set_protocols
.
protocols
- the array of registered protocols, as for
set_protocols
Method Detail |
---|
public Protocol[] get_protocols()
set_protocols
must be called before the next protocol is
selected. This is necessary even if the array itself stays the
same and only fields in the array are changed.
public short get_max_protocol_index()
max_protocol_index
.
private void check_protocols()
max_protocol_index
are non-null
public void set_protocols(Protocol[] protocols)
protocols
. In addition, this method determins max_protocol_index
as the maximal index such that all entries
less than max_protocol_index
in protocols
are
non-null.
This method can be called several times, for instance to make delayed protocols available at a later stage.
Internally the protocols
argument is not copied, only
an alias is stored. Changing the protocols array is permitted
under the condition that the currently running protocol does
not change its position in the array and remains itself
unchanged.
After changing, set_protocols
must be called before the next
protocol is selected. This is necessary even if the array
itself stays the same and only fields in the array are changed.
protocols
- the protocols array, must be non-null but may
contain null references. Only protocols before the first null
reference get activated.public Protocol get_protocol(short ins)
ins
or null if ins
is greater than max_protocol_index
. (The argument ins
is the INS byte
of the first APDU of the first step of a newly selected
protocol.)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |