Creates new MjdbcLogger instance

@param clazz Class description
@return MjdbcLogger instance
425085
public static MjdbcLogger getLogger(Class clazz) {
        MjdbcLogger mjdbcLogger = new MjdbcLogger(clazz.getName(), null);

        if (isSLF4jAvailable() == true) {
            try {
                mjdbcLogger = new MjdbcLogger(clazz.getName(), null);
                mjdbcLogger.setSlfLogger(MappingUtils.invokeStaticFunction(Class.forName("org.slf4j.LoggerFactory"), "getLogger", new Class[]{Class.class}, new Object[]{clazz}));
            } catch (MjdbcException e) {
                setSLF4jAvailable(false);
            } catch (ClassNotFoundException e) {
                setSLF4jAvailable(false);
            }
        }

        return mjdbcLogger;
    }
1345801
public static Annotation[] jlClassGetDeclaredAnnotations(Class<?> clazz) {
		if (TypeRegistry.nothingReloaded) {
			return clazz.getDeclaredAnnotations();
		}
		ReloadableType rtype = getReloadableTypeIfHasBeenReloaded(clazz);
		if (rtype == null) {
			return clazz.getDeclaredAnnotations();
		}
		CurrentLiveVersion clv = rtype.getLiveVersion();
		return clv.getExecutorClass().getDeclaredAnnotations();
	}
619698
public static final DataGridConfig getInstance(Class clazz) {
        DataGridConfig config = (DataGridConfig)ExtensionUtil.instantiateClass(clazz, DataGridConfig.class);
        return config;
    }
749699
public static BeanDesc getBeanDesc(Class<?> clazz) {
		BeanDesc beanDesc = BeanDescCache.INSTANCE.getBeanDesc(clazz);
		if (null == beanDesc) {
			beanDesc = new BeanDesc(clazz);
			BeanDescCache.INSTANCE.putBeanDesc(clazz, beanDesc);
		}
		return beanDesc;
	}
124758
public static Resource getJar(@NonNull Class<?> clazz) {
      URL fileURL = clazz.getProtectionDomain().getCodeSource().getLocation();
      return new FileResource(fileURL.getFile());
   }
1281210
@SuppressWarnings("unchecked") 
   private static void initLogging(ClassLoader cl)
   {
      try
      {
         Class<?> clz = Class.forName("org.jboss.logging.Logger", true, cl);
         
         Method mGetLogger = clz.getMethod("getLogger", String.class);

         logging = mGetLogger.invoke((Object)null, new Object[] {"org.ironjacamar.sjc.Main"});
      }
      catch (Throwable t)
      {
         // Nothing we can do
      }
   }
168747
public static File getClassFile(Class<?> clazz) {
    File dir = new File(clazz.getProtectionDomain().getCodeSource().getLocation().getPath());
    if (!dir.isDirectory()) return null; // class file might be contained in Jar
    File clazzFile = new File(dir, clazz.getName().replace('.', File.separatorChar) + ".class");
    return clazzFile.isFile() ? clazzFile : null;
  }
1173965
public static Method[] getDeclaredMethods(Class clazz) {
	Method[] methods = clazz.getMethods();
	ArrayList list = new ArrayList();
	for (int i = 0; i < methods.length; i++) {
	    if (methods[i].getDeclaringClass() == clazz) list.add(methods[i]);
	}
	if (list.size() == 0) return new Method[0];
	return (Method[]) list.toArray(new Method[list.size()]);
    }
769309
public static ContextualLogger getLogger(Class clazz, LoggerContext context) {
    return new ContextualLogger(LoggerFactory.getLogger(clazz), context);
  }
1306904
public static org.modeshape.jcr.api.Logger getLogger(Class<?> clazz) {
        return new ExtensionLogger(Logger.getLogger(clazz));
    }
132837
public static Method[] getAllInstanceMethods(final Class<?> clazz) {
        if (clazz == null) {
            return null;
        }

        List<Method> methods = new ArrayList<Method>();
        for (Method method : clazz.getMethods()) {
            if (!Modifier.isStatic(method.getModifiers())
                    && Modifier.isPublic(method.getModifiers())) {
                methods.add(method);
            }
        }

        return methods.toArray(new Method[methods.size()]);
    }
69867
public static <A extends Annotation> A getAnnotation(final Class<?> clazz, Class<A> annoClazz) {
        if (clazz == null || annoClazz == null) {
            return null;
        }

        return clazz.getAnnotation(annoClazz);
    }
894663
public static <T> T newInstance(final Class<T> clazz) {
        Constructor<?>[] constructors = getAllConstructorsOfClass(clazz, true);
        if (constructors == null || constructors.length == 0) {
            return null;
        }
        Object[] initParameters = getInitParameters(constructors[0].getParameterTypes());
        try {
            @SuppressWarnings("unchecked")
            T instance = (T) constructors[0].newInstance(initParameters);
            return instance;
        } catch (Exception e) {
            log.error("newInstance", e);
            return null;
        }
    }
1190586
@SuppressWarnings("unchecked")
    public static <T extends Annotation> T createAnnotation(final Class<T> clazz) {
        return (T) Proxy.newProxyInstance(clazz.getClassLoader(), new Class[]{clazz, Annotation.class}, new SimpleAnnoInvocationHandler(clazz));
    }
862992
public static Object newInstance(Class clazz, ArgumentResolver resolver){
        Validate.argumentIsNotNull(clazz);
        for (Constructor constructor : clazz.getDeclaredConstructors()) {
            if (isPrivate(constructor) || isProtected(constructor)) {
                continue;
            }

            Class [] types = constructor.getParameterTypes();
            Object[] params = new Object[types.length];
            for (int i=0; i<types.length; i++){
                try {
                    params[i] = resolver.resolve(types[i]);
                } catch (JaversException e){
                    logger.error("failed to create new instance of "+clazz.getName()+", argument resolver for arg["+i+"] " +
                                 types[i].getName() + " thrown exception: "+e.getMessage());
                    throw e;
                }
            }
            try {
                constructor.setAccessible(true);
                return constructor.newInstance(params);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
        throw new JaversException(JaversExceptionCode.NO_PUBLIC_CONSTRUCTOR,clazz.getName());
    }
154590
public Logger getLogger(Class<?> clazz) {
      if (clazz == null) {
         return getGlobalLogger();
      }
      return getLogger(clazz.getName());
   }
343431
public static <T> T newInstance(final Class<T> clazz) {
        try {
            return clazz.newInstance();
        } catch (InstantiationException | IllegalAccessException e) {
            throw new ClassApiException(e);
        }
    }