repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_documentation_string stringlengths 1 47.2k | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|
tcalmant/ipopo | samples/handler/logger_minimal.py | _LoggerHandlerFactory.get_handlers | def get_handlers(self, component_context, instance):
"""
Sets up service providers for the given component
:param component_context: The ComponentContext bean
:param instance: The component instance
:return: The list of handlers associated to the given component
... | python | def get_handlers(self, component_context, instance):
"""
Sets up service providers for the given component
:param component_context: The ComponentContext bean
:param instance: The component instance
:return: The list of handlers associated to the given component
... | Sets up service providers for the given component
:param component_context: The ComponentContext bean
:param instance: The component instance
:return: The list of handlers associated to the given component
(never None) | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/samples/handler/logger_minimal.py#L100-L125 |
tcalmant/ipopo | pelix/shell/console.py | _resolve_file | def _resolve_file(file_name):
"""
Checks if the file exists.
If the file exists, the method returns its absolute path.
Else, it returns None
:param file_name: The name of the file to check
:return: An absolute path, or None
"""
if not file_name:
return None
path = os.path.... | python | def _resolve_file(file_name):
"""
Checks if the file exists.
If the file exists, the method returns its absolute path.
Else, it returns None
:param file_name: The name of the file to check
:return: An absolute path, or None
"""
if not file_name:
return None
path = os.path.... | Checks if the file exists.
If the file exists, the method returns its absolute path.
Else, it returns None
:param file_name: The name of the file to check
:return: An absolute path, or None | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/console.py#L497-L514 |
tcalmant/ipopo | pelix/shell/console.py | make_common_parser | def make_common_parser():
"""
Creates an argument parser (argparse module) with the options that should
be common to all shells.
The result can be used as a parent parser (``parents`` argument in
``argparse.ArgumentParser``)
:return: An ArgumentParser object
"""
parser = argparse.Argum... | python | def make_common_parser():
"""
Creates an argument parser (argparse module) with the options that should
be common to all shells.
The result can be used as a parent parser (``parents`` argument in
``argparse.ArgumentParser``)
:return: An ArgumentParser object
"""
parser = argparse.Argum... | Creates an argument parser (argparse module) with the options that should
be common to all shells.
The result can be used as a parent parser (``parents`` argument in
``argparse.ArgumentParser``)
:return: An ArgumentParser object | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/console.py#L517-L594 |
tcalmant/ipopo | pelix/shell/console.py | handle_common_arguments | def handle_common_arguments(parsed_args):
"""
Handles the arguments defined by :meth:`~make_common_parser`
:param parsed_args: Argument parsed with ``argparse`` (``Namespace``)
:return: An :class:`~InitFileHandler` object
:raise IOError: Initial or run script not found
"""
# Setup the logge... | python | def handle_common_arguments(parsed_args):
"""
Handles the arguments defined by :meth:`~make_common_parser`
:param parsed_args: Argument parsed with ``argparse`` (``Namespace``)
:return: An :class:`~InitFileHandler` object
:raise IOError: Initial or run script not found
"""
# Setup the logge... | Handles the arguments defined by :meth:`~make_common_parser`
:param parsed_args: Argument parsed with ``argparse`` (``Namespace``)
:return: An :class:`~InitFileHandler` object
:raise IOError: Initial or run script not found | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/console.py#L597-L656 |
tcalmant/ipopo | pelix/shell/console.py | main | def main(argv=None):
"""
Entry point
:param argv: Script arguments (None for sys.argv)
:return: An exit code or None
"""
# Parse arguments
parser = argparse.ArgumentParser(
prog="pelix.shell.console",
parents=[make_common_parser()],
description="Pelix Shell Console",... | python | def main(argv=None):
"""
Entry point
:param argv: Script arguments (None for sys.argv)
:return: An exit code or None
"""
# Parse arguments
parser = argparse.ArgumentParser(
prog="pelix.shell.console",
parents=[make_common_parser()],
description="Pelix Shell Console",... | Entry point
:param argv: Script arguments (None for sys.argv)
:return: An exit code or None | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/console.py#L659-L702 |
tcalmant/ipopo | pelix/shell/console.py | InteractiveShell._normal_prompt | def _normal_prompt(self):
"""
Flushes the prompt before requesting the input
:return: The command line
"""
sys.stdout.write(self.__get_ps1())
sys.stdout.flush()
return safe_input() | python | def _normal_prompt(self):
"""
Flushes the prompt before requesting the input
:return: The command line
"""
sys.stdout.write(self.__get_ps1())
sys.stdout.flush()
return safe_input() | Flushes the prompt before requesting the input
:return: The command line | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/console.py#L137-L145 |
tcalmant/ipopo | pelix/shell/console.py | InteractiveShell.loop_input | def loop_input(self, on_quit=None):
"""
Reads the standard input until the shell session is stopped
:param on_quit: A call back method, called without argument when the
shell session has ended
"""
# Start the init script
self._run_script(
... | python | def loop_input(self, on_quit=None):
"""
Reads the standard input until the shell session is stopped
:param on_quit: A call back method, called without argument when the
shell session has ended
"""
# Start the init script
self._run_script(
... | Reads the standard input until the shell session is stopped
:param on_quit: A call back method, called without argument when the
shell session has ended | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/console.py#L147-L173 |
tcalmant/ipopo | pelix/shell/console.py | InteractiveShell._run_script | def _run_script(self, session, file_path):
"""
Runs the given script file
:param session: Current shell session
:param file_path: Path to the file to execute
:return: True if a file has been execute
"""
if file_path:
# The 'run' command returns False ... | python | def _run_script(self, session, file_path):
"""
Runs the given script file
:param session: Current shell session
:param file_path: Path to the file to execute
:return: True if a file has been execute
"""
if file_path:
# The 'run' command returns False ... | Runs the given script file
:param session: Current shell session
:param file_path: Path to the file to execute
:return: True if a file has been execute | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/console.py#L175-L188 |
tcalmant/ipopo | pelix/shell/console.py | InteractiveShell._run_loop | def _run_loop(self, session):
"""
Runs the main input loop
:param session: Current shell session
"""
try:
first_prompt = True
# Set up the prompt
prompt = (
self._readline_prompt
if readline is not None
... | python | def _run_loop(self, session):
"""
Runs the main input loop
:param session: Current shell session
"""
try:
first_prompt = True
# Set up the prompt
prompt = (
self._readline_prompt
if readline is not None
... | Runs the main input loop
:param session: Current shell session | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/console.py#L190-L230 |
tcalmant/ipopo | pelix/shell/console.py | InteractiveShell.readline_completer | def readline_completer(self, text, state):
"""
A completer for the readline library
"""
if state == 0:
# New completion, reset the list of matches and the display hook
self._readline_matches = []
try:
readline.set_completion_display_mat... | python | def readline_completer(self, text, state):
"""
A completer for the readline library
"""
if state == 0:
# New completion, reset the list of matches and the display hook
self._readline_matches = []
try:
readline.set_completion_display_mat... | A completer for the readline library | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/console.py#L232-L336 |
tcalmant/ipopo | pelix/shell/console.py | InteractiveShell.search_shell | def search_shell(self):
"""
Looks for a shell service
"""
with self._lock:
if self._shell is not None:
# A shell is already there
return
reference = self._context.get_service_reference(SERVICE_SHELL)
if reference is not... | python | def search_shell(self):
"""
Looks for a shell service
"""
with self._lock:
if self._shell is not None:
# A shell is already there
return
reference = self._context.get_service_reference(SERVICE_SHELL)
if reference is not... | Looks for a shell service | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/console.py#L338-L349 |
tcalmant/ipopo | pelix/shell/console.py | InteractiveShell.service_changed | def service_changed(self, event):
"""
Called by Pelix when an events changes
"""
kind = event.get_kind()
reference = event.get_service_reference()
if kind in (pelix.ServiceEvent.REGISTERED, pelix.ServiceEvent.MODIFIED):
# A service matches our filter
... | python | def service_changed(self, event):
"""
Called by Pelix when an events changes
"""
kind = event.get_kind()
reference = event.get_service_reference()
if kind in (pelix.ServiceEvent.REGISTERED, pelix.ServiceEvent.MODIFIED):
# A service matches our filter
... | Called by Pelix when an events changes | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/console.py#L351-L368 |
tcalmant/ipopo | pelix/shell/console.py | InteractiveShell.set_shell | def set_shell(self, svc_ref):
"""
Binds the given shell service.
:param svc_ref: A service reference
"""
if svc_ref is None:
return
with self._lock:
# Get the service
self._shell_ref = svc_ref
self._shell = self._context.g... | python | def set_shell(self, svc_ref):
"""
Binds the given shell service.
:param svc_ref: A service reference
"""
if svc_ref is None:
return
with self._lock:
# Get the service
self._shell_ref = svc_ref
self._shell = self._context.g... | Binds the given shell service.
:param svc_ref: A service reference | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/console.py#L370-L389 |
tcalmant/ipopo | pelix/shell/console.py | InteractiveShell.clear_shell | def clear_shell(self):
"""
Unbinds the active shell service
"""
with self._lock:
# Clear the flag
self._shell_event.clear()
# Clear the readline completer
if readline is not None:
readline.set_completer(None)
... | python | def clear_shell(self):
"""
Unbinds the active shell service
"""
with self._lock:
# Clear the flag
self._shell_event.clear()
# Clear the readline completer
if readline is not None:
readline.set_completer(None)
... | Unbinds the active shell service | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/console.py#L391-L409 |
tcalmant/ipopo | pelix/shell/console.py | InteractiveShell.stop | def stop(self):
"""
Clears all members
"""
# Exit the loop
with self._lock:
self._stop_event.set()
self._shell_event.clear()
if self._context is not None:
# Unregister from events
self._context.remove_service_listener(self)... | python | def stop(self):
"""
Clears all members
"""
# Exit the loop
with self._lock:
self._stop_event.set()
self._shell_event.clear()
if self._context is not None:
# Unregister from events
self._context.remove_service_listener(self)... | Clears all members | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/console.py#L411-L426 |
tcalmant/ipopo | pelix/remote/json_rpc.py | _JsonRpcServlet.do_POST | def do_POST(self, request, response):
# pylint: disable=C0103
"""
Handles a HTTP POST request
:param request: The HTTP request bean
:param response: The HTTP response handler
"""
try:
# Get the request content
data = to_str(request.read_da... | python | def do_POST(self, request, response):
# pylint: disable=C0103
"""
Handles a HTTP POST request
:param request: The HTTP request bean
:param response: The HTTP response handler
"""
try:
# Get the request content
data = to_str(request.read_da... | Handles a HTTP POST request
:param request: The HTTP request bean
:param response: The HTTP response handler | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/remote/json_rpc.py#L115-L135 |
tcalmant/ipopo | pelix/ipopo/handlers/requires.py | _HandlerFactory._prepare_requirements | def _prepare_requirements(requirements, requires_filters):
"""
Overrides the filters specified in the decorator with the given ones
:param requirements: Dictionary of requirements (field → Requirement)
:param requires_filters: Content of the 'requires.filter' component
... | python | def _prepare_requirements(requirements, requires_filters):
"""
Overrides the filters specified in the decorator with the given ones
:param requirements: Dictionary of requirements (field → Requirement)
:param requires_filters: Content of the 'requires.filter' component
... | Overrides the filters specified in the decorator with the given ones
:param requirements: Dictionary of requirements (field → Requirement)
:param requires_filters: Content of the 'requires.filter' component
property (field → string)
:return: The new requirements | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requires.py#L59-L88 |
tcalmant/ipopo | pelix/ipopo/handlers/requires.py | _HandlerFactory.get_handlers | def get_handlers(self, component_context, instance):
"""
Sets up service providers for the given component
:param component_context: The ComponentContext bean
:param instance: The component instance
:return: The list of handlers associated to the given component
"""
... | python | def get_handlers(self, component_context, instance):
"""
Sets up service providers for the given component
:param component_context: The ComponentContext bean
:param instance: The component instance
:return: The list of handlers associated to the given component
"""
... | Sets up service providers for the given component
:param component_context: The ComponentContext bean
:param instance: The component instance
:return: The list of handlers associated to the given component | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requires.py#L90-L120 |
tcalmant/ipopo | pelix/ipopo/handlers/requires.py | _RuntimeDependency.manipulate | def manipulate(self, stored_instance, component_instance):
"""
Stores the given StoredInstance bean.
:param stored_instance: The iPOPO component StoredInstance
:param component_instance: The component instance
"""
# Store the stored instance...
self._ipopo_instan... | python | def manipulate(self, stored_instance, component_instance):
"""
Stores the given StoredInstance bean.
:param stored_instance: The iPOPO component StoredInstance
:param component_instance: The component instance
"""
# Store the stored instance...
self._ipopo_instan... | Stores the given StoredInstance bean.
:param stored_instance: The iPOPO component StoredInstance
:param component_instance: The component instance | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requires.py#L193-L204 |
tcalmant/ipopo | pelix/ipopo/handlers/requires.py | _RuntimeDependency.clear | def clear(self):
"""
Cleans up the manager. The manager can't be used after this method has
been called
"""
self._lock = None
self._ipopo_instance = None
self._context = None
self.requirement = None
self._value = None
self._field = None | python | def clear(self):
"""
Cleans up the manager. The manager can't be used after this method has
been called
"""
self._lock = None
self._ipopo_instance = None
self._context = None
self.requirement = None
self._value = None
self._field = None | Cleans up the manager. The manager can't be used after this method has
been called | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requires.py#L206-L216 |
tcalmant/ipopo | pelix/ipopo/handlers/requires.py | _RuntimeDependency.service_changed | def service_changed(self, event):
"""
Called by the framework when a service event occurs
"""
if (
self._ipopo_instance is None
or not self._ipopo_instance.check_event(event)
):
# stop() and clean() may have been called after we have been put
... | python | def service_changed(self, event):
"""
Called by the framework when a service event occurs
"""
if (
self._ipopo_instance is None
or not self._ipopo_instance.check_event(event)
):
# stop() and clean() may have been called after we have been put
... | Called by the framework when a service event occurs | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requires.py#L282-L312 |
tcalmant/ipopo | pelix/ipopo/handlers/requires.py | _RuntimeDependency.start | def start(self):
"""
Starts the dependency manager
"""
self._context.add_service_listener(
self, self.requirement.filter, self.requirement.specification
) | python | def start(self):
"""
Starts the dependency manager
"""
self._context.add_service_listener(
self, self.requirement.filter, self.requirement.specification
) | Starts the dependency manager | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requires.py#L314-L320 |
tcalmant/ipopo | pelix/ipopo/handlers/requires.py | SimpleDependency.clear | def clear(self):
"""
Cleans up the manager. The manager can't be used after this method has
been called
"""
self.reference = None
self._pending_ref = None
super(SimpleDependency, self).clear() | python | def clear(self):
"""
Cleans up the manager. The manager can't be used after this method has
been called
"""
self.reference = None
self._pending_ref = None
super(SimpleDependency, self).clear() | Cleans up the manager. The manager can't be used after this method has
been called | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requires.py#L348-L355 |
tcalmant/ipopo | pelix/ipopo/handlers/requires.py | SimpleDependency.on_service_arrival | def on_service_arrival(self, svc_ref):
"""
Called when a service has been registered in the framework
:param svc_ref: A service reference
"""
with self._lock:
if self._value is None:
# Inject the service
self.reference = svc_ref
... | python | def on_service_arrival(self, svc_ref):
"""
Called when a service has been registered in the framework
:param svc_ref: A service reference
"""
with self._lock:
if self._value is None:
# Inject the service
self.reference = svc_ref
... | Called when a service has been registered in the framework
:param svc_ref: A service reference | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requires.py#L369-L384 |
tcalmant/ipopo | pelix/ipopo/handlers/requires.py | SimpleDependency.on_service_modify | def on_service_modify(self, svc_ref, old_properties):
"""
Called when a service has been modified in the framework
:param svc_ref: A service reference
:param old_properties: Previous properties values
"""
with self._lock:
if self.reference is None:
... | python | def on_service_modify(self, svc_ref, old_properties):
"""
Called when a service has been modified in the framework
:param svc_ref: A service reference
:param old_properties: Previous properties values
"""
with self._lock:
if self.reference is None:
... | Called when a service has been modified in the framework
:param svc_ref: A service reference
:param old_properties: Previous properties values | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requires.py#L411-L426 |
tcalmant/ipopo | pelix/ipopo/handlers/requires.py | SimpleDependency.stop | def stop(self):
"""
Stops the dependency manager (must be called before clear())
:return: The removed bindings (list) or None
"""
super(SimpleDependency, self).stop()
if self.reference is not None:
# Return a tuple of tuple
return ((self._value, s... | python | def stop(self):
"""
Stops the dependency manager (must be called before clear())
:return: The removed bindings (list) or None
"""
super(SimpleDependency, self).stop()
if self.reference is not None:
# Return a tuple of tuple
return ((self._value, s... | Stops the dependency manager (must be called before clear())
:return: The removed bindings (list) or None | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requires.py#L428-L439 |
tcalmant/ipopo | pelix/ipopo/handlers/requires.py | SimpleDependency.is_valid | def is_valid(self):
"""
Tests if the dependency is in a valid state
"""
return super(SimpleDependency, self).is_valid() or (
self.requirement.immediate_rebind and self._pending_ref is not None
) | python | def is_valid(self):
"""
Tests if the dependency is in a valid state
"""
return super(SimpleDependency, self).is_valid() or (
self.requirement.immediate_rebind and self._pending_ref is not None
) | Tests if the dependency is in a valid state | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requires.py#L441-L447 |
tcalmant/ipopo | pelix/ipopo/handlers/requires.py | SimpleDependency.try_binding | def try_binding(self):
"""
Searches for the required service if needed
:raise BundleException: Invalid ServiceReference found
"""
with self._lock:
if self.reference is not None:
# Already bound
return
if self._pending_ref ... | python | def try_binding(self):
"""
Searches for the required service if needed
:raise BundleException: Invalid ServiceReference found
"""
with self._lock:
if self.reference is not None:
# Already bound
return
if self._pending_ref ... | Searches for the required service if needed
:raise BundleException: Invalid ServiceReference found | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requires.py#L449-L472 |
tcalmant/ipopo | pelix/ipopo/handlers/requires.py | AggregateDependency.clear | def clear(self):
"""
Cleans up the manager. The manager can't be used after this method has
been called
"""
self.services.clear()
self.services = None
self._future_value = None
super(AggregateDependency, self).clear() | python | def clear(self):
"""
Cleans up the manager. The manager can't be used after this method has
been called
"""
self.services.clear()
self.services = None
self._future_value = None
super(AggregateDependency, self).clear() | Cleans up the manager. The manager can't be used after this method has
been called | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requires.py#L492-L500 |
tcalmant/ipopo | pelix/ipopo/handlers/requires.py | AggregateDependency.on_service_arrival | def on_service_arrival(self, svc_ref):
"""
Called when a service has been registered in the framework
:param svc_ref: A service reference
"""
with self._lock:
if svc_ref not in self.services:
# Get the new service
service = self._conte... | python | def on_service_arrival(self, svc_ref):
"""
Called when a service has been registered in the framework
:param svc_ref: A service reference
"""
with self._lock:
if svc_ref not in self.services:
# Get the new service
service = self._conte... | Called when a service has been registered in the framework
:param svc_ref: A service reference | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requires.py#L532-L554 |
tcalmant/ipopo | pelix/ipopo/handlers/requires.py | AggregateDependency.on_service_departure | def on_service_departure(self, svc_ref):
"""
Called when a service has been unregistered from the framework
:param svc_ref: A service reference
:return: A tuple (service, reference) if the service has been lost,
else None
"""
with self._lock:
... | python | def on_service_departure(self, svc_ref):
"""
Called when a service has been unregistered from the framework
:param svc_ref: A service reference
:return: A tuple (service, reference) if the service has been lost,
else None
"""
with self._lock:
... | Called when a service has been unregistered from the framework
:param svc_ref: A service reference
:return: A tuple (service, reference) if the service has been lost,
else None | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requires.py#L556-L582 |
tcalmant/ipopo | pelix/ipopo/handlers/requires.py | AggregateDependency.on_service_modify | def on_service_modify(self, svc_ref, old_properties):
"""
Called when a service has been modified in the framework
:param svc_ref: A service reference
:param old_properties: Previous properties values
:return: A tuple (added, (service, reference)) if the dependency has
... | python | def on_service_modify(self, svc_ref, old_properties):
"""
Called when a service has been modified in the framework
:param svc_ref: A service reference
:param old_properties: Previous properties values
:return: A tuple (added, (service, reference)) if the dependency has
... | Called when a service has been modified in the framework
:param svc_ref: A service reference
:param old_properties: Previous properties values
:return: A tuple (added, (service, reference)) if the dependency has
been changed, else None | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requires.py#L584-L606 |
tcalmant/ipopo | pelix/ipopo/handlers/requires.py | AggregateDependency.stop | def stop(self):
"""
Stops the dependency manager (must be called before clear())
:return: The removed bindings (list) or None
"""
super(AggregateDependency, self).stop()
if self.services:
return [
(service, reference)
for refe... | python | def stop(self):
"""
Stops the dependency manager (must be called before clear())
:return: The removed bindings (list) or None
"""
super(AggregateDependency, self).stop()
if self.services:
return [
(service, reference)
for refe... | Stops the dependency manager (must be called before clear())
:return: The removed bindings (list) or None | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requires.py#L608-L622 |
tcalmant/ipopo | pelix/misc/log.py | LogReaderService._store_entry | def _store_entry(self, entry):
"""
Stores a new log entry and notifies listeners
:param entry: A LogEntry object
"""
# Get the logger and log the message
self.__logs.append(entry)
# Notify listeners
for listener in self.__listeners.copy():
tr... | python | def _store_entry(self, entry):
"""
Stores a new log entry and notifies listeners
:param entry: A LogEntry object
"""
# Get the logger and log the message
self.__logs.append(entry)
# Notify listeners
for listener in self.__listeners.copy():
tr... | Stores a new log entry and notifies listeners
:param entry: A LogEntry object | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/misc/log.py#L241-L270 |
tcalmant/ipopo | pelix/misc/log.py | LogServiceInstance.log | def log(self, level, message, exc_info=None, reference=None):
# pylint: disable=W0212
"""
Logs a message, possibly with an exception
:param level: Severity of the message (Python logging level)
:param message: Human readable message
:param exc_info: The exception context... | python | def log(self, level, message, exc_info=None, reference=None):
# pylint: disable=W0212
"""
Logs a message, possibly with an exception
:param level: Severity of the message (Python logging level)
:param message: Human readable message
:param exc_info: The exception context... | Logs a message, possibly with an exception
:param level: Severity of the message (Python logging level)
:param message: Human readable message
:param exc_info: The exception context (sys.exc_info()), if any
:param reference: The ServiceReference associated to the log | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/misc/log.py#L289-L316 |
tcalmant/ipopo | pelix/misc/log.py | LogServiceFactory._bundle_from_module | def _bundle_from_module(self, module_object):
"""
Find the bundle associated to a module
:param module_object: A Python module object
:return: The Bundle object associated to the module, or None
"""
try:
# Get the module name
module_object = modul... | python | def _bundle_from_module(self, module_object):
"""
Find the bundle associated to a module
:param module_object: A Python module object
:return: The Bundle object associated to the module, or None
"""
try:
# Get the module name
module_object = modul... | Find the bundle associated to a module
:param module_object: A Python module object
:return: The Bundle object associated to the module, or None | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/misc/log.py#L334-L348 |
tcalmant/ipopo | pelix/misc/log.py | LogServiceFactory.emit | def emit(self, record):
# pylint: disable=W0212
"""
Handle a message logged with the logger
:param record: A log record
"""
# Get the bundle
bundle = self._bundle_from_module(record.module)
# Convert to a LogEntry
entry = LogEntry(
re... | python | def emit(self, record):
# pylint: disable=W0212
"""
Handle a message logged with the logger
:param record: A log record
"""
# Get the bundle
bundle = self._bundle_from_module(record.module)
# Convert to a LogEntry
entry = LogEntry(
re... | Handle a message logged with the logger
:param record: A log record | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/misc/log.py#L350-L364 |
tcalmant/ipopo | pelix/services/mqtt.py | _MqttConnection.publish | def publish(self, topic, payload, qos=0, retain=False):
"""
Publishes an MQTT message
"""
# TODO: check (full transmission) success
return self._client.publish(topic, payload, qos, retain) | python | def publish(self, topic, payload, qos=0, retain=False):
"""
Publishes an MQTT message
"""
# TODO: check (full transmission) success
return self._client.publish(topic, payload, qos, retain) | Publishes an MQTT message | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/services/mqtt.py#L487-L492 |
tcalmant/ipopo | pelix/ipopo/handlers/requiresmap.py | _HandlerFactory._prepare_requirements | def _prepare_requirements(configs, requires_filters):
"""
Overrides the filters specified in the decorator with the given ones
:param configs: Field → (Requirement, key, allow_none) dictionary
:param requires_filters: Content of the 'requires.filter' component
... | python | def _prepare_requirements(configs, requires_filters):
"""
Overrides the filters specified in the decorator with the given ones
:param configs: Field → (Requirement, key, allow_none) dictionary
:param requires_filters: Content of the 'requires.filter' component
... | Overrides the filters specified in the decorator with the given ones
:param configs: Field → (Requirement, key, allow_none) dictionary
:param requires_filters: Content of the 'requires.filter' component
property (field → string)
:return: The new configuration di... | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requiresmap.py#L60-L92 |
tcalmant/ipopo | pelix/ipopo/handlers/requiresmap.py | _HandlerFactory.get_handlers | def get_handlers(self, component_context, instance):
"""
Sets up service providers for the given component
:param component_context: The ComponentContext bean
:param instance: The component instance
:return: The list of handlers associated to the given component
"""
... | python | def get_handlers(self, component_context, instance):
"""
Sets up service providers for the given component
:param component_context: The ComponentContext bean
:param instance: The component instance
:return: The list of handlers associated to the given component
"""
... | Sets up service providers for the given component
:param component_context: The ComponentContext bean
:param instance: The component instance
:return: The list of handlers associated to the given component | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requiresmap.py#L94-L129 |
tcalmant/ipopo | pelix/ipopo/handlers/requiresmap.py | _RuntimeDependency.manipulate | def manipulate(self, stored_instance, component_instance):
"""
Stores the given StoredInstance bean.
:param stored_instance: The iPOPO component StoredInstance
:param component_instance: The component instance
"""
# Store the stored instance...
self._ipopo_instan... | python | def manipulate(self, stored_instance, component_instance):
"""
Stores the given StoredInstance bean.
:param stored_instance: The iPOPO component StoredInstance
:param component_instance: The component instance
"""
# Store the stored instance...
self._ipopo_instan... | Stores the given StoredInstance bean.
:param stored_instance: The iPOPO component StoredInstance
:param component_instance: The component instance | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requiresmap.py#L213-L227 |
tcalmant/ipopo | pelix/ipopo/handlers/requiresmap.py | _RuntimeDependency.clear | def clear(self):
"""
Cleans up the manager. The manager can't be used after this method has
been called
"""
self.services.clear()
self._future_value.clear()
self.services = None
self._lock = None
self._ipopo_instance = None
self._context =... | python | def clear(self):
"""
Cleans up the manager. The manager can't be used after this method has
been called
"""
self.services.clear()
self._future_value.clear()
self.services = None
self._lock = None
self._ipopo_instance = None
self._context =... | Cleans up the manager. The manager can't be used after this method has
been called | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requiresmap.py#L229-L245 |
tcalmant/ipopo | pelix/ipopo/handlers/requiresmap.py | _RuntimeDependency.is_valid | def is_valid(self):
"""
Tests if the dependency is in a valid state
"""
return (
self.requirement is not None and self.requirement.optional
) or bool(self._future_value) | python | def is_valid(self):
"""
Tests if the dependency is in a valid state
"""
return (
self.requirement is not None and self.requirement.optional
) or bool(self._future_value) | Tests if the dependency is in a valid state | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requiresmap.py#L281-L287 |
tcalmant/ipopo | pelix/ipopo/handlers/requiresmap.py | _RuntimeDependency.stop | def stop(self):
"""
Stops the dependency manager (must be called before clear())
:return: The removed bindings (list) or None
"""
self._context.remove_service_listener(self)
if self.services:
return [
(service, reference)
for r... | python | def stop(self):
"""
Stops the dependency manager (must be called before clear())
:return: The removed bindings (list) or None
"""
self._context.remove_service_listener(self)
if self.services:
return [
(service, reference)
for r... | Stops the dependency manager (must be called before clear())
:return: The removed bindings (list) or None | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requiresmap.py#L354-L367 |
tcalmant/ipopo | pelix/ipopo/handlers/requiresmap.py | _RuntimeDependency.try_binding | def try_binding(self):
"""
Searches for the required service if needed
:raise BundleException: Invalid ServiceReference found
"""
with self._lock:
if self.services:
# We already are alive (not our first call)
# => we are updated throug... | python | def try_binding(self):
"""
Searches for the required service if needed
:raise BundleException: Invalid ServiceReference found
"""
with self._lock:
if self.services:
# We already are alive (not our first call)
# => we are updated throug... | Searches for the required service if needed
:raise BundleException: Invalid ServiceReference found | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requiresmap.py#L369-L412 |
tcalmant/ipopo | pelix/ipopo/handlers/requiresmap.py | SimpleDependency.on_service_arrival | def on_service_arrival(self, svc_ref):
"""
Called when a service has been registered in the framework
:param svc_ref: A service reference
"""
with self._lock:
if svc_ref not in self.services:
# Get the key property
prop_value = svc_ref... | python | def on_service_arrival(self, svc_ref):
"""
Called when a service has been registered in the framework
:param svc_ref: A service reference
"""
with self._lock:
if svc_ref not in self.services:
# Get the key property
prop_value = svc_ref... | Called when a service has been registered in the framework
:param svc_ref: A service reference | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requiresmap.py#L420-L446 |
tcalmant/ipopo | pelix/ipopo/handlers/requiresmap.py | AggregateDependency.__store_service | def __store_service(self, key, service):
"""
Stores the given service in the dictionary
:param key: Dictionary key
:param service: Service to add to the dictionary
"""
self._future_value.setdefault(key, []).append(service) | python | def __store_service(self, key, service):
"""
Stores the given service in the dictionary
:param key: Dictionary key
:param service: Service to add to the dictionary
"""
self._future_value.setdefault(key, []).append(service) | Stores the given service in the dictionary
:param key: Dictionary key
:param service: Service to add to the dictionary | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requiresmap.py#L521-L528 |
tcalmant/ipopo | pelix/ipopo/handlers/requiresmap.py | AggregateDependency.__remove_service | def __remove_service(self, key, service):
"""
Removes the given service from the future dictionary
:param key: Dictionary key
:param service: Service to remove from the dictionary
"""
try:
# Remove the injected service
prop_services = self._future... | python | def __remove_service(self, key, service):
"""
Removes the given service from the future dictionary
:param key: Dictionary key
:param service: Service to remove from the dictionary
"""
try:
# Remove the injected service
prop_services = self._future... | Removes the given service from the future dictionary
:param key: Dictionary key
:param service: Service to remove from the dictionary | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requiresmap.py#L530-L549 |
tcalmant/ipopo | pelix/ipopo/handlers/requiresmap.py | AggregateDependency.get_value | def get_value(self):
"""
Retrieves the value to inject in the component
:return: The value to inject
"""
with self._lock:
# The value field must be a deep copy of our dictionary
if self._future_value is not None:
return {
... | python | def get_value(self):
"""
Retrieves the value to inject in the component
:return: The value to inject
"""
with self._lock:
# The value field must be a deep copy of our dictionary
if self._future_value is not None:
return {
... | Retrieves the value to inject in the component
:return: The value to inject | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requiresmap.py#L551-L564 |
tcalmant/ipopo | pelix/ipopo/handlers/requiresmap.py | AggregateDependency.on_service_departure | def on_service_departure(self, svc_ref):
"""
Called when a service has been unregistered from the framework
:param svc_ref: A service reference
:return: A tuple (service, reference) if the service has been lost,
else None
"""
with self._lock:
... | python | def on_service_departure(self, svc_ref):
"""
Called when a service has been unregistered from the framework
:param svc_ref: A service reference
:return: A tuple (service, reference) if the service has been lost,
else None
"""
with self._lock:
... | Called when a service has been unregistered from the framework
:param svc_ref: A service reference
:return: A tuple (service, reference) if the service has been lost,
else None | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requiresmap.py#L590-L612 |
tcalmant/ipopo | pelix/ipopo/handlers/requiresmap.py | AggregateDependency.on_service_modify | def on_service_modify(self, svc_ref, old_properties):
"""
Called when a service has been modified in the framework
:param svc_ref: A service reference
:param old_properties: Previous properties values
:return: A tuple (added, (service, reference)) if the dependency has
... | python | def on_service_modify(self, svc_ref, old_properties):
"""
Called when a service has been modified in the framework
:param svc_ref: A service reference
:param old_properties: Previous properties values
:return: A tuple (added, (service, reference)) if the dependency has
... | Called when a service has been modified in the framework
:param svc_ref: A service reference
:param old_properties: Previous properties values
:return: A tuple (added, (service, reference)) if the dependency has
been changed, else None | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/requiresmap.py#L614-L657 |
tcalmant/ipopo | pelix/rsa/remoteserviceadmin.py | ExportRegistrationImpl.match_sr | def match_sr(self, svc_ref, cid=None):
# type: (ServiceReference, Optional[Tuple[str, str]] ) -> bool
"""
Checks if this export registration matches the given service reference
:param svc_ref: A service reference
:param cid: A container ID
:return: True if the service ma... | python | def match_sr(self, svc_ref, cid=None):
# type: (ServiceReference, Optional[Tuple[str, str]] ) -> bool
"""
Checks if this export registration matches the given service reference
:param svc_ref: A service reference
:param cid: A container ID
:return: True if the service ma... | Checks if this export registration matches the given service reference
:param svc_ref: A service reference
:param cid: A container ID
:return: True if the service matches this export registration | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/rsa/remoteserviceadmin.py#L886-L908 |
tcalmant/ipopo | pelix/rsa/remoteserviceadmin.py | ExportRegistrationImpl.get_exception | def get_exception(self):
# type: () -> Optional[Tuple[Any, Any, Any]]
"""
Returns the exception associated to the export
:return: An exception tuple, if any
"""
with self.__lock:
return (
self.__updateexception
if self.__update... | python | def get_exception(self):
# type: () -> Optional[Tuple[Any, Any, Any]]
"""
Returns the exception associated to the export
:return: An exception tuple, if any
"""
with self.__lock:
return (
self.__updateexception
if self.__update... | Returns the exception associated to the export
:return: An exception tuple, if any | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/rsa/remoteserviceadmin.py#L970-L982 |
tcalmant/ipopo | pelix/rsa/remoteserviceadmin.py | ExportRegistrationImpl.close | def close(self):
"""
Cleans up the export endpoint
"""
publish = False
exporterid = rsid = exception = export_ref = ed = None
with self.__lock:
if not self.__closed:
exporterid = self.__exportref.get_export_container_id()
export... | python | def close(self):
"""
Cleans up the export endpoint
"""
publish = False
exporterid = rsid = exception = export_ref = ed = None
with self.__lock:
if not self.__closed:
exporterid = self.__exportref.get_export_container_id()
export... | Cleans up the export endpoint | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/rsa/remoteserviceadmin.py#L1026-L1055 |
tcalmant/ipopo | pelix/rsa/providers/discovery/__init__.py | EndpointAdvertiser.advertise_endpoint | def advertise_endpoint(self, endpoint_description):
"""
Advertise and endpoint_description for remote discovery.
If it hasn't already been a endpoint_description will be advertised via
a some protocol.
:param endpoint_description: an instance of EndpointDescription to
ad... | python | def advertise_endpoint(self, endpoint_description):
"""
Advertise and endpoint_description for remote discovery.
If it hasn't already been a endpoint_description will be advertised via
a some protocol.
:param endpoint_description: an instance of EndpointDescription to
ad... | Advertise and endpoint_description for remote discovery.
If it hasn't already been a endpoint_description will be advertised via
a some protocol.
:param endpoint_description: an instance of EndpointDescription to
advertise. Must not be None.
:return: True if advertised, False if... | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/rsa/providers/discovery/__init__.py#L77-L98 |
tcalmant/ipopo | pelix/rsa/providers/discovery/__init__.py | EndpointAdvertiser.update_endpoint | def update_endpoint(self, updated_ed):
"""
Update a previously advertised endpoint_description.
:param endpoint_description: an instance of EndpointDescription to
update. Must not be None.
:return: True if advertised, False if not
(e.g. it's already been advertised)
... | python | def update_endpoint(self, updated_ed):
"""
Update a previously advertised endpoint_description.
:param endpoint_description: an instance of EndpointDescription to
update. Must not be None.
:return: True if advertised, False if not
(e.g. it's already been advertised)
... | Update a previously advertised endpoint_description.
:param endpoint_description: an instance of EndpointDescription to
update. Must not be None.
:return: True if advertised, False if not
(e.g. it's already been advertised) | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/rsa/providers/discovery/__init__.py#L100-L120 |
tcalmant/ipopo | pelix/rsa/providers/discovery/__init__.py | EndpointAdvertiser.unadvertise_endpoint | def unadvertise_endpoint(self, endpointid):
"""
Unadvertise a previously-advertised endpointid (string).
:param endpointid. The string returned from ed.get_id() or
the value of property endpoint.id. Should not be None
:return True if removed, False if not removed (hasn't been... | python | def unadvertise_endpoint(self, endpointid):
"""
Unadvertise a previously-advertised endpointid (string).
:param endpointid. The string returned from ed.get_id() or
the value of property endpoint.id. Should not be None
:return True if removed, False if not removed (hasn't been... | Unadvertise a previously-advertised endpointid (string).
:param endpointid. The string returned from ed.get_id() or
the value of property endpoint.id. Should not be None
:return True if removed, False if not removed (hasn't been previously advertised
by this advertiser | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/rsa/providers/discovery/__init__.py#L122-L142 |
tcalmant/ipopo | pelix/ipopo/handlers/provides.py | _HandlerFactory.get_handlers | def get_handlers(self, component_context, instance):
"""
Sets up service providers for the given component
:param component_context: The ComponentContext bean
:param instance: The component instance
:return: The list of handlers associated to the given component
"""
... | python | def get_handlers(self, component_context, instance):
"""
Sets up service providers for the given component
:param component_context: The ComponentContext bean
:param instance: The component instance
:return: The list of handlers associated to the given component
"""
... | Sets up service providers for the given component
:param component_context: The ComponentContext bean
:param instance: The component instance
:return: The list of handlers associated to the given component | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/provides.py#L56-L78 |
tcalmant/ipopo | pelix/ipopo/handlers/provides.py | ServiceRegistrationHandler._field_controller_generator | def _field_controller_generator(self):
"""
Generates the methods called by the injected controller
"""
# Local variable, to avoid messing with "self"
stored_instance = self._ipopo_instance
def get_value(self, name):
# pylint: disable=W0613
"""
... | python | def _field_controller_generator(self):
"""
Generates the methods called by the injected controller
"""
# Local variable, to avoid messing with "self"
stored_instance = self._ipopo_instance
def get_value(self, name):
# pylint: disable=W0613
"""
... | Generates the methods called by the injected controller | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/provides.py#L154-L187 |
tcalmant/ipopo | pelix/ipopo/handlers/provides.py | ServiceRegistrationHandler.manipulate | def manipulate(self, stored_instance, component_instance):
"""
Manipulates the component instance
:param stored_instance: The iPOPO component StoredInstance
:param component_instance: The component instance
"""
# Store the stored instance
self._ipopo_instance = s... | python | def manipulate(self, stored_instance, component_instance):
"""
Manipulates the component instance
:param stored_instance: The iPOPO component StoredInstance
:param component_instance: The component instance
"""
# Store the stored instance
self._ipopo_instance = s... | Manipulates the component instance
:param stored_instance: The iPOPO component StoredInstance
:param component_instance: The component instance | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/provides.py#L189-L224 |
tcalmant/ipopo | pelix/ipopo/handlers/provides.py | ServiceRegistrationHandler.on_controller_change | def on_controller_change(self, name, value):
"""
Called by the instance manager when a controller value has been
modified
:param name: The name of the controller
:param value: The new value of the controller
"""
if self.__controller != name:
# Nothing... | python | def on_controller_change(self, name, value):
"""
Called by the instance manager when a controller value has been
modified
:param name: The name of the controller
:param value: The new value of the controller
"""
if self.__controller != name:
# Nothing... | Called by the instance manager when a controller value has been
modified
:param name: The name of the controller
:param value: The new value of the controller | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/provides.py#L251-L270 |
tcalmant/ipopo | pelix/ipopo/handlers/provides.py | ServiceRegistrationHandler.on_property_change | def on_property_change(self, name, old_value, new_value):
"""
Called by the instance manager when a component property is modified
:param name: The changed property name
:param old_value: The previous property value
:param new_value: The new property value
"""
if... | python | def on_property_change(self, name, old_value, new_value):
"""
Called by the instance manager when a component property is modified
:param name: The changed property name
:param old_value: The previous property value
:param new_value: The new property value
"""
if... | Called by the instance manager when a component property is modified
:param name: The changed property name
:param old_value: The previous property value
:param new_value: The new property value | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/provides.py#L272-L282 |
tcalmant/ipopo | pelix/ipopo/handlers/provides.py | ServiceRegistrationHandler._register_service | def _register_service(self):
"""
Registers the provided service, if possible
"""
if (
self._registration is None
and self.specifications
and self.__validated
and self.__controller_on
):
# Use a copy of component properti... | python | def _register_service(self):
"""
Registers the provided service, if possible
"""
if (
self._registration is None
and self.specifications
and self.__validated
and self.__controller_on
):
# Use a copy of component properti... | Registers the provided service, if possible | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/provides.py#L302-L330 |
tcalmant/ipopo | pelix/ipopo/handlers/provides.py | ServiceRegistrationHandler._unregister_service | def _unregister_service(self):
"""
Unregisters the provided service, if needed
"""
if self._registration is not None:
# Ignore error
try:
self._registration.unregister()
except BundleException as ex:
# Only log the error... | python | def _unregister_service(self):
"""
Unregisters the provided service, if needed
"""
if self._registration is not None:
# Ignore error
try:
self._registration.unregister()
except BundleException as ex:
# Only log the error... | Unregisters the provided service, if needed | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/ipopo/handlers/provides.py#L332-L354 |
tcalmant/ipopo | pelix/utilities.py | use_service | def use_service(bundle_context, svc_reference):
"""
Utility context to safely use a service in a "with" block.
It looks after the the given service and releases its reference when
exiting the context.
:param bundle_context: The calling bundle context
:param svc_reference: The reference of the s... | python | def use_service(bundle_context, svc_reference):
"""
Utility context to safely use a service in a "with" block.
It looks after the the given service and releases its reference when
exiting the context.
:param bundle_context: The calling bundle context
:param svc_reference: The reference of the s... | Utility context to safely use a service in a "with" block.
It looks after the the given service and releases its reference when
exiting the context.
:param bundle_context: The calling bundle context
:param svc_reference: The reference of the service to use
:return: The requested service
:raise ... | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/utilities.py#L64-L88 |
tcalmant/ipopo | pelix/utilities.py | SynchronizedClassMethod | def SynchronizedClassMethod(*locks_attr_names, **kwargs):
# pylint: disable=C1801
"""
A synchronizer decorator for class methods. An AttributeError can be raised
at runtime if the given lock attribute doesn't exist or if it is None.
If a parameter ``sorted`` is found in ``kwargs`` and its value is ... | python | def SynchronizedClassMethod(*locks_attr_names, **kwargs):
# pylint: disable=C1801
"""
A synchronizer decorator for class methods. An AttributeError can be raised
at runtime if the given lock attribute doesn't exist or if it is None.
If a parameter ``sorted`` is found in ``kwargs`` and its value is ... | A synchronizer decorator for class methods. An AttributeError can be raised
at runtime if the given lock attribute doesn't exist or if it is None.
If a parameter ``sorted`` is found in ``kwargs`` and its value is True,
then the list of locks names will be sorted before locking.
:param locks_attr_names... | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/utilities.py#L250-L326 |
tcalmant/ipopo | pelix/utilities.py | is_lock | def is_lock(lock):
"""
Tests if the given lock is an instance of a lock class
"""
if lock is None:
# Don't do useless tests
return False
for attr in "acquire", "release", "__enter__", "__exit__":
if not hasattr(lock, attr):
# Missing something
return ... | python | def is_lock(lock):
"""
Tests if the given lock is an instance of a lock class
"""
if lock is None:
# Don't do useless tests
return False
for attr in "acquire", "release", "__enter__", "__exit__":
if not hasattr(lock, attr):
# Missing something
return ... | Tests if the given lock is an instance of a lock class | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/utilities.py#L329-L343 |
tcalmant/ipopo | pelix/utilities.py | remove_duplicates | def remove_duplicates(items):
"""
Returns a list without duplicates, keeping elements order
:param items: A list of items
:return: The list without duplicates, in the same order
"""
if items is None:
return items
new_list = []
for item in items:
if item not in new_list:... | python | def remove_duplicates(items):
"""
Returns a list without duplicates, keeping elements order
:param items: A list of items
:return: The list without duplicates, in the same order
"""
if items is None:
return items
new_list = []
for item in items:
if item not in new_list:... | Returns a list without duplicates, keeping elements order
:param items: A list of items
:return: The list without duplicates, in the same order | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/utilities.py#L373-L387 |
tcalmant/ipopo | pelix/utilities.py | add_listener | def add_listener(registry, listener):
"""
Adds a listener in the registry, if it is not yet in
:param registry: A registry (a list)
:param listener: The listener to register
:return: True if the listener has been added
"""
if listener is None or listener in registry:
return False
... | python | def add_listener(registry, listener):
"""
Adds a listener in the registry, if it is not yet in
:param registry: A registry (a list)
:param listener: The listener to register
:return: True if the listener has been added
"""
if listener is None or listener in registry:
return False
... | Adds a listener in the registry, if it is not yet in
:param registry: A registry (a list)
:param listener: The listener to register
:return: True if the listener has been added | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/utilities.py#L393-L405 |
tcalmant/ipopo | pelix/utilities.py | remove_listener | def remove_listener(registry, listener):
"""
Removes a listener from the registry
:param registry: A registry (a list)
:param listener: The listener to remove
:return: True if the listener was in the list
"""
if listener is not None and listener in registry:
registry.remove(listener... | python | def remove_listener(registry, listener):
"""
Removes a listener from the registry
:param registry: A registry (a list)
:param listener: The listener to remove
:return: True if the listener was in the list
"""
if listener is not None and listener in registry:
registry.remove(listener... | Removes a listener from the registry
:param registry: A registry (a list)
:param listener: The listener to remove
:return: True if the listener was in the list | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/utilities.py#L408-L420 |
tcalmant/ipopo | pelix/utilities.py | to_iterable | def to_iterable(value, allow_none=True):
"""
Tries to convert the given value to an iterable, if necessary.
If the given value is a list, a list is returned; if it is a string, a list
containing one string is returned, ...
:param value: Any object
:param allow_none: If True, the method returns ... | python | def to_iterable(value, allow_none=True):
"""
Tries to convert the given value to an iterable, if necessary.
If the given value is a list, a list is returned; if it is a string, a list
containing one string is returned, ...
:param value: Any object
:param allow_none: If True, the method returns ... | Tries to convert the given value to an iterable, if necessary.
If the given value is a list, a list is returned; if it is a string, a list
containing one string is returned, ...
:param value: Any object
:param allow_none: If True, the method returns None if value is None, else
it... | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/utilities.py#L551-L574 |
tcalmant/ipopo | pelix/utilities.py | Deprecated.__log | def __log(self, method_name):
"""
Logs the deprecation message on first call, does nothing after
:param method_name: Name of the deprecated method
"""
if not self.__already_logged:
# Print only if not already done
stack = "\n\t".join(traceback.format_stac... | python | def __log(self, method_name):
"""
Logs the deprecation message on first call, does nothing after
:param method_name: Name of the deprecated method
"""
if not self.__already_logged:
# Print only if not already done
stack = "\n\t".join(traceback.format_stac... | Logs the deprecation message on first call, does nothing after
:param method_name: Name of the deprecated method | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/utilities.py#L177-L190 |
tcalmant/ipopo | pelix/utilities.py | CountdownEvent.step | def step(self):
# type: () -> bool
"""
Decreases the internal counter. Raises an error if the counter goes
below 0
:return: True if this step was the final one, else False
:raise ValueError: The counter has gone below 0
"""
with self.__lock:
s... | python | def step(self):
# type: () -> bool
"""
Decreases the internal counter. Raises an error if the counter goes
below 0
:return: True if this step was the final one, else False
:raise ValueError: The counter has gone below 0
"""
with self.__lock:
s... | Decreases the internal counter. Raises an error if the counter goes
below 0
:return: True if this step was the final one, else False
:raise ValueError: The counter has gone below 0 | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/utilities.py#L692-L711 |
tcalmant/ipopo | pelix/shell/completion/pelix.py | BundleCompleter.display_hook | def display_hook(prompt, session, context, matches, longest_match_len):
# type: (str, ShellSession, BundleContext, List[str], int) -> None
"""
Displays the available bundle matches and the bundle name
:param prompt: Shell prompt string
:param session: Current shell session (for ... | python | def display_hook(prompt, session, context, matches, longest_match_len):
# type: (str, ShellSession, BundleContext, List[str], int) -> None
"""
Displays the available bundle matches and the bundle name
:param prompt: Shell prompt string
:param session: Current shell session (for ... | Displays the available bundle matches and the bundle name
:param prompt: Shell prompt string
:param session: Current shell session (for display)
:param context: BundleContext of the shell
:param matches: List of words matching the substitution
:param longest_match_len: Length of... | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/completion/pelix.py#L71-L97 |
tcalmant/ipopo | pelix/shell/completion/pelix.py | BundleCompleter.complete | def complete(
self, config, prompt, session, context, current_arguments, current
):
# type: (CompletionInfo, str, ShellSession, BundleContext, List[str], str) -> List[str]
"""
Returns the list of bundle IDs matching the current state
:param config: Configuration of the curre... | python | def complete(
self, config, prompt, session, context, current_arguments, current
):
# type: (CompletionInfo, str, ShellSession, BundleContext, List[str], str) -> List[str]
"""
Returns the list of bundle IDs matching the current state
:param config: Configuration of the curre... | Returns the list of bundle IDs matching the current state
:param config: Configuration of the current completion
:param prompt: Shell prompt (for re-display)
:param session: Shell session (to display in shell)
:param context: Bundle context of the Shell bundle
:param current_arg... | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/completion/pelix.py#L99-L125 |
tcalmant/ipopo | pelix/shell/completion/pelix.py | ServiceCompleter.display_hook | def display_hook(prompt, session, context, matches, longest_match_len):
# type: (str, ShellSession, BundleContext, List[str], int) -> None
"""
Displays the available services matches and the service details
:param prompt: Shell prompt string
:param session: Current shell session... | python | def display_hook(prompt, session, context, matches, longest_match_len):
# type: (str, ShellSession, BundleContext, List[str], int) -> None
"""
Displays the available services matches and the service details
:param prompt: Shell prompt string
:param session: Current shell session... | Displays the available services matches and the service details
:param prompt: Shell prompt string
:param session: Current shell session (for display)
:param context: BundleContext of the shell
:param matches: List of words matching the substitution
:param longest_match_len: Len... | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/completion/pelix.py#L134-L165 |
tcalmant/ipopo | pelix/shell/completion/pelix.py | ServiceCompleter.complete | def complete(
self, config, prompt, session, context, current_arguments, current
):
# type: (CompletionInfo, str, ShellSession, BundleContext, List[str], str) -> List[str]
"""
Returns the list of services IDs matching the current state
:param config: Configuration of the cur... | python | def complete(
self, config, prompt, session, context, current_arguments, current
):
# type: (CompletionInfo, str, ShellSession, BundleContext, List[str], str) -> List[str]
"""
Returns the list of services IDs matching the current state
:param config: Configuration of the cur... | Returns the list of services IDs matching the current state
:param config: Configuration of the current completion
:param prompt: Shell prompt (for re-display)
:param session: Shell session (to display in shell)
:param context: Bundle context of the Shell bundle
:param current_a... | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/completion/pelix.py#L167-L193 |
tcalmant/ipopo | pelix/rsa/providers/distribution/__init__.py | ExportDistributionProvider.supports_export | def supports_export(self, exported_configs, service_intents, export_props):
"""
Method called by rsa.export_service to ask if this
ExportDistributionProvider supports export for given
exported_configs (list), service_intents (list), and
export_props (dict).
If a ExportCo... | python | def supports_export(self, exported_configs, service_intents, export_props):
"""
Method called by rsa.export_service to ask if this
ExportDistributionProvider supports export for given
exported_configs (list), service_intents (list), and
export_props (dict).
If a ExportCo... | Method called by rsa.export_service to ask if this
ExportDistributionProvider supports export for given
exported_configs (list), service_intents (list), and
export_props (dict).
If a ExportContainer instance is returned then it is used to export
the service. If None is returned... | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/rsa/providers/distribution/__init__.py#L351-L366 |
tcalmant/ipopo | pelix/rsa/providers/distribution/__init__.py | ImportDistributionProvider.supports_import | def supports_import(
self, exported_configs, service_intents, endpoint_props
):
"""
Method called by rsa.export_service to ask if this
ImportDistributionProvider supports import for given
exported_configs (list), service_intents (list), and
export_props (dict).
... | python | def supports_import(
self, exported_configs, service_intents, endpoint_props
):
"""
Method called by rsa.export_service to ask if this
ImportDistributionProvider supports import for given
exported_configs (list), service_intents (list), and
export_props (dict).
... | Method called by rsa.export_service to ask if this
ImportDistributionProvider supports import for given
exported_configs (list), service_intents (list), and
export_props (dict).
If a ImportContainer instance is returned then it is used to import
the service. If None is returned... | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/rsa/providers/distribution/__init__.py#L386-L403 |
tcalmant/ipopo | pelix/rsa/providers/distribution/__init__.py | Container.is_valid | def is_valid(self):
# type: () -> bool
"""
Checks if the component is valid
:return: Always True if it doesn't raise an exception
:raises AssertionError: Invalid properties
"""
assert self._bundle_context
assert self._container_props is not None
a... | python | def is_valid(self):
# type: () -> bool
"""
Checks if the component is valid
:return: Always True if it doesn't raise an exception
:raises AssertionError: Invalid properties
"""
assert self._bundle_context
assert self._container_props is not None
a... | Checks if the component is valid
:return: Always True if it doesn't raise an exception
:raises AssertionError: Invalid properties | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/rsa/providers/distribution/__init__.py#L429-L442 |
tcalmant/ipopo | pelix/rsa/providers/distribution/__init__.py | Container._validate_component | def _validate_component(self, bundle_context, container_props):
# type: (BundleContext, Dict[str, Any]) -> None
"""
Component validated
:param bundle_context: Bundle context
:param container_props: Instance properties
:raises AssertionError: Invalid properties
""... | python | def _validate_component(self, bundle_context, container_props):
# type: (BundleContext, Dict[str, Any]) -> None
"""
Component validated
:param bundle_context: Bundle context
:param container_props: Instance properties
:raises AssertionError: Invalid properties
""... | Component validated
:param bundle_context: Bundle context
:param container_props: Instance properties
:raises AssertionError: Invalid properties | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/rsa/providers/distribution/__init__.py#L445-L456 |
tcalmant/ipopo | pelix/rsa/providers/distribution/__init__.py | Container._add_export | def _add_export(self, ed_id, inst):
# type: (str, Tuple[Any, EndpointDescription]) -> None
"""
Keeps track of an exported service
:param ed_id: ID of the endpoint description
:param inst: A tuple: (service instance, endpoint description)
"""
with self._exported_i... | python | def _add_export(self, ed_id, inst):
# type: (str, Tuple[Any, EndpointDescription]) -> None
"""
Keeps track of an exported service
:param ed_id: ID of the endpoint description
:param inst: A tuple: (service instance, endpoint description)
"""
with self._exported_i... | Keeps track of an exported service
:param ed_id: ID of the endpoint description
:param inst: A tuple: (service instance, endpoint description) | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/rsa/providers/distribution/__init__.py#L478-L487 |
tcalmant/ipopo | pelix/rsa/providers/distribution/__init__.py | Container._find_export | def _find_export(self, func):
# type: (Callable[[Tuple[Any, EndpointDescription]], bool]) -> Optional[Tuple[Any, EndpointDescription]]
"""
Look for an export using the given lookup method
The lookup method must accept a single parameter, which is a tuple
containing a service ins... | python | def _find_export(self, func):
# type: (Callable[[Tuple[Any, EndpointDescription]], bool]) -> Optional[Tuple[Any, EndpointDescription]]
"""
Look for an export using the given lookup method
The lookup method must accept a single parameter, which is a tuple
containing a service ins... | Look for an export using the given lookup method
The lookup method must accept a single parameter, which is a tuple
containing a service instance and endpoint description.
:param func: A function to look for the excepted export
:return: The found tuple or None | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/rsa/providers/distribution/__init__.py#L513-L529 |
tcalmant/ipopo | pelix/rsa/providers/distribution/__init__.py | ExportContainer._export_service | def _export_service(self, svc, ed):
# type: (Any, EndpointDescription) -> None
"""
Registers a service export
:param svc: Service instance
:param ed: Endpoint description
"""
self._add_export(ed.get_id(), (svc, ed)) | python | def _export_service(self, svc, ed):
# type: (Any, EndpointDescription) -> None
"""
Registers a service export
:param svc: Service instance
:param ed: Endpoint description
"""
self._add_export(ed.get_id(), (svc, ed)) | Registers a service export
:param svc: Service instance
:param ed: Endpoint description | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/rsa/providers/distribution/__init__.py#L586-L594 |
tcalmant/ipopo | pelix/rsa/providers/distribution/__init__.py | ExportContainer.prepare_endpoint_props | def prepare_endpoint_props(self, intfs, svc_ref, export_props):
# type: (List[str], ServiceReference, Dict[str, Any]) -> Dict[str, Any]
"""
Sets up the properties of an endpoint
:param intfs: Specifications to export
:param svc_ref: Reference of the exported service
:par... | python | def prepare_endpoint_props(self, intfs, svc_ref, export_props):
# type: (List[str], ServiceReference, Dict[str, Any]) -> Dict[str, Any]
"""
Sets up the properties of an endpoint
:param intfs: Specifications to export
:param svc_ref: Reference of the exported service
:par... | Sets up the properties of an endpoint
:param intfs: Specifications to export
:param svc_ref: Reference of the exported service
:param export_props: Export properties
:return: The properties of the endpoint | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/rsa/providers/distribution/__init__.py#L611-L661 |
tcalmant/ipopo | pelix/rsa/providers/distribution/__init__.py | ExportContainer.export_service | def export_service(self, svc_ref, export_props):
# type: (ServiceReference, Dict[str, Any]) -> EndpointDescription
"""
Exports the given service
:param svc_ref: Reference to the service to export
:param export_props: Export properties
:return: The endpoint description
... | python | def export_service(self, svc_ref, export_props):
# type: (ServiceReference, Dict[str, Any]) -> EndpointDescription
"""
Exports the given service
:param svc_ref: Reference to the service to export
:param export_props: Export properties
:return: The endpoint description
... | Exports the given service
:param svc_ref: Reference to the service to export
:param export_props: Export properties
:return: The endpoint description | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/rsa/providers/distribution/__init__.py#L663-L676 |
tcalmant/ipopo | pelix/shell/xmpp.py | main | def main(argv=None):
"""
Entry point
:param argv: Script arguments (None for sys.argv)
:return: An exit code or None
"""
# Prepare arguments
parser = argparse.ArgumentParser(
prog="pelix.shell.xmpp",
parents=[make_common_parser()],
description="Pelix XMPP Shell",
... | python | def main(argv=None):
"""
Entry point
:param argv: Script arguments (None for sys.argv)
:return: An exit code or None
"""
# Prepare arguments
parser = argparse.ArgumentParser(
prog="pelix.shell.xmpp",
parents=[make_common_parser()],
description="Pelix XMPP Shell",
... | Entry point
:param argv: Script arguments (None for sys.argv)
:return: An exit code or None | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/xmpp.py#L364-L474 |
tcalmant/ipopo | pelix/shell/xmpp.py | _XmppOutStream.flush | def flush(self):
"""
Sends buffered data to the target
"""
# Flush buffer
content = self._buffer.getvalue()
self._buffer = StringIO()
if content:
# Send message
self._client.send_message(self._target, content, mtype="chat") | python | def flush(self):
"""
Sends buffered data to the target
"""
# Flush buffer
content = self._buffer.getvalue()
self._buffer = StringIO()
if content:
# Send message
self._client.send_message(self._target, content, mtype="chat") | Sends buffered data to the target | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/shell/xmpp.py#L114-L124 |
tcalmant/ipopo | pelix/internals/registry.py | _FactoryCounter._get_from_factory | def _get_from_factory(self, factory, svc_registration):
# type: (Any, ServiceRegistration) -> Any
"""
Returns a service instance from a Prototype Service Factory
:param factory: The prototype service factory
:param svc_registration: The ServiceRegistration object
:return... | python | def _get_from_factory(self, factory, svc_registration):
# type: (Any, ServiceRegistration) -> Any
"""
Returns a service instance from a Prototype Service Factory
:param factory: The prototype service factory
:param svc_registration: The ServiceRegistration object
:return... | Returns a service instance from a Prototype Service Factory
:param factory: The prototype service factory
:param svc_registration: The ServiceRegistration object
:return: The requested service instance returned by the factory | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L138-L161 |
tcalmant/ipopo | pelix/internals/registry.py | _FactoryCounter._get_from_prototype | def _get_from_prototype(self, factory, svc_registration):
# type: (Any, ServiceRegistration) -> Any
"""
Returns a service instance from a Prototype Service Factory
:param factory: The service factory
:param svc_registration: The ServiceRegistration object
:return: The re... | python | def _get_from_prototype(self, factory, svc_registration):
# type: (Any, ServiceRegistration) -> Any
"""
Returns a service instance from a Prototype Service Factory
:param factory: The service factory
:param svc_registration: The ServiceRegistration object
:return: The re... | Returns a service instance from a Prototype Service Factory
:param factory: The service factory
:param svc_registration: The ServiceRegistration object
:return: The requested service instance returned by the factory | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L163-L187 |
tcalmant/ipopo | pelix/internals/registry.py | _FactoryCounter.get_service | def get_service(self, factory, svc_registration):
# type: (Any, ServiceRegistration) -> Any
"""
Returns the service required by the bundle. The Service Factory is
called only when necessary while the Prototype Service Factory is
called each time
:param factory: The servi... | python | def get_service(self, factory, svc_registration):
# type: (Any, ServiceRegistration) -> Any
"""
Returns the service required by the bundle. The Service Factory is
called only when necessary while the Prototype Service Factory is
called each time
:param factory: The servi... | Returns the service required by the bundle. The Service Factory is
called only when necessary while the Prototype Service Factory is
called each time
:param factory: The service factory
:param svc_registration: The ServiceRegistration object
:return: The requested service instan... | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L189-L204 |
tcalmant/ipopo | pelix/internals/registry.py | _FactoryCounter.unget_service | def unget_service(self, factory, svc_registration, service=None):
# type: (Any, ServiceRegistration, Any) -> bool
"""
Releases references to the given service reference
:param factory: The service factory
:param svc_registration: The ServiceRegistration object
:param ser... | python | def unget_service(self, factory, svc_registration, service=None):
# type: (Any, ServiceRegistration, Any) -> bool
"""
Releases references to the given service reference
:param factory: The service factory
:param svc_registration: The ServiceRegistration object
:param ser... | Releases references to the given service reference
:param factory: The service factory
:param svc_registration: The ServiceRegistration object
:param service: Service instance (for prototype factories)
:return: True if all service references to this service factory
have... | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L206-L242 |
tcalmant/ipopo | pelix/internals/registry.py | _FactoryCounter.cleanup_service | def cleanup_service(self, factory, svc_registration):
# type: (Any, ServiceRegistration) -> bool
"""
If this bundle used that factory, releases the reference; else does
nothing
:param factory: The service factory
:param svc_registration: The ServiceRegistration object
... | python | def cleanup_service(self, factory, svc_registration):
# type: (Any, ServiceRegistration) -> bool
"""
If this bundle used that factory, releases the reference; else does
nothing
:param factory: The service factory
:param svc_registration: The ServiceRegistration object
... | If this bundle used that factory, releases the reference; else does
nothing
:param factory: The service factory
:param svc_registration: The ServiceRegistration object
:return: True if the bundle was using the factory, else False | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L244-L277 |
tcalmant/ipopo | pelix/internals/registry.py | ServiceReference.unused_by | def unused_by(self, bundle):
"""
Indicates that this reference is not being used anymore by the given
bundle.
This method should only be used by the framework.
:param bundle: A bundle that used this reference
"""
if bundle is None or bundle is self.__bundle:
... | python | def unused_by(self, bundle):
"""
Indicates that this reference is not being used anymore by the given
bundle.
This method should only be used by the framework.
:param bundle: A bundle that used this reference
"""
if bundle is None or bundle is self.__bundle:
... | Indicates that this reference is not being used anymore by the given
bundle.
This method should only be used by the framework.
:param bundle: A bundle that used this reference | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L454-L474 |
tcalmant/ipopo | pelix/internals/registry.py | ServiceReference.used_by | def used_by(self, bundle):
"""
Indicates that this reference is being used by the given bundle.
This method should only be used by the framework.
:param bundle: A bundle using this reference
"""
if bundle is None or bundle is self.__bundle:
# Ignore
... | python | def used_by(self, bundle):
"""
Indicates that this reference is being used by the given bundle.
This method should only be used by the framework.
:param bundle: A bundle using this reference
"""
if bundle is None or bundle is self.__bundle:
# Ignore
... | Indicates that this reference is being used by the given bundle.
This method should only be used by the framework.
:param bundle: A bundle using this reference | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L476-L488 |
tcalmant/ipopo | pelix/internals/registry.py | ServiceRegistration.set_properties | def set_properties(self, properties):
"""
Updates the service properties
:param properties: The new properties
:raise TypeError: The argument is not a dictionary
"""
if not isinstance(properties, dict):
raise TypeError("Waiting for dictionary")
# Key... | python | def set_properties(self, properties):
"""
Updates the service properties
:param properties: The new properties
:raise TypeError: The argument is not a dictionary
"""
if not isinstance(properties, dict):
raise TypeError("Waiting for dictionary")
# Key... | Updates the service properties
:param properties: The new properties
:raise TypeError: The argument is not a dictionary | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L562-L618 |
tcalmant/ipopo | pelix/internals/registry.py | EventDispatcher.clear | def clear(self):
"""
Clears the event dispatcher
"""
with self.__bnd_lock:
self.__bnd_listeners = []
with self.__svc_lock:
self.__svc_listeners.clear()
with self.__fw_lock:
self.__fw_listeners = [] | python | def clear(self):
"""
Clears the event dispatcher
"""
with self.__bnd_lock:
self.__bnd_listeners = []
with self.__svc_lock:
self.__svc_listeners.clear()
with self.__fw_lock:
self.__fw_listeners = [] | Clears the event dispatcher | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L661-L672 |
tcalmant/ipopo | pelix/internals/registry.py | EventDispatcher.add_bundle_listener | def add_bundle_listener(self, listener):
"""
Adds a bundle listener
:param listener: The bundle listener to register
:return: True if the listener has been registered, False if it was
already known
:raise BundleException: An invalid listener has been given
... | python | def add_bundle_listener(self, listener):
"""
Adds a bundle listener
:param listener: The bundle listener to register
:return: True if the listener has been registered, False if it was
already known
:raise BundleException: An invalid listener has been given
... | Adds a bundle listener
:param listener: The bundle listener to register
:return: True if the listener has been registered, False if it was
already known
:raise BundleException: An invalid listener has been given | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L674-L694 |
tcalmant/ipopo | pelix/internals/registry.py | EventDispatcher.add_framework_listener | def add_framework_listener(self, listener):
"""
Registers a listener that will be called back right before the
framework stops.
:param listener: The framework stop listener
:return: True if the listener has been registered, False if it was
already known
... | python | def add_framework_listener(self, listener):
"""
Registers a listener that will be called back right before the
framework stops.
:param listener: The framework stop listener
:return: True if the listener has been registered, False if it was
already known
... | Registers a listener that will be called back right before the
framework stops.
:param listener: The framework stop listener
:return: True if the listener has been registered, False if it was
already known
:raise BundleException: An invalid listener has been given | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L696-L717 |
tcalmant/ipopo | pelix/internals/registry.py | EventDispatcher.add_service_listener | def add_service_listener(
self, bundle_context, listener, specification=None, ldap_filter=None
):
"""
Registers a service listener
:param bundle_context: The bundle_context of the service listener
:param listener: The service listener
:param specification: The specif... | python | def add_service_listener(
self, bundle_context, listener, specification=None, ldap_filter=None
):
"""
Registers a service listener
:param bundle_context: The bundle_context of the service listener
:param listener: The service listener
:param specification: The specif... | Registers a service listener
:param bundle_context: The bundle_context of the service listener
:param listener: The service listener
:param specification: The specification that must provide the service
(optional, None to accept all services)
:param ldap_fi... | https://github.com/tcalmant/ipopo/blob/2f9ae0c44cd9c34ef1a9d50837b3254e75678eb1/pelix/internals/registry.py#L719-L755 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.