jautil
Class AvatarsEnv

java.lang.Object
  extended by jautil.AvatarsEnv

public class AvatarsEnv
extends java.lang.Object

A JA avatars environment provides information about the available avatars based on the JA options settings (JAOptions) and the current execution context (JAEnv). The avatars environment also keeps track of the identity of the currently selected selected avatar.


Field Summary
static java.lang.String ASD_XML_NAME
           
static java.lang.String AVATAR_DEF_NAME_ARP
           
static java.lang.String AVATAR_DEF_NAME_JARP
           
static java.lang.String AVATAR_DEF_STEM
           
static int AXI_ASD
          Avatar XML Index: for avatar's ASD file.
static int AXI_AVATAR_CONFIG
          Avatar XML Index: for avatar's configuration file.
static int AXI_COMMON_CONFIG
          Avatar XML Index: for common configuration file.
static int AXI_COUNT
          Total count of valid Avatar XML Indices.
static int AXI_NONMANUALS
          Avatar XML Index: for avatar's non-manuals file.
static java.lang.String COMMON_BASE_NAME
           
static java.lang.String CONFIG_XML_NAME
           
static java.lang.String NONMANUALS_XML_NAME
           
 
Constructor Summary
AvatarsEnv(JAOptions jaopts)
          Constructs a new avatars environment based on the given JA options collection.
 
Method Summary
 java.lang.String configBaseURL()
          Returns this environment's avatar configuration base URL.
 int countAvatars()
          Returns the number of avatars in this environment's avatar list.
 java.lang.String currentAvatar()
          Returns the name of this environment's currently selected avatar.
 java.lang.String[] getAvatars()
          Returns this environment's avatar list.
 byte[][] getCurrentXMLConfigTexts()
          Returns the texts of the XML configuration files for the current avatar, as byte arrays, whose indices are AXI_COMMON_CONFIG, etc.
 AvatarDefinitionAccess getDefinition(java.lang.String av, java.lang.String nonstdav, AsynchAvatarClient client)
          Tries to create a new AvatarAccess for the given avatar, and then to create and return a new AvatarDefinitionAccess based on the avatar access.
 boolean isCacheable(java.lang.String av)
          Indicates whether access to the given avatar is via a locally cacheable JAR file containing an access class.
 boolean isValidAvatar(java.lang.String av)
          Tests for the presence of the given name in the avatar list.
 void setAvatar(int aix)
          Sets this environment's currently selected avatar to be the one with the given index, which is required to be in the range [0..N), where N is the number of avatars, countAvatars().
 void setAvatar(java.lang.String av)
          Sets the given avatar to be the one currently selected in this environment, providing it is in the avatar list; otherwise makes no change.
 java.lang.String specialAvatarDefURL()
          Returns the special avatar definition URL on the first invocation, and null on any subsequent invocation.
 void terminate()
          Terminates this avatars environment, by terminating each of its cached data access objects.
 boolean usesDirectFiles(java.lang.String av)
          Indicates whether access to the given avatar is directly via files in a configuration directory.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMMON_BASE_NAME

public static final java.lang.String COMMON_BASE_NAME
See Also:
Constant Field Values

CONFIG_XML_NAME

public static final java.lang.String CONFIG_XML_NAME
See Also:
Constant Field Values

ASD_XML_NAME

public static final java.lang.String ASD_XML_NAME
See Also:
Constant Field Values

NONMANUALS_XML_NAME

public static final java.lang.String NONMANUALS_XML_NAME
See Also:
Constant Field Values

AVATAR_DEF_STEM

public static final java.lang.String AVATAR_DEF_STEM
See Also:
Constant Field Values

AVATAR_DEF_NAME_ARP

public static final java.lang.String AVATAR_DEF_NAME_ARP
See Also:
Constant Field Values

AVATAR_DEF_NAME_JARP

public static final java.lang.String AVATAR_DEF_NAME_JARP
See Also:
Constant Field Values

AXI_COMMON_CONFIG

public static final int AXI_COMMON_CONFIG
Avatar XML Index: for common configuration file.

See Also:
Constant Field Values

AXI_AVATAR_CONFIG

public static final int AXI_AVATAR_CONFIG
Avatar XML Index: for avatar's configuration file.

See Also:
Constant Field Values

AXI_ASD

public static final int AXI_ASD
Avatar XML Index: for avatar's ASD file.

See Also:
Constant Field Values

AXI_NONMANUALS

public static final int AXI_NONMANUALS
Avatar XML Index: for avatar's non-manuals file.

See Also:
Constant Field Values

AXI_COUNT

public static final int AXI_COUNT
Total count of valid Avatar XML Indices.

See Also:
Constant Field Values
Constructor Detail

AvatarsEnv

public AvatarsEnv(JAOptions jaopts)
Constructs a new avatars environment based on the given JA options collection.

Method Detail

countAvatars

public int countAvatars()
Returns the number of avatars in this environment's avatar list.


specialAvatarDefURL

public java.lang.String specialAvatarDefURL()
Returns the special avatar definition URL on the first invocation, and null on any subsequent invocation.


currentAvatar

public java.lang.String currentAvatar()
Returns the name of this environment's currently selected avatar.


getAvatars

public java.lang.String[] getAvatars()
Returns this environment's avatar list.


configBaseURL

public java.lang.String configBaseURL()
Returns this environment's avatar configuration base URL.


setAvatar

public void setAvatar(int aix)
Sets this environment's currently selected avatar to be the one with the given index, which is required to be in the range [0..N), where N is the number of avatars, countAvatars().


setAvatar

public void setAvatar(java.lang.String av)
Sets the given avatar to be the one currently selected in this environment, providing it is in the avatar list; otherwise makes no change.


getCurrentXMLConfigTexts

public byte[][] getCurrentXMLConfigTexts()
Returns the texts of the XML configuration files for the current avatar, as byte arrays, whose indices are AXI_COMMON_CONFIG, etc. .


isValidAvatar

public boolean isValidAvatar(java.lang.String av)
Tests for the presence of the given name in the avatar list.


terminate

public void terminate()
Terminates this avatars environment, by terminating each of its cached data access objects.


usesDirectFiles

public boolean usesDirectFiles(java.lang.String av)
Indicates whether access to the given avatar is directly via files in a configuration directory.


isCacheable

public boolean isCacheable(java.lang.String av)
Indicates whether access to the given avatar is via a locally cacheable JAR file containing an access class.


getDefinition

public AvatarDefinitionAccess getDefinition(java.lang.String av,
                                            java.lang.String nonstdav,
                                            AsynchAvatarClient client)
Tries to create a new AvatarAccess for the given avatar, and then to create and return a new AvatarDefinitionAccess based on the avatar access. If the required AvatarAccess is not immediately available, null is returned and the required avatar data is instead obtained asynchronously on completion of which process the given client is notified of the result.