Java Code Examples for java.security.CodeSource#equals()
The following examples show how to use
java.security.CodeSource#equals() .
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: JavaAdapterFactory.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
private StaticClass getInstanceAdapterClass(final ProtectionDomain protectionDomain) { CodeSource codeSource = protectionDomain.getCodeSource(); if(codeSource == null) { codeSource = MINIMAL_PERMISSION_DOMAIN.getCodeSource(); } StaticClass instanceAdapterClass = instanceAdapters.get(codeSource); if(instanceAdapterClass != null) { return instanceAdapterClass; } // Any "unknown source" code source will default to no permission domain. final ProtectionDomain effectiveDomain = codeSource.equals(MINIMAL_PERMISSION_DOMAIN.getCodeSource()) ? MINIMAL_PERMISSION_DOMAIN : protectionDomain; instanceAdapterClass = instanceAdapterGenerator.generateClass(commonLoader, effectiveDomain); final StaticClass existing = instanceAdapters.putIfAbsent(codeSource, instanceAdapterClass); return existing == null ? instanceAdapterClass : existing; }
Example 2
Source File: JavaAdapterFactory.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
private StaticClass getInstanceAdapterClass(final ProtectionDomain protectionDomain) { CodeSource codeSource = protectionDomain.getCodeSource(); if(codeSource == null) { codeSource = MINIMAL_PERMISSION_DOMAIN.getCodeSource(); } StaticClass instanceAdapterClass = instanceAdapters.get(codeSource); if(instanceAdapterClass != null) { return instanceAdapterClass; } // Any "unknown source" code source will default to no permission domain. final ProtectionDomain effectiveDomain = codeSource.equals(MINIMAL_PERMISSION_DOMAIN.getCodeSource()) ? MINIMAL_PERMISSION_DOMAIN : protectionDomain; instanceAdapterClass = instanceAdapterGenerator.generateClass(commonLoader, effectiveDomain); final StaticClass existing = instanceAdapters.putIfAbsent(codeSource, instanceAdapterClass); return existing == null ? instanceAdapterClass : existing; }
Example 3
Source File: JavaAdapterFactory.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
private StaticClass getInstanceAdapterClass(final ProtectionDomain protectionDomain) { CodeSource codeSource = protectionDomain.getCodeSource(); if(codeSource == null) { codeSource = MINIMAL_PERMISSION_DOMAIN.getCodeSource(); } StaticClass instanceAdapterClass = instanceAdapters.get(codeSource); if(instanceAdapterClass != null) { return instanceAdapterClass; } // Any "unknown source" code source will default to no permission domain. final ProtectionDomain effectiveDomain = codeSource.equals(MINIMAL_PERMISSION_DOMAIN.getCodeSource()) ? MINIMAL_PERMISSION_DOMAIN : protectionDomain; instanceAdapterClass = instanceAdapterGenerator.generateClass(commonLoader, effectiveDomain); final StaticClass existing = instanceAdapters.putIfAbsent(codeSource, instanceAdapterClass); return existing == null ? instanceAdapterClass : existing; }
Example 4
Source File: JavaAdapterFactory.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
private StaticClass getInstanceAdapterClass(final ProtectionDomain protectionDomain) { CodeSource codeSource = protectionDomain.getCodeSource(); if(codeSource == null) { codeSource = MINIMAL_PERMISSION_DOMAIN.getCodeSource(); } StaticClass instanceAdapterClass = instanceAdapters.get(codeSource); if(instanceAdapterClass != null) { return instanceAdapterClass; } // Any "unknown source" code source will default to no permission domain. final ProtectionDomain effectiveDomain = codeSource.equals(MINIMAL_PERMISSION_DOMAIN.getCodeSource()) ? MINIMAL_PERMISSION_DOMAIN : protectionDomain; instanceAdapterClass = instanceAdapterGenerator.generateClass(commonLoader, effectiveDomain); final StaticClass existing = instanceAdapters.putIfAbsent(codeSource, instanceAdapterClass); return existing == null ? instanceAdapterClass : existing; }
Example 5
Source File: JavaAdapterFactory.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
private StaticClass getInstanceAdapterClass(final ProtectionDomain protectionDomain) { CodeSource codeSource = protectionDomain.getCodeSource(); if(codeSource == null) { codeSource = MINIMAL_PERMISSION_DOMAIN.getCodeSource(); } StaticClass instanceAdapterClass = instanceAdapters.get(codeSource); if(instanceAdapterClass != null) { return instanceAdapterClass; } // Any "unknown source" code source will default to no permission domain. final ProtectionDomain effectiveDomain = codeSource.equals(MINIMAL_PERMISSION_DOMAIN.getCodeSource()) ? MINIMAL_PERMISSION_DOMAIN : protectionDomain; instanceAdapterClass = instanceAdapterGenerator.generateClass(commonLoader, effectiveDomain); final StaticClass existing = instanceAdapters.putIfAbsent(codeSource, instanceAdapterClass); return existing == null ? instanceAdapterClass : existing; }
Example 6
Source File: JavaAdapterFactory.java From hottub with GNU General Public License v2.0 | 6 votes |
private StaticClass getInstanceAdapterClass(final ProtectionDomain protectionDomain) { CodeSource codeSource = protectionDomain.getCodeSource(); if(codeSource == null) { codeSource = MINIMAL_PERMISSION_DOMAIN.getCodeSource(); } StaticClass instanceAdapterClass = instanceAdapters.get(codeSource); if(instanceAdapterClass != null) { return instanceAdapterClass; } // Any "unknown source" code source will default to no permission domain. final ProtectionDomain effectiveDomain = codeSource.equals(MINIMAL_PERMISSION_DOMAIN.getCodeSource()) ? MINIMAL_PERMISSION_DOMAIN : protectionDomain; instanceAdapterClass = instanceAdapterGenerator.generateClass(commonLoader, effectiveDomain); final StaticClass existing = instanceAdapters.putIfAbsent(codeSource, instanceAdapterClass); return existing == null ? instanceAdapterClass : existing; }
Example 7
Source File: JavaAdapterFactory.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
private StaticClass getInstanceAdapterClass(final ProtectionDomain protectionDomain) { CodeSource codeSource = protectionDomain.getCodeSource(); if(codeSource == null) { codeSource = MINIMAL_PERMISSION_DOMAIN.getCodeSource(); } StaticClass instanceAdapterClass = instanceAdapters.get(codeSource); if(instanceAdapterClass != null) { return instanceAdapterClass; } // Any "unknown source" code source will default to no permission domain. final ProtectionDomain effectiveDomain = codeSource.equals(MINIMAL_PERMISSION_DOMAIN.getCodeSource()) ? MINIMAL_PERMISSION_DOMAIN : protectionDomain; instanceAdapterClass = instanceAdapterGenerator.generateClass(commonLoader, effectiveDomain); final StaticClass existing = instanceAdapters.putIfAbsent(codeSource, instanceAdapterClass); return existing == null ? instanceAdapterClass : existing; }
Example 8
Source File: JavaAdapterFactory.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
private StaticClass getInstanceAdapterClass(final ProtectionDomain protectionDomain) { CodeSource codeSource = protectionDomain.getCodeSource(); if(codeSource == null) { codeSource = MINIMAL_PERMISSION_DOMAIN.getCodeSource(); } StaticClass instanceAdapterClass = instanceAdapters.get(codeSource); if(instanceAdapterClass != null) { return instanceAdapterClass; } // Any "unknown source" code source will default to no permission domain. final ProtectionDomain effectiveDomain = codeSource.equals(MINIMAL_PERMISSION_DOMAIN.getCodeSource()) ? MINIMAL_PERMISSION_DOMAIN : protectionDomain; instanceAdapterClass = instanceAdapterGenerator.generateClass(commonLoader, effectiveDomain); final StaticClass existing = instanceAdapters.putIfAbsent(codeSource, instanceAdapterClass); return existing == null ? instanceAdapterClass : existing; }
Example 9
Source File: JavaAdapterFactory.java From jdk8u_nashorn with GNU General Public License v2.0 | 6 votes |
private StaticClass getInstanceAdapterClass(final ProtectionDomain protectionDomain) { CodeSource codeSource = protectionDomain.getCodeSource(); if(codeSource == null) { codeSource = MINIMAL_PERMISSION_DOMAIN.getCodeSource(); } StaticClass instanceAdapterClass = instanceAdapters.get(codeSource); if(instanceAdapterClass != null) { return instanceAdapterClass; } // Any "unknown source" code source will default to no permission domain. final ProtectionDomain effectiveDomain = codeSource.equals(MINIMAL_PERMISSION_DOMAIN.getCodeSource()) ? MINIMAL_PERMISSION_DOMAIN : protectionDomain; instanceAdapterClass = instanceAdapterGenerator.generateClass(commonLoader, effectiveDomain); final StaticClass existing = instanceAdapters.putIfAbsent(codeSource, instanceAdapterClass); return existing == null ? instanceAdapterClass : existing; }
Example 10
Source File: DependencyResolver.java From streamsx.topology with Apache License 2.0 | 6 votes |
public void addJarDependency(BOperatorInvocation op, Class<?> clazz) { CodeSource thisCodeSource = this.getClass().getProtectionDomain() .getCodeSource(); CodeSource source = clazz.getProtectionDomain().getCodeSource(); if (null == source || thisCodeSource.equals(source)) { return; } Path absolutePath = null; try { absolutePath = Paths.get(source.getLocation().toURI()).toAbsolutePath(); } catch (URISyntaxException e) { throw new RuntimeException(e); } if (operatorToJarDependencies.containsKey(op)) { operatorToJarDependencies.get(op).add(absolutePath); } else { operatorToJarDependencies.put(op, new HashSet<Path>()); operatorToJarDependencies.get(op).add(absolutePath); } }