Java Code Examples for org.kie.api.builder.ReleaseId#getVersion()
The following examples show how to use
org.kie.api.builder.ReleaseId#getVersion() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: KieRepositoryImpl.java From kogito-runtimes with Apache License 2.0 | 6 votes |
synchronized KieModule remove(ReleaseId releaseId) { KieModule removedKieModule = null; String ga = releaseId.getGroupId() + ":" + releaseId.getArtifactId(); ComparableVersion comparableVersion = new ComparableVersion(releaseId.getVersion()); NavigableMap<ComparableVersion, KieModule> artifactMap = kieModules.get(ga); if (artifactMap != null) { removedKieModule = artifactMap.remove(comparableVersion); if (artifactMap.isEmpty()) { kieModules.remove(ga); } oldKieModules.remove(releaseId); } return removedKieModule; }
Example 2
Source File: KieRepositoryImpl.java From kogito-runtimes with Apache License 2.0 | 6 votes |
synchronized void store(KieModule kieModule) { ReleaseId releaseId = kieModule.getReleaseId(); String ga = releaseId.getGroupId() + ":" + releaseId.getArtifactId(); ComparableVersion comparableVersion = new ComparableVersion(releaseId.getVersion()); NavigableMap<ComparableVersion, KieModule> artifactMap = kieModules.get(ga); if( artifactMap == null ) { artifactMap = createNewArtifactMap(); kieModules.put(ga, artifactMap); } KieModule oldReleaseIdKieModule = oldKieModules.get(releaseId); // variable used in order to test race condition if (oldReleaseIdKieModule == null) { KieModule oldKieModule = artifactMap.get(comparableVersion); if (oldKieModule != null) { oldKieModules.put( releaseId, oldKieModule ); } } artifactMap.put( comparableVersion, kieModule ); }
Example 3
Source File: ReleaseIdImpl.java From kogito-runtimes with Apache License 2.0 | 5 votes |
public static ReleaseId adapt(ReleaseId r ) { if (r instanceof ReleaseId) { return ( ReleaseId ) r; } final ReleaseIdImpl newReleaseIdImpl = new ReleaseIdImpl(r.getGroupId(), r.getArtifactId(), r.getVersion(), ((ReleaseIdImpl) r).getType()); if (r.isSnapshot()) { newReleaseIdImpl.setSnapshotVersion(r.getVersion()); } return newReleaseIdImpl; }
Example 4
Source File: KieFileSystemScannerTest.java From kogito-runtimes with Apache License 2.0 | 5 votes |
private File write( InternalKieModule kModule, Path tempDir, ReleaseId releaseId) { String fileName = releaseId.getArtifactId() + "-" + releaseId.getVersion() + ".jar"; File file = new File(tempDir.toString(), fileName); try (FileOutputStream fos = new FileOutputStream(file)) { fos.write(kModule.getBytes()); fos.flush(); } catch (IOException ioe) { throw new RuntimeException(ioe); } return file; }
Example 5
Source File: KieFileSystemScannerTest.java From kogito-runtimes with Apache License 2.0 | 5 votes |
private String getPom(ReleaseId releaseId, ReleaseId... dependencies) { return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" + " xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n" + " <modelVersion>4.0.0</modelVersion>\n" + "\n" + " <groupId>" + releaseId.getGroupId() + "</groupId>\n" + " <artifactId>" + releaseId.getArtifactId() + "</artifactId>\n" + " <version>" + releaseId.getVersion() + "</version>\n" + "\n" + "</project>"; }
Example 6
Source File: GAV.java From kogito-runtimes with Apache License 2.0 | 4 votes |
public static GAV from(ReleaseId rel) { return new GAV(rel.getGroupId(), rel.getArtifactId(), rel.getVersion()); }