Registers the classes needed to use ObjectSpaces. This should be called before any connections are opened.
@see Kryo#register(Class, Serializer)
348299
static public void registerClasses (final Kryo kryo) {
		kryo.register(Object[].class);
		kryo.register(InvokeMethod.class);

		FieldSerializer<InvokeMethodResult> resultSerializer = new FieldSerializer<InvokeMethodResult>(kryo,
			InvokeMethodResult.class) {
			public void write (Kryo kryo, Output output, InvokeMethodResult result) {
				super.write(kryo, output, result);
				output.writeInt(result.objectID, true);
			}

			public InvokeMethodResult read (Kryo kryo, Input input, Class<InvokeMethodResult> type) {
				InvokeMethodResult result = super.read(kryo, input, type);
				result.objectID = input.readInt(true);
				return result;
			}
		};
		resultSerializer.removeField("objectID");
		kryo.register(InvokeMethodResult.class, resultSerializer);

		kryo.register(InvocationHandler.class, new Serializer() {
			public void write (Kryo kryo, Output output, Object object) {
				RemoteInvocationHandler handler = (RemoteInvocationHandler)Proxy.getInvocationHandler(object);
				output.writeInt(handler.objectID, true);
			}

			public Object read (Kryo kryo, Input input, Class type) {
				int objectID = input.readInt(true);
				Connection connection = (Connection)kryo.getContext().get("connection");
				Object object = getRegisteredObject(connection, objectID);
				if (WARN && object == null) warn("kryonet", "Unknown object ID " + objectID + " for connection: " + connection);
				return object;
			}
		});
	}
691149
def register(cls):
    
    if not issubclass(cls, Entity):
        raise ValueError("Class must be a subclass of abilian.core.entities.Entity")

    Commentable.register(cls)
    return cls
1284098
public function registerClass($alias, $class)
    {
        $classSymbol = new ClassSymbol($alias, $class);
        $this->classes[$alias] = $classSymbol;
        $aliasNamespace = $classSymbol->getAliasNamespace();
        if (!in_array($aliasNamespace, $this->aliasNamespaces, true)) {
            $this->aliasNamespaces[] = $aliasNamespace;
        }
    }
669008
public static synchronized void register(JSONObject type) {
    Class<? extends JSONObject> previous = registrations.put(type.getIdentifier(), type.getClass());
    if (previous != null && !previous.isInstance(type))
      throw new RuntimeException("Attempt to register conflicting classes for identifier: " + type.getIdentifier());
    if (previous == null)
      log.debug("Registered {} to {}", type.getIdentifier(), type.getClass());
  }
1063904
public function registerPropelModelLoader()
    {
        $loader = new ClassLoader();

        $loader->addPrefix(
            '', // no prefix, models already define their full namespace
            $this->getPropelModelDir()
        );

        $loader->register(
            true // prepend the autoloader to use cached models first
        );
    }
47591
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
		in.defaultReadObject();

		// kryoRegistrations may be null if this Kryo serializer is deserialized from an old version
		if (kryoRegistrations == null) {
			this.kryoRegistrations = buildKryoRegistrations(
					type,
					registeredTypes,
					registeredTypesWithSerializerClasses,
					registeredTypesWithSerializers);
		}
	}
1321901
def register_namespace(self, namespace_handler):
        
        if not isinstance(namespace_handler, namespace.Namespace):
            raise ValueError('Not a namespace instance')
        if self.is_asyncio_based() != namespace_handler.is_asyncio_based():
            raise ValueError('Not a valid namespace class for this server')
        namespace_handler._set_server(self)
        self.namespace_handlers[namespace_handler.namespace] = \
            namespace_handler
47911
def register_classes():
    
    CopyBaseROI.register_class()
    CopyBaseROI_SG.register_class()
    SimulateROI.register_class()
    SimulateROI_SG.register_class()
    RandomDirGen.register_class()
    RandomDirGen_SG.register_class()
22536
protected void registerIfNamed(Class<?> from, Serializer<?> serializer)
	{
		if(from.isAnnotationPresent(Named.class))
		{
			Named named = from.getAnnotation(Named.class);
			QualifiedName key = new QualifiedName(named.namespace(), named.name());
			nameToSerializer.put(key, serializer);
			serializerToName.put(serializer, key);
		}
	}
1146442
public void registerClass(Class<?> clazz) {
        registeredClasses.add(clazz);
        for (Field field : clazz.getFields()) {
            if (field.isAnnotationPresent(Opt.class)) {
                int mod = field.getModifiers();
                if (!Modifier.isPublic(mod)) { throw new IllegalStateException("@"+Opt.class.getName()+" on non-public field: " + field); }
                if (Modifier.isFinal(mod)) { throw new IllegalStateException("@"+Opt.class.getName()+" on final field: " + field); }
                if (Modifier.isAbstract(mod)) { throw new IllegalStateException("@"+Opt.class.getName()+" on abstract field: " + field); }

                // Add an Apache Commons CLI Option for this field.
                Opt opt = field.getAnnotation(Opt.class);

                String name = getName(opt, field);
                if (!names.add(name)) {
                    throw new RuntimeException("Multiple options have the same name: --" + name);
                }

                String shortName = null;
                if (createShortNames) {
                    shortName = getAndAddUniqueShortName(name);
                }
                
                Option apacheOpt = new Option(shortName, name, opt.hasArg(), opt.description());                    
                apacheOpt.setRequired(opt.required());
                options.addOption(apacheOpt);

                optionFieldMap.put(apacheOpt, field);

                // Check that only boolean has hasArg() == false.
                if (!field.getType().equals(Boolean.TYPE) && !opt.hasArg()) {
                    throw new RuntimeException("Only booleans can not have arguments.");
                }
            }
        }
    }
603632
public void addDefaultKryoSerializer(Class<?> type, Class<? extends Serializer<?>> serializerClass) {
		if (type == null || serializerClass == null) {
			throw new NullPointerException("Cannot register null class or serializer.");
		}
		defaultKryoSerializerClasses.put(type, serializerClass);
	}
490883
protected void initializeDefaultNamespaces( NamespaceRegistry namespaceRegistry ) {
        if (namespaceRegistry == null) return;
        namespaceRegistry.register(JcrLexicon.Namespace.PREFIX, JcrLexicon.Namespace.URI);
        namespaceRegistry.register(JcrMixLexicon.Namespace.PREFIX, JcrMixLexicon.Namespace.URI);
        namespaceRegistry.register(JcrNtLexicon.Namespace.PREFIX, JcrNtLexicon.Namespace.URI);
        namespaceRegistry.register(ModeShapeLexicon.Namespace.PREFIX, ModeShapeLexicon.Namespace.URI);
    }
265201
public static void registerMarshallers(SerializationContext ctx) {
      ctx.registerMarshaller(new QueryRequest.NamedParameter.Marshaller());
      ctx.registerMarshaller(new QueryRequest.Marshaller());
      ctx.registerMarshaller(new QueryResponse.Marshaller());
      ctx.registerMarshaller(new FilterResultMarshaller());
      ctx.registerMarshaller(new ContinuousQueryResult.ResultType.Marshaller());
      ctx.registerMarshaller(new ContinuousQueryResult.Marshaller());
   }
93151
protected void registerKnownJdkImmutableClasses() {
        registerImmutable(String.class);
        registerImmutable(Integer.class);
        registerImmutable(Long.class);
        registerImmutable(Boolean.class);
        registerImmutable(Class.class);
        registerImmutable(Float.class);
        registerImmutable(Double.class);
        registerImmutable(Character.class);
        registerImmutable(Byte.class);
        registerImmutable(Short.class);
        registerImmutable(Void.class);

        registerImmutable(BigDecimal.class);
        registerImmutable(BigInteger.class);
        registerImmutable(URI.class);
        registerImmutable(URL.class);
        registerImmutable(UUID.class);
        registerImmutable(Pattern.class);
    }
21931
private void _initializeObjectMapper() {

		SimpleModule module = new SimpleModule();
		module.addSerializer(Alert.class, new Alert.Serializer());
		module.addSerializer(Trigger.class, new Trigger.Serializer());
		module.addSerializer(Notification.class, new Notification.Serializer());
		module.addSerializer(PrincipalUser.class, new Alert.PrincipalUserSerializer());
		module.addDeserializer(Alert.class, new Alert.Deserializer());

		_mapper.registerModule(module);
	}
603298
public function register($serializer)
    {
        if (is_array($serializer)) {
            foreach ($serializer as $s) {
                $this->register($s);
            }

            return $this;
        }

        if (is_string($serializer)) {
            if (!class_exists($serializer)) {
                throw new SerializersPoolException("Serializer class '{$serializer}' not found");
            }

            $serializer = new $serializer;
        }

        if (!is_object($serializer)) {
            $serializer_type = gettype($serializer);
            throw new SerializersPoolException("Serializer should be object or class name, scalar '{$serializer_type}' given instead");
        }

        if (!is_subclass_of($serializer, 'AMQPy\Serializers\SerializerInterface')) {
            $serializer_class = get_class($serializer);
            throw new SerializersPoolException("Serializer class '{$serializer_class}' doesn't implement default serializer interface");
        }

        $this->registered[$serializer->getContentType()] = $serializer;

        return $this;
    }
1145095
private function registerClasses()
	{
    	$this->addValidator(self::DEFAULT_VALIDATOR_LABEL, new Validator($this)); //Connect form validator
    	$this->setEntityRepository(new EntityRepository($this));
    	$this->setResponse(new Response($this));
    	$this->setDict(new Dictionary($this)); //Connect dictionary
    	$this->setStore(new Store($this)); //Connect Store
		$this->setBin(new Bin($this)); // Connect Bin
    	$this->setUserService(new UserService($this));
    	$this->setRouter(new Router($this));
    }