Examples of ClassLoader


Examples of java.lang.ClassLoader

                InstantiationException {

        Method m = null;

        ClassLoader cl = null;



        try {

            m = Thread.class.getMethod("getContextClassLoader", null);

        } catch (NoSuchMethodException e) {

            // Assume that we are running JDK 1.1, use the current ClassLoader

            cl = DOMImplementationRegistry.class.getClassLoader();

        }



        if (cl == null ) {

            try {

                cl = (ClassLoader) m.invoke(Thread.currentThread(), null);

            } catch (IllegalAccessException e) {

                // assert(false)

                throw new UnknownError(e.getMessage());

            } catch (InvocationTargetException e) {

                // assert(e.getTargetException() instanceof SecurityException)

                throw new UnknownError(e.getMessage());

            }

        }

        if (cl == null) {

            // fall back to Class.forName

            return Class.forName(className);

        }

        try {

            return cl.loadClass(className);

        } catch (ClassNotFoundException e) {

            return Class.forName(className);
View Full Code Here

Examples of java.lang.ClassLoader

    private static Class getClass (String className)
                throws ClassNotFoundException, IllegalAccessException,
                InstantiationException {
        Method m = null;
        ClassLoader cl = null;

        try {
            m = Thread.class.getMethod("getContextClassLoader", null);
        } catch (NoSuchMethodException e) {
            // Assume that we are running JDK 1.1, use the current ClassLoader
            cl = DOMImplementationRegistry.class.getClassLoader();
        }

        if (cl == null ) {
            try {
                cl = (ClassLoader) m.invoke(Thread.currentThread(), null);
            } catch (IllegalAccessException e) {
                // assert(false)
                throw new UnknownError(e.getMessage());
            } catch (InvocationTargetException e) {
                // assert(e.getTargetException() instanceof SecurityException)
                throw new UnknownError(e.getMessage());
            }
        }
        if (cl == null) {
            // fall back to Class.forName
            return Class.forName(className);
        }
        try {
            return cl.loadClass(className);
        } catch (ClassNotFoundException e) {
            return Class.forName(className);
        }
    }
View Full Code Here

Examples of java.lang.ClassLoader

    private boolean commonToBothInterfaces(String home, String remote, EjbDescriptor descriptor) {
  boolean oneFailed = false;
  try {
        Context context = getVerifierContext();
    ClassLoader jcl = context.getClassLoader();
        Class c = Class.forName(home, false, getVerifierContext().getClassLoader());
        Class rc = Class.forName(remote, false, getVerifierContext().getClassLoader());
        Method methods[] = c.getDeclaredMethods();
        Class methodReturnType;
        boolean validReturn = false;
View Full Code Here

Examples of java.lang.ClassLoader

        Class [] ejbFinderMethodParameterTypes;
        int ejbFinderMethodLoopCounter = 0;
        try {
            // retrieve the home interface methods
            Context context = getVerifierContext();
            ClassLoader jcl = context.getClassLoader();
            Class homeInterfaceClass = Class.forName(home, false, getVerifierContext().getClassLoader());
            Class remoteInterfaceClass = Class.forName(remote, false, getVerifierContext().getClassLoader());
            Class EJBClass = Class.forName(descriptor.getEjbClassName(), false, getVerifierContext().getClassLoader());
            Method [] homeInterfaceMethods = homeInterfaceClass.getMethods();
            Method [] ejbFinderMethods = EJBClass.getMethods();
View Full Code Here

Examples of java.lang.ClassLoader

        return result;
    }

    try {
        Context context = getVerifierContext();
    ClassLoader jcl = context.getClassLoader();
        Class c = Class.forName(descriptor.getHomeClassName(), false, getVerifierContext().getClassLoader());
        Method methods[] = c.getDeclaredMethods();
        Class [] methodExceptionTypes;
        boolean throwsRemoteException = false;
 
View Full Code Here

Examples of java.lang.ClassLoader

  //       methods which must throw javax.ejb.FinderException
  try {
      PersistenceDescriptor pers = ((EjbCMPEntityDescriptor)descriptor).getPersistenceDescriptor();

      Context context = getVerifierContext();
      ClassLoader jcl = context.getClassLoader();
      Class c = Class.forName(home, false, getVerifierContext().getClassLoader());
      Method methods[] = c.getDeclaredMethods();
     
      for (int i=0; i< methods.length; i++) {
          if (methods[i].getName().startsWith("find") && !(methods[i].getName()).equals(FINDBYPRIMARYKEY)) {
View Full Code Here

Examples of java.lang.ClassLoader

  boolean oneFailed = false;
    // RULE: Entity home interface are only allowed to have find<METHOD>
    //       methods which must throw javax.ejb.FinderException
    try {
        Context context = getVerifierContext();
    ClassLoader jcl = context.getClassLoader();
        Class c = Class.forName(home, false, getVerifierContext().getClassLoader());
        Method methods[] = c.getDeclaredMethods();
        Class [] methodExceptionTypes;
        boolean throwsFinderException = false;
 
View Full Code Here

Examples of java.lang.ClassLoader

    {
      ConnectionDefDescriptor connDefDesc = (ConnectionDefDescriptor)
        iter.next();
      String intf = connDefDesc.getConnectionIntf();
      Context context = getVerifierContext();
      ClassLoader jcl = context.getRarClassLoader();
      Class intfClass = null;
      try
      {
        intfClass = Class.forName(intf, false, getVerifierContext().getClassLoader());   
      }
View Full Code Here

Examples of java.lang.ClassLoader

    int findMethodModifiers = 0;
    int foundAtLeastOne = 0;
    try {
        // retrieve the EJB Class Methods
        Context context = getVerifierContext();
    ClassLoader jcl = context.getClassLoader();
        Class EJBClass = Class.forName(descriptor.getEjbClassName(), false, getVerifierContext().getClassLoader());
                    // start do while loop here....
                    do {
      Method [] ejbFinderMethods = EJBClass.getDeclaredMethods();
       
View Full Code Here

Examples of java.lang.ClassLoader

           (getClass().getName() + ".notApplicable1",
            " [ {0} ] does not have a remote home interface. ",
            new Object[] {descriptor.getEjbClassName()}));
        return result;
    }
    ClassLoader jcl = getVerifierContext().getClassLoader();
    Class rc = Class.forName(descriptor.getHomeClassName(), false, jcl);

    Class methodReturnType;
    boolean homeMethodFound = false;
    boolean isLegalRMIIIOPReturn = false;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.