@Override public String toString() { return "RequirementRecipe[fieldName=" + requirement.getFieldName() + ", role=" + componentDescriptor.getRole() + "]"; } }
public String toString() { return "ComponentRequirement{" + "role='" + getRole() + "'" + ", " + "roleHint='" + getRoleHint() + "', " + "fieldName='" + getFieldName() + "'" + "}"; }
ComponentRequirement cr = new ComponentRequirement(); cr.setRole( requirement.getChild( "role" ).getValue() ); cr.setRoleHint( requirement.getChild( "role-hint" ).getValue() ); cr.setFieldName( requirement.getChild( "field-name" ).getValue() );
ComponentDependency cd = new ComponentDependency(); cd.setArtifactId( d.getChild( "artifactId" ).getValue() ); cd.setGroupId( d.getChild( "groupId" ).getValue() ); cd.setType( d.getChild( "type" ).getValue() ); cd.setVersion( d.getChild( "version" ).getValue() );
public boolean equals( Object other ) { if ( this == other ) { return true; } if ( !( other instanceof ComponentDescriptor ) ) { return false; } ComponentDescriptor<?> that = (ComponentDescriptor<?>) other; return eq( getRole(), that.getRole() ) && eq( getRoleHint(), that.getRoleHint() ) && eq( getRealm(), that.getRealm() ); }
public PlexusConfiguration getConfiguration( ComponentDescriptor componentDescriptor ) { if ( componentDescriptor.hasConfiguration() ) { return componentDescriptor.getConfiguration(); } return null; } }
private void discoverPluginComponents( final ClassRealm pluginRealm, Plugin plugin, PluginDescriptor pluginDescriptor ) throws PluginContainerException { try { if ( pluginDescriptor != null ) { for ( ComponentDescriptor<?> componentDescriptor : pluginDescriptor.getComponents() ) { componentDescriptor.setRealm( pluginRealm ); container.addComponentDescriptor( componentDescriptor ); } } ( (DefaultPlexusContainer) container ).discoverComponents( pluginRealm, new SessionScopeModule( container ), new MojoExecutionScopeModule( container ) ); } catch ( ComponentLookupException | CycleDetectedInComponentGraphException e ) { throw new PluginContainerException( plugin, pluginRealm, "Error in component graph of plugin " + plugin.getId() + ": " + e.getMessage(), e ); } }
/** * Sets the role of this component. * * @param role this component's role */ public void setRole( String role ) { this.role = role; // reload role class roleClass = null; attemptRoleLoad(); }
/** * Sets the implementation of this componet. * * @param implementation string denoting a FQCN in normal Java components, or some other name or file for other * component factory implementations */ public void setImplementation( String implementation ) { this.implementation = implementation; // reload implementation class implementationClass = null; attemptImplementationLoad(); }
public ComponentRepository getComponentRepository() { if ( componentRepository == null ) { componentRepository = new DefaultComponentRepository(); } return componentRepository; }
public void addComponentDescriptor( ComponentDescriptor<?> componentDescriptor ) throws CycleDetectedInComponentGraphException { repository.addComponentDescriptor( componentDescriptor ); }
public <T> Map<String, ComponentDescriptor<T>> getComponentDescriptorMap( Class<T> type, String role ) { return repository.getComponentDescriptorMap( type, role ); }
public <T> ComponentDescriptor<T> getComponentDescriptor( Class<T> type, String role, String roleHint ) { return repository.getComponentDescriptor( type, role, roleHint ); }
public <T> List<ComponentDescriptor<T>> getComponentDescriptorList( Class<T> type, String role ) { return repository.getComponentDescriptorList( type, role ); }
ComponentRequirement cr = new ComponentRequirement(); cr.setRole( requirement.getChild( "role" ).getValue() ); cr.setRoleHint( requirement.getChild( "role-hint" ).getValue() ); cr.setFieldName( requirement.getChild( "field-name" ).getValue() );
ComponentDependency cd = new ComponentDependency(); cd.setArtifactId( d.getChild( "artifactId" ).getValue() ); cd.setGroupId( d.getChild( "groupId" ).getValue() ); cd.setType( d.getChild( "type" ).getValue() ); cd.setVersion( d.getChild( "version" ).getValue() );
public Class<T> getRoleClass() { attemptRoleLoad(); if (roleClass == null) { return (Class<T>) Object.class; } return (Class<T>) roleClass; }
/** * Returns the implementation class of this componet, or null if the implementation class can not be loaded. * * @return the implementation of this componet's role. */ public Class<? extends T> getImplementationClass() { attemptImplementationLoad(); if (implementationClass == null) { return (Class<T>) Object.class; } return (Class<T>)implementationClass; }