Class DefaultClientProfile
The profile returned by this class depends on the SAMP_HUB environment
variable (HUBLOC_ENV
).
If it consists of the prefix "jsamp-class:
"
(HUBLOC_CLASS_PREFIX
) followed by the classname of a class
which implements ClientProfile
and has a no-arg constructor,
then an instance of the named class is used.
Otherwise, an instance of StandardClientProfile
or
WebClientProfile
is returned.
- Since:
- 4 Aug 2009
- Author:
- Mark Taylor
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic ClientProfile
Returns a ClientProfile instance suitable for general purpose use.static void
setProfile
(ClientProfile profile) Sets the profile object which will be returned bygetProfile()
.
-
Field Details
-
HUBLOC_ENV
Environment variable used for hub location ("SAMP_HUB").- See Also:
-
HUBLOC_CLASS_PREFIX
Prefix for SAMP_HUB env var indicating a supplied ClientProfile implementation ("jsamp-class:").- See Also:
-
-
Method Details
-
getProfile
Returns a ClientProfile instance suitable for general purpose use. By default this is currently the Standard Profile (StandardClientProfile.getInstance()
), but the instance may be modified programatically or by use of the SAMP_HUB environment variable.If no instance has been set, the SAMP_HUB environment variable is examined. If it consists of the prefix "
jsamp-class:
" (HUBLOC_CLASS_PREFIX
) followed by the classname of a class which implementsClientProfile
and has a no-arg constructor, then an instance of the named class is used. Otherwise, an instance ofStandardClientProfile
is returned.The instance is obtained lazily.
- Returns:
- client profile instance
-
setProfile
Sets the profile object which will be returned bygetProfile()
.- Parameters:
profile
- default profile instance
-