Import given CMIS type to the JCR repository.

@param cmisType cmis object type
@param typeManager JCR type manager/
@param registry
@throws RepositoryException if there is a problem importing the types
518899
@SuppressWarnings( "unchecked" )
    public void importType( ObjectType cmisType,
                            NodeTypeManager typeManager,
                            NamespaceRegistry registry ) throws RepositoryException {
        // TODO: get namespace information and register
        // registry.registerNamespace(cmisType.getLocalNamespace(), cmisType.getLocalNamespace());

        // create node type template
        NodeTypeTemplate type = typeManager.createNodeTypeTemplate();

        // convert CMIS type's attributes to node type template we have just created
        type.setName(cmisType.getId());
        type.setAbstract(false);
        type.setMixin(false);
        type.setOrderableChildNodes(true);
        type.setQueryable(true);
        if (!cmisType.isBaseType()) {
            type.setDeclaredSuperTypeNames(superTypes(cmisType));
        }

        Map<String, PropertyDefinition<?>> props = cmisType.getPropertyDefinitions();
        Set<String> names = props.keySet();
        // properties
        for (String name : names) {
            PropertyDefinition<?> pd = props.get(name);
            PropertyDefinitionTemplate pt = typeManager.createPropertyDefinitionTemplate();
            pt.setRequiredType(properties.getJcrType(pd.getPropertyType()));
            pt.setAutoCreated(false);
            pt.setAvailableQueryOperators(new String[] {});
            pt.setName(name);
            pt.setMandatory(pd.isRequired());
            type.getPropertyDefinitionTemplates().add(pt);
        }

        // register type
        NodeTypeDefinition[] nodeDefs = new NodeTypeDefinition[] {type};
        typeManager.registerNodeTypes(nodeDefs, true);
    }
1031412
private void processSingletonConcurrencyManagementType(BeanMetaData bmd) throws EJBConfigurationException {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();

        if (isTraceOn && tc.isEntryEnabled()) {
            Tr.entry(tc, "processSingletonConcurrencyManagementType");
        }

        // Initialize DD Concurrency Management type to null and change to
        // non null value if it is specified in the DD for the module.
        ConcurrencyManagementType ddType = null;

        // F743-7027 start
        Session sessionBean = (Session) bmd.wccm.enterpriseBean;
        if (sessionBean != null) {
            int type = sessionBean.getConcurrencyManagementTypeValue();
            if (type == Session.CONCURRENCY_MANAGEMENT_TYPE_CONTAINER) {
                ddType = ConcurrencyManagementType.CONTAINER;
            } else if (type == Session.CONCURRENCY_MANAGEMENT_TYPE_BEAN) {
                ddType = ConcurrencyManagementType.BEAN;
            }
        } // F743-7027 end

        // Initialize annotation Concurrency Management type to null and change to
        // non null value only if metadata complete is false and annotation is used
        // for this Singleton session bean.
        ConcurrencyManagementType annotationType = null;
        if (bmd.metadataComplete == false) {
            // Metadata complete is false, so do we have annotation value?
            // Note, EJB spec says annotation can not be inherited from superclass.
            Class<?> ejbClass = bmd.enterpriseBeanClass;
            ConcurrencyManagement annotation = ejbClass.getAnnotation(javax.ejb.ConcurrencyManagement.class);
            if (annotation != null) {
                // We have an annotation on EJB class, so validate that it is a valid value.
                annotationType = annotation.value();
                if (annotationType != ConcurrencyManagementType.CONTAINER && annotationType != ConcurrencyManagementType.BEAN) {
                    // CNTR0193E: The value, {0}, that is specified for the concurrency management type of
                    // the {1} enterprise bean class must be either BEAN or CONTAINER.
                    Tr.error(tc, "SINGLETON_INVALID_CONCURRENCY_MANAGEMENT_CNTR0193E", new Object[] { annotationType, bmd.enterpriseBeanClassName });

                    throw new EJBConfigurationException("CNTR0193E: The value, " + annotationType
                                                        + ", that is specified for the concurrency management type of the "
                                                        + bmd.enterpriseBeanClassName + " enterprise bean class must be either BEAN or CONTAINER.");
                }
            }
        }

        // Assign concurrency management type for this Singleton seesion bean.
        // Note, in "4.8.4.3 Specification of a Concurrency Management Type" of EJB 3.1 specification,
        // it says "The application assembler is not permitted to use the deployment
        // descriptor to override a bean's concurrency management type regardless of whether
        // it has been explicitly specified or defaulted by the Bean Provider."  However,
        // we have no way to know whether DD is from application assembler vs Bean Provider,
        // so we have to assume it came from Bean Provider.  The team decided that if both
        // annotation and DD is used, then the value must match. If they do not match,
        // throw an exception.

        // Was a value provided via DD?
        if (ddType == null) {
            // DD did not provide a value, so use annotation value if one was provided.
            // Otherwise, use default value required by EJB 3.1 spec.
            if (annotationType != null) {
                // No DD, but we have annotation. So use the annotation.
                bmd.ivSingletonUsesBeanManagedConcurrency = (annotationType == ConcurrencyManagementType.BEAN);
            } else {
                // Neither DD nor annotation, so default to Container Concurrency Management type.
                bmd.ivSingletonUsesBeanManagedConcurrency = false;
            }
        } else {
            // DD did provide a concurrency management type. Verify it matches annotation type
            // if both annotation and DD provided a value.
            if (annotationType != null && ddType != annotationType) {
                // CNTR0194E: The value {0} that is specified in the ejb-jar.xml file for concurrency management type is
                // not the same as the @ConcurrencyManagement annotation value {1} on the {2} enterprise bean class.
                Tr.error(tc, "SINGLETON_XML_OVERRIDE_CONCURRENCY_MANAGEMENT_CNTR0194E", new Object[] { ddType, annotationType, bmd.enterpriseBeanClassName });

                throw new EJBConfigurationException("CNTR0194E: The value " + ddType
                                                    + " that is specified in the ejb-jar.xml file for concurrency management type is not the same "
                                                    + " as the @ConcurrencyManagement annotation value " + annotationType + " on the "
                                                    + bmd.enterpriseBeanClassName + " enterprise bean class.");
            }

            // Use DD value since either annotation not used or DD matches the annotation type.
            bmd.ivSingletonUsesBeanManagedConcurrency = (ddType == ConcurrencyManagementType.BEAN);
        }

        if (isTraceOn && tc.isEntryEnabled()) {
            Tr.exit(tc, "processSingletonConcurrencyManagementType returning "
                        + bmd.ivSingletonUsesBeanManagedConcurrency + " for j2ee name = " + bmd.j2eeName);
        }
    }
338203
public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException {

		for (String beanName : registry.getBeanDefinitionNames()) {
			BeanDefinition beanDefinition = registry.getBeanDefinition(beanName);
			String beanClassName = beanDefinition.getBeanClassName();
			try {
				Class beanClass = Class.forName(beanClassName);
				// large project need using Google Collection's lookup
				for (final Field field : ClassUtil.getAllDecaredFields(beanClass)) {
					if (field.isAnnotationPresent(Autowired.class)) {
						// inject jdon components into spring components with
						// AutoWire;
						Object o = findBeanClassInJdon(field.getType());
						if (o != null) {
							neededJdonComponents.put(field.getName(), o);
						}
					}
				}
			} catch (ClassNotFoundException ex) {
				ex.printStackTrace();
			}
		}
	}
873489
public void addDocumentTypeConfig(CmsSearchDocumentType documentType) {

        m_documentTypeConfigs.add(documentType);

        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(
                Messages.get().getBundle().key(
                    Messages.INIT_SEARCH_DOC_TYPES_2,
                    documentType.getName(),
                    documentType.getClassName()));
        }
    }
677158
public void registerTypeWithKryoSerializer(Class<?> type, Class<? extends Serializer<?>> serializerClass) {
		config.registerTypeWithKryoSerializer(type, serializerClass);
	}
336160
public static void initEbInterface (@Nonnull final ValidationExecutorSetRegistry aRegistry)
  {
    ValueEnforcer.notNull (aRegistry, "Registry");

    final boolean bNotDeprecated = false;

    // No Schematrons here
    for (final EEbInterfaceDocumentType e : EEbInterfaceDocumentType.values ())
    {
      final String sVersion = e.name ().charAt (3) + "." + e.name ().substring (4);
      final VESID aVESID = new VESID (GROUP_ID, "invoice", sVersion);

      // No Schematrons here
      aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (aVESID,
                                                                             "ebInterface " + sVersion,
                                                                             bNotDeprecated,
                                                                             ValidationExecutorXSD.create (e)));
    }
  }
825698
public static void installDefaultRegistry(@NonNull final DefaultResolverRegistry registry) {
            /*
             * register built-in cards & mCells
             */
        MVHelper mvHelper = new MVHelper(new MVResolver());
        registry.setMVHelper(mvHelper);

        // built-in mCells
        registry.registerCell(TYPE_EXTENDED_VIEW_COMPACT, Card.PlaceholderCell.class,
            SimpleEmptyView.class);
        registry.registerCell(TYPE_EMPTY_VIEW_COMPACT, BaseCell.class, SimpleEmptyView.class);
        //registry.registerCell(TYPE_SIMPLE_IMAGE_COMPACT, Cell.class, SimpleImgView.class);
        registry.registerCell(TYPE_CAROUSEL_CELL_COMPACT, BannerView.class);
        registry.registerCell(TYPE_CONTAINER_BANNER, BannerView.class);
        registry.registerCell(TYPE_LINEAR_SCROLL_CELL_COMPACT, LinearScrollView.class);
        registry.registerCell(TYPE_CONTAINER_SCROLL, LinearScrollView.class);

        // built-in cards
        registry.registerCard(TYPE_CAROUSEL_COMPACT, BannerCard.class);
        registry.registerCard(TYPE_CONTAINER_BANNER, BannerCard.class);
        registry.registerCard(TYPE_SINGLE_COLUMN_COMPACT, SingleColumnCard.class);
        registry.registerCard(TYPE_CONTAINER_1C_FLOW, SingleColumnCard.class);
        registry.registerCard(TYPE_DOUBLE_COLUMN_COMPACT, DoubleColumnCard.class);
        registry.registerCard(TYPE_CONTAINER_2C_FLOW, DoubleColumnCard.class);
        registry.registerCard(TYPE_TRIPLE_COLUMN_COMPACT, TripleColumnCard.class);
        registry.registerCard(TYPE_CONTAINER_3C_FLOW, TripleColumnCard.class);
        registry.registerCard(TYPE_FOUR_COLUMN_COMPACT, FourColumnCard.class);
        registry.registerCard(TYPE_CONTAINER_4C_FLOW, FourColumnCard.class);
        registry.registerCard(TYPE_ONE_PLUS_N_COMPACT, OnePlusNCard.class);
        registry.registerCard(TYPE_CONTAINER_ON_PLUSN, OnePlusNCard.class);
        registry.registerCard(TYPE_FLOAT_COMPACT, FloatCard.class);
        registry.registerCard(TYPE_CONTAINER_FLOAT, FloatCard.class);
        registry.registerCard(TYPE_PIN_BOTTOM_COMPACT, PinBottomCard.class);
        registry.registerCard(TYPE_FIVE_COLUMN_COMPACT, FiveColumnCard.class);
        registry.registerCard(TYPE_CONTAINER_5C_FLOW, FiveColumnCard.class);
        registry.registerCard(TYPE_STICKY_COMPACT, StickyCard.class);
        registry.registerCard(TYPE_CONTAINER_STICKY, StickyCard.class);
        registry.registerCard(TYPE_STICKY_START_COMPACT, StickyCard.class);
        registry.registerCard(TYPE_STICKY_END_COMPACT, StickyEndCard.class);
        registry.registerCard(TYPE_PIN_TOP_COMPACT, PinTopCard.class);
        registry.registerCard(TYPE_CONTAINER_FIX, FixCard.class);
        registry.registerCard(TYPE_STAGGER_COMPACT, StaggeredCard.class);
        registry.registerCard(TYPE_CONTAINER_WATERFALL, StaggeredCard.class);

        registry.registerCard(TYPE_FUSION_TABS_COMPACT, FusionCard.class);
        registry.registerCard(TYPE_FLOW_COMPACT, FlowCard.class);
        registry.registerCard(TYPE_CONTAINER_FLOW, FlowCard.class);
        registry.registerCard(TYPE_SCROLL_FIX_COMPACT, ScrollFixCard.class);
        registry.registerCard(TYPE_CONTAINER_SCROLL_FIX, ScrollFixCard.class);

        registry.registerCard(TYPE_LINEAR_SCROLL_COMPACT, LinearScrollCard.class);
        registry.registerCard(TYPE_CONTAINER_SCROLL, LinearScrollCard.class);
        registry.registerCard(TYPE_SCROLL_FIX_BANNER_COMPACT, FixLinearScrollCard.class);
        registry.registerCard(TYPE_CONTAINER_SCROLL_FIX_BANNER, FixLinearScrollCard.class);

        // extend cards
        registry.registerCard(TYPE_FIX_COMPACT, FixCard.class);
        registry.registerCard(TYPE_GRID_COMPACT, GridCard.class);
        registry.registerCard(TYPE_LINEAR_COMPACT, LinearCard.class);
        registry.registerCard(TYPE_X_COLUMN_COMPACT, ColumnCard.class);
    }
69318
public void setType(String typeName) {

        try {
            try {
                m_type = OpenCms.getResourceManager().getResourceType(typeName);
            } catch (CmsLoaderException e) {
                // TODO: what happens if the resource type is a specialized folder and is not configured??
                int plainId;
                try {
                    plainId = OpenCms.getResourceManager().getResourceType(
                        CmsResourceTypePlain.getStaticTypeName()).getTypeId();
                } catch (CmsLoaderException e1) {
                    // this should really never happen
                    plainId = CmsResourceTypePlain.getStaticTypeId();
                }
                m_type = OpenCms.getResourceManager().getResourceType(plainId);
            }
            if (m_type.isFolder()) {
                // ensure folders end with a "/"
                if (!CmsResource.isFolder(m_destination)) {
                    m_destination += "/";
                }
            }
        } catch (Throwable e) {
            setThrowable(e);
        }
    }
600170
public <T> void load(ExtensionRepository<T> repository, Class<T> extensionType) {
//		loadExtensionFromPackage(repository, extensionType, getDefaultScanPackage());
//		String customScanPackage = getCustomScanPackage();
//		if (!Strings.isNullOrEmpty(customScanPackage)) {
//			loadExtensionFromPackage(repository, extensionType, customScanPackage);
//		}
		loadMetricsFromSPI(repository, extensionType);
	}
807721
public void registerDatatype(Class<? extends GVRHybridObject> textureClass,
            AsyncLoaderFactory<? extends GVRHybridObject, ?> asyncLoaderFactory) {
        mFactories.put(textureClass, asyncLoaderFactory);
    }
315286
@Override
    public <T> void registerInjectionTarget(javax.enterprise.inject.spi.InjectionTarget<T> injectionTarget, AnnotatedType<T> annotatedType) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "registerInjectionTarget", new Object[] { injectionTarget, Util.identity(annotatedType) });
        }
        Class<?> declaringClass = annotatedType.getJavaClass();
        WebSphereBeanDeploymentArchive wbda = deployment.getBeanDeploymentArchiveFromClass(declaringClass);
        //If it's not an application class we don't need to validate it
        if (wbda != null) {
            CDIArchive cdiArchive = wbda.getArchive();
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Injection Target Annotations: " + annotatedType.getAnnotations());
            }
            //We don't need to worry about constructors because constructors cannot be a producer.
            for (Annotated annotated : annotatedType.getFields()) {
                validateAnnotatedMember(annotated, annotatedType.getJavaClass(), cdiArchive);
            }
            for (AnnotatedMethod<?> annotatedMethod : annotatedType.getMethods()) {
                validateAnnotatedMethod(annotatedMethod, declaringClass, cdiArchive);
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "registerInjectionTarget");
        }
    }
112412
public void initRegistryEntry(String groupName, String entryName) throws RepositoryException,
      RepositoryConfigurationException
   {

      String relPath = EXO_REGISTRY + "/" + groupName + "/" + entryName;
      for (RepositoryEntry repConfiguration : repConfigurations())
      {
         String repName = repConfiguration.getName();
         SessionProvider sysProvider = SessionProvider.createSystemProvider();
         Node root = session(sysProvider, repositoryService.getRepository(repName)).getRootNode();
         if (!root.hasNode(relPath))
         {
            root.addNode(relPath, EXO_REGISTRYENTRY_NT);
            root.save();
         }
         else
         {
            LOG.info("The RegistryEntry " + relPath + "is already initialized on repository " + repName);
         }
         sysProvider.close();
      }
   }
953831
public static void register(BeanDefinitionRegistry registry,
			Collection<String> packageNames) {
		Assert.notNull(registry, "Registry must not be null");
		Assert.notNull(packageNames, "PackageNames must not be null");
		if (registry.containsBeanDefinition(BEAN)) {
			BeanDefinition beanDefinition = registry.getBeanDefinition(BEAN);
			ConstructorArgumentValues constructorArguments = beanDefinition
					.getConstructorArgumentValues();
			constructorArguments.addIndexedArgumentValue(0,
					addPackageNames(constructorArguments, packageNames));
		}
		else {
			GenericBeanDefinition beanDefinition = new GenericBeanDefinition();
			beanDefinition.setBeanClass(EntityScanPackages.class);
			beanDefinition.getConstructorArgumentValues().addIndexedArgumentValue(0,
					StringUtils.toStringArray(packageNames));
			beanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
			registry.registerBeanDefinition(BEAN, beanDefinition);
		}
	}
1181504
@Bean
    @ConditionalOnMissingBean
    SoftwareModuleTypeManagement softwareModuleTypeManagement(
            final DistributionSetTypeRepository distributionSetTypeRepository,
            final SoftwareModuleTypeRepository softwareModuleTypeRepository,
            final VirtualPropertyReplacer virtualPropertyReplacer,
            final SoftwareModuleRepository softwareModuleRepository, final NoCountPagingRepository criteriaNoCountDao,
            final JpaProperties properties) {
        return new JpaSoftwareModuleTypeManagement(distributionSetTypeRepository, softwareModuleTypeRepository,
                virtualPropertyReplacer, softwareModuleRepository, criteriaNoCountDao, properties.getDatabase());
    }
158700
public static <E> void registerTypeConverter(Class<E> cls, TypeConverter<E> converter) {
        TYPE_CONVERTERS.put(cls, converter);
    }
634606
public void initConfiguration(Map<?, ?> configurationMap, ServiceRegistryImplementor serviceRegistry) {
		ClassLoaderService classLoaderService = serviceRegistry.getService( ClassLoaderService.class );
		ConfigurationPropertyReader propertyReader = new ConfigurationPropertyReader( configurationMap, classLoaderService );

		this.configurationResource = propertyReader
				.property( InfinispanRemoteProperties.CONFIGURATION_RESOURCE_NAME, URL.class )
				.withDefaultStringValue( InfinispanRemoteProperties.DEFAULT_CONFIGURATION_RESOURCE_NAME )
				.getValue();

		this.clientProperties = getHotRodConfiguration( configurationMap, propertyReader, this.configurationResource );

		this.schemaCaptureService = propertyReader
				.property( InfinispanRemoteProperties.SCHEMA_CAPTURE_SERVICE, SchemaCapture.class )
				.instantiate()
				.getValue();

		this.schemaOverrideService = propertyReader
				.property( InfinispanRemoteProperties.SCHEMA_OVERRIDE_SERVICE, SchemaOverride.class )
				.instantiate()
				.getValue();

		this.schemaOverrideResource = propertyReader
				.property( InfinispanRemoteProperties.SCHEMA_OVERRIDE_RESOURCE, URL.class )
				.getValue();

		this.schemaPackageName = propertyReader
				.property( InfinispanRemoteProperties.SCHEMA_PACKAGE_NAME, String.class )
				.withDefault( InfinispanRemoteProperties.DEFAULT_SCHEMA_PACKAGE_NAME )
				.getValue();

		this.schemaFileName = propertyReader
				.property( InfinispanRemoteProperties.SCHEMA_FILE_NAME, String.class )
				.withDefault( InfinispanRemoteProperties.DEFAULT_SCHEMA_FILE_NAME )
				.withValidator( InfinispanRemoteValidators.SCHEMA_FILE_NAME )
				.getValue();

		this.createCachesEnabled = propertyReader
				.property( OgmProperties.CREATE_DATABASE, boolean.class )
				.withDefault( false )
				.getValue();

		this.cacheConfiguration = propertyReader
				.property( InfinispanRemoteProperties.CACHE_CONFIGURATION, String.class )
				.withDefault( null )
				.getValue();

		String transactionModeString = propertyReader
				.property( InfinispanRemoteProperties.TRANSACTION_MODE, String.class )
				.withDefault( InfinispanRemoteProperties.DEFAULT_TRANSACTION_MODE )
				.getValue();

		this.transactionMode = extractTransactionMode( transactionModeString );

		log.tracef( "Initializing Infinispan Hot Rod client from configuration file at '%1$s'", configurationResource );
	}
184899
public static void register(BeanDefinitionRegistry registry, String... packageNames) {
		Assert.notNull(registry, "Registry must not be null");
		Assert.notNull(packageNames, "PackageNames must not be null");
		register(registry, Arrays.asList(packageNames));
	}