Called by the parent Cluster instance when the user registers a new
        mapping from a user-defined type to a class.  Intended for internal
        use only.
485476
def user_type_registered(self, keyspace, user_type, klass):
        
        try:
            ks_meta = self.cluster.metadata.keyspaces[keyspace]
        except KeyError:
            raise UserTypeDoesNotExist(
                'Keyspace %s does not exist or has not been discovered by the driver' % (keyspace,))

        try:
            type_meta = ks_meta.user_types[user_type]
        except KeyError:
            raise UserTypeDoesNotExist(
                'User type %s does not exist in keyspace %s' % (user_type, keyspace))

        field_names = type_meta.field_names
        if six.PY2:
            # go from unicode to string to avoid decode errors from implicit
            # decode when formatting non-ascii values
            field_names = [fn.encode('utf-8') for fn in field_names]

        def encode(val):
            return '{ %s }' % ' , '.join('%s : %s' % (
                field_name,
                self.encoder.cql_encode_all_types(getattr(val, field_name, None))
            ) for field_name in field_names)

        self.encoder.mapping[klass] = encode
1102867
private void initializeMapper() {
    if (valueClass == null) {
      valueMapper = CatchAllMapper.getInstance();
    } else {
      try {
        valueMapper = MapperFactory.getInstance().getMapper(valueClass);
      } catch (NoSuitableMapperException exp) {
        valueMapper = CatchAllMapper.getInstance();
      }

    }
  }
5127
def register(cls):
    
    registry_entry = RegistryEntry(category = cls.category, namespace = cls.namespace, name = cls.name, cls=cls)
    if registry_entry not in registry and not exists_in_registry(cls.category, cls.namespace, cls.name):
        registry.append(registry_entry)
    else:
        log.warn("Class {0} already in registry".format(cls))
436213
public static <T,R> void register(Class<T> from, Class<R> to, Function<T,R> transform) {
        REGISTRY.register(from, to, transform);
    }
461473
public final void register(Class type, Serializer serializer) {
        if (type == null) {
            throw new IllegalArgumentException("Class type information is required!");
        }
        if (serializer.getTypeId() <= 0) {
            throw new IllegalArgumentException(
                    "Type ID must be positive! Current: " + serializer.getTypeId() + ", Serializer: " + serializer);
        }
        safeRegister(type, createSerializerAdapter(serializer, this));
    }
449124
@SuppressWarnings("rawtypes")
  public SerializerRegistry register(Class<?> type, Class<? extends TypeSerializer> serializer) {
    return register(type, calculateTypeId(type), new DefaultTypeSerializerFactory(serializer));
  }
1346435
private ObjectMapper createObjectMapper() {
        ObjectMapper mapper = new ObjectMapper();
        mapper.registerModule(new JodaModule());
        mapper.configure(SerializationFeature.INDENT_OUTPUT, true);
        return mapper;
    }
1030588
public void register(InstanceInfo registrant, int leaseDuration, boolean isReplication) {
        try {
            read.lock();
            Map<String, Lease<InstanceInfo>> gMap = registry.get(registrant.getAppName());
            REGISTER.increment(isReplication);
            if (gMap == null) {
                final ConcurrentHashMap<String, Lease<InstanceInfo>> gNewMap = new ConcurrentHashMap<String, Lease<InstanceInfo>>();
                gMap = registry.putIfAbsent(registrant.getAppName(), gNewMap);
                if (gMap == null) {
                    gMap = gNewMap;
                }
            }
            Lease<InstanceInfo> existingLease = gMap.get(registrant.getId());
            // Retain the last dirty timestamp without overwriting it, if there is already a lease
            if (existingLease != null && (existingLease.getHolder() != null)) {
                Long existingLastDirtyTimestamp = existingLease.getHolder().getLastDirtyTimestamp();
                Long registrationLastDirtyTimestamp = registrant.getLastDirtyTimestamp();
                logger.debug("Existing lease found (existing={}, provided={}", existingLastDirtyTimestamp, registrationLastDirtyTimestamp);

                // this is a > instead of a >= because if the timestamps are equal, we still take the remote transmitted
                // InstanceInfo instead of the server local copy.
                if (existingLastDirtyTimestamp > registrationLastDirtyTimestamp) {
                    logger.warn("There is an existing lease and the existing lease's dirty timestamp {} is greater" +
                            " than the one that is being registered {}", existingLastDirtyTimestamp, registrationLastDirtyTimestamp);
                    logger.warn("Using the existing instanceInfo instead of the new instanceInfo as the registrant");
                    registrant = existingLease.getHolder();
                }
            } else {
                // The lease does not exist and hence it is a new registration
                synchronized (lock) {
                    if (this.expectedNumberOfClientsSendingRenews > 0) {
                        // Since the client wants to register it, increase the number of clients sending renews
                        this.expectedNumberOfClientsSendingRenews = this.expectedNumberOfClientsSendingRenews + 1;
                        updateRenewsPerMinThreshold();
                    }
                }
                logger.debug("No previous lease information found; it is new registration");
            }
            Lease<InstanceInfo> lease = new Lease<InstanceInfo>(registrant, leaseDuration);
            if (existingLease != null) {
                lease.setServiceUpTimestamp(existingLease.getServiceUpTimestamp());
            }
            gMap.put(registrant.getId(), lease);
            synchronized (recentRegisteredQueue) {
                recentRegisteredQueue.add(new Pair<Long, String>(
                        System.currentTimeMillis(),
                        registrant.getAppName() + "(" + registrant.getId() + ")"));
            }
            // This is where the initial state transfer of overridden status happens
            if (!InstanceStatus.UNKNOWN.equals(registrant.getOverriddenStatus())) {
                logger.debug("Found overridden status {} for instance {}. Checking to see if needs to be add to the "
                                + "overrides", registrant.getOverriddenStatus(), registrant.getId());
                if (!overriddenInstanceStatusMap.containsKey(registrant.getId())) {
                    logger.info("Not found overridden id {} and hence adding it", registrant.getId());
                    overriddenInstanceStatusMap.put(registrant.getId(), registrant.getOverriddenStatus());
                }
            }
            InstanceStatus overriddenStatusFromMap = overriddenInstanceStatusMap.get(registrant.getId());
            if (overriddenStatusFromMap != null) {
                logger.info("Storing overridden status {} from map", overriddenStatusFromMap);
                registrant.setOverriddenStatus(overriddenStatusFromMap);
            }

            // Set the status based on the overridden status rules
            InstanceStatus overriddenInstanceStatus = getOverriddenInstanceStatus(registrant, existingLease, isReplication);
            registrant.setStatusWithoutDirty(overriddenInstanceStatus);

            // If the lease is registered with UP status, set lease service up timestamp
            if (InstanceStatus.UP.equals(registrant.getStatus())) {
                lease.serviceUp();
            }
            registrant.setActionType(ActionType.ADDED);
            recentlyChangedQueue.add(new RecentlyChangedItem(lease));
            registrant.setLastUpdatedTimestamp();
            invalidateCache(registrant.getAppName(), registrant.getVIPAddress(), registrant.getSecureVipAddress());
            logger.info("Registered instance {}/{} with status {} (replication={})",
                    registrant.getAppName(), registrant.getId(), registrant.getStatus(), isReplication);
        } finally {
            read.unlock();
        }
    }
626544
private void register(String converterClassName) {

    Class<Converter> converterClass = ObjectUtils.loadClass(converterClassName);

    if (ObjectUtils.assignableTo(converterClass, Converter.class)) {
      try {
        Converter<?, ?> converter = (Converter<?, ?>) converterClass.newInstance();
        register(converter);
      }
      catch (Exception ignore) {
      }
    }
  }
8926
public void register(Class src, Class target) {
        List<BeanMappingObject> objects = BeanMappingParser.parseMapping(src, target);
        for (BeanMappingObject object : objects) {
            register(object);
        }
    }
246460
public void register(T instance) {
		if(!isContained(instance)) {
			registry.add(instance);
			if(current == null) {
				current = instance;
			}
		}
	}
612
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out)
    {
        //
        // Get the bean and associated beanInfo for the source instance
        //
        ControlBean control = (ControlBean)oldInstance;
        BeanInfo beanInfo;
        try
        {
            beanInfo = Introspector.getBeanInfo(control.getClass());
        }
        catch (IntrospectionException ie)
        {
            throw new ControlException("Unable to locate BeanInfo", ie);
        }

        //
        // Cast the encoding stream to an XMLEncoder (only encoding supported) and then set
        // the stream owner to the bean being persisted
        //
        XMLEncoder xmlOut = (XMLEncoder)out;
        Object owner = xmlOut.getOwner();
        xmlOut.setOwner(control);
        try
        {

            //
            // The default implementation of property persistence will use BeanInfo to 
            // incrementally compare oldInstance property values to newInstance property values.   
            // Because the bean instance PropertyMap holds only the values that have been 
            // modified, this process can be optimized by directly writing out only the properties 
            // found in the map.
            //
            BeanPropertyMap beanMap = control.getPropertyMap();
            PropertyDescriptor [] propDescriptors = beanInfo.getPropertyDescriptors();
            for (PropertyKey pk : beanMap.getPropertyKeys())
            {
                //
                // Locate the PropertyDescriptor for the modified property, and use it to write
                // the property value to the encoder stream
                //
                String propName = pk.getPropertyName();
                boolean found = false;
                for (int i = 0; i < propDescriptors.length; i++)
                {
                    if (propName.equals(propDescriptors[i].getName()))
                    {
                        found = true;

                        // Only write the property if it is not flagged as transient
                        Object transientVal = propDescriptors[i].getValue("transient");
                        if (transientVal == null || transientVal.equals(Boolean.FALSE))
                        {
                            xmlOut.writeStatement(
                                new Statement(oldInstance, 
                                      propDescriptors[i].getWriteMethod().getName(),
                                      new Object [] {beanMap.getProperty(pk)}));
                        }
                    }
                }
                if (found == false)
                {
                    throw new ControlException("Unknown property in bean PropertyMap: " + pk);
                }
            }

            //
            // Get the bean context associated with the bean, and persist any nested controls
            //
            ControlBeanContext cbc = control.getControlBeanContext();
            if (cbc.size() != 0)
            {
                xmlOut.setPersistenceDelegate(ControlBeanContext.class, 
                                              new ContextPersistenceDelegate());

                Iterator nestedIter = cbc.iterator();
                while (nestedIter.hasNext())
                {
                    Object bean = nestedIter.next();
                    if (bean instanceof ControlBean)
                    {
                        xmlOut.writeStatement(
                            new Statement(cbc, "add", new Object [] { bean } ));
                    }
                }
            }

            //
            // Restore any listeners associated with the control
            //
            EventSetDescriptor [] eventSetDescriptors = beanInfo.getEventSetDescriptors();
            for (int i = 0; i < eventSetDescriptors.length; i++)
            {
                EventSetDescriptor esd = eventSetDescriptors[i];
                Method listenersMethod = esd.getGetListenerMethod();
                String addListenerName = esd.getAddListenerMethod().getName();
                if (listenersMethod != null)
                {
                    //
                    // Get the list of listeners, and then add statements to incrementally
                    // add them in the same order
                    //
                    try
                    {
                        Object [] lstnrs = (Object [])listenersMethod.invoke(control, 
                                                                             new Object []{});
                        for (int j = 0; j < lstnrs.length; j++)
                        {
                            //
                            // If this is a generated EventAdaptor class, then set the delegate
                            // explicitly
                            //
                            if (lstnrs[j] instanceof EventAdaptor)
                                xmlOut.setPersistenceDelegate(lstnrs[j].getClass(), 
                                                              new AdaptorPersistenceDelegate());
                            xmlOut.writeStatement(
                                new Statement(control, addListenerName, new Object [] {lstnrs[j]}));
                        }
                    }
                    catch (Exception iae)
                    {
                        throw new ControlException("Unable to initialize listeners", iae);
                    } 
                }
            }

            //
            // See if the control holds an implementation instance, if so, we need to include
            // it (and any nested controls or state) in the encoding stream
            //
            Object impl = control.getImplementation();
            if (impl != null)
            {

                //
                // Set the persistence delegate for the impl class to the Impl delegate,
                // set the current stream owner to the bean, and then write the implementation
                //
                Class implClass = impl.getClass(); 
                if (xmlOut.getPersistenceDelegate(implClass) instanceof DefaultPersistenceDelegate) 
                    xmlOut.setPersistenceDelegate(implClass, new ImplPersistenceDelegate());

                //
                // HACK: This bit of hackery pushes the impl into the persistence stream
                // w/out actually requiring it be used as an argument elsewhere, since there
                // is no public API on the bean that takes an impl instance as an argument.
                //
                xmlOut.writeStatement(
                    new Statement(impl, "toString", null));
            }
        }
        finally
        {
            // Restore the previous encoding stream owner
            xmlOut.setOwner(owner);
        }
    }
715458
public void register(BeanMappingObject object) {
        BeanMappingObject old = null;
        String name = null;
        if (object != null) {
            if (StringUtils.isEmpty(object.getName())) {
                name = mapperObjectName(object.getSrcClass(), object.getTargetClass());
            } else {
                name = object.getName();
            }

            old = mappings.put(name, object);
        }

        if (old != null) {
            logger.warn("{} has been replaced by : {}", name, object.toString());
        }
    }
694843
private function initializeMapper() {
    // set the mapper
    $persistenceFacade = ObjectFactory::getInstance('persistenceFacade');
    if ($persistenceFacade->isKnownType($this->type)) {
      $this->mapper = $persistenceFacade->getMapper($this->type);
    }
    else {
      // initialize null mapper if not done already
      if (self::$nullMapper == null) {
        self::$nullMapper = new NullMapper();
      }
      $this->mapper = self::$nullMapper;
    }
  }
755490
protected <T> RegistrationAnnotatedBindingBuilder<T> register(Class<T> type) {
        return registryBinderImpl.register(type);
    }
647114
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out)
    {
        super.initialize(type, oldInstance, newInstance, out);
    }
854698
protected static void register(Class<?> parent, String cname) {
    Entry e = data.get(parent);
    if(e == null) {
      data.put(parent, e = new Entry());
    }
    e.addName(cname);
  }