Package java.security

Examples of java.security.CodeSource


                    url = new URL("jar:" + url + "!/" + bytecode.codebase);
                } catch (MalformedURLException mux) {
                    mux.printStackTrace(System.out);
                }

                CodeSource source = new CodeSource(url, (CodeSigner[]) null);
                pd = new ProtectionDomain(source, null, this, null);
                protectionDomainMap.put(bytecode.codebase, pd);
            }
            return defineClass(name, bytecode.bytes, 0, bytecode.length, pd);
        }
View Full Code Here


                    url = new URL("jar:" + url + "!/" + bytecode.codebase);
                } catch (MalformedURLException mux) {
                    mux.printStackTrace(System.out);
                }

                CodeSource source = new CodeSource(url, null);
                pd = new ProtectionDomain(source, null, this, null);
                pdCache.put(bytecode.codebase, pd);
            }

            // Do it the simple way.
View Full Code Here

        pcData.onAdd( pkg.getDialectRuntimeRegistry(), rb.getRootClassLoader() );
        pcData.onBeforeExecute();
       
        Class cls = ((InternalRuleBase)rb).getRootClassLoader().loadClass( "org.drools.core.rule.PackageCompilationDataTest$TestEvalExpression" );
       
        final CodeSource codeSource = invoker.getEvalExpression().getClass().getProtectionDomain().getCodeSource();
        assertNotNull(codeSource.getLocation());
    }
View Full Code Here

*/
public class JACCPermissions {

  public static void checkPermission(Class clazz, String contextID, EJBMethodPermission methodPerm)
      throws SecurityException {
    CodeSource ejbCS = clazz.getProtectionDomain().getCodeSource();

    try {
      setContextID( contextID );

      Policy policy = Policy.getPolicy();
View Full Code Here

            }

            if (entry.loadedClass == null) {
                clazz = defineClass(name, entry.binaryContent, 0,
                        entry.binaryContent.length,
                        new CodeSource(entry.codeBase, entry.certificates));
                entry.loadedClass = clazz;
                entry.binaryContent = null;
                entry.source = null;
                entry.codeBase = null;
                entry.manifest = null;
View Full Code Here

    // TODO: SECURITY - This should probably take a revision, not a bundle.
    BundleProtectionDomain(Felix felix, BundleImpl bundle, Object certificates)
        throws MalformedURLException
    {
        super(
            new CodeSource(
                Felix.m_secureAction.createURL(
                    Felix.m_secureAction.createURL(null, "location:", new FakeURLStreamHandler()),
                    bundle._getLocation().startsWith("reference:") ?
                        bundle._getLocation().substring("reference:".length()) :
                        bundle._getLocation(),
View Full Code Here

    public DocumentJarClassLoader(URL jarURL,
                                  URL documentURL){
        super(new URL[]{jarURL});

        if (documentURL != null) {
            documentCodeSource = new CodeSource(documentURL, null);
        }
    }
View Full Code Here

    public RhinoClassLoader(URL documentURL){
        super(documentURL != null ? new URL[]{documentURL} : new URL[]{});
        // super(new URL[]{});
        this.documentURL = documentURL;
        if (documentURL != null){
            codeSource = new CodeSource(documentURL, null);
        }
    }
View Full Code Here

    public RhinoClassLoader(URL documentURL){
        super(documentURL != null ? new URL[]{documentURL} : new URL[]{});
        // super(new URL[]{});
        this.documentURL = documentURL;
        if (documentURL != null){
            codeSource = new CodeSource(documentURL, null);
        }
        
        //
        // Create the Rhino ProtectionDomain
        // and AccessControlContext
View Full Code Here

            }

            try {
                clazz = defineClass(name, entry.binaryContent, 0,
                        entry.binaryContent.length,
                        new CodeSource(entry.codeBase, entry.certificates));
            } catch (UnsupportedClassVersionError ucve) {
                throw new UnsupportedClassVersionError(
                        ucve.getLocalizedMessage() + " " +
                        sm.getString("webappClassLoader.wrongVersion",
                                name));
View Full Code Here

TOP

Related Classes of java.security.CodeSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.