Tabnine Logo
Scope
Code IndexAdd Tabnine to your IDE (free)

How to use
Scope
in
juzu

Best Java code snippets using juzu.Scope (Showing top 20 results out of 315)

origin: org.juzu/juzu-core

void afterBeanDiscovery(@Observes AfterBeanDiscovery event, BeanManager beanManager) {
 if (context != null) {
  for (Scope scope : context.injector.scopes) {
   if (!scope.isBuiltIn()) {
    event.addContext(new ContextImpl(context.injector.scopeController, scope, scope.getAnnotationType()));
   }
  }
  
  // Add the manager
  event.addBean(new SingletonBean(InjectionContext.class, Tools.set(AbstractBean.DEFAULT_QUALIFIER, AbstractBean.ANY_QUALIFIER), context));
  
  // Add bound beans
  for (AbstractBean bean : context.injector.boundBeans) {
   bean.register(beanManager);
   event.addBean(bean);
  }      
 }
}
origin: juzu/juzu

 @Override
 public int hashCode() {
  return scope.hashCode() ^ scoped.hashCode();
 }
}
origin: org.juzu/juzu-core

 @Override
 public ScopeMetadata resolveScopeMetadata(BeanDefinition definition) {
  ScopeMetadata metadata = new ScopeMetadata();
  if (definition instanceof AnnotatedBeanDefinition) {
   AnnotatedBeanDefinition annDef = (AnnotatedBeanDefinition)definition;
   Set<String> annotationTypes = annDef.getMetadata().getAnnotationTypes();

   //
   String scopeName;
   if (annotationTypes.contains(Singleton.class.getName())) {
    scopeName = "singleton";
   }
   else {
    scopeName = "prototype";
    for (Scope scope : scopes) {
     if (annotationTypes.contains(scope.getAnnotationType().getName())) {
      scopeName = scope.name().toLowerCase();
      break;
     }
    }
   }
   metadata.setScopeName(scopeName);
   return metadata;
  }
  else {
   return super.resolveScopeMetadata(definition);
  }
 }
}
origin: org.juzu/juzu-core

if (!scope.isBuiltIn()) {
 factory.registerScope(scope.name().toLowerCase(), new SpringScope(factory, scope, scopeController));
origin: org.juzu/juzu-core

 @Override
 void configure(String name, SpringInjector builder, DefaultListableBeanFactory factory) {
  AnnotatedGenericBeanDefinition definition = new AnnotatedGenericBeanDefinition(type);

  //
  if (scope != null) {
   definition.setScope(scope.name().toLowerCase());
  }
  else {
   ScopeMetadata scopeMD = builder.scopeResolver.resolveScopeMetadata(definition);
   if (scopeMD != null) {
    definition.setScope(scopeMD.getScopeName());
   }
  }

  //
  if (qualifiers != null) {
   for (AutowireCandidateQualifier qualifier : qualifiers) {
    definition.addQualifier(qualifier);
   }
  }

  //
  factory.registerBeanDefinition(name, definition);
 }
}
origin: org.juzu/juzu-core

scopeType = scope.getAnnotationType();
origin: org.juzu/juzu-core

juzu.Scope beanScope = scope != null ? juzu.Scope.valueOf(scope.toUpperCase()) : null;
Class<?> beanImplClass = implementation != null ? loader.loadClass(implementation) : null;
origin: org.juzu/juzu-core

for (Scope scope : Scope.values()) {
 injector.addScope(scope);
origin: juzu/juzu

if (!scope.isBuiltIn()) {
 factory.registerScope(scope.name().toLowerCase(), new SpringScope(factory, scope, scopeController));
origin: juzu/juzu

 @Override
 void configure(String name, SpringInjector builder, DefaultListableBeanFactory factory) {
  AnnotatedGenericBeanDefinition definition = new AnnotatedGenericBeanDefinition(type);

  //
  if (scope != null) {
   definition.setScope(scope.name().toLowerCase());
  }
  else {
   ScopeMetadata scopeMD = builder.scopeResolver.resolveScopeMetadata(definition);
   if (scopeMD != null) {
    definition.setScope(scopeMD.getScopeName());
   }
  }

  //
  if (qualifiers != null) {
   for (AutowireCandidateQualifier qualifier : qualifiers) {
    definition.addQualifier(qualifier);
   }
  }

  //
  factory.registerBeanDefinition(name, definition);
 }
}
origin: juzu/juzu

scopeType = scope.getAnnotationType();
origin: juzu/juzu

juzu.Scope beanScope = scope != null ? juzu.Scope.valueOf(scope.toUpperCase()) : null;
Class<?> beanImplClass = implementation != null ? loader.loadClass(implementation) : null;
origin: juzu/juzu

for (Scope scope : Scope.values()) {
 injector.addScope(scope);
origin: juzu/juzu

void afterBeanDiscovery(@Observes AfterBeanDiscovery event, BeanManager beanManager) {
 if (context != null) {
  for (Scope scope : context.injector.scopes) {
   if (!scope.isBuiltIn()) {
    event.addContext(new ContextImpl(context.injector.scopeController, scope, scope.getAnnotationType()));
   }
  }
  
  // Add the manager
  event.addBean(new SingletonBean(InjectionContext.class, Tools.set(AbstractBean.DEFAULT_QUALIFIER, AbstractBean.ANY_QUALIFIER), context));
  
  // Add bound beans
  for (AbstractBean bean : context.injector.boundBeans) {
   bean.register(beanManager);
   event.addBean(bean);
  }      
 }
}
origin: juzu/juzu

 @Override
 public ScopeMetadata resolveScopeMetadata(BeanDefinition definition) {
  ScopeMetadata metadata = new ScopeMetadata();
  if (definition instanceof AnnotatedBeanDefinition) {
   AnnotatedBeanDefinition annDef = (AnnotatedBeanDefinition)definition;
   Set<String> annotationTypes = annDef.getMetadata().getAnnotationTypes();

   //
   String scopeName;
   if (annotationTypes.contains(Singleton.class.getName())) {
    scopeName = "singleton";
   }
   else {
    scopeName = "prototype";
    for (Scope scope : scopes) {
     if (annotationTypes.contains(scope.getAnnotationType().getName())) {
      scopeName = scope.name().toLowerCase();
      break;
     }
    }
   }
   metadata.setScopeName(scopeName);
   return metadata;
  }
  else {
   return super.resolveScopeMetadata(definition);
  }
 }
}
origin: org.juzu/juzu-core

definition.setScope(scope.name().toLowerCase());
origin: org.juzu/juzu-core

scopeAnnotation = scope.getAnnotationType();
origin: org.juzu/juzu-core

 @Override
 public int hashCode() {
  return scope.hashCode() ^ scoped.hashCode();
 }
}
origin: org.juzu/juzu-core

if (!scope.isBuiltIn()) {
 bindScope(scope.getAnnotationType(), new GuiceScope(scope, scopeController));
origin: juzu/juzu

definition.setScope(scope.name().toLowerCase());
juzuScope

Most used methods

  • getAnnotationType
  • hashCode
  • isBuiltIn
  • name
  • valueOf
  • values

Popular in Java

  • Running tasks concurrently on multiple threads
  • setRequestProperty (URLConnection)
  • getSystemService (Context)
  • onCreateOptionsMenu (Activity)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • BoxLayout (javax.swing)
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now