IProcessManager Class Reference
[Binder]

#include <support/IProcessManager.h>

Inheritance diagram for IProcessManager:

IInterface SAtom BnProcessManager List of all members.

Detailed Description

Simple interface for dynamically instantiating components into processes.

This is a very basic interface that is used by SContext to give smooved (or another system entity) the ability to implement policies for how components are instantiated into processes

SContext normally finds the implementation of this interface in the namespace at /processes, and the object there should normally also implement the INode, IIterable, and ICatalog APIs so it can behave like a normal directory.

See Binder Process Model for more information.


Public Member Functions

status_t LinkProcessManager (const sptr< IBinder > &to, const SValue &mappings, uint32_t flags=0)
virtual sptr< IBinderNewIfRemote (const sptr< INode > &context, const SString &component, const SValue &args, uint32_t flags, const sptr< IProcess > &caller, SValue *componentInfo, status_t *status=NULL)=0
 Perform component instantiation in remote process, if needed.
status_t UnlinkProcessManager (const sptr< IBinder > &to, const SValue &mappings, uint32_t flags=0)

Protected Member Functions

 IProcessManager ()
virtual ~IProcessManager ()


Constructor & Destructor Documentation

IProcessManager  )  [inline, protected]
 

virtual ~IProcessManager  )  [protected, virtual]
 


Member Function Documentation

status_t LinkProcessManager const sptr< IBinder > &  to,
const SValue mappings,
uint32_t  flags = 0
[inline]
 

virtual sptr<IBinder> NewIfRemote const sptr< INode > &  context,
const SString component,
const SValue args,
uint32_t  flags,
const sptr< IProcess > &  caller,
SValue componentInfo,
status_t status = NULL
[pure virtual]
 

Perform component instantiation in remote process, if needed.

Parameters:
[in] context Context (root of namespace) for this component to run in.
[in] component Name of the component to instantiate. Unlike SContext::New(), this can not be a complex mapping of name and arguments.
[in] args Arguments to pass to component.
[in] flags Behavior modification, as per SContext::New().
[in] caller Which process the caller is/will use.
[out] componentInfo Information from package manager about component.
[out] status Error code or B_OK.
Returns:
Non-NULL if a new instance of the component was created in a different process. NULL if there was an error or the component should be created in caller (you can use status to distinguish between the two).
This method is called by SContext::New() before it tries to instantiate the requested component in its local process. This gives the process manager a chance to decide how the instantiation should proceed, based on whatever policies it wants to apply -- for example, if there is a dedicated process for certain kinds of components, it can always instantiate them there instead.

If the process manager decides the component should be instantiated in caller, it should always return NULL since this will be more efficient than transfering the object reference through itself. Note that SContext is free at this point to cache this information, so that it doesn't have to call this method if it later needs to make another instance of the same component in the same process.

The flags are as defined on SContext, and the process manager should try to respect any passed in, but is not required to.

status_t UnlinkProcessManager const sptr< IBinder > &  to,
const SValue mappings,
uint32_t  flags = 0
[inline]
 


The documentation for this class was generated from the following file: