@Override public void visitEnd() { if ( pathPrefix != null ) { nexusType = new DetailedNexusType( new RepositoryTypeImpl( pathPrefix, repositoryMaxInstanceCount ) ); } } }
@Override public void visit( final String name, final Object value ) { setHint( (String) value ); } }
@Override public void visitEnd() { if ( isSingleton ) { nexusType = nexusType.asSingleton(); } }
private void scanForNexusMarkers( final String clazz, final String[] interfaces ) { for ( final String i : interfaces ) { nexusType = nexusTypeCache.nexusType( space, i ); if ( nexusType.isComponent() ) { final AnnotationVisitor componentVisitor = getComponentVisitor(); componentVisitor.visit( "role", Type.getObjectType( i ) ); if ( nexusType != MarkedNexusTypes.MANAGED && nexusType != MarkedNexusTypes.MANAGED_SINGLETON ) { componentVisitor.visit( "hint", clazz ); } if ( !nexusType.isSingleton() ) { componentVisitor.visit( "instantiationStrategy", Strategies.PER_LOOKUP ); } break; } } }
@Override public void visit( final int version, final int access, final String name, final String signature, final String superName, final String[] interfaces ) { final String clazz = name.replace( '/', '.' ); nexusTypeListener.hear( clazz ); if ( ( access & ( Opcodes.ACC_ABSTRACT | Opcodes.ACC_INTERFACE | Opcodes.ACC_SYNTHETIC ) ) == 0 ) { scanForNexusMarkers( clazz, interfaces ); } plexusTypeVisitor.visit( version, access, name, signature, superName, interfaces ); }
private void scanInterfaces( final String... interfaces ) throws IOException { // look for @ExtensionPoint / @Managed for ( final String i : interfaces ) { // check cached results type = knownTypes.get( i ); if ( null == type ) { searchForComponentType( i ); } if ( type.isComponent() ) { // we now know the Plexus role setRole( i.replace( '/', '.' ) ); break; } } }
@Override protected ClassSpaceVisitor visitor( final Binder binder ) { return new NexusTypeVisitor( new NexusTypeBinder( binder, classNames, descriptors ) ); } }
public DetailedNexusType asSingleton() { return isSingleton ? this : new DetailedNexusType( true, details ); }
@Override public void visit( final String name, final Object value ) { getComponentVisitor().visit( "hint", value ); } }
public Map<Component, DeferredClass<?>> scan( final ClassSpace space, final boolean localSearch ) throws IOException { final NexusComponentClassVisitor visitor = new NexusComponentClassVisitor( space, repositoryTypes, exportedClassNames ); return visitClassResources( space, visitor ).getComponents(); } }
@Override public AnnotationVisitor visitAnnotation( final String desc, final boolean visible ) { final AnnotationVisitor annotationVisitor = plexusTypeVisitor.visitAnnotation( desc, visible ); return nexusType.isComponent() && NAMED_DESC.equals( desc ) ? namedHintVisitor : annotationVisitor; }
@Override public void visitEnd() { if ( singleton ) { type = type.toSingleton(); } } }
private void scanForNexusMarkers( final String clazz, final String[] interfaces ) { for ( final String i : interfaces ) { nexusType = nexusTypeCache.nexusType( space, i ); if ( nexusType.isComponent() ) { final AnnotationVisitor componentVisitor = getComponentVisitor(); componentVisitor.visit( "role", Type.getObjectType( i ) ); if ( nexusType != MarkedNexusTypes.MANAGED && nexusType != MarkedNexusTypes.MANAGED_SINGLETON ) { componentVisitor.visit( "hint", clazz ); } if ( !nexusType.isSingleton() ) { componentVisitor.visit( "instantiationStrategy", Strategies.PER_LOOKUP ); } break; } } }
@Override public void visitEnd() { if ( pathPrefix != null ) { nexusType = new DetailedNexusType( new RepositoryTypeImpl( pathPrefix, repositoryMaxInstanceCount ) ); } } }
@Override public void visit( final int version, final int access, final String name, final String signature, final String superName, final String[] interfaces ) { final String clazz = name.replace( '/', '.' ); nexusTypeListener.hear( clazz ); if ( ( access & ( Opcodes.ACC_ABSTRACT | Opcodes.ACC_INTERFACE | Opcodes.ACC_SYNTHETIC ) ) == 0 ) { scanForNexusMarkers( clazz, interfaces ); } plexusTypeVisitor.visit( version, access, name, signature, superName, interfaces ); }
@Override public void visitEnd() { if ( isSingleton ) { nexusType = nexusType.asSingleton(); } }
public DetailedNexusType asSingleton() { return isSingleton ? this : new DetailedNexusType( true, details ); }
@Override public void visit( final String name, final Object value ) { getComponentVisitor().visit( "hint", value ); } }