Codota Logo
SpringBuilder
Code IndexAdd Codota to your IDE (free)

How to use
SpringBuilder
in
cn.dreampie.common.spring

Best Java code snippets using cn.dreampie.common.spring.SpringBuilder (Showing top 16 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: Dreampie/Resty

 public static <T> T getBean(Class<T> clazz) {
  ConfigurableApplicationContext context = getContext();
  if (context != null) {
   return context.getBean(clazz);
  }
  return null;
 }
}
origin: Dreampie/Resty

public static void registerSingleton(Class clazz) {
 try {
  registerSingleton(clazz, clazz.newInstance());
 } catch (InstantiationException e) {
  logger.error(e.getMessage(), e);
 } catch (IllegalAccessException e) {
  logger.error(e.getMessage(), e);
 }
}
origin: Dreampie/Resty

 public boolean stop() {
  SpringBuilder.removeContext();
  return true;
 }
}
origin: Dreampie/Resty

public boolean start() {
 if (this.context == null) {
  if (configFiles == null) {
   this.context = new AnnotationConfigApplicationContext(configClasses);
  } else {
   this.context = new ClassPathXmlApplicationContext(configFiles);
  }
 }
 SpringBuilder.setContext(context);
 return true;
}
origin: Dreampie/Resty

 resource = SpringBuilder.getBean(route.getResourceClass());
} else {
 resource = route.getResourceClass().newInstance();
origin: Dreampie/Resty

SpringBuilder.register(resourceClazz);//如果spring plugin init注入到spring容器
origin: cn.dreampie/resty-common

public boolean start() {
 if (this.context == null) {
  if (configFiles == null) {
   this.context = new AnnotationConfigApplicationContext(configClasses);
  } else {
   this.context = new ClassPathXmlApplicationContext(configFiles);
  }
 }
 SpringBuilder.setContext(context);
 return true;
}
origin: cn.dreampie/resty-route

 resource = SpringBuilder.getBean(route.getResourceClass());
} else {
 resource = route.getResourceClass().newInstance();
origin: cn.dreampie/resty-route

SpringBuilder.register(resourceClazz);//如果spring plugin init注入到spring容器
origin: Dreampie/Resty

/**
 * 注册bean
 *
 * @param clazz
 */
public static void register(Class clazz) {
 ConfigurableApplicationContext context = getContext();
 if (context != null) {
  DefaultListableBeanFactory beanFactory = (DefaultListableBeanFactory) context.getBeanFactory();
  String beanName = Stringer.firstLowerCase(clazz.getSimpleName());
  beanFactory.registerBeanDefinition(beanName, BeanDefinitionBuilder.rootBeanDefinition(clazz).getBeanDefinition());
 }
}
origin: cn.dreampie/resty-common

 public boolean stop() {
  SpringBuilder.removeContext();
  return true;
 }
}
origin: cn.dreampie/resty-common

public static void registerSingleton(Class clazz) {
 try {
  registerSingleton(clazz, clazz.newInstance());
 } catch (InstantiationException e) {
  logger.error(e.getMessage(), e);
 } catch (IllegalAccessException e) {
  logger.error(e.getMessage(), e);
 }
}
origin: Dreampie/Resty

public static void registerSingleton(Class clazz, Object bean) {
 ConfigurableApplicationContext context = getContext();
 if (context != null) {
  DefaultListableBeanFactory beanFactory = (DefaultListableBeanFactory) context.getBeanFactory();
  String beanName = Stringer.firstLowerCase(clazz.getSimpleName());
  beanFactory.registerSingleton(beanName, bean);
 }
}
origin: cn.dreampie/resty-common

 public static <T> T getBean(Class<T> clazz) {
  ConfigurableApplicationContext context = getContext();
  if (context != null) {
   return context.getBean(clazz);
  }
  return null;
 }
}
origin: cn.dreampie/resty-common

/**
 * 注册bean
 *
 * @param clazz
 */
public static void register(Class clazz) {
 ConfigurableApplicationContext context = getContext();
 if (context != null) {
  DefaultListableBeanFactory beanFactory = (DefaultListableBeanFactory) context.getBeanFactory();
  String beanName = Stringer.firstLowerCase(clazz.getSimpleName());
  beanFactory.registerBeanDefinition(beanName, BeanDefinitionBuilder.rootBeanDefinition(clazz).getBeanDefinition());
 }
}
origin: cn.dreampie/resty-common

public static void registerSingleton(Class clazz, Object bean) {
 ConfigurableApplicationContext context = getContext();
 if (context != null) {
  DefaultListableBeanFactory beanFactory = (DefaultListableBeanFactory) context.getBeanFactory();
  String beanName = Stringer.firstLowerCase(clazz.getSimpleName());
  beanFactory.registerSingleton(beanName, bean);
 }
}
cn.dreampie.common.springSpringBuilder

Most used methods

  • getBean
  • getContext
  • register
    注册bean
  • registerSingleton
  • removeContext
  • setContext

Popular in Java

  • Reading from database using SQL prepared statement
  • notifyDataSetChanged (ArrayAdapter)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • findViewById (Activity)
  • Point (java.awt)
    A point representing a location in (x, y) coordinate space, specified in integer precision.
  • BigInteger (java.math)
    Immutable arbitrary-precision integers. All operations behave as if BigIntegers were represented in
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Reference (javax.naming)
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now