Registers a new proxy bean with the bean factory.
971711
private void registerJsonProxyBean(DefaultListableBeanFactory defaultListableBeanFactory, String className, String path) {
		BeanDefinitionBuilder beanDefinitionBuilder = BeanDefinitionBuilder
				.rootBeanDefinition(JsonProxyFactoryBean.class)
				.addPropertyValue("serviceUrl", appendBasePath(path))
				.addPropertyValue("serviceInterface", className);
		
		if (objectMapper != null) {
			beanDefinitionBuilder.addPropertyValue("objectMapper", objectMapper);
		}
		
		if (contentType != null) {
			beanDefinitionBuilder.addPropertyValue("contentType", contentType);
		}
		
		defaultListableBeanFactory.registerBeanDefinition(className + "-clientProxy", beanDefinitionBuilder.getBeanDefinition());
	}
82532
public void registerBeans(BeanDefinitionRegistry registry) {
        finalizeDeferredProperties();

        if (registry instanceof GenericApplicationContext) {
            GenericApplicationContext ctx = (GenericApplicationContext) registry;
            ctx.setClassLoader(classLoader);
            ctx.getBeanFactory().setBeanClassLoader(classLoader);
        }

        springConfig.registerBeansWithRegistry(registry);
    }
709624
protected ServiceRegistration registerProxy(Object objectProxy, Class clazz) {
        Dictionary<String, Object> props = new Hashtable<String, Object>();
        ServiceRegistration registration;
        registration = context.registerService(clazz, objectProxy, props);

        return registration;
    }
385096
public SerializerRegistry registerAbstract(Class<?> abstractType, TypeSerializerFactory factory) {
    return registerAbstract(abstractType, calculateTypeId(abstractType), factory);
  }
486901
private void createInstance() throws InvocationTargetException {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "createInstance");

        ManagedObjectFactory<?> ejbManagedObjectFactory = home.beanMetaData.ivEnterpriseBeanFactory;
        if (ejbManagedObjectFactory != null) {
            createInstanceUsingMOF(ejbManagedObjectFactory);
        } else {
            createInstanceUsingConstructor();
        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "createInstance");
    }
268197
def register(self, service, name=''):
        
        # expose a sub-factory
        if isinstance(service, ApiFactory):
            self.services[name] = (service.factory, None)

        # expose a module dynamically as a service
        elif inspect.ismodule(service):
            name = name or service.__name__.split('.')[-1]

            # exclude endpoints with patterns
            for obj in vars(service).values():
                endpoint = getattr(obj, 'endpoint', None)
                if isinstance(endpoint, Endpoint) and endpoint.pattern:
                    route = Route('', endpoint.pattern)
                    self.routes.append((route, endpoint))

            self.services[name] = (ModuleService, service)

        # expose a class dynamically as a service
        elif inspect.isclass(service):
            name = name or service.__name__
            self.services[name] = (ClassService, service)

        # expose an endpoint directly
        elif isinstance(getattr(service, 'endpoint', None), Endpoint):
            if service.endpoint.pattern:
                route = Route('', service.endpoint.pattern)
                self.routes.append((route, service.endpoint))
            else:
                self.services[service.endpoint.name] = (service.endpoint, None)

        # expose a scope
        elif isinstance(service, dict):
            for srv in service.values():
                try:
                    self.register(srv)
                except RuntimeError:
                    pass

        # expose a list of services
        elif isinstance(service, list):
            for srv in service:
                try:
                    self.register(srv)
                except RuntimeError:
                    pass

        # expose a service directly
        else:
            raise RuntimeError('Invalid service provide: {0} ({1}).'.format(service, type(service)))
177951
def _register_factory(self):
        
        for name, info in self._plugins.items():
            if info['priority']:
                factory = getattr(info['plugin'], 'factory', None)
                if callable(factory):
                    registry[info['factory']] = info['plugin'].factory
        registry.freeze()
957768
public static BeanDefinitionHolder registerBean(String beanId, BeanDefinition beanDefinition, ParserContext parserContext, boolean shouldFireEvents) {
        if (parserContext.getRegistry().containsBeanDefinition(beanId)) {
            return new BeanDefinitionHolder(parserContext.getRegistry().getBeanDefinition(beanId), beanId);
        }

        BeanDefinitionHolder configurationHolder = new BeanDefinitionHolder(beanDefinition, beanId);
        BeanDefinitionReaderUtils.registerBeanDefinition(configurationHolder, parserContext.getRegistry());

        if (shouldFireEvents) {
            BeanComponentDefinition componentDefinition = new BeanComponentDefinition(configurationHolder);
            parserContext.registerComponent(componentDefinition);
        }

        return configurationHolder;
    }
1283860
static EntityManager createProxy(final HibernateEntityManagerFactory factory) {
        final EntityManagerInterceptor handler = new EntityManagerInterceptor(factory);

        final Enhancer e = new Enhancer();

        // make sure we're Serializable and have a write replace method
        e.setInterfaces(new Class[] { EntityManager.class, Serializable.class, IWriteReplace.class });
        e.setSuperclass(Object.class);
        e.setCallback(handler);
        e.setNamingPolicy(new DefaultNamingPolicy() {
            @Override
            public String getClassName(final String prefix,
                                       final String source,
                                       final Object key,
                                       final Predicate names) {
                return super.getClassName("CROQUET_ENTITY_MANAGER_PROXY_" + prefix, source, key, names);
            }
        });

        LOG.trace("Created proxy for an EntityManager");

        return (EntityManager)e.create();
    }
829531
public void initialize()
    {
        //
        // Register the ControlBeanContext provider on all new context instances.
        //
        addService(org.apache.beehive.controls.api.context.ControlBeanContext.class, CONTROL_BEAN_CONTEXT_PROVIDER);
    }
704842
public void register(BeanMappingBuilder builder) {
        if (builder != null) {
            BeanMappingObject object = builder.get();
            register(object);
        }
    }
1051122
private void registerJMXStuff() {
    LOG.info("registering InApplicationMonitorDynamicMBean on JMX server");

    try {
      jmxBeanRegistrationHelper.registerMBeanOnJMX(this, "InApplicationMonitor", null);
    } catch (Exception e) {
      LOG.error("could not register MBean server : ", e);
    }
  }
839034
public static Object createProxyBean(Class<?> clazz, BeanBox box, BeanBoxContext ctx) {
		BeanBoxException.assureNotNull(clazz, "Try to create a proxy bean, but beanClass not found.");
		Enhancer enhancer = new Enhancer();
		enhancer.setSuperclass(clazz);
		if (box.getConstructorParams() != null && box.getConstructorParams().length > 0) {
			BeanBox[] boxes = box.getConstructorParams();
			Class<?>[] argsTypes = new Class<?>[boxes.length];
			Object[] realArgsValue = new Object[boxes.length];
			for (int i = 0; i < boxes.length; i++) {
				argsTypes[i] = boxes[i].getType();
				Object realValue = ctx.getBean(boxes[i]);
				if (realValue != null && realValue instanceof String)
					realValue = ctx.getValueTranslator().translate((String) realValue, boxes[i].getType());
				realArgsValue[i] = realValue;
			}
			enhancer.setCallback(new ProxyBean(box, ctx));
			return enhancer.create(argsTypes, realArgsValue);
		} else {
			enhancer.setCallback(new ProxyBean(box, ctx));
			return enhancer.create();
		}
	}
1118947
@Override
    public T create(final CreationalContext<T> creationalContext) {
        if (proxyInstantiator == null) {
            // initializeAfterBeanDiscovery wasn't yet invoked
            // this can happen if you attempt to create bean prior to fully booting container
            throw BeanLogger.LOG.initABDnotInvoked(annotatedType);
        }
        return proxyInstantiator.newInstance(creationalContext, beanManager);
    }
254775
protected void registerConfiguration(@Nonnull BeanConfiguration configuration) {
        ArgumentUtils.requireNonNull("configuration", configuration);
        beanConfigurations.put(configuration.getName(), configuration);
        ClassLoadingReporter.reportPresent(configuration.getClass());
    }
580234
protected BeanDefinition registerBean(Definition def, BindRegistry registry) {
    BeanDefinition bd = convert(def);
    if ((def.isAbstract() && def.clazz == null) || FactoryBean.class.isAssignableFrom(def.clazz)) {
      try {
        Class<?> target = def.targetClass;

        if (null == target && def.clazz != null)
          target = ((FactoryBean<?>) def.clazz.newInstance()).getObjectType();
        Assert.isTrue(null != target || def.isAbstract(), "Concrete bean [%1$s] should has class.",
            def.beanName);

        registry.register(target, def.beanName, bd);
        // register concrete factory bean
        if (!def.isAbstract()) registry.register(def.clazz, "&" + def.beanName);
      } catch (Exception e) {
        logger.error("Cannot get Factory's Object Type {}", def.clazz);
      }
    } else {
      registry.register(def.clazz, def.beanName, bd);
    }
    logger.debug("Register definition {} for {}", def.beanName, def.clazz);
    return bd;
  }
208424
public SerializerRegistry register(Class<?> type, TypeSerializerFactory factory) {
    return register(type, calculateTypeId(type), factory);
  }