Packagecom.bourre.service
Interfacepublic interface Service extends ASyncCommand, Command, Runnable
ImplementorsAbstractService

Player version: Flash Player 9.0
Language version: ActionScript 3.0

The Service interface defines rules for remoting service.



Public Methods
 MethodDefined by
 Inherited
addASyncCommandListener(listener:ASyncCommandListener, ... rest):Boolean
Adds the passed-in command listener object as listener for this command events.
ASyncCommand
  
addEventListener(type:String, listener:Object, ... rest):Boolean
Adds an event listener for the specified event type.
Service
  
addServiceListener(listener:Object):Boolean
Adds the passed-in listener as listener for all events dispatched by this event broadcaster.
Service
 Inherited
execute(e:Event = null):void
Execute the request according to the current command data.
Command
 Inherited
Fires the onCommandEnd event to the listeners of this command.
ASyncCommand
  
fireError():void
Dispatches an error event to tell listeners that an error occurs.
Service
  
fireResult():void
Dispatches event to tell listeners that a result is available.
Service
  
getArguments():Object
Returns arguments used by this service.
Service
  
getResult():Object
Returns the service treatment result.
Service
  
Returns a Collection view of listeners for the passed-in event type.
Service
 Inherited
isRunning():Boolean
Returns true if this object is running.
Runnable
  
release():void
Releases service.
Service
 Inherited
Removes the passed-in command listener object as listener for this command events.
ASyncCommand
  
removeEventListener(listener:Object):Boolean
Removes the passed-in listener object from this event broadcaster.
Service
  
removeServiceListener(listener:Object):Boolean
Removes the passed-in listener object from this event broadcaster.
Service
 Inherited
run():void
Starts the asynchronous process of this runnable object.
Runnable
  
setArguments(... rest):void
Defines arguments to use for this service.
Service
Method detail
addEventListener()method
public function addEventListener(type:String, listener:Object, ... rest):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Adds an event listener for the specified event type. There is two behaviors for the addEventListener function :

  1. The passed-in listener is an object : The object is added as listener only for the specified event, the object must have a function with the same name than type or at least a handleEvent function.
  2. The passed-in listener is a function : A Delegate object is created and then added as listener for the event type. There is no restriction on the name of the function. If the rest is not empty, all elements in it is used as additional arguments into the delegate object.

Parameters
type:String — name of the event for which register the listener
 
listener:Object — object or function which will receive this event
 
... rest — additional arguments for the function listener

Returns
Booleantrue if the function have been succesfully added as listener fot the passed-in event
addServiceListener()method 
public function addServiceListener(listener:Object):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Adds the passed-in listener as listener for all events dispatched by this event broadcaster. The function returns true if the listener have been added at the end of the call. If the listener is already registered in this event broadcaster the function returns false.

Note : The addListener function doesn't accept functions as listener, functions could only register for a single event.

Parameters
listener:Object — the listener object to add as global listener

Returns
Booleantrue if the listener have been added during this call
fireError()method 
public function fireError():void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Dispatches an error event to tell listeners that an error occurs.

fireResult()method 
public function fireResult():void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Dispatches event to tell listeners that a result is available.

getArguments()method 
public function getArguments():Object

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns arguments used by this service.

Returns
Object — arguments used by this service.
getResult()method 
public function getResult():Object

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns the service treatment result.

Returns
Object — The service treatment result.
getServiceListener()method 
public function getServiceListener(type:String = null):Collection

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns a Collection view of listeners for the passed-in event type. The returned collection is a reference to the internal collection of this event broadcaster, resulting that there's no guarantee that collection cannot be altered by another object. If the type parameter is omitted, the function returns the collection of global listeners objects (all objects that haven't register for a specific event).

Parameters
type:String (default = null) — the event name for which get a collection, if not defined, the collection of global listeners is returned

Returns
CollectionCollection of listeners corresponding to the passed-in event type
release()method 
public function release():void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Releases service.

Event broadcaster, service arguments and result are released.

removeEventListener()method 
public function removeEventListener(listener:Object):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Removes the passed-in listener object from this event broadcaster. The object is removed as listener for all events the broadcaster may dispatch.

Parameters
listener:Object — the listener object to remove from this event broadcaster object

Returns
Booleantrue if the object have been successfully removed from this event broadcaster
removeServiceListener()method 
public function removeServiceListener(listener:Object):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Removes the passed-in listener object from this event broadcaster. The object is removed as listener for all events the broadcaster may dispatch.

Parameters
listener:Object — the listener object to remove from this event broadcaster object

Returns
Booleantrue if the object have been successfully removed from this event broadcaster
setArguments()method 
public function setArguments(... rest):void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Defines arguments to use for this service.

Parameters
... rest — argument list