borrow a Handler instance from Modelhandler pool
4651
public ModelHandler borrowtHandlerObject(String formName) {
		ModelHandler modelHandler = null;
		try {
			modelHandler = handlerObjectFactory.borrowHandlerObject(formName);
			modelHandler.setModelMapping(modelFactory.getModelMapping(formName));
		} catch (Exception ex) {
			Debug.logError("[JdonFramework]can't get the modelHandler for the formName " + formName, module);
			returnHandlerObject(modelHandler);
		}
		return modelHandler;
	}
706082
def _dispatch(self, typ):
        
        for can_handle, handler in self._handler_pairs:
            # can handle could raise an exception here
            # such as issubclass being called on an instance.
            # it's easier to just ignore that case.
            try:
                if can_handle(typ):
                    return handler
            except Exception:
                pass
        raise KeyError("unable to find handler for {0}".format(typ))
952613
function getHandlers (name, callback, context) {
    var events = [];
    if (!callback && !context) {
        if (name) {
            return (this._events && this._events[name]) || [];
        } else {
            return this._events;
        }
    }
    _.each(this._events, function (value, key) {
        if (!name || key === name) {
            value.forEach(function (event) {
                if ((!callback || event.callback === callback) && (!context || event.context === context)) {
                    events.push(event);
                }
            });
        }
    });
    return events;
}
112100
function Model(model) {
    this.child = window;
    this.model = model;
    this.parent = this.child.parent;
    return this.sendHandshakeReply();
  }
600208
function loadModels(mongoose, modelPath) {
    if (mongoose === undefined) {
        throw new Error('expect a mongoose handle to be passed');
    }
    return getMongoHandle(mongoose).then((modelHandle) => {
        debuglog(`got a mongo handle for ${modelPath}`);
        return _loadModelsFull(modelHandle, modelPath);
    });
}
1190395
def async_get(self, handle):
        '''  '''
        assert handle in self._thread_pool, 'Invalid async call handle'
        result = self._thread_pool[handle].result_queue.get()
        del self._thread_pool[handle]
        return result
544462
def model_get(method_name):
    

    def model_get(_value, context, **_params):
        method = getattr(context["model"], method_name)
        return _get(method, context["key"], (), {})

    return model_get
328938
def handle(self, handler):
        
        with self._hlock:
            self._handler_list.append(handler)
        return self
632739
def infer(self, handler):
        """"""
        table = handler.table
        new_self = self.copy()
        new_self.set_table(table)
        new_self.get_attr()
        new_self.read_metadata(handler)
        return new_self
1334490
function connectHandlers (decorator, event) {
    const handlers = Metadata.getClassMeta(Object.getPrototypeOf(self), decorator, Object.create(null));
    for (const f of Object.keys(handlers)) {
      ravelInstance.once(event, (...args) => {
        ravelInstance.$log.trace(`${name}: Invoking ${decorator} ${f}`);
        handlers[f].apply(self, args);
      });
    }
  }
574935
def get_handlers(self, component_context, instance):
        
        # Extract information from the context
        configs = component_context.get_handler(
            ipopo_constants.HANDLER_TEMPORAL
        )
        requires_filters = component_context.properties.get(
            ipopo_constants.IPOPO_REQUIRES_FILTERS, None
        )
        temporal_timeouts = component_context.properties.get(
            ipopo_constants.IPOPO_TEMPORAL_TIMEOUTS, None
        )

        # Prepare requirements
        new_configs = self._prepare_configs(
            configs, requires_filters, temporal_timeouts
        )

        # Return handlers
        return [
            TemporalDependency(field, requirement, timeout)
            for field, (requirement, timeout) in new_configs.items()
        ]
715900
def get_handler(self, request):
        
        try:
            f = self._json_rpc_methods[request.method]

        except (AttributeError, KeyError):  # pragma no coverage
            raise RPCMethodError("Received invalid method '{}'".format(request.method))

        return f
702094
def model_function(self, model_name, version, func_name):
        """"""
        assert func_name in ('serializer', 'loader', 'invalidator')
        name = "%s_%s_%s" % (model_name.lower(), version, func_name)
        return getattr(self, name)
903157
function getHandlersFromArgs(args, start) {
  assert.ok(args);

  args = Array.prototype.slice.call(args, start);

  function process(handlers, acc) {
    if (handlers.length === 0) {
      return acc;
    }

    var head = handlers.shift();
    if (Array.isArray(head)) {
      return process(head.concat(handlers), acc);
    } else {
      assert.func(head, 'handler');
      acc.push(head);
      return process(handlers, acc);
    }
  }

  return process(args, []);
}
753671
def get_handler(self, *args, **options):
        
        handler = WSGIHandler()
        try:
            from django.contrib.staticfiles.handlers import StaticFilesHandler
        except ImportError:
            return handler
        use_static_handler = options.get('use_static_handler', True)
        insecure_serving = options.get('insecure_serving', False)
        if (settings.DEBUG and use_static_handler or
                (use_static_handler and insecure_serving)):
            handler = StaticFilesHandler(handler)
        return handler
653840
def get_handler(ptr, method):
    
    obj = CACHE.get(ptr, None)
    if obj is None:
        raise BridgeReferenceError(
            "Reference id={} never existed or has already been destroyed"
            .format(ptr))
    elif not hasattr(obj, method):
        raise NotImplementedError("{}.{} is not implemented.".format(obj,
                                                                     method))
    return obj, getattr(obj, method)
568301
def get_handlers(self, kind=None):
        
        with self._lock:
            if kind is not None:
                try:
                    return self._handlers[kind][:]
                except KeyError:
                    return []

            return self.__all_handlers.copy()