The ServiceLocator allows service to be located and security credentials to be managed.

Although credentials are set against a service they apply to the channel i.e. the set of services belonging to the channel share the same credentials.

You must always make sure you call logout at the end of the user's session.

Static variables

staticread onlyinstance:ServiceLocator

Static methods

staticgetInstance():ServiceLocator

Return the ServiceLocator instance.

Returns:

the instance.

staticreleaseInstance():Void

Releases the current instance so that the next call to getInstance() returns a new instance.

Variables

Methods

getHTTPService(name:String):HTTPService

Return the HTTPService for the given name.

Parameters:

name

the name of the HTTPService

Returns:

the HTTPService.

@:meta(Deprecated("You should now use one of the strongly typed methods for returning a service."))getInvokerService(serviceId:String):AbstractInvoker

Deprecated: "You should now use one of the strongly typed methods for returning a service."

Deprecated.

Returns an AbstractInvoker defined for the id, to allow services to be looked up using the ServiceLocator by a canonical name.

If no service exists for the service name, an Error will be thrown.

Parameters:

serviceId

The id of the service to be returned. This is the id defined in the concrete service locator implementation.

getRemoteObject(name:String):RemoteObject

Return the RemoteObject for the given name.

Parameters:

name

the name of the RemoteObject.

Returns:

the RemoteObject.

@:meta(Deprecated("You should now use one of the strongly typed methods for returning a service."))getService(serviceId:String):AbstractService

Deprecated: "You should now use one of the strongly typed methods for returning a service."

Deprecated.

Returns the service defined for the id, to allow services to be looked up using the ServiceLocator by a canonical name.

If no service exists for the service name, an Error will be thrown.

Parameters:

serviceId

The id of the service to be returned. This is the id defined in the concrete service locator implementation.

logout():Void

Logs the user out of all registered services.

setCredentials(username:String, password:String):Void

Set the credentials for all registered services.

Parameters:

username

the username to set.

password

the password to set.

setRemoteCredentials(username:String, password:String):Void

Set the remote credentials for all registered services.

Parameters:

username

the username to set.

password

the password to set.