Package java.security

Examples of java.security.ProtectionDomain


          intp.println(ConsoleMsg.CONSOLE_NO_EXPORTED_PACKAGES_NO_PACKAGE_ADMIN_MESSAGE);
        }

        SecurityManager sm = System.getSecurityManager();
        if (sm != null) {
          ProtectionDomain domain = bundle.getProtectionDomain();

          intp.println(domain);
        }
      }
      nextArg = intp.nextArgument();
View Full Code Here


    fwkFile = new File(fwkFile.getParent());
    return fwkFile.getAbsolutePath();
  }

  private static String getSysPathFromCodeSource() {
    ProtectionDomain pd = EclipseStarter.class.getProtectionDomain();
    if (pd == null)
      return null;
    CodeSource cs = pd.getCodeSource();
    if (cs == null)
      return null;
    URL url = cs.getLocation();
    if (url == null)
      return null;
View Full Code Here

   private static Class<?> createProxyClass(ClassLoader loader, ProxyMixin[] mixins, Class<?>[] interfaces)
   throws Exception
   {
      CtClass proxy = createProxyCtClass(loader, mixins, interfaces);
      // Choose the first non-null ProtectionDomain
      ProtectionDomain pd = null;
      for(int n = 0; n < interfaces.length && pd == null; n ++)
      {
        pd = interfaces[n].getProtectionDomain();
      }
      Class<?> clazz = TransformerCommon.toClass(proxy, loader, pd);
View Full Code Here

   }

   private static Class<?> generateProxy(ClassPool pool, Class<?> clazz, ProxyMixin[] mixins, boolean interceptWriteReplace) throws Exception
   {
      CtClass proxy = createProxyCtClass(pool, mixins, clazz, interceptWriteReplace);
      ProtectionDomain pd = clazz.getProtectionDomain();
      Class<?> proxyClass = TransformerCommon.toClass(proxy, pd);
      Map<Long, MethodPersistentReference> methodmap = ClassProxyFactory.getMethodMap(proxyClass);
      Field field = proxyClass.getDeclaredField("methodMap");
      SecurityActions.setAccessible(field);
      field.set(null, methodmap);
View Full Code Here

   private static Class<?> generateProxy(boolean objectAsSuper, ClassLoader loader, Class<?> clazz, Advisor advisor, MarshalledContainerProxy outOfVmProxy) throws Exception
   {
      ArrayList<InterfaceIntroduction> introductions = advisor.getInterfaceIntroductions();
      CtClass proxy = createProxyCtClass(objectAsSuper, loader, introductions, clazz, advisor, outOfVmProxy);
//      ClassLoader loader = determineClassLoaderToUse(clazz, proxy);
      ProtectionDomain pd = clazz.getProtectionDomain();
      Class<?> proxyClass = TransformerCommon.toClass(proxy, /*loader,*/ pd);
      return proxyClass;
   }
View Full Code Here

            // Load the bytecode
            byte[] byteCode = ClassLoaderUtils.loadByteCode(name, is);
           
            // Let the policy do things before we define the class
            BaseClassLoaderPolicy basePolicy = policy;
            ProtectionDomain protectionDomain = basePolicy.getProtectionDomain(name, resourcePath);
            try
            {
               byte[] transformed = policy.transform(name, byteCode, protectionDomain);
               if (transformed != null)
                  byteCode = transformed;
            }
            catch (Throwable t)
            {
               throw new RuntimeException("Unexpected error transforming class " + name, t);
            }
           
            // Create the package if necessary
            URL codeSourceURL = null;
            if (protectionDomain != null)
            {
               CodeSource codeSource = protectionDomain.getCodeSource();
               if (codeSource != null)
                  codeSourceURL = codeSource.getLocation();
            }
            definePackage(name, codeSourceURL);
           
View Full Code Here

    * @param clazz the class
    * @return the code source or null if it doesn't have one
    */
   private static final CodeSource getCodeSource(final Class<?> clazz)
   {
      ProtectionDomain protectionDomain = getProtectionDomain(clazz);
      if (protectionDomain == null)
         return null;
      return protectionDomain.getCodeSource();
   }
View Full Code Here

         else
         {
            //We need to do all the work again
            AspectManager manager = AspectManager.instance();
            ClassPool pool = manager.findClassPool(classloader);
            ProtectionDomain pd = advisorClass.getProtectionDomain();
            generatedClass = generateJoinpointClass(pool, info, classloader, pd);
            generatedJoinPointClassCache.put(infoAdviceString, generatedClass);
         }
         Object obj = generatedClass.createJoinPointInstance(classloader, info);
        
View Full Code Here

         results.append(Integer.toHexString(iface.hashCode()));
         results.append(")");
         ClassLoader loader = ifaces[i].getClassLoader();
         results.append("\n++++ClassLoader: ");
         results.append(loader);
         ProtectionDomain pd = ifaces[i].getProtectionDomain();
         CodeSource cs = pd.getCodeSource();
         if( cs != null )
         {
            results.append("\n++++CodeSource: ");
            results.append(cs);
         }
View Full Code Here

         results.append(Integer.toHexString(iface.hashCode()));
         results.append(")");
         ClassLoader loader = ifaces[i].getClassLoader();
         results.append("\n++++ClassLoader: ");
         results.append(loader);
         ProtectionDomain pd = ifaces[i].getProtectionDomain();
         CodeSource cs = pd.getCodeSource();
         if( cs != null )
         {
            results.append("\n++++CodeSource: ");
            results.append(cs);
         }
View Full Code Here

TOP

Related Classes of java.security.ProtectionDomain

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.