Package java.lang.reflect

Examples of java.lang.reflect.Constructor.newInstance()


      } catch (Throwable thr) {
        throw new RegainException("Analyzer " + analyzerType
                + " does not support stop words", thr);
      }
      try {
        analyzer = (Analyzer) ctor.newInstance(new Object[]{Version.LUCENE_30, stopWordSet});
      } catch (Throwable thr) {
        throw new RegainException("Creating analyzer instance failed", thr);
      }

    } else {
View Full Code Here


        } catch (Throwable thr) {
          throw new RegainException("Analyzer " + analyzerType
                  + " is not supported.", thr);
        }

        analyzer = (Analyzer) analyzerWithoutStopWords.newInstance(new Object[]{Version.LUCENE_30});
      } catch (Throwable thr) {
        throw new RegainException("Creating analyzer instance failed", thr);
      }
    }
View Full Code Here

                {
                    Constructor constructor;
                    try
                    {
                        constructor = expectedType.getConstructor(new Class[] {originalType});
                        object = constructor.newInstance(new Object[] {object});
                    }
                    catch (final NoSuchMethodException exception)
                    {
                        throw new IntrospectorException("Could not convert '" + object + "' to type '" +
                            expectedType.getName() + "'");
View Full Code Here

            getLogger().debug(
                "constructing metafacade from class '" + metafacadeClass + "' mapping object '" + mappingObject +
                "', and context '" + context + "'");
        }
        final Constructor constructor = metafacadeClass.getDeclaredConstructors()[0];
        return (MetafacadeBase)constructor.newInstance(new Object[] {mappingObject, context});
    }

    /**
     * Retrieves the inherited mapping class name for the given <code>mapping</code> by traveling
     * up the inheritance hiearchy to find the first one that has the mapping class name declared.
View Full Code Here

    try
    {
      Class classDefinition = classForName(classname);
      Constructor objectConstructor = classDefinition
          .getConstructor(conArgsClass);
      retObject = objectConstructor.newInstance(conArgs);
    }
    catch (Exception e)
    {
      if ((e.getCause() != null) && (e.getCause() instanceof XException))
      {
View Full Code Here

            try {
                // Build the realm
                Class realmClass = Class.forName(realmClassName, true, parentClassLoader);
                Constructor realmConstr = realmClass.getConstructor(
                        new Class[] {Set.class, Map.class });
                this.authenticationRealm = (AuthenticationRealm) realmConstr.newInstance(
                        new Object[] { rolesAllowed, startupArgs });

                // Build the authentication handler
                Class authClass = Class.forName(authClassName);
                Constructor authConstr = authClass
View Full Code Here

                // Build the authentication handler
                Class authClass = Class.forName(authClassName);
                Constructor authConstr = authClass
                        .getConstructor(new Class[] { Node.class, List.class,
                                Set.class, AuthenticationRealm.class });
                this.authenticationHandler = (AuthenticationHandler) authConstr
                        .newInstance(new Object[] { loginConfigNode,
                                constraintNodes, rolesAllowed,
                                authenticationRealm });
            } catch (ClassNotFoundException err) {
                Logger.log(Logger.DEBUG, Launcher.RESOURCES,
View Full Code Here

            try {
                // Build the realm
                Class jndiMgrClass = Class.forName(jndiMgrClassName, true, parentClassLoader);
                Constructor jndiMgrConstr = jndiMgrClass.getConstructor(new Class[] {
                        Map.class, List.class, ClassLoader.class });
                this.jndiManager = (JNDIManager) jndiMgrConstr.newInstance(new Object[] {
                        null, envEntryNodes, this.loader });
                if (this.jndiManager != null)
                    this.jndiManager.setup();
            } catch (ClassNotFoundException err) {
                Logger.log(Logger.DEBUG, Launcher.RESOURCES,
View Full Code Here

            try {
                // Build the realm
                Class loggerClass = Class.forName(loggerClassName, true, parentClassLoader);
                Constructor loggerConstr = loggerClass.getConstructor(new Class[] {
                        WebAppConfiguration.class, Map.class });
                this.accessLogger = (AccessLogger) loggerConstr.newInstance(new Object[] {
                        this, startupArgs});
            } catch (Throwable err) {
                Logger.log(Logger.ERROR, Launcher.RESOURCES,
                        "WebAppConfig.LoggerError", loggerClassName, err);
            }
View Full Code Here

        if (!preferredClassLoader.equals("")) {
            try {
                Class preferredCL = Class.forName(preferredClassLoader, true, parentClassLoader);
                Constructor reloadConstr = preferredCL.getConstructor(new Class[] {
                        URL[].class, ClassLoader.class});
                outputCL = (ClassLoader) reloadConstr.newInstance(new Object[] {
                        jarURLs, parentClassLoader});
            } catch (Throwable err) {
                if (!stringArg(startupArgs, "preferredClassLoader", "").equals("") ||
                        !preferredClassLoader.equals(WEBAPP_CL_CLASS)) {
                    Logger.log(Logger.ERROR, Launcher.RESOURCES, "WebAppConfig.CLError", err);
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.