Returns artifact type registry. Defines standard Maven stereotypes.

@return
428823
public ArtifactTypeRegistry artifactTypeRegistry() {
        DefaultArtifactTypeRegistry stereotypes = new DefaultArtifactTypeRegistry();
        stereotypes.add(new DefaultArtifactType("pom"));
        stereotypes.add(new DefaultArtifactType("maven-plugin", "jar", "", "java"));
        stereotypes.add(new DefaultArtifactType("jar", "jar", "", "java"));
        stereotypes.add(new DefaultArtifactType("ejb", "jar", "", "java"));
        stereotypes.add(new DefaultArtifactType("ejb-client", "jar", "client", "java"));
        stereotypes.add(new DefaultArtifactType("test-jar", "jar", "tests", "java"));
        stereotypes.add(new DefaultArtifactType("javadoc", "jar", "javadoc", "java"));
        stereotypes.add(new DefaultArtifactType("java-source", "jar", "sources", "java", false, false));
        stereotypes.add(new DefaultArtifactType("war", "war", "", "java", false, true));
        stereotypes.add(new DefaultArtifactType("ear", "ear", "", "java", false, true));
        stereotypes.add(new DefaultArtifactType("rar", "rar", "", "java", false, true));
        stereotypes.add(new DefaultArtifactType("par", "par", "", "java", false, true));
        return stereotypes;
    }
985332
public static Set<Integer> getApplicableHistoryTypes() {
		Set<Integer> allApplicableTypes = new HashSet<Integer>();
		allApplicableTypes.addAll(PluginPassiveScanner.getDefaultHistoryTypes());
		if (!optedInHistoryTypes.isEmpty()) {
			allApplicableTypes.addAll(optedInHistoryTypes);
		}
		return allApplicableTypes;
	}
1306189
public static String getVersion(Class<?> aClass, String groupId, String artifactId) {
        String version = null;
        // lets try find the maven property - as the Java API rarely works :)
        InputStream is = null;
        String fileName = "/META-INF/maven/" +
                groupId + "/" + artifactId +
                "/pom.properties";
        // try to load from maven properties first
        try {
            Properties p = new Properties();
            is = aClass.getResourceAsStream(fileName);
            if (is != null) {
                p.load(is);
                version = p.getProperty("version", "");
            }
        } catch (Exception e) {
            // ignore
        } finally {
            if (is != null) {
                IOHelper.close(is, fileName, LOG);
            }
        }
        if (version == null) {
            Package aPackage = aClass.getPackage();
            if (aPackage != null) {
                version = aPackage.getImplementationVersion();
                if (Strings.isBlank(version)) {
                    version = aPackage.getSpecificationVersion();
                }
            }
        }
        if (version == null) {
            Enumeration<URL> resources = null;
            try {
                resources = aClass.getClassLoader().getResources("META-INF/MANIFEST.MF");
            } catch (IOException e) {
                // ignore
            }
            if (resources != null) {
                String expectedBundleName = groupId + "." + artifactId;
                while (resources.hasMoreElements()) {
                    try {
                        Manifest manifest = new Manifest(resources.nextElement().openStream());
                        Attributes attributes = manifest.getMainAttributes();
                        String bundleName = attributes.getValue("Bundle-SymbolicName");
                        if (Objects.equals(expectedBundleName, bundleName)) {
                            version = attributes.getValue("Implementation-Version");
                            if (Strings.isNotBlank(version)) break;
                        }
                    } catch (IOException e) {
                        // ignore
                    }
                }
            }
        }
        return version;
    }
1316102
@Override
	public JvmType getType() {
		if (type == null) {
			JvmGenericType objectType = TypesFactory.eINSTANCE.createJvmGenericType();
			String objectClassName = Object.class.getName();
			((InternalEObject) objectType).eSetProxyURI(URIHelperConstants.OBJECTS_URI.appendSegment(objectClassName).appendFragment(objectClassName));
			setType(objectType);
		}
		return super.getType();
	}
120240
public org.efaps.admin.datamodel.Type getType()
    {
        org.efaps.admin.datamodel.Type ret = null;
        try {
            ret =  org.efaps.admin.datamodel.Type.get(this.uuid);
        } catch (final CacheReloadException e) {
            CIType.LOG.error("Error on retrieving Type for CIType with uuid: {}", this.uuid);
        }
        return ret;
    }
480051
public JSType build() {
    if (result == null) {
      result = reduceAlternatesWithoutUnion();
      if (result == null) {
        result = new UnionType(registry, ImmutableList.copyOf(getAlternates()));
      }
    }
    return result;
  }
758296
public String getURL()
    {
        validateNotEmpty( m_groupId, true, "Group" );
        validateNotEmpty( m_artifactId, true, "Artifact" );
        final StringBuilder url = new StringBuilder();
        url.append( "mvn:" ).append( m_groupId ).append( "/" ).append( m_artifactId );
        if( m_version != null || m_type != null || m_classifier != null )
        {
            url.append( "/" );
        }
        if( m_version != null )
        {
            url.append( m_version );
        }
        if( m_type != null || m_classifier != null )
        {
            url.append( "/" );
        }
        if( m_type != null )
        {
            url.append( m_type );
        }
        if( m_classifier != null )
        {
            url.append( "/" ).append( m_classifier );
        }
        return url.toString();
    }
421493
public static TypeRegistry getTypeRegistryFor(ClassLoader classloader) {
		if (classloader == null) {
			return null;
		}
		//WeakReference<TypeRegistry> existingRegistryRef = loaderToRegistryMap.get(classloader);
		TypeRegistry existingRegistry = loaderToRegistryMap.get(classloader);//existingRegistryRef==null?null:existingRegistryRef.get();
		if (existingRegistry != null) {
			return existingRegistry;
		}

		if (GlobalConfiguration.isRuntimeLogging && log.isLoggable(Level.INFO)) {
			if (excludedLoaderInstances.contains(classloader.toString())) {
				return null;
			}
		}
		String classloaderName = classloader.getClass().getName();
		if (classloaderName.equals("sun.reflect.DelegatingClassLoader")) {
			return null;
		}
		for (String excluded : excludedLoaders) {
			if (classloaderName.startsWith(excluded)) {
				if (GlobalConfiguration.isRuntimeLogging && log.isLoggable(Level.FINEST)) {
					log.info("Classloader " + classloaderName + " has been deliberately excluded");
				}
				excludedLoaderInstances.add(classloader.toString());
				return null;
			}
		}
		//		if (GlobalConfiguration.limit) {
		//			// only allow for certain loaders!
		//			boolean isOK = false;
		//			if (classloaderName.equals("org.apache.catalina.loader.StandardClassLoader")) {
		//				isOK = true;
		//			} else if (classloaderName.equals("com.springsource.insight.collection.tcserver.ltw.TomcatWeavingInsightClassLoader")) {
		//				isOK = true;
		//			} else if (classloaderName.equals("org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader")) {
		//				isOK = true;
		//			} else if (classloaderName.equals("org.apache.catalina.loader.WebappClassLoader")) {
		//				isOK = true;
		//			}
		//			if (!isOK) {
		//				return null;
		//			}
		//		}

                try {
                    Class.forName("org.springsource.loaded.ri.ReflectiveInterceptor", false, classloader);
                } catch (ClassNotFoundException ex) {
                    if (GlobalConfiguration.isRuntimeLogging && log.isLoggable(Level.INFO)) {
                            log.info("No TypeRegistry (can't load ReflectiveInterceptor) for loader " + classloader);
                    }
                    return null;
                }

		if (GlobalConfiguration.isRuntimeLogging && log.isLoggable(Level.INFO)) {
			log.info("TypeRegistry.getRegistryFor(): creating new TypeRegistry for loader " + classloader);
		}

		TypeRegistry tr = new TypeRegistry(classloader);
		//		if (GlobalConfiguration.isRuntimeLogging) {
		//			Utils.log(100, "TypeRegistry.getTypeRegistryFor(classloader=" + classloader + ") returning " + tr);
		//		}
		return tr;
	}
136166
public Registry getRegistry() throws RemoteException {
        if (registry == null) {
            if (StringUtils.hasText(host)) {
                registry = LocateRegistry.getRegistry(host, port);
            } else {
                registry = LocateRegistry.getRegistry(port);
            }
        }

        return registry;
    }
329132
public <T extends Annotation> StereotypeModel<T> getStereotype(final Class<T> stereotype) {
        return stereotypes.getCastValue(stereotype);
    }
171892
public Set<ArtifactSpec> getTransientDependencies() {
        if (null == allTransient) {
            allTransient = getTransientDependencies(true, true);
        }
        return allTransient;
    }
235967
public LinkedHashSet<Class<?>> getRegisteredKryoTypes() {
		if (isForceKryoEnabled()) {
			// if we force kryo, we must also return all the types that
			// were previously only registered as POJO
			LinkedHashSet<Class<?>> result = new LinkedHashSet<>();
			result.addAll(registeredKryoTypes);
			for(Class<?> t : registeredPojoTypes) {
				if (!result.contains(t)) {
					result.add(t);
				}
			}
			return result;
		} else {
			return registeredKryoTypes;
		}
	}
719593
private JobType getJobTypeToProcess() {
        double denominator = migrationConfiguration.getConsistencyCheckerWeight() + migrationConfiguration.getMigratorWeight();

        if (random.nextDouble() <= migrationConfiguration.getConsistencyCheckerWeight() / denominator) {
            return JobType.GENERATED;
        } else {
            return JobType.NONGENERATED;
        }
    }
1055810
public JvmTypeReference inferredType() {
		XComputedTypeReference result = xtypesFactory.createXComputedTypeReference();
		result.setTypeProvider(new InferredTypeIndicator(null));
		return result;
	}
661551
public static MavenArtifactUrlReference.VersionResolver asInProject() {
        return new MavenArtifactUrlReference.VersionResolver() {

            @Override
            public String getVersion(final String groupId, final String artifactId) {
                return getArtifactVersion(groupId, artifactId);
            }

        };
    }
787524
protected String buildDefaultMavenCoordinates() {
        StringBuilder sb = new StringBuilder();
        sb.append(getGroupId()).append(":");
        sb.append(getArtifactId());
        if (StringUtils.isNotBlank(getType())) {
            sb.append(":").append(getType());
        }
        if (StringUtils.isNotBlank(getClassifier())) {
            sb.append(":").append(getClassifier());
        }
        sb.append(":");
        sb.append(getVersion());
        return sb.toString().trim();
    }
1320244
public LauncherTypeEnum getLauncherType() {
    return Enums.getIfPresent(LauncherTypeEnum.class,
        this.getProp(ConfigurationKeys.JOB_LAUNCHER_TYPE_KEY, JobLauncherFactory.JobLauncherType.LOCAL.name()))
        .or(LauncherTypeEnum.LOCAL);
  }