/** * Returns the canonical role-hint for the given Plexus component. * * @param component The Plexus component * @return Canonical role-hint denoting the given component */ public static String canonicalRoleHint( final Component component ) { return canonicalRoleHint( component.role().getName(), component.hint() ); }
/** * Returns the canonical role-hint for the given Plexus component. * * @param component The Plexus component * @return Canonical role-hint denoting the given component */ public static String canonicalRoleHint( final Component component ) { return canonicalRoleHint( component.role().getName(), component.hint() ); }
/** * Returns the component binding {@link Key} for the given Plexus component. * * @param component The Plexus component * @return Component binding key denoting the given component */ public static Key<?> componentKey( final Component component ) { return componentKey( component.role(), component.hint() ); }
/** * Returns the component binding {@link Key} for the given Plexus component. * * @param component The Plexus component * @return Component binding key denoting the given component */ public static Key<?> componentKey( final Component component ) { return componentKey( component.role(), component.hint() ); }
public void hear( final Component component, final DeferredClass<?> clazz, final Object source ) { plexusTypeBinder.hear( component, clazz, source ); if ( null != repositoryType ) { descriptors.add( new RepositoryTypeDescriptor( component.role().getName(), component.hint(), repositoryType.pathPrefix(), repositoryType.repositoryMaxInstanceCount() ) ); repositoryType = null; } }
public void hear( final Component component, final DeferredClass<?> clazz, final Object source ) { plexusTypeBinder.hear( component, clazz, source ); if ( null != repositoryType ) { descriptors.add( new RepositoryTypeDescriptor( component.role().getName(), component.hint(), repositoryType.pathPrefix(), repositoryType.repositoryMaxInstanceCount() ) ); repositoryType = null; } }
/** * Records that the given Plexus component should be loaded when the container starts. * * @param role The Plexus role * @param hint The Plexus hint */ void loadOnStart( final String role, final String hint ) { final String key = Roles.canonicalRoleHint( role, hint ); final Component c = components.get( key ); if ( null == c ) { components.put( key, LOAD_ON_START_PLACEHOLDER ); } else if ( !Strategies.LOAD_ON_START.equals( c.instantiationStrategy() ) ) { components.put( key, new ComponentImpl( c.role(), c.hint(), Strategies.LOAD_ON_START, c.description() ) ); } }
/** * Records that the given Plexus component should be loaded when the container starts. * * @param role The Plexus role * @param hint The Plexus hint */ void loadOnStart( final String role, final String hint ) { final String key = Roles.canonicalRoleHint( role, hint ); final Component c = components.get( key ); if ( null == c ) { components.put( key, LOAD_ON_START_PLACEHOLDER ); } else if ( !Strategies.LOAD_ON_START.equals( c.instantiationStrategy() ) ) { components.put( key, new ComponentImpl( c.role(), c.hint(), Strategies.LOAD_ON_START, c.description() ) ); } }
@SuppressWarnings( "unchecked" ) public void hear( final Component component, final DeferredClass<?> clazz, final Object source ) { plexusTypeBinder.hear( component, clazz, source ); if ( null != repositoryType ) { descriptors.add( new RepositoryTypeDescriptor( (Class<? extends Repository>) component.role(), component.hint(), repositoryType.pathPrefix(), repositoryType.repositoryMaxInstanceCount() ) ); repositoryType = null; } }
@Override public boolean equals( final Object rhs ) { if ( this == rhs ) { return true; } if ( rhs instanceof Component ) { final Component cmp = (Component) rhs; if ( role.equals( cmp.role() ) && hint.equals( cmp.hint() ) && instantiationStrategy.equals( cmp.instantiationStrategy() ) && description.equals( cmp.description() ) ) { // optimization: we hard-code all these attributes to be empty final String hardCodedAttributes = cmp.alias() + cmp.composer() + cmp.configurator() + cmp.factory() + cmp.lifecycleHandler() + cmp.profile() + cmp.type() + cmp.version(); return hardCodedAttributes.length() == 0 && !cmp.isolatedRealm(); } } return false; }
@Override public boolean equals( final Object rhs ) { if ( this == rhs ) { return true; } if ( rhs instanceof Component ) { final Component cmp = (Component) rhs; if ( role.equals( cmp.role() ) && hint.equals( cmp.hint() ) && instantiationStrategy.equals( cmp.instantiationStrategy() ) && description.equals( cmp.description() ) ) { // optimization: we hard-code all these attributes to be empty final String hardCodedAttributes = cmp.alias() + cmp.composer() + cmp.configurator() + cmp.factory() + cmp.lifecycleHandler() + cmp.profile() + cmp.type() + cmp.version(); return hardCodedAttributes.length() == 0 && !cmp.isolatedRealm(); } } return false; }
@Override public boolean equals( final Object rhs ) { if ( this == rhs ) { return true; } if ( rhs instanceof Component ) { final Component cmp = (Component) rhs; if ( role.equals( cmp.role() ) && hint.equals( cmp.hint() ) && instantiationStrategy.equals( cmp.instantiationStrategy() ) && description.equals( cmp.description() ) ) { // optimization: we hard-code all these attributes to be empty final String hardCodedAttributes = cmp.alias() + cmp.composer() + cmp.configurator() + cmp.factory() + cmp.lifecycleHandler() + cmp.profile() + cmp.type() + cmp.version(); return hardCodedAttributes.length() == 0 && !cmp.isolatedRealm(); } } return false; }
component.setRoleHint(filterEmptyAsNull(anno.hint()));