Registers a device using the device's unique device ID.

@param context
@param properties
@return a Device object if success
11596
public Device registerDeviceForPush(UUID deviceId,
                                        String notifier,
                                        String token,
                                        Map<String, Object> properties) {
      if (properties == null) {
          properties = new HashMap<String, Object>();
      }
      String notifierKey = notifier + ".notifier.id";
      properties.put(notifierKey, token);
      return registerDevice(deviceId, properties);
    }
1237045
public Signal register(TimerContext context)
    {
        assert context != null;
        RegisteredSignal signal = new TimedSignal(context);
        queue.add(signal);
        return signal;
    }
887931
protected void activate(ComponentContext context, Map<String, Object> properties) {
        if (TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, "activate", "context=" + context);
            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, "activate", "properties=" + properties);
        }
        embeddableWebSphereTransactionManagerRef.activate(context);
        localTransactionCurrentRef.activate(context);
        resourceConfigFactoryRef.activate(context);
        dataSourceFactoryRef.activate(context);
        uowCurrentRef.activate(context);
        userTransactionRef.activate(context);
        serializationServiceRef.activate(context);
        configurationProperties = properties;

    }
1029341
public static void registerXiaomiPush(Context context, String miAppId, String miAppKey, String profile) {
    if (null == context) {
      throw new IllegalArgumentException("context cannot be null.");
    }

    if (StringUtil.isEmpty(miAppId)) {
      throw new IllegalArgumentException("miAppId cannot be null.");
    }

    if (StringUtil.isEmpty(miAppKey)) {
      throw new IllegalArgumentException("miAppKey cannot be null.");
    }

    if (!isXiaomiPhone()) {
      printErrorLog("register error, is not xiaomi phone!");
      return;
    }

    if (!checkXiaomiManifest(context)) {
      printErrorLog("register error, mainifest is incomplete!");
      return;
    }

    miDeviceProfile = profile;

    com.xiaomi.mipush.sdk.MiPushClient.registerPush(context, miAppId, miAppKey);

    LOGGER.d("start register mi push");
  }
1323606
public <R, W> JSONer register(Converter<R, W> converter, String... properties) {
        for (String property : checkNotNull(properties)) {
            converts.put(property, checkNotNull(converter));
        }
        return this;
    }
849148
@Override
    public void register(Builder.Registry registry) {
        registry.add(new AzureAdTokenFactory()); 
        registry.add(MediaContract.class, MediaExceptionProcessor.class);
        registry.add(MediaRestProxy.class);
        registry.add(OAuthFilter.class);
        registry.add(ResourceLocationManager.class);
        registry.add(RedirectFilter.class);
        registry.add(VersionHeadersFilter.class);
        registry.add(UserAgentFilter.class);

        registry.alter(MediaContract.class, ClientConfig.class,
                new Builder.Alteration<ClientConfig>() {
                    @SuppressWarnings("rawtypes")
                    @Override
                    public ClientConfig alter(String profile,
                            ClientConfig instance, Builder builder,
                            Map<String, Object> properties) {

                        instance.getProperties().put(
                                JSONConfiguration.FEATURE_POJO_MAPPING, true);

                        // Turn off auto-follow redirects, because Media
                        // Services rest calls break if it's on
                        instance.getProperties().put(
                                ClientConfig.PROPERTY_FOLLOW_REDIRECTS, false);

                        try {
                            instance.getSingletons().add(
                                    new ODataEntityProvider());
                            instance.getSingletons().add(
                                    new ODataEntityCollectionProvider());
                            instance.getSingletons().add(
                                    new MediaContentProvider());
                            instance.getSingletons().add(
                                    new BatchMimeMultipartBodyWritter());
                        } catch (JAXBException e) {
                            throw new RuntimeException(e);
                        } catch (ParserConfigurationException e) {
                            throw new RuntimeException(e);
                        }

                        return instance;
                    }
                });
    }
558836
private void invokeInstanceRegistrationRequest(final Context context) {

        AuthorizationRequestManager.RequestOptions options = new AuthorizationRequestManager.RequestOptions();

        options.parameters = createRegistrationParams();
        options.headers = createRegistrationHeaders();
        options.requestMethod = Request.POST;

        InnerAuthorizationResponseListener listener = new InnerAuthorizationResponseListener() {
            @Override
            public void handleAuthorizationSuccessResponse(Response response) throws Exception {
                saveCertificateFromResponse(response);
                invokeAuthorizationRequest(context);
            }
        };

        authorizationRequestSend(null, "clients/instance", options, listener);
    }
1045269
@Override
	public IServiceRegistration registerService(String clazz, Object service,
			Dictionary<String, String> properties) {
		final String sourceMethod = "registerService"; //$NON-NLS-1$
		boolean isTraceLogging = log.isLoggable(Level.FINER);
		if (isTraceLogging) {
			log.entering(PlatformServicesImpl.class.getName(), sourceMethod, new Object[]{clazz, service, properties});
		}
		ServiceRegistrationOSGi serviceRegistrationOSGi = null;
		ServiceRegistration<?> serviceRegistration = null;
		BundleContext bundleContext = Activator.getBundleContext();
		if (bundleContext != null) {
			serviceRegistration = bundleContext.registerService(clazz, service,
					properties);
			serviceRegistrationOSGi = new ServiceRegistrationOSGi(serviceRegistration);
		}
		if (isTraceLogging) {
			log.exiting(PlatformServicesImpl.class.getName(), sourceMethod, serviceRegistrationOSGi);
		}
		return serviceRegistrationOSGi;
	}
693231
protected void activate(ComponentContext context) {
        Dictionary<String, ?> props = context.getProperties();
        final boolean trace = TraceComponent.isAnyTracingEnabled();
        if (trace && tc.isEntryEnabled())
            Tr.entry(this, tc, "activate", props);

        name = (String) props.get("config.displayId");
        lock.writeLock().lock();
        try {
            properties = props;
        } finally {
            lock.writeLock().unlock();
        }

        if ("file".equals(props.get("config.source"))) {
            if (name.startsWith(AppDefinedResource.PREFIX)) // avoid conflicts with application defined data sources
                throw new IllegalArgumentException(ConnectorService.getMessage("UNSUPPORTED_VALUE_J2CA8011", name, ID, JDBC_DRIVER));
        }
        if (trace && tc.isEntryEnabled())
            Tr.exit(this, tc, "activate");
    }
309059
@Override
    public void registerObject(Object object) {
        if (object instanceof IManagedContext) {
            managedContexts.add((IManagedContext<?>) object);
        }
    }
36768
public static synchronized void registerSystemPropertiesListener(PropertiesListener listener) {
		Properties currentProperties = System.getProperties();

		// 将System的properties实现替换为ListenableProperties
		if (!(currentProperties instanceof ListenableProperties)) {
			ListenableProperties newProperties = new ListenableProperties(currentProperties);
			System.setProperties(newProperties);
			currentProperties = newProperties;
		}

		((ListenableProperties) currentProperties).register(listener);
	}
301769
public static void register(ActivityListener activityListener, Context context) {
    ListenableActivity activity = getListenableActivity(context);
    if (activity != null) {
      Listener listener = new Listener(activityListener);
      activity.addActivityListener(listener);
    }
  }
864404
public void registerService(Object service)
    {
    	this.setService(service);
    	String serviceClass = getInterfaceClassName(); 

    	if (service != null)
    		serviceRegistration = context.registerService(serviceClass, this.service, properties);
    }
1291624
@Override
    public void initialize(ExtensionContext context) {
        SubsystemRegistration registration = context.registerSubsystem(SUBSYSTEM_NAME, JGroupsModel.CURRENT.getVersion());

        registration.registerSubsystemModel(new JGroupsSubsystemResourceDefinition(context.isRuntimeOnlyRegistrationValid()));
        registration.registerXMLElementWriter(new JGroupsSubsystemXMLWriter());
    }
805067
public static IpCamDevice register(IpCamDevice ipcam) {

		for (WebcamDevice d : DEVICES) {
			String name = ipcam.getName();
			if (d.getName().equals(name)) {
				throw new WebcamException(String.format("Webcam with name '%s' is already registered", name));
			}
		}

		DEVICES.add(ipcam);

		rescan();

		return ipcam;
	}
571181
void setDeviceId(int nDeviceId) {
        synchronized (LOCK) {
            // Move this instance inside the HashMaps
            INSTANCES.get(connection()).remove(getDeviceId());
            INSTANCES.get(connection()).put(nDeviceId, this);

            this.deviceId = nDeviceId;
        }
    }
1280830
private ServiceRegistration registerCrud(BundleContext context, JcrCrudService crud) {
        Dictionary prop = jcromConfiguration.toDictionary();
        prop.put(Crud.ENTITY_CLASS_PROPERTY, crud.getEntityClass());
        prop.put(Crud.ENTITY_CLASSNAME_PROPERTY, crud.getEntityClass().getName());
        ServiceRegistration serviceRegistration = context.registerService(new String[]{Crud.class.getName(), JcrCrud.class.getName()}, crud, prop);
        return serviceRegistration;
    }