Creates a RemoteServiceAdminEvent object from an ExportRegistration
14463
def fromexportreg(cls, bundle, export_reg):
        # type: (Bundle, ExportRegistration) -> RemoteServiceAdminEvent
        
        exc = export_reg.get_exception()
        if exc:
            return RemoteServiceAdminEvent(
                RemoteServiceAdminEvent.EXPORT_ERROR,
                bundle,
                export_reg.get_export_container_id(),
                export_reg.get_remoteservice_id(),
                None,
                None,
                exc,
                export_reg.get_description(),
            )

        return RemoteServiceAdminEvent(
            RemoteServiceAdminEvent.EXPORT_REGISTRATION,
            bundle,
            export_reg.get_export_container_id(),
            export_reg.get_remoteservice_id(),
            None,
            export_reg.get_export_reference(),
            None,
            export_reg.get_description(),
        )
701519
function createWatchEvent(type, record, event) {
    const payload = Object.assign({ type, key: record.id, modelName: record.modelName, pluralName: record.pluralName, modelConstructor: record.modelConstructor, dynamicPathProperties: record.dynamicPathComponents, compositeKey: record.compositeKey, dbPath: record.dbPath, localPath: record.localPath || "", localPostfix: record.META.localPostfix }, event);
    return payload;
}
1043720
function execExport(exportation, content) {
    if (!exportation) {
      return;
    }
    if (exportation.indexOf('@') === 0) { // argv
      console.error(colors.red('Argv is readonly.'));
      return;
    }
    if (exportation.indexOf(':') === 0) { // env
      console.error(colors.red('Env is readonly.'));
      return;
    }
    if (exportation.indexOf('#') === 0) { // variants
      setVariant(exportation.slice(1), content);
      cacheKeys[exportation] = null;
      return true;
    }
    else if (!invalidFilename(exportation)) {
      var name = path.resolve(getDirname(), exportation);
      cacheKeys[name] = null;
      if (fs.existsSync(name)) {
        console.warn(
          colors.blue('File "%s" overwrite.'), name
        );
      }
      else {
        mkdirp.sync(path.dirname(name));
      }
      fs.writeFileSync(name, content);
      scopes[name] = null;
      return true;
    }
    else {
      console.error(colors.red('Export %j invalid.'), exportation);
      return;
    }
  }
1098476
static OcAgentMetricsServiceExportRpcHandler create(MetricsServiceStub stub) {
    OcAgentMetricsServiceExportRpcHandler exportRpcHandler =
        new OcAgentMetricsServiceExportRpcHandler();
    ExportResponseObserver exportResponseObserver = new ExportResponseObserver(exportRpcHandler);
    try {
      StreamObserver<ExportMetricsServiceRequest> exportRequestObserver =
          stub.export(exportResponseObserver);
      exportRpcHandler.setExportRequestObserver(exportRequestObserver);
    } catch (StatusRuntimeException e) {
      exportRpcHandler.onComplete(e);
    }
    return exportRpcHandler;
  }
682607
private static Main mainEmbeddedImpl(ContextFactory factory,
                                         Object scopeProvider,
                                         String title) {
        if (title == null) {
            title = "Rhino JavaScript Debugger (embedded usage)";
        }
        Main main = new Main(title);
        main.doBreak();
        main.setExitAction(new IProxy(IProxy.EXIT_ACTION));

        main.attachTo(factory);
        if (scopeProvider instanceof ScopeProvider) {
            main.setScopeProvider((ScopeProvider)scopeProvider);
        } else {
            Scriptable scope = (Scriptable)scopeProvider;
            if (scope instanceof Global) {
                Global global = (Global)scope;
                global.setIn(main.getIn());
                global.setOut(main.getOut());
                global.setErr(main.getErr());
            }
            main.setScope(scope);
        }

        main.pack();
        main.setSize(600, 460);
        main.setVisible(true);
        return main;
    }
675668
private Message createMessageProxy(Message msgObject) {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "createMessageProxy", msgObject);

        Message retObj;
        try {

            retObj = (Message) Proxy.newProxyInstance(msgObject.getClass().getClassLoader(),
                                                      msgObject.getClass().getInterfaces(),
                                                      new MessageProxyInvocationHandler(msgObject));
        } catch (Exception e) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                SibTr.debug(tc, "Exception caught while trying to createMessageProxy ", e);

            //if any exception .. return the same msgObject.
            retObj = msgObject;

        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "createMessageProxy", retObj);

        return retObj;

    }
699864
function (type, create) {
            var self = this, customEvent, customEventObservables = self.getCustomEvents();
            customEvent = customEventObservables && customEventObservables[type];
            if (!customEvent && create) {
                customEvent = customEventObservables[type] = new CustomEventObservable({
                    currentTarget: self,
                    type: type
                });
            }
            return customEvent;
        }
358038
function emitEvent(payload, eventNameBase, debugParams) {

        // create a copy of the payload so that nothing modifies the original object
        try {
            payload = JSON.parse(JSON.stringify(payload));
        }
        catch (err) {
            /* eslint no-console:0 */
            console.log('issue parsing during emit ' + JSON.stringify(eventNameBase));
        }

        // we don't want to emit the potentially huge resource file
        if (payload && payload.resource) {
            delete payload.resource;
        }

        // create the event data and emit the event
        var name = _.extend({}, eventNameBase, debugParams);
        var eventData = {
            name: name,
            payload: payload
        };
        var eventName = name.resource + '.' + name.adapter + '.' + name.method;
        eventName += debugParams ? '.' + name.type + '.' + name.timing : '';
        eventBus.emit(eventName, eventData);
    }
973971
def fromexporterror(cls, bundle, exporterid, rsid, exception, endpoint):
        # type: (Bundle, Tuple[str, str], Tuple[Tuple[str, str], int], Optional[Tuple[Any, Any, Any]], EndpointDescription) -> RemoteServiceAdminEvent
        
        return RemoteServiceAdminEvent(
            RemoteServiceAdminEvent.EXPORT_ERROR,
            bundle,
            exporterid,
            rsid,
            None,
            None,
            exception,
            endpoint,
        )
446847
public <T> EventHandler<RemoteEvent<T>> getHandler() {
    return new RemoteSenderEventHandler<T>(encoder, transport, executor);
  }
1325029
function createService(senderType) {
        return (function (type) {

            // Angular service constructor
            return function ($q, $rootScope) {
                var className = type.charAt(0).toUpperCase() + type.slice(1) + 'Sender',
                    sender = new enplug.classes[className]();

                // Remove event listeners for existing sender and reassign
                enplug[type].cleanup();
                enplug[type] = sender;

                // Return promises
                decorateSend($q, $rootScope, sender.transport);
                return sender;
            };
        }(senderType));
    }
396872
@Override
  public <T> EventHandler<T> getHandler(
      final RemoteIdentifier destinationIdentifier, final Class<? extends T> messageType) {

    if (LOG.isLoggable(Level.FINE)) {
      LOG.log(Level.FINE, "RemoteManager: {0} destinationIdentifier: {1} messageType: {2}",
          new Object[] {this.name, destinationIdentifier, messageType.getCanonicalName()});
    }

    return new ProxyEventHandler<>(this.myIdentifier, destinationIdentifier,
        "default", this.reSendStage.<T>getHandler(), this.seqGen);
  }
858797
def export_service(self, svc_ref, export_props):
        # type: (ServiceReference, Dict[str, Any]) -> EndpointDescription
        
        ed = EndpointDescription.fromprops(export_props)
        self._export_service(
            self._get_bundle_context().get_service(svc_ref), ed
        )
        return ed
1277674
def ExportInstance(r, instance, mode, destination, shutdown=None,
                   remove_instance=None, x509_key_name=None,
                   destination_x509_ca=None):
    

    body = {
        "destination": destination,
        "mode": mode,
    }

    if shutdown is not None:
        body["shutdown"] = shutdown

    if remove_instance is not None:
        body["remove_instance"] = remove_instance

    if x509_key_name is not None:
        body["x509_key_name"] = x509_key_name

    if destination_x509_ca is not None:
        body["destination_x509_ca"] = destination_x509_ca

    return r.request("put", "/2/instances/%s/export" % instance, content=body)
1327353
public void onStartServiceEvent(
			javax.slee.serviceactivity.ServiceStartedEvent event,
			ActivityContextInterface aci) {

		try {
			XDMClientChildSbbLocalObject child = (XDMClientChildSbbLocalObject) this
					.getXDMClientChildSbbChildRelation().create(ChildRelationExt.DEFAULT_CHILD_NAME);
			String[] resourceURIS = new String[] { getDocumentSelector() };
			// String aserted = null;
			// subscribe to changes - before doc is created.
			// assume we are bound to the same localhost.
			// from/to must match
			child.subscribe(user, user, 60, resourceURIS);
		} catch (Exception e) {
			tracer.severe("failed to subscribe changes to doc", e);
		}
	}
1004265
@Subscribe
    public void publishJCREvent(final FedoraEvent fedoraEvent) throws JMSException {
        LOGGER.debug("Received an event from the internal bus.");
        final Message tm =
                eventFactory.getMessage(fedoraEvent, jmsSession);
        LOGGER.debug("Transformed the event to a JMS message.");
        producer.send(tm);

        LOGGER.debug("Put event: {} onto JMS.", tm.getJMSMessageID());
    }
1282116
def fromexportunreg(
        cls, bundle, exporterid, rsid, export_ref, exception, endpoint
    ):
        # type: (Bundle, Tuple[str, str], Tuple[Tuple[str, str], int], ExportReference, Optional[Tuple[Any, Any, Any]], EndpointDescription) -> RemoteServiceAdminEvent
        
        return RemoteServiceAdminEvent(
            typ=RemoteServiceAdminEvent.EXPORT_UNREGISTRATION,
            bundle=bundle,
            cid=exporterid,
            rsid=rsid,
            export_ref=export_ref,
            exception=exception,
            endpoint=endpoint,
        )