File tree Expand file tree Collapse file tree 6 files changed +20
-22
lines changed
src/main/java/org/codehaus/plexus/components/interactivity
plexus-interactivity-jline
src/main/java/org/codehaus/plexus/components/interactivity/jline Expand file tree Collapse file tree 6 files changed +20
-22
lines changed Original file line number Diff line number Diff line change 22
22
<version >5.9.3</version >
23
23
<scope >test</scope >
24
24
</dependency >
25
+ <!--
26
+ | @PostConstruct and @PreDestroy help with Plexus->JSR330 migration
27
+ -->
25
28
<dependency >
26
- <groupId >org.codehaus.plexus</groupId >
27
- <artifactId >plexus-container-default</artifactId >
29
+ <groupId >javax.annotation</groupId >
30
+ <artifactId >javax.annotation-api</artifactId >
31
+ <version >1.2</version >
28
32
</dependency >
29
33
</dependencies >
30
34
</project >
Original file line number Diff line number Diff line change 24
24
* SOFTWARE.
25
25
*/
26
26
27
- import org .codehaus .plexus .logging .AbstractLogEnabled ;
28
-
29
27
import java .util .List ;
30
28
import java .util .ArrayList ;
31
29
import java .io .IOException ;
37
35
* @version $Id$
38
36
*/
39
37
public abstract class AbstractInputHandler
40
- extends AbstractLogEnabled
41
38
implements InputHandler
42
39
{
43
40
public List <String > readMultipleLines ()
Original file line number Diff line number Diff line change 24
24
* SOFTWARE.
25
25
*/
26
26
27
- import org .codehaus .plexus .personality .plexus .lifecycle .phase .Initializable ;
28
- import org .codehaus .plexus .personality .plexus .lifecycle .phase .InitializationException ;
29
-
27
+ import javax .annotation .PostConstruct ;
30
28
import java .io .BufferedReader ;
31
29
import java .io .IOException ;
32
30
import java .io .InputStreamReader ;
39
37
*/
40
38
public class DefaultInputHandler
41
39
extends AbstractInputHandler
42
- implements Initializable
43
40
{
44
41
private BufferedReader consoleReader ;
45
42
@@ -55,8 +52,8 @@ public String readPassword()
55
52
return consoleReader .readLine ();
56
53
}
57
54
55
+ @ PostConstruct
58
56
public void initialize ()
59
- throws InitializationException
60
57
{
61
58
consoleReader = new BufferedReader ( new InputStreamReader ( System .in ) );
62
59
}
Original file line number Diff line number Diff line change 24
24
* SOFTWARE.
25
25
*/
26
26
27
- import org .codehaus .plexus .personality .plexus .lifecycle .phase .Initializable ;
28
- import org .codehaus .plexus .personality .plexus .lifecycle .phase .InitializationException ;
29
-
27
+ import javax .annotation .PostConstruct ;
30
28
import java .io .IOException ;
31
29
import java .io .PrintWriter ;
32
30
37
35
* @version $Id$
38
36
*/
39
37
public class DefaultOutputHandler
40
- implements Initializable , OutputHandler
38
+ implements OutputHandler
41
39
{
42
40
private PrintWriter consoleWriter ;
43
41
42
+ @ PostConstruct
44
43
public void initialize ()
45
- throws InitializationException
46
44
{
47
45
consoleWriter = new PrintWriter ( System .out );
48
46
}
Original file line number Diff line number Diff line change 22
22
<artifactId >plexus-interactivity-api</artifactId >
23
23
<version >${project.version} </version >
24
24
</dependency >
25
+ <!--
26
+ | @PostConstruct and @PreDestroy help with Plexus->JSR330 migration
27
+ -->
25
28
<dependency >
26
- <groupId >org.codehaus.plexus</groupId >
27
- <artifactId >plexus-container-default</artifactId >
29
+ <groupId >javax.annotation</groupId >
30
+ <artifactId >javax.annotation-api</artifactId >
31
+ <version >1.2</version >
28
32
</dependency >
29
33
</dependencies >
30
34
</project >
Original file line number Diff line number Diff line change 26
26
27
27
import jline .ConsoleReader ;
28
28
import org .codehaus .plexus .components .interactivity .AbstractInputHandler ;
29
- import org .codehaus .plexus .personality .plexus .lifecycle .phase .Initializable ;
30
- import org .codehaus .plexus .personality .plexus .lifecycle .phase .InitializationException ;
31
29
30
+ import javax .annotation .PostConstruct ;
32
31
import java .io .IOException ;
33
32
34
33
/**
39
38
*/
40
39
public class JLineInputHandler
41
40
extends AbstractInputHandler
42
- implements Initializable
43
41
{
44
42
private ConsoleReader consoleReader ;
45
43
@@ -55,16 +53,16 @@ public String readPassword()
55
53
return consoleReader .readLine ( new Character ( '*' ) );
56
54
}
57
55
56
+ @ PostConstruct
58
57
public void initialize ()
59
- throws InitializationException
60
58
{
61
59
try
62
60
{
63
61
consoleReader = new ConsoleReader ();
64
62
}
65
63
catch ( IOException e )
66
64
{
67
- throw new InitializationException ( "Cannot create console reader: " , e );
65
+ throw new IllegalStateException ( "Cannot create console reader: " , e );
68
66
}
69
67
}
70
68
}
You can’t perform that action at this time.
0 commit comments