-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split AbstractLoggingSpy into an abstract BuildEventListener and
ClientDispatcher to avoid circular package dependencies
- Loading branch information
Showing
6 changed files
with
124 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
daemon/src/main/java/org/mvndaemon/mvnd/logging/smart/BuildEventListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* Copyright 2019 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.mvndaemon.mvnd.logging.smart; | ||
|
||
import org.apache.maven.execution.ExecutionEvent; | ||
|
||
/** | ||
* An abstract build event sink. | ||
*/ | ||
public abstract class BuildEventListener { | ||
private static final BuildEventListener DUMMY = new BuildEventListener() { | ||
|
||
public void sessionStarted(ExecutionEvent event) { | ||
} | ||
|
||
public void projectStarted(ExecutionEvent event) { | ||
} | ||
|
||
public void projectLogMessage(String projectId, String event) { | ||
} | ||
|
||
public void projectFinished(ExecutionEvent event) { | ||
} | ||
|
||
public void mojoStarted(ExecutionEvent event) { | ||
} | ||
|
||
public void finish(int exitCode) throws Exception { | ||
} | ||
|
||
public void fail(Throwable t) throws Exception { | ||
} | ||
|
||
public void log(String msg) { | ||
} | ||
|
||
}; | ||
|
||
/** | ||
* @return a dummy {@link BuildEventListener} that just swallows the messages and does not send them anywhere | ||
*/ | ||
public static BuildEventListener dummy() { | ||
return DUMMY; | ||
} | ||
|
||
protected BuildEventListener() { | ||
} | ||
|
||
public abstract void sessionStarted(ExecutionEvent event); | ||
|
||
public abstract void projectStarted(ExecutionEvent event); | ||
|
||
public abstract void projectLogMessage(String projectId, String event); | ||
|
||
public abstract void projectFinished(ExecutionEvent event); | ||
|
||
public abstract void mojoStarted(ExecutionEvent event); | ||
|
||
public abstract void finish(int exitCode) throws Exception; | ||
|
||
public abstract void fail(Throwable t) throws Exception; | ||
|
||
public abstract void log(String msg); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.