Dominique,
at the time we discussed a version API (autumn 1998) SUN had already betas
of JDK 1.2 available which contained
the java.lang.package.getImplementationVersion() and
java.lang.package.getSpecificationVersion() APIs.

Thus we decided that we didn't need to reinvent our own mechanism for OCF.

Unfortunately JDK 1.2 is deployed much slower than originally expected.

For the time being the only way to detect the version of OCF is to
check for the existence of specific classes that are unique to a specific
version:

The following lists some classes that indicate the version

only in OCF 1.0
=============
opencard.core.service.CardServiceInsufficientMemoryException
==> if class exists version is <= 1.0

since OCF 1.1
============
opencard.opt.service.CardServiceInsufficientMemoryException
==> if class exists version is > 1.0

only in OCF 1.1.1
==============
opencard.core.service.CardType
==> if class exists version is > 1.1

The code to test the existence of a class should look something like

/** The name of the class to test for. */
  private static String name =      "opencard.core.service.CardType";

try {
      Class       clazz  = Class.forName(name);
      } catch (Exception e) {
      // not OCF 1.1.1 ==> 1.1 or 1.0
    }


Peter Bendel, Smartcard Solutions,       Tel.: +49-7031-16-4650, Fax -4888
Dept. 4969, Bldg. 7103-01, Room 01-109        Lotus Notes:  bed@ibmde
IBM Pervasive Computing Division         Internet: [EMAIL PROTECTED]

Please visit the OpenCard Framework's homepage at http://www.opencard.org



Visit the OpenCard Framework's WWW site at http://www.opencard.org/ for
access to documentation, code, presentations, and OCF announcements.
-----------------------------------------------------------------------------
To unsubscribe from the OCF Mailing list, send a mail to
"[EMAIL PROTECTED]" with the word "unsubscribe" in the BODY of the
message.

Reply via email to