Activate DEP communication with a target.
970492
def activate(self, target=None, **options):
        """"""
        log.debug("initiator options: {0}".format(options))

        self.did = options.get('did', None)
        self.nad = options.get('nad', None)
        self.gbi = options.get('gbi', '')[0:48]
        self.brs = min(max(0, options.get('brs', 2)), 2)
        self.lri = min(max(0, options.get('lri', 3)), 3)
        if self._acm is None or 'acm' in options:
            self._acm = bool(options.get('acm', True))

        assert self.did is None or 0 <= self.did <= 255
        assert self.nad is None or 0 <= self.nad <= 255

        ppi = (self.lri << 4) | (bool(self.gbi) << 1) | int(bool(self.nad))
        did = 0 if self.did is None else self.did
        atr_req = ATR_REQ(os.urandom(10), did, 0, 0, ppi, self.gbi)
        psl_req = PSL_REQ(did, (0, 9, 18)[self.brs], self.lri)
        atr_res = psl_res = None
        self.target = target

        if self.target is None and self.acm is True:
            log.debug("searching active communication mode target at 106A")
            tg = nfc.clf.RemoteTarget("106A", atr_req=atr_req.encode())
            try:
                self.target = self.clf.sense(tg, iterations=2, interval=0.1)
            except nfc.clf.UnsupportedTargetError:
                self._acm = False
            except nfc.clf.CommunicationError:
                pass
            else:
                if self.target:
                    atr_res = ATR_RES.decode(self.target.atr_res)
                else:
                    self._acm = None

        if self.target is None:
            log.debug("searching passive communication mode target at 106A")
            target = nfc.clf.RemoteTarget("106A")
            target = self.clf.sense(target, iterations=2, interval=0.1)
            if target and target.sel_res and bool(target.sel_res[0] & 0x40):
                self.target = target

        if self.target is None and self.brs > 0:
            log.debug("searching passive communication mode target at 212F")
            target = nfc.clf.RemoteTarget("212F", sensf_req=b'\0\xFF\xFF\0\0')
            target = self.clf.sense(target, iterations=2, interval=0.1)
            if target and target.sensf_res.startswith(b'\1\1\xFE'):
                atr_req.nfcid3 = target.sensf_res[1:9] + b'ST'
                self.target = target

        if self.target and self.target.atr_res is None:
            try:
                atr_res = self.send_req_recv_res(atr_req, 1.0)
            except nfc.clf.CommunicationError:
                pass
            if atr_res is None:
                log.debug("NFC-DEP Attribute Request failed")
                return None

        if self.target and atr_res:
            if self.brs > ('106A', '212F', '424F').index(self.target.brty):
                try:
                    psl_res = self.send_req_recv_res(psl_req, 0.1)
                except nfc.clf.CommunicationError:
                    pass
                if psl_res is None:
                    log.debug("NFC-DEP Parameter Selection failed")
                    return None
                self.target.brty = ('212F', '424F')[self.brs-1]

            self.rwt = (4096/13.56E6
                        * 2**(atr_res.wt if atr_res.wt < 15 else 14))
            self.miu = (atr_res.lr-3 - int(self.did is not None)
                        - int(self.nad is not None))
            self.gbt = atr_res.gb
            self.pni = 0

            log.info("running as " + str(self))
            return self.gbt
684163
def listen_init(self):
        """"""
        self.dispatcher = ObjectDispatch(self)
        self.factory = MsgPackProtocolFactory(self.dispatcher)
        self.server = UnixServer(self.loop, self.factory, self.path)
        self.server.start()
290144
def messaging(_context, repository, reset_on_start=False):
    
    discriminator = ('messaging', repository)
    reg = get_current_registry()
    config = Configurator(reg, package=_context.package)
    _context.action(discriminator=discriminator, # pylint: disable=E1101
                    callable=config.setup_system_repository,
                    args=(repository,),
                    kw=dict(reset_on_start=reset_on_start))
901930
def _activate(self):
        """"""
        if six.callable(self.streamer):
            # If it's a function, create the stream.
            self.stream_ = self.streamer(*(self.args), **(self.kwargs))

        else:
            # If it's iterable, use it directly.
            self.stream_ = iter(self.streamer)
591591
def listen():
        """"""
        msg = MSG()
        ctypes.windll.user32.GetMessageA(ctypes.byref(msg), 0, 0, 0)
846488
def _on_open(self, _):
        """"""
        nick = self._format_nick(self._nick, self._pwd)
        data = {"cmd": "join", "channel": self._channel, "nick": nick}
        self._send_packet(data)
        self._thread = True
        threading.Thread(target=self._ping).start()
906592
def bind_target(self, target, ctx=None):
        

        # process self _bind_target
        result = self._bind_target(target=target, ctx=ctx)

        # fire on bind target event
        self.on_bind_target(target=target, ctx=ctx)

        return result
361144
def postActivate_(self):
        
        self.tmpfile = os.path.join(constant.tmpdir,"valkka-"+str(os.getpid())) # e.g. "/tmp/valkka-10968" 
        self.analyzer = ExternalDetector(
            executable = self.executable,
            image_dimensions = self.image_dimensions,
            tmpfile = self.tmpfile
            )
447756
public static void createAgent (
        ClientObject target, int arg1)
    {
        sendNotification(
            target, BureauDecoder.RECEIVER_CODE, BureauDecoder.CREATE_AGENT,
            new Object[] { Integer.valueOf(arg1) });
    }
1246336
def register_target(repo_cmd, repo_service):
    """"""
    def decorate(klass):
        log.debug('Loading service module class: {}'.format(klass.__name__) )
        klass.command = repo_cmd
        klass.name = repo_service
        RepositoryService.service_map[repo_service] = klass
        RepositoryService.command_map[repo_cmd] = repo_service
        return klass
    return decorate
1089462
def emit(self, *args, **kwargs):
        '''
        
        '''
        self._messanger.send(self, *args, **kwargs)
68971
protected void activate()
   {
      LOG.debug("Activating receipt of incoming messages");
      String addr = endpointInfo.getAddress();
      try
      {
         new URL(addr);
      }
      catch (Exception e)
      {
         throw new Fault(e);
      }
      engine.addHandler(addr, new Handler(this, SecurityActions.getContextClassLoader()));
   }
1168886
public void preInvokeMdbAfterActivate(EJSWrapperBase wrapper,
                                          EJSDeployedSupport s,
                                          Object eb, // d414873
                                          Object[] args) throws RemoteException {
        // Now perform preinvoke processing that must occur after
        // the bean is activated.
        preInvokeAfterActivate(wrapper, eb, s, args);

        // If there is a registered message endpoint collaborator, call it for preInvoke processing.
        MessageEndpointCollaborator meCollaborator = getEJBRuntime().getMessageEndpointCollaborator(wrapper.bmd);
        if (meCollaborator != null) {
            HashMap<String, Object> contextData = new HashMap<String, Object>();
            contextData.put(MessageEndpointCollaborator.KEY_ACTIVATION_SPEC_ID, wrapper.bmd.ivActivationSpecJndiName);
            contextData.put(MessageEndpointCollaborator.KEY_J2EE_NAME, wrapper.bmd.j2eeName);

            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Invoking MECollaborator " + meCollaborator + " for preInvoke processing with the following context data: " + contextData);
            }
            
            s.messageEndpointContext = meCollaborator.preInvoke(contextData);
        }

        // Normal path exit.
        if (TraceComponent.isAnyTracingEnabled()) {
            if (tc.isEntryEnabled()) {
                int methodId = s.methodId;
                EJBMethodInfoImpl methodInfo = s.methodInfo;
                ContainerTx containerTx = s.currentTx;
                Tr.exit(tc, "EJBpreInvoke(" + methodId + ":" +
                            methodInfo.getMethodName() + ") " +
                            " Invoking method '" + methodInfo.getMethodName() +
                            "' on bean '" + wrapper.getClass().getName() +
                            "(" + wrapper.beanId + ")" +
                            "', '" + containerTx + "', isGlobalTx=" +
                            (containerTx != null ? (containerTx.isTransactionGlobal() ? "true" : "false") : "Unknown"));
            }

            if (TEEJBInvocationInfo.isTraceEnabled())
                TEEJBInvocationInfo.tracePreInvokeEnds(s, wrapper);
        }
    }
59292
def kick(self, channel, target, reason=None):
        """"""
        if reason:
            target += ' :' + reason
        self.send_line('KICK %s %s' % (channel, target), nowait=True)
737530
public void activated(Pipe pipe)
    {
        //  Move the pipe from passive to eligible state.
        Collections.swap(pipes, pipes.indexOf(pipe), eligible);
        eligible++;

        //  If there's no message being sent at the moment, move it to
        //  the active state.
        if (!more) {
            Collections.swap(pipes, eligible - 1, active);
            active++;
        }
    }
314639
public void targetAppears( TargetHandler targetItf ) {
		this.defaultTargetHandlerResolver.addTargetHandler( targetItf );

		// When a target is deployed, we may also have to update instance states.
		// Consider as an example when the DM restarts. Targets may be injected
		// before and after the pojo was started by iPojo.

		// See #519 for more details.
		// Notice we restore instances only when the DM was started (the messaging
		// must be ready). If it is not started, do nothing. The "start" method
		// will trigger the restoration.

		// We consider the DM is started if the timer is not null.
		if( this.timer != null )
			restoreInstancesFrom( targetItf );
	}
749503
def trigger_callback(meth, wi_or_msg, err=nil)

      wi, msg, err = if err
        [ wi_or_msg['workitem'], wi_or_msg, err ]
      elsif wi_or_msg['workitem']
        [ wi_or_msg['workitem'], wi_or_msg, nil ]
      else
        [ wi_or_msg, nil, nil ]
      end

      pinfo =
        h.participant ||
        @context.plist.lookup_info(h.participant_name, wi)

      pa = @context.plist.instantiate(pinfo, :if_respond_to? => meth)

      return nil unless pa

      args = { 'workitem' => Ruote::Workitem.new(wi) }
      args['error'] = err if err
      args['msg'] = msg if msg

      Ruote.participant_send(pa, meth, args)
    end