Skip to content
This repository was archived by the owner on Oct 17, 2020. It is now read-only.

Commit c9123db

Browse files
author
jdcasey
committed
[maven-release-plugin] copy for tag plexus-active-collections-1.0-beta-2
0 parents  commit c9123db

30 files changed

Lines changed: 3126 additions & 0 deletions

‎pom.xml‎

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
<parent>
4+
<artifactId>plexus-components</artifactId>
5+
<groupId>org.codehaus.plexus</groupId>
6+
<version>1.1.6</version>
7+
</parent>
8+
9+
<artifactId>plexus-active-collections</artifactId>
10+
<version>1.0-beta-2</version>
11+
<name>Plexus Container-Backed Active Collections</name>
12+
13+
<dependencies>
14+
<dependency>
15+
<groupId>org.codehaus.plexus</groupId>
16+
<artifactId>plexus-component-api</artifactId>
17+
<version>1.0-alpha-22</version>
18+
<scope>provided</scope>
19+
</dependency>
20+
<dependency>
21+
<groupId>org.codehaus.plexus</groupId>
22+
<artifactId>plexus-container-default</artifactId>
23+
<version>1.0-alpha-22</version>
24+
</dependency>
25+
<dependency>
26+
<groupId>junit</groupId>
27+
<artifactId>junit</artifactId>
28+
<version>3.8.1</version>
29+
<scope>test</scope>
30+
</dependency>
31+
</dependencies>
32+
33+
<build>
34+
<plugins>
35+
<plugin>
36+
<artifactId>maven-surefire-plugin</artifactId>
37+
<configuration>
38+
<excludes>
39+
<exclude>**/TestComponent.java</exclude>
40+
<exclude>**/TestBadComponent.java</exclude>
41+
<exclude>**/*TCK.java</exclude>
42+
</excludes>
43+
</configuration>
44+
</plugin>
45+
<plugin>
46+
<groupId>org.codehaus.plexus</groupId>
47+
<artifactId>plexus-maven-plugin</artifactId>
48+
<version>1.3</version>
49+
<executions>
50+
<execution>
51+
<id>create-component-descriptor</id>
52+
<goals>
53+
<goal>descriptor</goal>
54+
</goals>
55+
</execution>
56+
<!--
57+
<execution>
58+
<id>merge</id>
59+
<configuration>
60+
<output>${project.build.outputDirectory}/META-INF/plexus/components.xml</output>
61+
<descriptors>
62+
<descriptor>${project.build.directory}/generated-resources/plexus/META-INF/plexus/components.xml</descriptor>
63+
<descriptor>src/main/resources/META-INF/plexus/components.xml</descriptor>
64+
</descriptors>
65+
</configuration>
66+
<phase>generate-resources</phase>
67+
<goals>
68+
<goal>merge-descriptors</goal>
69+
</goals>
70+
</execution>
71+
-->
72+
</executions>
73+
</plugin>
74+
</plugins>
75+
</build>
76+
77+
<scm>
78+
<connection>scm:svn:http://svn.codehaus.org/plexus/tags/plexus-active-collections-1.0-beta-2</connection>
79+
<developerConnection>scm:svn:https://svn.codehaus.org/plexus/tags/plexus-active-collections-1.0-beta-2</developerConnection>
80+
</scm>
81+
</project>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>its</groupId>
5+
<artifactId>maven-compat-test-plugin</artifactId>
6+
<packaging>maven-plugin</packaging>
7+
<version>1.0-SNAPSHOT</version>
8+
<name>maven-compat-test-plugin Maven Mojo</name>
9+
<url>http://maven.apache.org</url>
10+
<dependencies>
11+
<dependency>
12+
<groupId>org.codehaus.plexus</groupId>
13+
<artifactId>plexus-active-collections</artifactId>
14+
<version>1.0-beta-2-SNAPSHOT</version>
15+
</dependency>
16+
<dependency>
17+
<groupId>org.apache.maven</groupId>
18+
<artifactId>maven-plugin-api</artifactId>
19+
<version>2.0</version>
20+
</dependency>
21+
<dependency>
22+
<groupId>junit</groupId>
23+
<artifactId>junit</artifactId>
24+
<version>3.8.1</version>
25+
<scope>test</scope>
26+
</dependency>
27+
</dependencies>
28+
</project>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package its;
2+
3+
/*
4+
* Copyright 2001-2005 The Apache Software Foundation.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
import org.apache.maven.plugin.AbstractMojo;
20+
import org.apache.maven.plugin.MojoExecutionException;
21+
import org.codehaus.plexus.collections.ActiveCollectionManager;
22+
import org.codehaus.plexus.collections.ActiveList;
23+
24+
import java.io.File;
25+
import java.io.FileWriter;
26+
import java.io.IOException;
27+
28+
/**
29+
* @goal test
30+
*
31+
* @phase validate
32+
*/
33+
public class MyMojo
34+
extends AbstractMojo
35+
{
36+
/**
37+
* @component
38+
*/
39+
private ActiveCollectionManager collectionManager;
40+
41+
public void execute()
42+
throws MojoExecutionException
43+
{
44+
ActiveList list = collectionManager.getActiveList( ActiveCollectionManager.ROLE );
45+
}
46+
}
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
package org.codehaus.plexus.collections;
2+
3+
import org.codehaus.plexus.PlexusConstants;
4+
import org.codehaus.plexus.PlexusContainer;
5+
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
6+
import org.codehaus.plexus.context.Context;
7+
import org.codehaus.plexus.context.ContextException;
8+
import org.codehaus.plexus.logging.Logger;
9+
10+
import java.util.Collection;
11+
import java.util.Collections;
12+
import java.util.List;
13+
14+
public abstract class AbstractActiveList
15+
implements ActiveList
16+
{
17+
18+
private String role;
19+
20+
private PlexusContainer container;
21+
22+
private Logger logger;
23+
24+
protected AbstractActiveList()
25+
{
26+
// used for plexus init.
27+
}
28+
29+
protected AbstractActiveList( PlexusContainer container, String role )
30+
{
31+
this.container = container;
32+
this.role = role;
33+
this.logger = container.getLoggerManager().getLoggerForComponent( ActiveList.ROLE );
34+
}
35+
36+
public boolean add( Object arg0 )
37+
{
38+
throw new UnsupportedOperationException( "ActiveList implementations are not mutable." );
39+
}
40+
41+
public void add( int arg0, Object arg1 )
42+
{
43+
throw new UnsupportedOperationException( "ActiveList implementations are not mutable." );
44+
}
45+
46+
public boolean addAll( Collection arg0 )
47+
{
48+
throw new UnsupportedOperationException( "ActiveList implementations are not mutable." );
49+
}
50+
51+
public boolean addAll( int arg0, Collection arg1 )
52+
{
53+
throw new UnsupportedOperationException( "ActiveList implementations are not mutable." );
54+
}
55+
56+
public void clear()
57+
{
58+
throw new UnsupportedOperationException( "ActiveList implementations are not mutable." );
59+
}
60+
61+
public boolean remove( Object o )
62+
{
63+
throw new UnsupportedOperationException( "ActiveList implementations are not mutable." );
64+
}
65+
66+
public Object remove( int index )
67+
{
68+
throw new UnsupportedOperationException( "ActiveList implementations are not mutable." );
69+
}
70+
71+
public boolean removeAll( Collection arg0 )
72+
{
73+
throw new UnsupportedOperationException( "ActiveList implementations are not mutable." );
74+
}
75+
76+
public boolean retainAll( Collection arg0 )
77+
{
78+
throw new UnsupportedOperationException( "ActiveList implementations are not mutable." );
79+
}
80+
81+
public Object set( int arg0, Object arg1 )
82+
{
83+
throw new UnsupportedOperationException( "ActiveList implementations are not mutable." );
84+
}
85+
86+
protected final List checkedGetList()
87+
throws ComponentLookupException
88+
{
89+
return container.lookupList( role );
90+
}
91+
92+
protected final List getList()
93+
{
94+
try
95+
{
96+
return checkedGetList();
97+
}
98+
catch ( ComponentLookupException e )
99+
{
100+
logger.debug( "Failed to lookup map for role: " + role, e );
101+
}
102+
103+
return Collections.EMPTY_LIST;
104+
}
105+
106+
public final String getRole()
107+
{
108+
return role;
109+
}
110+
111+
protected final void setRole( String role )
112+
{
113+
this.role = role;
114+
}
115+
116+
public final void contextualize( Context context )
117+
throws ContextException
118+
{
119+
this.container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
120+
}
121+
122+
protected final Logger getLogger()
123+
{
124+
return logger;
125+
}
126+
127+
public final void enableLogging( Logger logger )
128+
{
129+
this.logger = logger;
130+
}
131+
132+
}
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
package org.codehaus.plexus.collections;
2+
3+
import org.codehaus.plexus.PlexusConstants;
4+
import org.codehaus.plexus.PlexusContainer;
5+
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
6+
import org.codehaus.plexus.context.Context;
7+
import org.codehaus.plexus.context.ContextException;
8+
import org.codehaus.plexus.logging.LogEnabled;
9+
import org.codehaus.plexus.logging.Logger;
10+
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
11+
12+
import java.util.Collections;
13+
import java.util.Map;
14+
15+
public abstract class AbstractActiveMap
16+
implements ActiveMap, Contextualizable, LogEnabled
17+
{
18+
19+
private String role;
20+
21+
private PlexusContainer container;
22+
23+
private Logger logger;
24+
25+
protected AbstractActiveMap()
26+
{
27+
// used for plexus component init.
28+
}
29+
30+
protected AbstractActiveMap( PlexusContainer container, String role )
31+
{
32+
this.container = container;
33+
this.role = role;
34+
this.logger = container.getLoggerManager().getLoggerForComponent( ActiveMap.ROLE );
35+
}
36+
37+
public void clear()
38+
{
39+
throw new UnsupportedOperationException( "ActiveMap implementations are not mutable." );
40+
}
41+
42+
public Object put( Object arg0, Object arg1 )
43+
{
44+
throw new UnsupportedOperationException( "ActiveMap implementations are not mutable." );
45+
}
46+
47+
public void putAll( Map arg0 )
48+
{
49+
throw new UnsupportedOperationException( "ActiveMap implementations are not mutable." );
50+
}
51+
52+
public Object remove( Object key )
53+
{
54+
throw new UnsupportedOperationException( "ActiveMap implementations are not mutable." );
55+
}
56+
57+
protected final Logger getLogger()
58+
{
59+
return logger;
60+
}
61+
62+
protected final Map getMap()
63+
{
64+
try
65+
{
66+
return checkedGetMap();
67+
}
68+
catch ( ComponentLookupException e )
69+
{
70+
logger.debug( "Failed to lookup map for role: " + role, e );
71+
}
72+
73+
return Collections.EMPTY_MAP;
74+
}
75+
76+
protected final Map checkedGetMap()
77+
throws ComponentLookupException
78+
{
79+
return container.lookupMap( role );
80+
}
81+
82+
public final String getRole()
83+
{
84+
return role;
85+
}
86+
87+
protected final void setRole( String role )
88+
{
89+
this.role = role;
90+
}
91+
92+
public final void contextualize( Context context )
93+
throws ContextException
94+
{
95+
this.container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
96+
}
97+
98+
public final void enableLogging( Logger logger )
99+
{
100+
this.logger = logger;
101+
}
102+
}

0 commit comments

Comments
 (0)